PipeWire  0.3.66
pod/event.h
Go to the documentation of this file.
1 /* Simple Plugin API */
2 /* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3 /* SPDX-License-Identifier: MIT */
4 
5 #ifndef SPA_EVENT_H
6 #define SPA_EVENT_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include <spa/pod/pod.h>
13 
19 struct spa_event_body {
21 };
22 
23 struct spa_event {
24  struct spa_pod pod;
25  struct spa_event_body body;
26 };
27 
28 #define SPA_EVENT_TYPE(ev) ((ev)->body.body.type)
29 #define SPA_EVENT_ID(ev,type) (SPA_EVENT_TYPE(ev) == (type) ? \
30  (ev)->body.body.id : SPA_ID_INVALID)
31 
32 #define SPA_EVENT_INIT_FULL(t,size,type,id,...) ((t) \
33  { { (size), SPA_TYPE_OBJECT }, \
34  { { (type), (id) }, ##__VA_ARGS__ } }) \
35 
36 #define SPA_EVENT_INIT(type,id) \
37  SPA_EVENT_INIT_FULL(struct spa_event, \
38  sizeof(struct spa_event_body), type, id)
39 
44 #ifdef __cplusplus
45 } /* extern "C" */
46 #endif
47 
48 #endif /* SPA_EVENT_H */
spa/pod/pod.h
Definition: pod/event.h:24
struct spa_pod_object_body body
Definition: pod/event.h:25
Definition: pod/event.h:28
struct spa_event_body body
Definition: pod/event.h:30
struct spa_pod pod
Definition: pod/event.h:29
Definition: pod/pod.h:177
Definition: pod/pod.h:43