20#define SPA_POD_ALIGN 8
21#define SPA_POD_MAX_SIZE (1u<<20)
23#define SPA_POD_BODY_SIZE(pod) (((struct spa_pod*)(pod))->size)
24#define SPA_POD_TYPE(pod) (((struct spa_pod*)(pod))->type)
25#define SPA_POD_SIZE(pod) ((uint64_t)sizeof(struct spa_pod) + SPA_POD_BODY_SIZE(pod))
26#define SPA_POD_CONTENTS_SIZE(type,pod) (SPA_POD_SIZE(pod)-sizeof(type))
28#define SPA_POD_CONTENTS(type,pod) SPA_PTROFF((pod),sizeof(type),void)
29#define SPA_POD_CONTENTS_CONST(type,pod) SPA_PTROFF((pod),sizeof(type),const void)
30#define SPA_POD_BODY(pod) SPA_PTROFF((pod),sizeof(struct spa_pod),void)
31#define SPA_POD_BODY_CONST(pod) SPA_PTROFF((pod),sizeof(struct spa_pod),const void)
33#define SPA_POD_IS_VALID(pod) \
34 (SPA_POD_BODY_SIZE(pod) < SPA_POD_MAX_SIZE)
35#define SPA_POD_CHECK_TYPE(pod,_type) \
36 (SPA_POD_IS_VALID(pod) && \
37 (pod)->type == (_type))
38#define SPA_POD_CHECK(pod,_type,_size) \
39 (SPA_POD_CHECK_TYPE(pod,_type) && (pod)->size >= (_size))
47#define SPA_POD_VALUE(type,pod) (((type*)(pod))->value)
108#define SPA_POD_ARRAY_CHILD(arr) (&((struct spa_pod_array*)(arr))->body.child)
109#define SPA_POD_ARRAY_VALUE_TYPE(arr) (SPA_POD_ARRAY_CHILD(arr)->type)
110#define SPA_POD_ARRAY_VALUE_SIZE(arr) (SPA_POD_ARRAY_CHILD(arr)->size)
111#define SPA_POD_ARRAY_N_VALUES(arr) (SPA_POD_ARRAY_VALUE_SIZE(arr) ? ((SPA_POD_BODY_SIZE(arr) - sizeof(struct spa_pod_array_body)) / SPA_POD_ARRAY_VALUE_SIZE(arr)) : 0)
112#define SPA_POD_ARRAY_VALUES(arr) SPA_POD_CONTENTS(struct spa_pod_array, arr)
124#define SPA_POD_CHOICE_CHILD(choice) (&((struct spa_pod_choice*)(choice))->body.child)
125#define SPA_POD_CHOICE_TYPE(choice) (((struct spa_pod_choice*)(choice))->body.type)
126#define SPA_POD_CHOICE_FLAGS(choice) (((struct spa_pod_choice*)(choice))->body.flags)
127#define SPA_POD_CHOICE_VALUE_TYPE(choice) (SPA_POD_CHOICE_CHILD(choice)->type)
128#define SPA_POD_CHOICE_VALUE_SIZE(choice) (SPA_POD_CHOICE_CHILD(choice)->size)
129#define SPA_POD_CHOICE_N_VALUES(choice) (SPA_POD_CHOICE_VALUE_SIZE(choice) ? ((SPA_POD_BODY_SIZE(choice) - sizeof(struct spa_pod_choice_body)) / SPA_POD_CHOICE_VALUE_SIZE(choice)) : 0)
130#define SPA_POD_CHOICE_VALUES(choice) (SPA_POD_CONTENTS(struct spa_pod_choice, choice))
153#define SPA_POD_STRUCT_BODY(pod) SPA_PTROFF((pod),sizeof(struct spa_pod),struct spa_pod)
154#define SPA_POD_STRUCT_BODY_CONST(pod) SPA_PTROFF((pod),sizeof(struct spa_pod),const struct spa_pod)
161#define SPA_POD_OBJECT_TYPE(obj) (((struct spa_pod_object*)(obj))->body.type)
162#define SPA_POD_OBJECT_ID(obj) (((struct spa_pod_object*)(obj))->body.id)
191#define SPA_POD_PROP_SIZE(prop) (sizeof(struct spa_pod_prop) + (prop)->value.size)
197#define SPA_POD_PROP_FLAG_READONLY (1u<<0)
198#define SPA_POD_PROP_FLAG_HARDWARE (1u<<1)
199#define SPA_POD_PROP_FLAG_HINT_DICT (1u<<2)
204#define SPA_POD_PROP_FLAG_MANDATORY (1u<<3)
206#define SPA_POD_PROP_FLAG_DONT_FIXATE (1u<<4)
207#define SPA_POD_PROP_FLAG_DROP (1u<<5)
214#define SPA_POD_CONTROL_SIZE(ev) (sizeof(struct spa_pod_control) + (ev)->value.size)
uint32_t id
Definition core.h:432
const char * key
Definition json-builder.h:308
spa_choice_type
Definition pod.h:160
@ SPA_CHOICE_Step
range with step: default, min, max, step
Definition pod.h:163
@ SPA_CHOICE_None
no choice, first value is current
Definition pod.h:161
@ SPA_CHOICE_Flags
flags: first value is flags
Definition pod.h:165
@ SPA_CHOICE_Range
range: default, min, max
Definition pod.h:162
@ SPA_CHOICE_Enum
list: default, alternative,...
Definition pod.h:164
struct spa_pod child
Definition pod.h:136
struct spa_pod_array_body body
Definition pod.h:142
struct spa_pod pod
Definition pod.h:120
int32_t _padding
Definition pod.h:68
int32_t value
Definition pod.h:67
struct spa_pod pod
Definition pod.h:66
struct spa_pod pod
Definition pod.h:105
struct spa_pod child
Definition pod.h:171
uint32_t flags
extra flags
Definition pod.h:170
struct spa_pod_choice_body body
Definition pod.h:178
struct spa_pod pod
Definition pod.h:177
uint32_t offset
media offset
Definition pod.h:258
double value
Definition pod.h:96
struct spa_pod pod
Definition pod.h:95
int64_t value
Definition pod.h:220
struct spa_pod pod
Definition pod.h:89
struct spa_fraction value
Definition pod.h:116
uint32_t value
Definition pod.h:73
int32_t _padding
Definition pod.h:74
struct spa_pod pod
Definition pod.h:72
struct spa_pod pod
Definition pod.h:78
int32_t _padding
Definition pod.h:80
int32_t value
Definition pod.h:79
struct spa_pod pod
Definition pod.h:84
struct spa_pod pod
Definition pod.h:203
struct spa_pod_object_body body
Definition pod.h:204
const void * value
Definition pod.h:210
uint32_t _padding
Definition pod.h:209
struct spa_pod_pointer_body body
Definition pod.h:215
struct spa_pod pod
Definition pod.h:214
uint32_t flags
flags for property
Definition pod.h:248
uint32_t pad
Definition pod.h:266
uint32_t unit
Definition pod.h:265
a sequence of timed controls
Definition pod.h:271
struct spa_pod pod
Definition pod.h:272
struct spa_pod_sequence_body body
Definition pod.h:273
struct spa_pod pod
Definition pod.h:100
struct spa_pod pod
Definition pod.h:187
uint32_t size
Definition pod.h:58