Go to the documentation of this file.
25 #ifndef PIPEWIRE_THREAD_LOOP_H
26 #define PIPEWIRE_THREAD_LOOP_H
98 struct pw_thread_loop;
102 #define PW_VERSION_THREAD_LOOP_EVENTS 0
110 struct pw_thread_loop *
115 struct pw_thread_loop *
SPA_EXPORT struct pw_thread_loop * pw_thread_loop_new_full(struct pw_loop *loop, const char *name, const struct spa_dict *props)
Create a new PipeWire Threaded Loop Object.
Definition: thread-loop.c:199
SPA_EXPORT int pw_thread_loop_start(struct pw_thread_loop *loop)
Start the thread to handle loop.
Definition: thread-loop.c:278
SPA_EXPORT void pw_thread_loop_unlock(struct pw_thread_loop *loop)
Unlock the mutex associated with loop.
Definition: thread-loop.c:332
#define pw_loop_leave(l)
Definition: src/pipewire/loop.h:69
SPA_EXPORT void pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept)
Signal the thread.
Definition: thread-loop.c:348
SPA_EXPORT struct pw_loop * pw_thread_loop_get_loop(struct pw_thread_loop *loop)
Get the loop implementation of the thread loop.
Definition: thread-loop.c:241
Definition: src/pipewire/loop.h:47
#define pw_log_trace(...)
Definition: src/pipewire/log.h:90
#define SPA_VERSION_LOOP_CONTROL_HOOKS
Definition: obj-x86_64-linux-gnu/doc/spa/support/loop.h:125
#define SPA_EXPORT
Definition: defs.h:207
void(* destroy)(void *data)
the loop is destroyed
Definition: thread-loop.h:106
SPA_EXPORT int pw_thread_loop_timed_wait_full(struct pw_thread_loop *loop, struct timespec *abstime)
Wait for the loop thread to call pw_thread_loop_signal() or time out.
Definition: thread-loop.c:431
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list.
Definition: hook.h:86
SPA_EXPORT bool pw_thread_loop_in_thread(struct pw_thread_loop *loop)
Check if we are inside the thread of the loop.
Definition: thread-loop.c:459
#define SPA_NSEC_PER_SEC
Definition: defs.h:184
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:117
static uint32_t int int res
Definition: core.h:329
#define CHECK(expression, label)
Definition: thread-loop.c:93
Definition: obj-x86_64-linux-gnu/doc/spa/support/loop.h:58
#define pw_loop_destroy_source(l,...)
Definition: src/pipewire/loop.h:80
#define pw_loop_add_hook(l,...)
Definition: src/pipewire/loop.h:66
#define pw_loop_add_event(l,...)
Definition: src/pipewire/loop.h:75
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:76
Control hooks.
Definition: obj-x86_64-linux-gnu/doc/spa/support/loop.h:124
SPA_EXPORT int pw_thread_loop_timed_wait(struct pw_thread_loop *loop, int wait_max_sec)
Wait for the loop thread to call pw_thread_loop_signal() or time out.
Definition: thread-loop.c:387
SPA_EXPORT void pw_thread_loop_stop(struct pw_thread_loop *loop)
Quit the loop and stop its thread.
Definition: thread-loop.c:300
Thread loop events.
Definition: thread-loop.h:101
SPA_EXPORT void pw_loop_destroy(struct pw_loop *loop)
Destroy a loop.
Definition: loop.c:158
Definition: utils/dict.h:48
#define pw_loop_signal_event(l,...)
Definition: src/pipewire/loop.h:76
SPA_EXPORT int pw_thread_loop_get_time(struct pw_thread_loop *loop, struct timespec *abstime, int64_t timeout)
Get the current time of the loop + timeout.
Definition: thread-loop.c:408
#define spa_strerror(err)
Definition: result.h:51
SPA_EXPORT void pw_thread_loop_wait(struct pw_thread_loop *loop)
Wait for the loop thread to call pw_thread_loop_signal()
Definition: thread-loop.c:369
#define pw_loop_enter(l)
Definition: src/pipewire/loop.h:67
uint32_t version
Definition: thread-loop.h:103
SPA_EXPORT void pw_thread_loop_add_listener(struct pw_thread_loop *loop, struct spa_hook *listener, const struct pw_thread_loop_events *events, void *data)
Add an event listener.
Definition: thread-loop.c:231
#define pw_loop_iterate(l,...)
Definition: src/pipewire/loop.h:68
A list of hooks.
Definition: hook.h:48
SPA_EXPORT struct pw_loop * pw_loop_new(const struct spa_dict *props)
Create a new loop.
Definition: loop.c:55
#define pw_thread_loop_events_destroy(o)
Definition: thread-loop.c:37
SPA_EXPORT void pw_thread_loop_destroy(struct pw_thread_loop *loop)
Destroy a threaded loop.
Definition: thread-loop.c:207
SPA_EXPORT void pw_thread_loop_accept(struct pw_thread_loop *loop)
Signal the loop thread waiting for accept with pw_thread_loop_signal()
Definition: thread-loop.c:446
void(* after)(void *data)
Executed right after waiting for events.
Definition: obj-x86_64-linux-gnu/doc/spa/support/loop.h:132
void spa_hook_list_append(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data)
Append a hook.
Definition: hook.h:97
struct spa_loop * loop
wrapped loop
Definition: src/pipewire/loop.h:49
SPA_EXPORT void pw_thread_loop_lock(struct pw_thread_loop *loop)
Lock the mutex associated with loop.
Definition: thread-loop.c:320
SPA_EXPORT struct pw_thread_loop * pw_thread_loop_new(const char *name, const struct spa_dict *props)
Create a new PipeWire Threaded Loop Object.
Definition: thread-loop.c:178
#define NAME
Definition: thread-loop.c:34
void(* before)(void *data)
Executed right before waiting for events.
Definition: obj-x86_64-linux-gnu/doc/spa/support/loop.h:129
void spa_hook_list_clean(struct spa_hook_list *list)
Definition: hook.h:124
#define pw_log_warn(...)
Definition: src/pipewire/log.h:87