PipeWire  0.2.7
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__ */
pw_loop::pw_loop_new
SPA_EXPORT struct pw_loop * pw_loop_new(struct pw_properties *properties)
Create a new loop.
Definition: loop.c:45
pw_main_loop::pw_main_loop_quit
SPA_EXPORT void pw_main_loop_quit(struct pw_main_loop *loop)
Stop a main loop.
Definition: main-loop.c:101
pw_main_loop
PipeWire main-loop interface.
pw_loop_add_event
#define pw_loop_add_event(l,...)
Definition: loop.h:64
pw_main_loop_events::destroy
void(* destroy)(void *data)
Emited when the main loop is destroyed.
Definition: main-loop.h:45
pw_main_loop::pw_main_loop_new
SPA_EXPORT struct pw_main_loop * pw_main_loop_new(struct pw_properties *properties)
Create a new new main loop.
Definition: main-loop.c:37
pw_loop_signal_event
#define pw_loop_signal_event(l,...)
Definition: loop.h:65
pw_loop_leave
#define pw_loop_leave(l)
Definition: loop.h:58
pw_loop
Definition: loop.h:37
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:88
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:68
pw_loop::pw_loop_destroy
SPA_EXPORT void pw_loop_destroy(struct pw_loop *loop)
Destroy a loop.
Definition: loop.c:121
pw_main_loop_events::version
uint32_t version
Definition: main-loop.h:42
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:79
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:88
main-loop.h
loop.h
pw_main_loop::pw_main_loop_run
SPA_EXPORT void pw_main_loop_run(struct pw_main_loop *loop)
Start a main loop.
Definition: main-loop.c:116
pw_loop_enter
#define pw_loop_enter(l)
Definition: loop.h:56
properties.h
pw_loop::loop
struct spa_loop * loop
wrapped loop
Definition: loop.h:38
pw_main_loop_events
Events of the main loop.
Definition: main-loop.h:40
pw_log::pw_log_debug
void pw_log_debug(const char *format,...)
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:79
pw_properties
A collection of key/value pairs.
Definition: properties.h:38
pw_loop_iterate
#define pw_loop_iterate(l,...)
Definition: loop.h:57