diff options
author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-02-28 15:11:51 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-02-28 15:11:51 +0100 |
commit | b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3 (patch) | |
tree | 4a0b4269bb557d2f9eca2b079da32e8320d0f91c /src/grabbers | |
parent | f588f10b6fc6e452d42a66abc56028fe21cd56c2 (diff) | |
download | uca-b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3.tar.gz uca-b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3.tar.bz2 uca-b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3.tar.xz uca-b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3.zip |
Complete frame grabber abstraction
Diffstat (limited to 'src/grabbers')
-rw-r--r-- | src/grabbers/me4.c | 42 | ||||
-rw-r--r-- | src/grabbers/me4.h | 8 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/grabbers/me4.c b/src/grabbers/me4.c index e69de29..aa61946 100644 --- a/src/grabbers/me4.c +++ b/src/grabbers/me4.c @@ -0,0 +1,42 @@ + +#include <stdlib.h> +#include <clser.h> +#include <fgrab_struct.h> +#include <fgrab_prototyp.h> + +#include "uca.h" +#include "uca-grabber.h" + +#define GET_FG(grabber) ((Fg_Struct *)(grabber->user)) + +uint32_t uca_me4_destroy(struct uca_grabber_t *grabber) +{ + Fg_FreeGrabber(GET_FG(grabber)); +} + +uint32_t uca_me4_set_property(struct uca_grabber_t *grabber, enum uca_property_ids property, void *data) +{ + return Fg_setParameter(GET_FG(grabber), property, data, PORT_A) == FG_OK ? UCA_NO_ERROR : UCA_ERR_PROP_GENERAL; +} + +uint32_t uca_me4_get_property(struct uca_grabber_t *grabber, enum uca_property_ids property, void *data) +{ + return Fg_getParameter(GET_FG(grabber), property, data, PORT_A) == FG_OK ? UCA_NO_ERROR : UCA_ERR_PROP_GENERAL; +} + +uint32_t uca_me4_init(struct uca_grabber_t **grabber) +{ + /* FIXME: find out if this board/grabber is running */ + Fg_Struct *fg = Fg_Init("libFullAreaGray8.so", 0); + if (fg == NULL) + return UCA_ERR_INIT_NOT_FOUND; + + struct uca_grabber_t *uca = (struct uca_grabber_t *) malloc(sizeof(struct uca_grabber_t)); + uca->user = fg; + uca->destroy = &uca_me4_destroy; + uca->set_property = &uca_me4_set_property; + uca->get_property = &uca_me4_get_property; + + *grabber = uca; + return UCA_NO_ERROR; +} diff --git a/src/grabbers/me4.h b/src/grabbers/me4.h index e69de29..a7a7b3c 100644 --- a/src/grabbers/me4.h +++ b/src/grabbers/me4.h @@ -0,0 +1,8 @@ +#ifndef __UNIFIED_CAMERA_ACCESS_ME4_H +#define __UNIFIED_CAMERA_ACCESS_ME4_H + +struct uca_grabber_t; + +uint32_t uca_me4_init(struct uca_grabber_t **grabber); + +#endif |