+ +
2da5fe7 OpenAVX v0.2.0 - High-performance open-standard IP audio and video transport suite
saifmukhtar · 2026-11-24
c · 49 lines · 972 B · SPDX: MIT
main
1 /* Simple Plugin API */
2 /* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3 /* SPDX-License-Identifier: MIT */
4  
5 #ifndef SPA_COMMAND_H
6 #define SPA_COMMAND_H
7  
8 #include <spa/utils/defs.h>
9 #include <spa/pod/pod.h>
10  
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14  
15 /**
16 * \addtogroup spa_pod
17 * \{
18 */
19  
20 struct spa_command_body {
21 struct spa_pod_object_body body;
22 };
23  
24 struct spa_command {
25 struct spa_pod pod;
26 struct spa_command_body body;
27 };
28  
29 #define SPA_COMMAND_TYPE(cmd) ((cmd)->body.body.type)
30 #define SPA_COMMAND_ID(cmd,type) (SPA_COMMAND_TYPE(cmd) == (type) ? \
31 (cmd)->body.body.id : SPA_ID_INVALID)
32  
33 #define SPA_COMMAND_INIT_FULL(t,size,type,id,...) ((t) \
34 { { (size), SPA_TYPE_Object }, \
35 { { (type), (id) }, ##__VA_ARGS__ } })
36  
37 #define SPA_COMMAND_INIT(type,id) \
38 SPA_COMMAND_INIT_FULL(struct spa_command, \
39 sizeof(struct spa_command_body), type, id)
40  
41 /**
42 * \}
43 */
44  
45 #ifdef __cplusplus
46 } /* extern "C" */
47 #endif
48  
49 #endif /* SPA_COMMAND_H */