Loading...
Searching...
No Matches
loop.h
Go to the documentation of this file.
/* Simple Plugin API */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef SPA_LOOP_H
#define SPA_LOOP_H
#include <errno.h>
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#include <spa/support/system.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SPA_API_LOOP
#ifdef SPA_API_IMPL
#define SPA_API_LOOP SPA_API_IMPL
#else
#define SPA_API_LOOP static inline
#endif
#endif
#define SPA_TYPE_INTERFACE_Loop SPA_TYPE_INFO_INTERFACE_BASE "Loop"
#define SPA_TYPE_INTERFACE_DataLoop SPA_TYPE_INFO_INTERFACE_BASE "DataLoop"
#define SPA_VERSION_LOOP 0
struct spa_loop { struct spa_interface iface; };
#define SPA_TYPE_INTERFACE_LoopControl SPA_TYPE_INFO_INTERFACE_BASE "LoopControl"
#define SPA_VERSION_LOOP_CONTROL 2
struct spa_loop_control { struct spa_interface iface; };
#define SPA_TYPE_INTERFACE_LoopUtils SPA_TYPE_INFO_INTERFACE_BASE "LoopUtils"
#define SPA_VERSION_LOOP_UTILS 0
struct spa_loop_utils { struct spa_interface iface; };
struct spa_source;
typedef void (*spa_source_func_t) (struct spa_source *source);
struct spa_source {
struct spa_loop *loop;
spa_source_func_t func;
void *data;
int fd;
uint32_t mask;
uint32_t rmask;
/* private data for the loop implementer */
void *priv;
};
typedef int (*spa_invoke_func_t) (struct spa_loop *loop,
bool async,
uint32_t seq,
const void *data,
size_t size,
void *user_data);
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;
int (*add_source) (void *object,
struct spa_source *source);
/** Update the source io mask. Must be called from the loop's own thread.
*
* \param[in] object The callbacks data.
* \param[in] source The source.
* \return 0 on success, negative errno-style value on failure.
*/
int (*update_source) (void *object,
struct spa_source *source);
int (*remove_source) (void *object,
struct spa_source *source);
int (*invoke) (void *object,
spa_invoke_func_t func,
uint32_t seq,
const void *data,
size_t size,
bool block,
void *user_data);
int (*locked) (void *object,
spa_invoke_func_t func,
uint32_t seq,
const void *data,
size_t size,
void *user_data);
};
SPA_API_LOOP int spa_loop_add_source(struct spa_loop *object, struct spa_source *source)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop, &object->iface, add_source, 0, source);
}
SPA_API_LOOP int spa_loop_update_source(struct spa_loop *object, struct spa_source *source)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop, &object->iface, update_source, 0, source);
}
SPA_API_LOOP int spa_loop_remove_source(struct spa_loop *object, struct spa_source *source)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop, &object->iface, remove_source, 0, source);
}
SPA_API_LOOP int spa_loop_invoke(struct spa_loop *object,
spa_invoke_func_t func, uint32_t seq, const void *data,
size_t size, bool block, void *user_data)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop, &object->iface, invoke, 0, func, seq, data,
size, block, user_data);
}
SPA_API_LOOP int spa_loop_locked(struct spa_loop *object,
spa_invoke_func_t func, uint32_t seq, const void *data,
size_t size, void *user_data)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop, &object->iface, locked, 0, func, seq, data,
size, user_data);
}
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 or integrate other fds into the loop. */
void (*before) (void *data);
void (*after) (void *data);
};
SPA_API_LOOP void spa_loop_control_hook_before(struct spa_hook_list *l)
{
struct spa_hook *h;
spa_list_for_each_reverse(h, &l->list, link)
spa_callbacks_call_fast(&h->cb, struct spa_loop_control_hooks, before, 0);
}
SPA_API_LOOP void spa_loop_control_hook_after(struct spa_hook_list *l)
{
struct spa_hook *h;
spa_list_for_each(h, &l->list, link)
spa_callbacks_call_fast(&h->cb, struct spa_loop_control_hooks, after, 0);
}
* The event loop control function provide API to run the event loop.
*
* The below (pseudo)code is a minimal example outlining the use of the loop
* control:
* \code{.c}
* spa_loop_control_enter(loop);
* while (running) {
* spa_loop_control_iterate(loop, -1);
* }
* spa_loop_control_leave(loop);
* \endcode
*
* It is also possible to add the loop to an existing event loop by using the
* spa_loop_control_get_fd() call. This fd will become readable when activity
* has been detected on the sources in the loop. spa_loop_control_iterate() with
* a 0 timeout should be called to process the pending sources.
*
* spa_loop_control_enter() and spa_loop_control_leave() should be called once
* from the thread that will run the iterate() function.
*/
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 2
uint32_t version;
int (*get_fd) (void *object);
/** Add a hook
* \param object 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,
const struct spa_loop_control_hooks *hooks,
void *data);
void (*enter) (void *object);
void (*leave) (void *object);
int (*iterate) (void *object, int timeout);
int (*check) (void *object);
int (*lock) (void *object);
int (*unlock) (void *object);
int (*get_time) (void *object, struct timespec *abstime, int64_t timeout);
int (*wait) (void *object, const struct timespec *abstime);
int (*signal) (void *object, bool wait_for_accept);
int (*accept) (void *object);
};
SPA_API_LOOP int spa_loop_control_get_fd(struct spa_loop_control *object)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, get_fd, 0);
}
SPA_API_LOOP void spa_loop_control_add_hook(struct spa_loop_control *object,
struct spa_hook *hook, const struct spa_loop_control_hooks *hooks,
void *data)
{
spa_api_method_v(spa_loop_control, &object->iface, add_hook, 0,
hook, hooks, data);
}
SPA_API_LOOP void spa_loop_control_enter(struct spa_loop_control *object)
{
spa_api_method_v(spa_loop_control, &object->iface, enter, 0);
}
SPA_API_LOOP void spa_loop_control_leave(struct spa_loop_control *object)
{
spa_api_method_v(spa_loop_control, &object->iface, leave, 0);
}
SPA_API_LOOP int spa_loop_control_iterate(struct spa_loop_control *object,
int timeout)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, iterate, 0, timeout);
}
SPA_API_LOOP int spa_loop_control_iterate_fast(struct spa_loop_control *object,
int timeout)
{
return spa_api_method_fast_r(int, -ENOTSUP,
spa_loop_control, &object->iface, iterate, 0, timeout);
}
SPA_API_LOOP int spa_loop_control_check(struct spa_loop_control *object)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, check, 1);
}
SPA_API_LOOP int spa_loop_control_lock(struct spa_loop_control *object)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, lock, 2);
}
SPA_API_LOOP int spa_loop_control_unlock(struct spa_loop_control *object)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, unlock, 2);
}
SPA_API_LOOP int spa_loop_control_get_time(struct spa_loop_control *object,
struct timespec *abstime, int64_t timeout)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, get_time, 2, abstime, timeout);
}
SPA_API_LOOP int spa_loop_control_wait(struct spa_loop_control *object,
const struct timespec *abstime)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, wait, 2, abstime);
}
SPA_API_LOOP int spa_loop_control_signal(struct spa_loop_control *object, bool wait_for_accept)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, signal, 2, wait_for_accept);
}
SPA_API_LOOP int spa_loop_control_accept(struct spa_loop_control *object)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, accept, 2);
}
typedef void (*spa_source_io_func_t) (void *data, int fd, uint32_t mask);
typedef void (*spa_source_idle_func_t) (void *data);
typedef void (*spa_source_event_func_t) (void *data, uint64_t count);
typedef void (*spa_source_timer_func_t) (void *data, uint64_t expirations);
typedef void (*spa_source_signal_func_t) (void *data, int signal_number);
* 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;
struct spa_source *(*add_io) (void *object,
int fd,
uint32_t mask,
bool close,
spa_source_io_func_t func, void *data);
int (*update_io) (void *object, struct spa_source *source, uint32_t mask);
struct spa_source *(*add_idle) (void *object,
bool enabled,
spa_source_idle_func_t func, void *data);
int (*enable_idle) (void *object, struct spa_source *source, bool enabled);
struct spa_source *(*add_event) (void *object,
spa_source_event_func_t func, void *data);
int (*signal_event) (void *object, struct spa_source *source);
struct spa_source *(*add_timer) (void *object,
spa_source_timer_func_t func, void *data);
int (*update_timer) (void *object,
struct spa_source *source,
struct timespec *value,
struct timespec *interval,
bool absolute);
struct spa_source *(*add_signal) (void *object,
int signal_number,
spa_source_signal_func_t func, void *data);
void (*destroy_source) (void *object, struct spa_source *source);
};
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_io(struct spa_loop_utils *object, int fd, uint32_t mask,
bool close, spa_source_io_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_io, 0, fd, mask, close, func, data);
}
SPA_API_LOOP int spa_loop_utils_update_io(struct spa_loop_utils *object,
struct spa_source *source, uint32_t mask)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_utils, &object->iface, update_io, 0, source, mask);
}
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_idle(struct spa_loop_utils *object, bool enabled,
spa_source_idle_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_idle, 0, enabled, func, data);
}
SPA_API_LOOP int spa_loop_utils_enable_idle(struct spa_loop_utils *object,
struct spa_source *source, bool enabled)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_utils, &object->iface, enable_idle, 0, source, enabled);
}
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_event(struct spa_loop_utils *object, spa_source_event_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_event, 0, func, data);
}
SPA_API_LOOP int spa_loop_utils_signal_event(struct spa_loop_utils *object,
struct spa_source *source)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_utils, &object->iface, signal_event, 0, source);
}
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_timer(struct spa_loop_utils *object, spa_source_timer_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_timer, 0, func, data);
}
SPA_API_LOOP int spa_loop_utils_update_timer(struct spa_loop_utils *object,
struct spa_source *source, struct timespec *value,
struct timespec *interval, bool absolute)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_utils, &object->iface, update_timer, 0, source,
value, interval, absolute);
}
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_signal(struct spa_loop_utils *object, int signal_number,
spa_source_signal_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_signal, 0,
signal_number, func, data);
}
SPA_API_LOOP void spa_loop_utils_destroy_source(struct spa_loop_utils *object,
struct spa_source *source)
{
spa_api_method_v(spa_loop_utils, &object->iface, destroy_source, 0, source);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* SPA_LOOP_H */
defs.h
spa/utils/defs.h
seq
uint32_t int seq
Definition core.h:432
spa_api_method_r
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition hook.h:291
spa_api_method_fast_r
#define spa_api_method_fast_r(rtype, def, type, o, method, version,...)
Definition hook.h:325
spa_callbacks_call_fast
#define spa_callbacks_call_fast(callbacks, type, method, vers,...)
Definition hook.h:184
spa_api_method_v
#define spa_api_method_v(type, o, method, version,...)
Definition hook.h:285
spa_list_for_each_reverse
#define spa_list_for_each_reverse(pos, head, member)
Definition list.h:122
spa_list_for_each
#define spa_list_for_each(pos, head, member)
Definition list.h:119
spa_loop_invoke
SPA_API_LOOP int spa_loop_invoke(struct spa_loop *object, spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
Definition loop.h:191
spa_loop_control_hook_before
SPA_API_LOOP void spa_loop_control_hook_before(struct spa_hook_list *l)
Definition loop.h:224
spa_loop_utils_add_idle
SPA_API_LOOP struct spa_source * spa_loop_utils_add_idle(struct spa_loop_utils *object, bool enabled, spa_source_idle_func_t func, void *data)
Definition loop.h:531
spa_loop_utils_add_signal
SPA_API_LOOP struct spa_source * spa_loop_utils_add_signal(struct spa_loop_utils *object, int signal_number, spa_source_signal_func_t func, void *data)
Definition loop.h:570
spa_loop_control_accept
SPA_API_LOOP int spa_loop_control_accept(struct spa_loop_control *object)
Definition loop.h:461
spa_loop_add_source
SPA_API_LOOP int spa_loop_add_source(struct spa_loop *object, struct spa_source *source)
Definition loop.h:176
spa_source_timer_func_t
void(* spa_source_timer_func_t)(void *data, uint64_t expirations)
Definition loop.h:470
spa_loop_utils_add_timer
SPA_API_LOOP struct spa_source * spa_loop_utils_add_timer(struct spa_loop_utils *object, spa_source_timer_func_t func, void *data)
Definition loop.h:556
spa_loop_control_get_fd
SPA_API_LOOP int spa_loop_control_get_fd(struct spa_loop_control *object)
Definition loop.h:397
spa_loop_control_enter
SPA_API_LOOP void spa_loop_control_enter(struct spa_loop_control *object)
Definition loop.h:409
spa_loop_control_signal
SPA_API_LOOP int spa_loop_control_signal(struct spa_loop_control *object, bool wait_for_accept)
Definition loop.h:456
spa_loop_remove_source
SPA_API_LOOP int spa_loop_remove_source(struct spa_loop *object, struct spa_source *source)
Definition loop.h:186
spa_loop_utils_update_timer
SPA_API_LOOP int spa_loop_utils_update_timer(struct spa_loop_utils *object, struct spa_source *source, struct timespec *value, struct timespec *interval, bool absolute)
Definition loop.h:561
spa_loop_utils_enable_idle
SPA_API_LOOP int spa_loop_utils_enable_idle(struct spa_loop_utils *object, struct spa_source *source, bool enabled)
Definition loop.h:537
spa_source_event_func_t
void(* spa_source_event_func_t)(void *data, uint64_t count)
Definition loop.h:469
spa_source_signal_func_t
void(* spa_source_signal_func_t)(void *data, int signal_number)
Definition loop.h:471
spa_loop_control_iterate_fast
SPA_API_LOOP int spa_loop_control_iterate_fast(struct spa_loop_control *object, int timeout)
Definition loop.h:423
spa_loop_control_add_hook
SPA_API_LOOP void spa_loop_control_add_hook(struct spa_loop_control *object, struct spa_hook *hook, const struct spa_loop_control_hooks *hooks, void *data)
Definition loop.h:402
spa_loop_control_wait
SPA_API_LOOP int spa_loop_control_wait(struct spa_loop_control *object, const struct timespec *abstime)
Definition loop.h:450
spa_source_idle_func_t
void(* spa_source_idle_func_t)(void *data)
Definition loop.h:468
spa_loop_control_iterate
SPA_API_LOOP int spa_loop_control_iterate(struct spa_loop_control *object, int timeout)
Definition loop.h:417
spa_loop_control_unlock
SPA_API_LOOP int spa_loop_control_unlock(struct spa_loop_control *object)
Definition loop.h:439
spa_loop_utils_destroy_source
SPA_API_LOOP void spa_loop_utils_destroy_source(struct spa_loop_utils *object, struct spa_source *source)
Definition loop.h:577
spa_source_func_t
void(* spa_source_func_t)(struct spa_source *source)
Definition loop.h:65
spa_loop_control_check
SPA_API_LOOP int spa_loop_control_check(struct spa_loop_control *object)
Definition loop.h:429
spa_loop_control_hook_after
SPA_API_LOOP void spa_loop_control_hook_after(struct spa_hook_list *l)
Definition loop.h:231
spa_loop_utils_add_event
SPA_API_LOOP struct spa_source * spa_loop_utils_add_event(struct spa_loop_utils *object, spa_source_event_func_t func, void *data)
Definition loop.h:544
spa_loop_control_get_time
SPA_API_LOOP int spa_loop_control_get_time(struct spa_loop_control *object, struct timespec *abstime, int64_t timeout)
Definition loop.h:444
spa_invoke_func_t
int(* spa_invoke_func_t)(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
Definition loop.h:78
spa_source_io_func_t
void(* spa_source_io_func_t)(void *data, int fd, uint32_t mask)
Definition loop.h:467
spa_loop_control_lock
SPA_API_LOOP int spa_loop_control_lock(struct spa_loop_control *object)
Definition loop.h:434
spa_loop_utils_signal_event
SPA_API_LOOP int spa_loop_utils_signal_event(struct spa_loop_utils *object, struct spa_source *source)
Definition loop.h:549
spa_loop_utils_update_io
SPA_API_LOOP int spa_loop_utils_update_io(struct spa_loop_utils *object, struct spa_source *source, uint32_t mask)
Definition loop.h:524
spa_loop_control_leave
SPA_API_LOOP void spa_loop_control_leave(struct spa_loop_control *object)
Definition loop.h:413
spa_loop_locked
SPA_API_LOOP int spa_loop_locked(struct spa_loop *object, spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, void *user_data)
Definition loop.h:199
spa_loop_update_source
SPA_API_LOOP int spa_loop_update_source(struct spa_loop *object, struct spa_source *source)
Definition loop.h:181
spa_loop_utils_add_io
SPA_API_LOOP struct spa_source * spa_loop_utils_add_io(struct spa_loop_utils *object, int fd, uint32_t mask, bool close, spa_source_io_func_t func, void *data)
Definition loop.h:518
hook.h
spa/utils/hook.h
SPA_API_LOOP
#define SPA_API_LOOP
Definition loop.h:29
spa_hook_list
A list of hooks.
Definition hook.h:416
spa_hook_list::list
struct spa_list list
Definition hook.h:417
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427
spa_hook::cb
struct spa_callbacks cb
Definition hook.h:429
spa_hook::link
struct spa_list link
Definition hook.h:428
spa_interface
Definition hook.h:148
spa_loop_control_hooks
Control hooks.
Definition loop.h:212
spa_loop_control_hooks::before
void(* before)(void *data)
Executed right before waiting for events.
Definition loop.h:218
spa_loop_control_hooks::version
uint32_t version
Definition loop.h:215
spa_loop_control_hooks::after
void(* after)(void *data)
Executed right after waiting for events.
Definition loop.h:221
spa_loop_control_methods
Control an event loop.
Definition loop.h:261
spa_loop_control_methods::accept
int(* accept)(void *object)
Accept signalers Resume the thread that signaled with wait_for accept.
Definition loop.h:394
spa_loop_control_methods::wait
int(* wait)(void *object, const struct timespec *abstime)
Wait for a signal Wait until a thread performs signal.
Definition loop.h:368
spa_loop_control_methods::iterate
int(* iterate)(void *object, int timeout)
Perform one iteration of the loop.
Definition loop.h:320
spa_loop_control_methods::signal
int(* signal)(void *object, bool wait_for_accept)
Signal waiters Wake up all threads blocked in wait.
Definition loop.h:383
spa_loop_control_methods::enter
void(* enter)(void *object)
Enter a loop.
Definition loop.h:298
spa_loop_control_methods::add_hook
void(* add_hook)(void *object, struct spa_hook *hook, const struct spa_loop_control_hooks *hooks, void *data)
Add a hook.
Definition loop.h:285
spa_loop_control_methods::get_time
int(* get_time)(void *object, struct timespec *abstime, int64_t timeout)
get the absolute time Get the current time with timeout that can be used in wait.
Definition loop.h:356
spa_loop_control_methods::lock
int(* lock)(void *object)
Lock the loop.
Definition loop.h:339
spa_loop_control_methods::check
int(* check)(void *object)
Check context of the loop.
Definition loop.h:330
spa_loop_control_methods::unlock
int(* unlock)(void *object)
Unlock the loop.
Definition loop.h:348
spa_loop_control_methods::leave
void(* leave)(void *object)
Leave a loop.
Definition loop.h:307
spa_loop_control
Definition loop.h:54
spa_loop_control::iface
struct spa_interface iface
Definition loop.h:54
spa_loop_methods
Register sources and work items to an event loop.
Definition loop.h:88
spa_loop_methods::add_source
int(* add_source)(void *object, struct spa_source *source)
Add a source to the loop.
Definition loop.h:101
spa_loop_methods::locked
int(* locked)(void *object, spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, void *user_data)
Call a function with the loop lock acquired May be called from any thread and multiple threads at the...
Definition loop.h:168
spa_loop_methods::remove_source
int(* remove_source)(void *object, struct spa_source *source)
Remove a source from the loop.
Definition loop.h:119
spa_loop_methods::invoke
int(* invoke)(void *object, spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
Invoke a function in the context of this loop.
Definition loop.h:149
spa_loop_methods::update_source
int(* update_source)(void *object, struct spa_source *source)
Update the source io mask.
Definition loop.h:110
spa_loop_methods::version
uint32_t version
Definition loop.h:93
spa_loop_utils_methods
Create sources for an event loop.
Definition loop.h:476
spa_loop_utils_methods::enable_idle
int(* enable_idle)(void *object, struct spa_source *source, bool enabled)
Definition loop.h:494
spa_loop_utils_methods::add_idle
struct spa_source *(* add_idle)(void *object, bool enabled, spa_source_idle_func_t func, void *data)
Definition loop.h:491
spa_loop_utils_methods::signal_event
int(* signal_event)(void *object, struct spa_source *source)
Definition loop.h:498
spa_loop_utils_methods::update_timer
int(* update_timer)(void *object, struct spa_source *source, struct timespec *value, struct timespec *interval, bool absolute)
Definition loop.h:502
spa_loop_utils_methods::destroy_source
void(* destroy_source)(void *object, struct spa_source *source)
destroy a source allocated with this interface.
Definition loop.h:514
spa_loop_utils_methods::add_io
struct spa_source *(* add_io)(void *object, int fd, uint32_t mask, bool close, spa_source_io_func_t func, void *data)
Definition loop.h:483
spa_loop_utils_methods::version
uint32_t version
Definition loop.h:481
spa_loop_utils
Definition loop.h:60
spa_loop_utils::iface
struct spa_interface iface
Definition loop.h:60
spa_loop
Definition loop.h:48
spa_loop::iface
struct spa_interface iface
Definition loop.h:48
spa_source
Definition loop.h:67
spa_source::rmask
uint32_t rmask
Definition loop.h:73
spa_source::priv
void * priv
Definition loop.h:75
spa_source::mask
uint32_t mask
Definition loop.h:72
spa_source::func
spa_source_func_t func
Definition loop.h:69
spa_source::fd
int fd
Definition loop.h:71
spa_source::loop
struct spa_loop * loop
Definition loop.h:68
system.h
spa/support/system.h