PipeWire: data-loop.h Source File

PipeWire 0.1.9

data-loop.h
Go to the documentation of this file.
1 /* PipeWire
2 * Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef __PIPEWIRE_DATA_LOOP_H__
21 #define __PIPEWIRE_DATA_LOOP_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include <spa/utils/hook.h>
28
34 struct pw_data_loop;
35
36 #include <pipewire/loop.h>
37 #include <pipewire/properties.h>
38
40 struct pw_data_loop_events {
41 #define PW_VERSION_DATA_LOOP_EVENTS 0
42 uint32_t version;
44 void (*destroy) (void *data);
45 };
46
48 struct pw_data_loop *
49 pw_data_loop_new(struct pw_properties *properties);
50
52 void pw_data_loop_add_listener(struct pw_data_loop *loop,
53 struct spa_hook *listener,
54 const struct pw_data_loop_events *events,
55 void *data);
56
58 struct pw_loop *
59 pw_data_loop_get_loop(struct pw_data_loop *loop);
60
62 void pw_data_loop_destroy(struct pw_data_loop *loop);
63
65 int pw_data_loop_start(struct pw_data_loop *loop);
66
68 int pw_data_loop_stop(struct pw_data_loop *loop);
69
71 bool pw_data_loop_in_thread(struct pw_data_loop *loop);
72
73 #ifdef __cplusplus
74 }
75 #endif
76
77 #endif /* __PIPEWIRE_DATA_LOOP_H__ */
pw_data_loop::pw_data_loop_destroy
void pw_data_loop_destroy(struct pw_data_loop *loop)
Destroy a data loop.
Definition: data-loop.c:88
pw_properties
A collection of key/value pairs.
Definition: properties.h:38
pw_data_loop::pw_data_loop_new
struct pw_data_loop * pw_data_loop_new(struct pw_properties *properties)
Create a new pw_data_loop.
Definition: data-loop.c:59
pw_data_loop::pw_data_loop_start
int pw_data_loop_start(struct pw_data_loop *loop)
Start a data loop.
Definition: data-loop.c:123
pw_loop
PipeWire loop object provides an implementation of the spa loop interfaces.
Definition: loop.h:37
pw_data_loop_events::version
uint32_t version
Definition: data-loop.h:42
pw_loop::loop
struct spa_loop * loop
wrapped loop
Definition: loop.h:38
pw_data_loop_events::destroy
void(* destroy)(void *data)
The loop is destroyed.
Definition: data-loop.h:44
loop.h
pw_data_loop::pw_data_loop_in_thread
bool pw_data_loop_in_thread(struct pw_data_loop *loop)
Check if we are inside the data loop.
Definition: data-loop.c:162
pw_data_loop_events
Loop events, use pw_data_loop_add_listener to add a listener.
Definition: data-loop.h:40
properties.h
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:101
pw_data_loop
PipeWire rt-loop object.
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:110
pw_data_loop::pw_data_loop_stop
int pw_data_loop_stop(struct pw_data_loop *loop)
Stop a data loop.
Definition: data-loop.c:146