summaryrefslogtreecommitdiffstats
path: root/ipecamera
diff options
context:
space:
mode:
Diffstat (limited to 'ipecamera')
-rw-r--r--ipecamera/image.c9
-rw-r--r--ipecamera/image.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/ipecamera/image.c b/ipecamera/image.c
index 3e320cd..5d2021c 100644
--- a/ipecamera/image.c
+++ b/ipecamera/image.c
@@ -532,7 +532,7 @@ static int ipecamera_resolve_event_id(ipecamera_t *ctx, pcilib_event_id_t evid)
return buf_ptr;
}
-pcilib_event_id_t ipecamera_next_event(void *vctx, pcilib_event_t event_mask) {
+pcilib_event_id_t ipecamera_next_event(void *vctx, pcilib_event_t event_mask, const struct timespec *timeout) {
int buf_ptr;
pcilib_event_id_t reported;
ipecamera_t *ctx = (ipecamera_t*)vctx;
@@ -547,7 +547,12 @@ pcilib_event_id_t ipecamera_next_event(void *vctx, pcilib_event_t event_mask) {
return PCILIB_EVENT_ID_INVALID;
}
- if ((!ctx->event_id)||(ctx->reported_id == ctx->event_id)) return PCILIB_EVENT_ID_INVALID;
+ if ((!ctx->event_id)||(ctx->reported_id == ctx->event_id)) {
+ if (timeout) {
+ // We should wait here for the specified timeout
+ }
+ return PCILIB_EVENT_ID_INVALID;
+ }
// We had an overflow in event counting
if (ctx->reported_id > ctx->event_id) {
diff --git a/ipecamera/image.h b/ipecamera/image.h
index 513449f..245e450 100644
--- a/ipecamera/image.h
+++ b/ipecamera/image.h
@@ -13,7 +13,7 @@ int ipecamera_reset(void *ctx);
int ipecamera_start(void *ctx, pcilib_event_t event_mask, pcilib_callback_t cb, void *user);
int ipecamera_stop(void *ctx);
int ipecamera_trigger(void *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
-pcilib_event_id_t ipecamera_next_event(void *ctx, pcilib_event_t event_mask);
+pcilib_event_id_t ipecamera_next_event(void *ctx, pcilib_event_t event_mask, const struct timespec *timeout);
void* ipecamera_get(void *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t *size);
int ipecamera_return(void *ctx, pcilib_event_id_t event_id);