From 28873ccf3f3f32486049eb40cd639bbab86e09dc Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Mon, 28 Feb 2011 17:48:55 +0100 Subject: Start grab interface --- src/grabbers/me4.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/grabbers/me4.c') diff --git a/src/grabbers/me4.c b/src/grabbers/me4.c index 5b46c79..2196172 100644 --- a/src/grabbers/me4.c +++ b/src/grabbers/me4.c @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -49,6 +50,21 @@ uint32_t uca_me4_alloc(struct uca_grabber_t *grabber, uint32_t n_buffers) return UCA_ERR_PROP_GENERAL; } +uint32_t uca_me4_acquire(struct uca_grabber_t *grabber, int32_t n_frames, bool async) +{ + if (GET_MEM(grabber) != NULL) { + if (Fg_AcquireEx(GET_FG(grabber), 0, n_frames, ACQ_STANDARD, GET_MEM(grabber)) != FG_OK) + return UCA_NO_ERROR; + } + return UCA_ERR_PROP_GENERAL; +} + +uint32_t uca_me4_grab(struct uca_grabber_t *grabber, char *buffer, size_t n_bytes) +{ + uint32_t last_frame = Fg_getLastPicNumber(GET_FG(grabber), PORT_A); + memcpy(buffer, Fg_getImagePtrEx(GET_FG(grabber), last_frame, PORT_A, GET_MEM(grabber)), n_bytes); +} + uint32_t uca_me4_init(struct uca_grabber_t **grabber) { /* FIXME: find out if this board/grabber is running */ @@ -66,6 +82,8 @@ uint32_t uca_me4_init(struct uca_grabber_t **grabber) uca->set_property = &uca_me4_set_property; uca->get_property = &uca_me4_get_property; uca->alloc = &uca_me4_alloc; + uca->acquire = &uca_me4_acquire; + uca->grab = &uca_me4_grab; *grabber = uca; return UCA_NO_ERROR; -- cgit v1.2.3