summaryrefslogtreecommitdiffstats
path: root/ipecamera/image.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-04-14 05:18:18 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-04-14 05:18:18 +0200
commitd7143e0f1ff45449f5e69adc1a42c72eddf642d8 (patch)
treeef7b4d90c487527963e9dbe70a5b218530b4932d /ipecamera/image.c
parentb70ed8b6ccf17a7c5b4339f05a33471eaf3b33e5 (diff)
downloadpcitool-d7143e0f1ff45449f5e69adc1a42c72eddf642d8.tar.gz
pcitool-d7143e0f1ff45449f5e69adc1a42c72eddf642d8.tar.bz2
pcitool-d7143e0f1ff45449f5e69adc1a42c72eddf642d8.tar.xz
pcitool-d7143e0f1ff45449f5e69adc1a42c72eddf642d8.zip
Accept timeout parameter to get_next_event call
Diffstat (limited to 'ipecamera/image.c')
-rw-r--r--ipecamera/image.c9
1 files changed, 7 insertions, 2 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) {