diff options
Diffstat (limited to 'src/grabbers')
-rw-r--r-- | src/grabbers/me4.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 <stdlib.h> +#include <string.h> #include <clser.h> #include <fgrab_struct.h> #include <fgrab_prototyp.h> @@ -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; |