PipeWire  0.2.0
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 
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 *
60 
63 
66 
69 
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* __PIPEWIRE_DATA_LOOP_H__ */
void pw_data_loop_destroy(struct pw_data_loop *loop)
Destroy a data loop.
Definition: data-loop.c:88
A collection of key/value pairs.
Definition: properties.h:38
struct pw_data_loop * pw_data_loop_new(struct pw_properties *properties)
Create a new pw_data_loop.
Definition: data-loop.c:59
int pw_data_loop_start(struct pw_data_loop *loop)
Start a data loop.
Definition: data-loop.c:123
PipeWire loop object provides an implementation of the spa loop interfaces.
Definition: loop.h:37
uint32_t version
Definition: data-loop.h:42
struct spa_loop * loop
wrapped loop
Definition: loop.h:38
void(* destroy)(void *data)
The loop is destroyed.
Definition: data-loop.h:44
bool pw_data_loop_in_thread(struct pw_data_loop *loop)
Check if we are inside the data loop.
Definition: data-loop.c:162
Loop events, use pw_data_loop_add_listener to add a listener.
Definition: data-loop.h:40
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
PipeWire rt-loop object.
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
int pw_data_loop_stop(struct pw_data_loop *loop)
Stop a data loop.
Definition: data-loop.c:146