PipeWire 0.1.9

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
40 struct pw_main_loop_events {
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
59 struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop);
60
62 void pw_main_loop_destroy(struct pw_main_loop *loop);
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__ */
pw_main_loop_events::destroy
void(* destroy)(void *data)
Emited when the main loop is destroyed.
Definition: main-loop.h:45
pw_properties
A collection of key/value pairs.
Definition: properties.h:38
pw_main_loop::pw_main_loop_run
void pw_main_loop_run(struct pw_main_loop *loop)
Start a main loop.
Definition: main-loop.c:110
pw_loop
PipeWire loop object provides an implementation of the spa loop interfaces.
Definition: loop.h:37
pw_loop::loop
struct spa_loop * loop
wrapped loop
Definition: loop.h:38
pw_main_loop::pw_main_loop_destroy
void pw_main_loop_destroy(struct pw_main_loop *loop)
Destroy a main loop.
Definition: main-loop.c:66
pw_main_loop_events
Events of the main loop.
Definition: main-loop.h:40
loop.h
pw_main_loop::pw_main_loop_new
struct pw_main_loop * pw_main_loop_new(struct pw_properties *properties)
Create a new new main loop.
Definition: main-loop.c:36
pw_main_loop_events::version
uint32_t version
Definition: main-loop.h:42
pw_main_loop::pw_main_loop_quit
void pw_main_loop_quit(struct pw_main_loop *loop)
Stop a main loop.
Definition: main-loop.c:96
properties.h
pw_main_loop
PipeWire main-loop interface.
pw_main_loop_get_loop
struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop)
Get the loop implementation.
Definition: main-loop.c:84
pw_main_loop_add_listener
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