diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-10-21 11:25:46 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-10-21 11:25:46 +0200 |
commit | ccaf5dfc7727ea32920527a7622509b9724ae42f (patch) | |
tree | 0a94f7a4a77b75fb83582de11005ab41221eea6c /src | |
parent | 7e1ec3056d1fdb6786c452ba6ed7e978355a98c2 (diff) | |
download | uca-ccaf5dfc7727ea32920527a7622509b9724ae42f.tar.gz uca-ccaf5dfc7727ea32920527a7622509b9724ae42f.tar.bz2 uca-ccaf5dfc7727ea32920527a7622509b9724ae42f.tar.xz uca-ccaf5dfc7727ea32920527a7622509b9724ae42f.zip |
Add: readout state
Diffstat (limited to 'src')
-rw-r--r-- | src/grabbers/me4.c | 5 | ||||
-rw-r--r-- | src/uca.c | 3 | ||||
-rw-r--r-- | src/uca.h | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/grabbers/me4.c b/src/grabbers/me4.c index 48d0756..a157206 100644 --- a/src/grabbers/me4.c +++ b/src/grabbers/me4.c @@ -215,8 +215,10 @@ static uint32_t uca_me4_grab(struct uca_grabber_priv *grabber, void **buffer, ui else last_frame = Fg_getLastPicNumberEx(me4->fg, PORT_A, me4->mem); - if (last_frame <= 0) + if (last_frame <= 0) { + *buffer = NULL; return UCA_ERR_GRABBER | UCA_ERR_FRAME_TRANSFER; + } *frame_number = (uint64_t) last_frame; *buffer = Fg_getImagePtrEx(me4->fg, last_frame, PORT_A, me4->mem); @@ -274,6 +276,7 @@ uint32_t uca_me4_init(struct uca_grabber_priv **grabber) Fg_getParameter(fg, FG_TIMEOUT, &me4->timeout, PORT_A); + me4->timeout = 1; uca->user = me4; uca->destroy = &uca_me4_destroy; uca->set_property = &uca_me4_set_property; @@ -327,7 +327,7 @@ uint32_t uca_cam_register_callback(struct uca_camera *cam, uca_cam_grab_callback uint32_t uca_cam_grab(struct uca_camera *cam, char *buffer, void *meta_data) { struct uca_camera_priv *priv = cam->priv; - if (priv->state != UCA_CAM_RECORDING) + if ((priv->state != UCA_CAM_RECORDING) && (priv->state != UCA_CAM_READOUT)) return UCA_ERR_CAMERA | UCA_ERR_NOT_RECORDING; return priv->grab(priv, buffer, meta_data); } @@ -339,6 +339,7 @@ uint32_t uca_cam_readout(struct uca_camera *cam) return UCA_ERR_CAMERA | UCA_ERR_IS_RECORDING; if (priv->readout == NULL) return UCA_ERR_CAMERA | UCA_ERR_NOT_IMPLEMENTED; + priv->state = UCA_CAM_READOUT; return priv->readout(priv); } @@ -196,6 +196,7 @@ enum uca_cam_state { UCA_CAM_CONFIGURABLE, /**< Camera can be configured and is not recording */ UCA_CAM_ARMED, /**< Camera is ready for recording */ UCA_CAM_RECORDING, /**< Camera is currently recording */ + UCA_CAM_READOUT /**< Camera recorded and is currently in readout mode */ }; |