Loading...
Searching...
No Matches
data-loop.h
Go to the documentation of this file.
/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef PIPEWIRE_DATA_LOOP_H
#define PIPEWIRE_DATA_LOOP_H
#include <spa/utils/hook.h>
#include <spa/support/thread.h>
#ifdef __cplusplus
extern "C" {
#endif
struct pw_data_loop;
#include <pipewire/loop.h>
#include <pipewire/properties.h>
struct pw_data_loop_events {
#define PW_VERSION_DATA_LOOP_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
};
struct pw_data_loop *
pw_data_loop_new(const struct spa_dict *props);
void pw_data_loop_add_listener(struct pw_data_loop *loop,
struct spa_hook *listener,
const struct pw_data_loop_events *events,
void *data);
int pw_data_loop_wait(struct pw_data_loop *loop, int timeout);
void pw_data_loop_exit(struct pw_data_loop *loop);
struct pw_loop *
pw_data_loop_get_loop(struct pw_data_loop *loop);
const char * pw_data_loop_get_name(struct pw_data_loop *loop);
const char * pw_data_loop_get_class(struct pw_data_loop *loop);
void pw_data_loop_destroy(struct pw_data_loop *loop);
int pw_data_loop_start(struct pw_data_loop *loop);
int pw_data_loop_stop(struct pw_data_loop *loop);
bool pw_data_loop_in_thread(struct pw_data_loop *loop);
struct spa_thread *pw_data_loop_get_thread(struct pw_data_loop *loop);
int pw_data_loop_invoke(struct pw_data_loop *loop,
spa_invoke_func_t func, uint32_t seq, const void *data, size_t size,
bool block, void *user_data);
void pw_data_loop_set_thread_utils(struct pw_data_loop *loop,
struct spa_thread_utils *impl);
#ifdef __cplusplus
}
#endif
#endif /* PIPEWIRE_DATA_LOOP_H */
seq
uint32_t int seq
Definition core.h:432
pw_data_loop_get_class
const char * pw_data_loop_get_class(struct pw_data_loop *loop)
Get the loop class.
Definition data-loop.c:225
pw_data_loop_wait
int pw_data_loop_wait(struct pw_data_loop *loop, int timeout)
wait for activity on the loop up to timeout milliseconds.
Definition data-loop.c:21
pw_data_loop_start
int pw_data_loop_start(struct pw_data_loop *loop)
Start the processing thread.
Definition data-loop.c:238
pw_data_loop_get_thread
struct spa_thread * pw_data_loop_get_thread(struct pw_data_loop *loop)
Get the thread object.
Definition data-loop.c:319
pw_data_loop_set_thread_utils
void pw_data_loop_set_thread_utils(struct pw_data_loop *loop, struct spa_thread_utils *impl)
Set a custom spa_thread_utils for this loop.
Definition data-loop.c:340
pw_data_loop_stop
int pw_data_loop_stop(struct pw_data_loop *loop)
Stop the processing thread.
Definition data-loop.c:279
pw_data_loop_add_listener
void pw_data_loop_add_listener(struct pw_data_loop *loop, struct spa_hook *listener, const struct pw_data_loop_events *events, void *data)
Add an event listener to loop.
Definition data-loop.c:185
pw_data_loop_get_name
const char * pw_data_loop_get_name(struct pw_data_loop *loop)
Get the loop name.
Definition data-loop.c:210
pw_data_loop_get_loop
struct pw_loop * pw_data_loop_get_loop(struct pw_data_loop *loop)
Get the loop implementation of this data loop.
Definition data-loop.c:195
pw_data_loop_new
struct pw_data_loop * pw_data_loop_new(const struct spa_dict *props)
Make a new loop.
Definition data-loop.c:155
pw_data_loop_destroy
void pw_data_loop_destroy(struct pw_data_loop *loop)
Destroy the loop.
Definition data-loop.c:165
pw_data_loop_in_thread
bool pw_data_loop_in_thread(struct pw_data_loop *loop)
Check if the current thread is the processing thread.
Definition data-loop.c:307
pw_data_loop_invoke
int pw_data_loop_invoke(struct pw_data_loop *loop, spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
invoke func in the context of the thread or in the caller thread when the loop is not running.
Definition data-loop.c:325
pw_data_loop_exit
void pw_data_loop_exit(struct pw_data_loop *loop)
make sure the thread will exit.
Definition data-loop.c:40
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
hook.h
spa/utils/hook.h
properties.h
pipewire/properties.h
thread.h
spa/support/thread.h
loop.h
pipewire/loop.h
pw_data_loop_events
Loop events, use pw_data_loop_add_listener to add a listener.
Definition data-loop.h:38
pw_data_loop_events::version
uint32_t version
Definition data-loop.h:41
pw_data_loop_events::destroy
void(* destroy)(void *data)
The loop is destroyed.
Definition data-loop.h:43
pw_data_loop
pw_loop
Definition loop.h:33
pw_loop::loop
struct spa_loop * loop
wrapped loop
Definition loop.h:35
spa_dict
Definition dict.h:51
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427
spa_thread_utils
Definition thread.h:55
spa_thread