From 2e4e8a00b27182a155cb10f0a00e44977bfcd5cf Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 12 Dec 2011 05:45:35 +0100 Subject: multithread preprocessing of ipecamera frames and code reorganization --- event.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'event.h') 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); }; -- cgit v1.2.3