summaryrefslogtreecommitdiffstats
path: root/src/cameras/ipe.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-02-03 16:09:56 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-02-03 16:09:56 +0100
commit0da06d904850330f583e1e8cdededcf6aa8cbe29 (patch)
treefb77f62ba768831ce6c4e9b4d2476e0867528050 /src/cameras/ipe.c
parent70e5dd5705d063119c2c0757082fd3a82c53ee71 (diff)
parentb66531ac0b9d78a4540920922b0aad02a99b7a24 (diff)
downloadlibuca-0da06d904850330f583e1e8cdededcf6aa8cbe29.tar.gz
libuca-0da06d904850330f583e1e8cdededcf6aa8cbe29.tar.bz2
libuca-0da06d904850330f583e1e8cdededcf6aa8cbe29.tar.xz
libuca-0da06d904850330f583e1e8cdededcf6aa8cbe29.zip
Merge
Diffstat (limited to 'src/cameras/ipe.c')
-rw-r--r--src/cameras/ipe.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cameras/ipe.c b/src/cameras/ipe.c
index 103d333..ba7eb59 100644
--- a/src/cameras/ipe.c
+++ b/src/cameras/ipe.c
@@ -164,17 +164,21 @@ static int event_callback(pcilib_event_id_t event_id, pcilib_event_info_t *info,
struct uca_camera_priv *cam = (struct uca_camera_priv *) user;
pcilib_t *handle = GET_HANDLE(cam);
size_t error = 0;
+
void *buffer = pcilib_get_data(handle, event_id, PCILIB_EVENT_DATA, &error);
- if (buffer == NULL)
- return UCA_ERR_CAMERA | UCA_ERR_CALLBACK;
+ if (buffer == NULL) {
+ pcilib_trigger(handle, PCILIB_EVENT0, 0, NULL);
+ return PCILIB_STREAMING_CONTINUE;
+ }
- enum uca_buffer_status status = cam->callback(info->seqnum, buffer, NULL, cam->user);
+ enum uca_buffer_status status = cam->callback(info->seqnum, buffer, NULL, cam->callback_user);
if (status == UCA_BUFFER_RELEASE)
pcilib_return_data(handle, event_id, PCILIB_EVENT_DATA, buffer);
- return UCA_NO_ERROR;
+ pcilib_trigger(handle, PCILIB_EVENT0, 0, NULL);
+ return PCILIB_STREAMING_CONTINUE;
}
static uint32_t uca_ipe_register_callback(struct uca_camera_priv *cam, uca_cam_grab_callback cb, void *user)
@@ -182,6 +186,7 @@ static uint32_t uca_ipe_register_callback(struct uca_camera_priv *cam, uca_cam_g
if (cam->callback == NULL) {
cam->callback = cb;
cam->callback_user = user;
+ pcilib_trigger(GET_HANDLE(cam), PCILIB_EVENT0, 0, NULL);
pcilib_stream(GET_HANDLE(cam), &event_callback, cam);
return UCA_NO_ERROR;
}