PipeWire  0.2.0
main-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_MAIN_LOOP_H__
21 #define __PIPEWIRE_MAIN_LOOP_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
34 struct pw_main_loop;
35 
36 #include <pipewire/loop.h>
37 #include <pipewire/properties.h>
38 
41 #define PW_VERSION_MAIN_LOOP_EVENTS 0
42  uint32_t version;
43 
45  void (*destroy) (void *data);
46 };
47 
49 struct pw_main_loop *
50 pw_main_loop_new(struct pw_properties *properties);
51 
53 void pw_main_loop_add_listener(struct pw_main_loop *loop,
54  struct spa_hook *listener,
55  const struct pw_main_loop_events *events,
56  void *data);
57 
60 
63 
65 void pw_main_loop_run(struct pw_main_loop *loop);
66 
68 void pw_main_loop_quit(struct pw_main_loop *loop);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* __PIPEWIRE_MAIN_LOOP_H__ */
void(* destroy)(void *data)
Emited when the main loop is destroyed.
Definition: main-loop.h:45
A collection of key/value pairs.
Definition: properties.h:38
void pw_main_loop_run(struct pw_main_loop *loop)
Start a main loop.
Definition: main-loop.c:110
PipeWire loop object provides an implementation of the spa loop interfaces.
Definition: loop.h:37
struct spa_loop * loop
wrapped loop
Definition: loop.h:38
void pw_main_loop_destroy(struct pw_main_loop *loop)
Destroy a main loop.
Definition: main-loop.c:66
Events of the main loop.
Definition: main-loop.h:40
struct pw_main_loop * pw_main_loop_new(struct pw_properties *properties)
Create a new new main loop.
Definition: main-loop.c:36
uint32_t version
Definition: main-loop.h:42
void pw_main_loop_quit(struct pw_main_loop *loop)
Stop a main loop.
Definition: main-loop.c:96
PipeWire main-loop interface.
struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop)
Get the loop implementation.
Definition: main-loop.c:84
void pw_main_loop_add_listener(struct pw_main_loop *loop, struct spa_hook *listener, const struct pw_main_loop_events *events, void *data)
Add an event listener.
Definition: main-loop.c:76