summaryrefslogtreecommitdiffstats
path: root/event.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-12 05:45:35 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-12 05:45:35 +0100
commit2e4e8a00b27182a155cb10f0a00e44977bfcd5cf (patch)
tree86afd1b7ceb834dbb3cedf8d55c3ac0734947333 /event.h
parent7a4cfb9e546c496792d3fe0c61c822c66ad0128f (diff)
downloadpcitool-2e4e8a00b27182a155cb10f0a00e44977bfcd5cf.tar.gz
pcitool-2e4e8a00b27182a155cb10f0a00e44977bfcd5cf.tar.bz2
pcitool-2e4e8a00b27182a155cb10f0a00e44977bfcd5cf.tar.xz
pcitool-2e4e8a00b27182a155cb10f0a00e44977bfcd5cf.zip
multithread preprocessing of ipecamera frames and code reorganization
Diffstat (limited to 'event.h')
-rw-r--r--event.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/event.h b/event.h
index 7a1810a..dfae452 100644
--- a/event.h
+++ b/event.h
@@ -3,6 +3,19 @@
#include "pcilib.h"
+
+/*
+ * get_data: This call is used by get_data and copy_data functions of public
+ * interface. When copy_data is the caller, the data parameter will be passed.
+ * Therefore, depending on data the parameter, the function should behave
+ * diferently. If get get_data function is used (buf == NULL), the caller is
+ * expected to call return_data afterwards. Otherwise, if buf != NULL and
+ * copy_data is used, the return call will not be executed.
+ * Still, the get_data function is not obliged to return the data in the
+ * passed buf, but a reference to the staticaly allocated memory may be
+ * returned instead. The copy can be managed by the envelope function.
+ */
+
struct pcilib_event_api_description_s {
pcilib_context_t *(*init)(pcilib_t *ctx);
void (*free)(pcilib_context_t *ctx);
@@ -14,10 +27,10 @@ struct pcilib_event_api_description_s {
int (*trigger)(pcilib_context_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
int (*stream)(pcilib_context_t *ctx, pcilib_event_callback_t callback, void *user);
- pcilib_event_id_t (*next_event)(pcilib_context_t *ctx, pcilib_timeout_t timeout, pcilib_event_id_t *evid, pcilib_event_info_t **info);
+ int (*next_event)(pcilib_context_t *ctx, pcilib_timeout_t timeout, pcilib_event_id_t *evid, size_t info_size, pcilib_event_info_t *info);
- void* (*get_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t *size, void *data);
- int (*return_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id, void *data);
+ int (*get_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t *size, void **data);
+ int (*return_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, void *data);
pcilib_dma_context_t *(*init_dma)(pcilib_context_t *ctx);
};