PipeWire  0.3.15
main-loop.h
Go to the documentation of this file.
1 /* PipeWire
2  *
3  * Copyright © 2018 Wim Taymans
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef PIPEWIRE_MAIN_LOOP_H
26 #define PIPEWIRE_MAIN_LOOP_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
39 struct pw_main_loop;
40 
41 #include <pipewire/loop.h>
42 
45 #define PW_VERSION_MAIN_LOOP_EVENTS 0
46  uint32_t version;
47 
49  void (*destroy) (void *data);
50 };
51 
53 struct pw_main_loop *
54 pw_main_loop_new(const struct spa_dict *props);
55 
57 void pw_main_loop_add_listener(struct pw_main_loop *loop,
58  struct spa_hook *listener,
59  const struct pw_main_loop_events *events,
60  void *data);
61 
64 
67 
70 
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* PIPEWIRE_MAIN_LOOP_H */
res
static uint32_t int int res
Definition: core.h:326
pw_main_loop
PipeWire main-loop interface.
pw_loop_add_event
#define pw_loop_add_event(l,...)
Definition: loop.h:69
pw_main_loop_events::destroy
void(* destroy)(void *data)
Emitted when the main loop is destroyed.
Definition: main-loop.h:49
pw_loop_signal_event
#define pw_loop_signal_event(l,...)
Definition: loop.h:70
data
Definition: filter.c:71
pw_loop_leave
#define pw_loop_leave(l)
Definition: loop.h:63
pw_loop
Definition: loop.h:41
pw_main_loop_get_loop
SPA_EXPORT struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop)
Get the loop implementation.
Definition: main-loop.c:121
NAME
#define NAME
Definition: main-loop.c:29
pw_main_loop::pw_main_loop_destroy
SPA_EXPORT void pw_main_loop_destroy(struct pw_main_loop *loop)
Destroy a main loop.
Definition: main-loop.c:98
pw_log::pw_log_debug
#define pw_log_debug(...)
pw_log::pw_log_warn
#define pw_log_warn(...)
pw_loop::pw_loop_destroy
SPA_EXPORT void pw_loop_destroy(struct pw_loop *loop)
Destroy a loop.
Definition: loop.c:158
pw_main_loop_events::version
uint32_t version
Definition: main-loop.h:46
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:112
log.h
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:121
main-loop.h
loop.h
pw_loop_enter
#define pw_loop_enter(l)
Definition: loop.h:61
pw_loop::pw_loop_new
SPA_EXPORT struct pw_loop * pw_loop_new(const struct spa_dict *props)
Create a new loop.
Definition: loop.c:55
pw_main_loop::pw_main_loop_run
SPA_EXPORT int pw_main_loop_run(struct pw_main_loop *loop)
Start a main loop.
Definition: main-loop.c:149
pw_loop::loop
struct spa_loop * loop
wrapped loop
Definition: loop.h:43
pw_main_loop_events
Events of the main loop.
Definition: main-loop.h:44
pw_main_loop::pw_main_loop_new
SPA_EXPORT struct pw_main_loop * pw_main_loop_new(const struct spa_dict *props)
Create a new new main loop.
Definition: main-loop.c:87
pw_main_loop::pw_main_loop_quit
SPA_EXPORT int pw_main_loop_quit(struct pw_main_loop *loop)
Stop a main loop.
Definition: main-loop.c:134
pw_main_loop_add_listener
SPA_EXPORT 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:112
pw_loop_iterate
#define pw_loop_iterate(l,...)
Definition: loop.h:62