/** * Register sources and work items to an event loop
*/ struct spa_loop_methods { /* the version of this structure. This can be used to expand this
* structure in the future */ #define SPA_VERSION_LOOP_METHODS 0
uint32_t version;
/** add a source to the loop */ int (*add_source) (void *object, struct spa_source *source);
/** update the source io mask */ int (*update_source) (void *object, struct spa_source *source);
/** remove a source from the loop */ int (*remove_source) (void *object, struct spa_source *source);
/** invoke a function in the context of this loop */ int (*invoke) (void *object,
spa_invoke_func_t func,
uint32_t seq, constvoid *data,
size_t size, bool block, void *user_data);
};
/** Control hooks. These hooks can't be removed from their * callbacks and must be removed from a safe place (when the loop
* is not running or when it is locked). */ struct spa_loop_control_hooks { #define SPA_VERSION_LOOP_CONTROL_HOOKS 0
uint32_t version; /** Executed right before waiting for events. It is typically used to
* release locks. */ void (*before) (void *data); /** Executed right after waiting for events. It is typically used to
* reacquire locks. */ void (*after) (void *data);
};
/** * Control an event loop
*/ struct spa_loop_control_methods { /* the version of this structure. This can be used to expand this
* structure in the future */ #define SPA_VERSION_LOOP_CONTROL_METHODS 0
uint32_t version;
int (*get_fd) (void *object);
/** Add a hook * \param ctrl the control to change * \param hooks the hooks to add * * Adds hooks to the loop controlled by \a ctrl.
*/ void (*add_hook) (void *object, struct spa_hook *hook, conststruct spa_loop_control_hooks *hooks, void *data);
/** Enter a loop * \param ctrl the control * * Start an iteration of the loop. This function should be called * before calling iterate and is typically used to capture the thread * that this loop will run in.
*/ void (*enter) (void *object); /** Leave a loop * \param ctrl the control * * Ends the iteration of a loop. This should be called after calling * iterate.
*/ void (*leave) (void *object);
/** Perform one iteration of the loop. * \param ctrl the control * \param timeout an optional timeout in milliseconds. * 0 for no timeout, -1 for infinite timeout. * * This function will block * up to \a timeout milliseconds and then dispatch the fds with activity. * The number of dispatched fds is returned.
*/ int (*iterate) (void *object, int timeout);
};
/** * Create sources for an event loop
*/ struct spa_loop_utils_methods { /* the version of this structure. This can be used to expand this
* structure in the future */ #define SPA_VERSION_LOOP_UTILS_METHODS 0
uint32_t version;
/** destroy a source allocated with this interface. This function * should only be called when the loop is not running or from the
* context of the running loop */ void (*destroy_source) (void *object, struct spa_source *source);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.