Loading...
Searching...
No Matches
body.h
Go to the documentation of this file.
/* Simple Plugin API */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef SPA_POD_BODY_H
#define SPA_POD_BODY_H
#include <errno.h>
#include <sys/types.h>
#include <spa/pod/pod.h>
#include <spa/utils/atomic.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SPA_API_POD_BODY
#ifdef SPA_API_IMPL
#define SPA_API_POD_BODY SPA_API_IMPL
#else
#define SPA_API_POD_BODY static inline
#endif
#endif
struct spa_pod_frame {
struct spa_pod pod;
struct spa_pod_frame *parent;
uint32_t offset;
uint32_t flags;
};
SPA_API_POD_BODY uint32_t spa_pod_type_size(uint32_t type)
{
switch (type) {
case SPA_TYPE_None:
case SPA_TYPE_Bytes:
case SPA_TYPE_Struct:
case SPA_TYPE_Pod:
return 0;
case SPA_TYPE_String:
return 1;
case SPA_TYPE_Bool:
case SPA_TYPE_Int:
return sizeof(int32_t);
case SPA_TYPE_Id:
return sizeof(uint32_t);
case SPA_TYPE_Long:
return sizeof(int64_t);
case SPA_TYPE_Float:
return sizeof(float);
case SPA_TYPE_Double:
return sizeof(double);
case SPA_TYPE_Rectangle:
return sizeof(struct spa_rectangle);
case SPA_TYPE_Fraction:
return sizeof(struct spa_fraction);
case SPA_TYPE_Bitmap:
return sizeof(uint8_t);
case SPA_TYPE_Array:
return sizeof(struct spa_pod_array_body);
case SPA_TYPE_Object:
return sizeof(struct spa_pod_object_body);
case SPA_TYPE_Sequence:
return sizeof(struct spa_pod_sequence_body);
case SPA_TYPE_Pointer:
return sizeof(struct spa_pod_pointer_body);
case SPA_TYPE_Fd:
return sizeof(int64_t);
case SPA_TYPE_Choice:
return sizeof(struct spa_pod_choice_body);
}
return 0;
}
SPA_API_POD_BODY int spa_pod_choice_n_values(uint32_t choice_type, uint32_t *min, uint32_t *max)
{
switch (choice_type) {
case SPA_CHOICE_Enum:
*min = 2;
*max = UINT32_MAX;
break;
case SPA_CHOICE_Range:
*min = *max = 3;
break;
case SPA_CHOICE_Step:
*min = *max = 4;
break;
case SPA_CHOICE_None:
case SPA_CHOICE_Flags:
*min = *max = 1;
break;
default:
/*
* This must always return at least 1, because callers
* assume that n_vals >= spa_pod_choice_n_values()
* mean that n_vals is at least 1.
*/
*min = 1;
*max = UINT32_MAX;
return 0;
}
return 1;
}
SPA_API_POD_BODY int spa_pod_body_from_data(void *data, size_t maxsize, off_t offset, size_t size,
struct spa_pod *pod, const void **body)
{
if (offset < 0 || offset > (int64_t)UINT32_MAX)
return -EINVAL;
if (size < sizeof(struct spa_pod) ||
size > maxsize ||
maxsize - size < (uint32_t)offset)
return -EINVAL;
memcpy(pod, SPA_PTROFF(data, offset, void), sizeof(struct spa_pod));
if (!SPA_POD_IS_VALID(pod))
return -EINVAL;
if (pod->size > size - sizeof(struct spa_pod))
return -EINVAL;
*body = SPA_PTROFF(data, offset + sizeof(struct spa_pod), void);
return 0;
}
SPA_API_POD_BODY int spa_pod_is_none(const struct spa_pod *pod)
{
return SPA_POD_CHECK_TYPE(pod, SPA_TYPE_None);
}
SPA_API_POD_BODY int spa_pod_is_bool(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Bool, sizeof(int32_t));
}
#define SPA_POD_BODY_LOAD_ONCE(a, b) (*(a) = SPA_LOAD_ONCE(*(__typeof__(a))(b)))
#define SPA_POD_BODY_LOAD_FIELD_ONCE(a, b, field) ((a)->field = SPA_LOAD_ONCE(((__typeof__(a))(b))->field))
SPA_API_POD_BODY int spa_pod_body_get_bool(const struct spa_pod *pod, const void *body, bool *value)
{
if (!spa_pod_is_bool(pod))
return -EINVAL;
*value = !!__atomic_load_n((const int32_t *)body, __ATOMIC_RELAXED);
return 0;
}
SPA_API_POD_BODY int spa_pod_is_id(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Id, sizeof(uint32_t));
}
SPA_API_POD_BODY int spa_pod_body_get_id(const struct spa_pod *pod, const void *body, uint32_t *value)
{
if (!spa_pod_is_id(pod))
return -EINVAL;
SPA_POD_BODY_LOAD_ONCE(value, body);
return 0;
}
SPA_API_POD_BODY int spa_pod_is_int(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Int, sizeof(int32_t));
}
SPA_API_POD_BODY int spa_pod_body_get_int(const struct spa_pod *pod, const void *body, int32_t *value)
{
if (!spa_pod_is_int(pod))
return -EINVAL;
SPA_POD_BODY_LOAD_ONCE(value, body);
return 0;
}
SPA_API_POD_BODY int spa_pod_is_long(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Long, sizeof(int64_t));
}
SPA_API_POD_BODY int spa_pod_body_get_long(const struct spa_pod *pod, const void *body, int64_t *value)
{
if (!spa_pod_is_long(pod))
return -EINVAL;
/* TODO this is wrong per C standard, but if it breaks so does the Linux kernel. */
SPA_BARRIER;
memcpy(value, body, sizeof *value);
SPA_BARRIER;
return 0;
}
SPA_API_POD_BODY int spa_pod_is_float(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Float, sizeof(float));
}
SPA_API_POD_BODY int spa_pod_body_get_float(const struct spa_pod *pod, const void *body, float *value)
{
if (!spa_pod_is_float(pod))
return -EINVAL;
SPA_BARRIER;
memcpy(value, body, sizeof *value);
SPA_BARRIER;
return 0;
}
SPA_API_POD_BODY int spa_pod_is_double(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Double, sizeof(double));
}
SPA_API_POD_BODY int spa_pod_body_get_double(const struct spa_pod *pod, const void *body, double *value)
{
if (!spa_pod_is_double(pod))
return -EINVAL;
SPA_BARRIER;
memcpy(value, body, sizeof *value);
SPA_BARRIER;
return 0;
}
SPA_API_POD_BODY int spa_pod_is_string(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_String, 1);
}
SPA_API_POD_BODY int spa_pod_body_get_string(const struct spa_pod *pod,
const void *body, const char **value)
{
const char *s;
if (!spa_pod_is_string(pod))
return -EINVAL;
s = (const char *)body;
if (((const volatile char *)s)[pod->size-1] != '\0')
return -EINVAL;
*value = s;
return 0;
}
SPA_API_POD_BODY int spa_pod_body_copy_string(const struct spa_pod *pod, const void *body,
char *dest, size_t maxlen)
{
const char *s;
if (spa_pod_body_get_string(pod, body, &s) < 0 || maxlen < 1)
return -EINVAL;
SPA_BARRIER;
strncpy(dest, s, maxlen-1);
SPA_BARRIER;
dest[maxlen-1]= '\0';
return 0;
}
SPA_API_POD_BODY int spa_pod_is_bytes(const struct spa_pod *pod)
{
return SPA_POD_CHECK_TYPE(pod, SPA_TYPE_Bytes);
}
SPA_API_POD_BODY int spa_pod_body_get_bytes(const struct spa_pod *pod, const void *body,
const void **value, uint32_t *len)
{
if (!spa_pod_is_bytes(pod))
return -EINVAL;
*value = (const void *)body;
*len = pod->size;
return 0;
}
SPA_API_POD_BODY int spa_pod_is_pointer(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Pointer, sizeof(struct spa_pod_pointer_body));
}
SPA_API_POD_BODY int spa_pod_body_get_pointer(const struct spa_pod *pod, const void *body,
uint32_t *type, const void **value)
{
struct spa_pod_pointer_body b;
if (!spa_pod_is_pointer(pod))
return -EINVAL;
SPA_POD_BODY_LOAD_FIELD_ONCE(&b, body, type);
SPA_POD_BODY_LOAD_FIELD_ONCE(&b, body, value);
*type = b.type;
*value = b.value;
return 0;
}
SPA_API_POD_BODY int spa_pod_is_fd(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Fd, sizeof(int64_t));
}
SPA_API_POD_BODY int spa_pod_body_get_fd(const struct spa_pod *pod, const void *body,
int64_t *value)
{
if (!spa_pod_is_fd(pod))
return -EINVAL;
SPA_BARRIER;
memcpy(value, body, sizeof *value);
SPA_BARRIER;
return 0;
}
SPA_API_POD_BODY int spa_pod_is_rectangle(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Rectangle, sizeof(struct spa_rectangle));
}
SPA_API_POD_BODY int spa_pod_body_get_rectangle(const struct spa_pod *pod, const void *body,
struct spa_rectangle *value)
{
if (!spa_pod_is_rectangle(pod))
return -EINVAL;
SPA_POD_BODY_LOAD_FIELD_ONCE(value, body, width);
SPA_POD_BODY_LOAD_FIELD_ONCE(value, body, height);
return 0;
}
SPA_API_POD_BODY int spa_pod_is_fraction(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Fraction, sizeof(struct spa_fraction));
}
SPA_API_POD_BODY int spa_pod_body_get_fraction(const struct spa_pod *pod, const void *body,
struct spa_fraction *value)
{
if (!spa_pod_is_fraction(pod))
return -EINVAL;
SPA_POD_BODY_LOAD_FIELD_ONCE(value, body, num);
SPA_POD_BODY_LOAD_FIELD_ONCE(value, body, denom);
return 0;
}
SPA_API_POD_BODY int spa_pod_is_bitmap(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Bitmap, sizeof(uint8_t));
}
SPA_API_POD_BODY int spa_pod_body_get_bitmap(const struct spa_pod *pod, const void *body,
const uint8_t **value)
{
if (!spa_pod_is_bitmap(pod))
return -EINVAL;
*value = (const uint8_t *)body;
return 0;
}
SPA_API_POD_BODY int spa_pod_is_array(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Array, sizeof(struct spa_pod_array_body));
}
SPA_API_POD_BODY int spa_pod_body_get_array(const struct spa_pod *pod, const void *body,
struct spa_pod_array *arr, const void **arr_body)
{
if (!spa_pod_is_array(pod))
return -EINVAL;
arr->pod = *pod;
SPA_POD_BODY_LOAD_FIELD_ONCE(&arr->body.child, body, type);
SPA_POD_BODY_LOAD_FIELD_ONCE(&arr->body.child, body, size);
*arr_body = SPA_PTROFF(body, sizeof(struct spa_pod_array_body), void);
return 0;
}
SPA_API_POD_BODY const void *spa_pod_array_body_get_values(const struct spa_pod_array *arr,
const void *body, uint32_t *n_values, uint32_t *val_size, uint32_t *val_type)
{
uint32_t child_size = arr->body.child.size;
*n_values = child_size ? (arr->pod.size - sizeof(arr->body)) / child_size : 0;
*val_size = child_size;
*val_type = arr->body.child.type;
if (*val_size < spa_pod_type_size(*val_type))
*n_values = 0;
return body;
}
SPA_API_POD_BODY const void *spa_pod_body_get_array_values(const struct spa_pod *pod,
const void *body, uint32_t *n_values, uint32_t *val_size, uint32_t *val_type)
{
struct spa_pod_array arr;
if (spa_pod_body_get_array(pod, body, &arr, &body) < 0)
return NULL;
return spa_pod_array_body_get_values(&arr, body, n_values, val_size, val_type);
}
SPA_API_POD_BODY int spa_pod_is_choice(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Choice, sizeof(struct spa_pod_choice_body));
}
SPA_API_POD_BODY int spa_pod_body_get_choice(const struct spa_pod *pod, const void *body,
struct spa_pod_choice *choice, const void **choice_body)
{
if (!spa_pod_is_choice(pod))
return -EINVAL;
choice->pod = *pod;
SPA_POD_BODY_LOAD_FIELD_ONCE(&choice->body, body, type);
SPA_POD_BODY_LOAD_FIELD_ONCE(&choice->body, body, flags);
SPA_POD_BODY_LOAD_FIELD_ONCE(&choice->body, body, child.size);
SPA_POD_BODY_LOAD_FIELD_ONCE(&choice->body, body, child.type);
*choice_body = SPA_PTROFF(body, sizeof(struct spa_pod_choice_body), void);
return 0;
}
SPA_API_POD_BODY const void *spa_pod_choice_body_get_values(const struct spa_pod_choice *pod,
const void *body, uint32_t *n_values, uint32_t *choice,
uint32_t *val_size, uint32_t *val_type)
{
uint32_t child_size = pod->body.child.size, min, max;
*val_size = child_size;
*val_type = pod->body.child.type;
*n_values = child_size ? (pod->pod.size - sizeof(pod->body)) / child_size : 0;
*choice = pod->body.type;
spa_pod_choice_n_values(*choice, &min, &max);
if (*n_values < min || *val_size < spa_pod_type_size(*val_type))
*n_values = 0;
else if (*n_values > max)
*n_values = max;
return body;
}
SPA_API_POD_BODY int spa_pod_is_struct(const struct spa_pod *pod)
{
return SPA_POD_CHECK_TYPE(pod, SPA_TYPE_Struct);
}
SPA_API_POD_BODY int spa_pod_is_object(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Object, sizeof(struct spa_pod_object_body));
}
SPA_API_POD_BODY int spa_pod_body_get_object(const struct spa_pod *pod, const void *body,
struct spa_pod_object *object, const void **object_body)
{
if (!spa_pod_is_object(pod))
return -EINVAL;
object->pod = *pod;
SPA_POD_BODY_LOAD_FIELD_ONCE(&object->body, body, type);
SPA_POD_BODY_LOAD_FIELD_ONCE(&object->body, body, id);
*object_body = SPA_PTROFF(body, sizeof(struct spa_pod_object_body), void);
return 0;
}
SPA_API_POD_BODY int spa_pod_is_sequence(const struct spa_pod *pod)
{
return SPA_POD_CHECK(pod, SPA_TYPE_Sequence, sizeof(struct spa_pod_sequence_body));
}
SPA_API_POD_BODY int spa_pod_body_get_sequence(const struct spa_pod *pod, const void *body,
struct spa_pod_sequence *seq, const void **seq_body)
{
if (!spa_pod_is_sequence(pod))
return -EINVAL;
seq->pod = *pod;
SPA_POD_BODY_LOAD_FIELD_ONCE(&seq->body, body, unit);
SPA_POD_BODY_LOAD_FIELD_ONCE(&seq->body, body, pad);
*seq_body = SPA_PTROFF(body, sizeof(struct spa_pod_sequence_body), void);
return 0;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* SPA_POD_BODY_H */
SPA_API_POD_BODY
#define SPA_API_POD_BODY
Definition body.h:29
seq
uint32_t int seq
Definition core.h:432
spa_pod_is_sequence
SPA_API_POD_BODY int spa_pod_is_sequence(const struct spa_pod *pod)
Definition body.h:444
spa_pod_is_pointer
SPA_API_POD_BODY int spa_pod_is_pointer(const struct spa_pod *pod)
Definition body.h:277
spa_pod_is_bitmap
SPA_API_POD_BODY int spa_pod_is_bitmap(const struct spa_pod *pod)
Definition body.h:340
SPA_POD_IS_VALID
#define SPA_POD_IS_VALID(pod)
Definition pod.h:48
spa_pod_is_fraction
SPA_API_POD_BODY int spa_pod_is_fraction(const struct spa_pod *pod)
Definition body.h:326
spa_pod_body_get_pointer
SPA_API_POD_BODY int spa_pod_body_get_pointer(const struct spa_pod *pod, const void *body, uint32_t *type, const void **value)
Definition body.h:282
spa_pod_is_double
SPA_API_POD_BODY int spa_pod_is_double(const struct spa_pod *pod)
Definition body.h:216
spa_pod_body_get_array_values
SPA_API_POD_BODY const void * spa_pod_body_get_array_values(const struct spa_pod *pod, const void *body, uint32_t *n_values, uint32_t *val_size, uint32_t *val_type)
Definition body.h:380
spa_pod_body_get_sequence
SPA_API_POD_BODY int spa_pod_body_get_sequence(const struct spa_pod *pod, const void *body, struct spa_pod_sequence *seq, const void **seq_body)
Definition body.h:448
spa_pod_body_get_string
SPA_API_POD_BODY int spa_pod_body_get_string(const struct spa_pod *pod, const void *body, const char **value)
Definition body.h:236
spa_pod_is_array
SPA_API_POD_BODY int spa_pod_is_array(const struct spa_pod *pod)
Definition body.h:353
spa_pod_is_rectangle
SPA_API_POD_BODY int spa_pod_is_rectangle(const struct spa_pod *pod)
Definition body.h:311
spa_pod_is_struct
SPA_API_POD_BODY int spa_pod_is_struct(const struct spa_pod *pod)
Definition body.h:423
spa_pod_is_int
SPA_API_POD_BODY int spa_pod_is_int(const struct spa_pod *pod)
Definition body.h:172
spa_pod_is_fd
SPA_API_POD_BODY int spa_pod_is_fd(const struct spa_pod *pod)
Definition body.h:295
spa_pod_body_get_fraction
SPA_API_POD_BODY int spa_pod_body_get_fraction(const struct spa_pod *pod, const void *body, struct spa_fraction *value)
Definition body.h:330
spa_pod_is_none
SPA_API_POD_BODY int spa_pod_is_none(const struct spa_pod *pod)
Definition body.h:136
spa_pod_choice_n_values
SPA_API_POD_BODY int spa_pod_choice_n_values(uint32_t choice_type, uint32_t *min, uint32_t *max)
Definition body.h:88
spa_pod_is_object
SPA_API_POD_BODY int spa_pod_is_object(const struct spa_pod *pod)
Definition body.h:428
spa_pod_array_body_get_values
SPA_API_POD_BODY const void * spa_pod_array_body_get_values(const struct spa_pod_array *arr, const void *body, uint32_t *n_values, uint32_t *val_size, uint32_t *val_type)
Definition body.h:368
spa_pod_is_bool
SPA_API_POD_BODY int spa_pod_is_bool(const struct spa_pod *pod)
Definition body.h:141
SPA_POD_CHECK_TYPE
#define SPA_POD_CHECK_TYPE(pod, _type)
Definition pod.h:50
spa_pod_is_id
SPA_API_POD_BODY int spa_pod_is_id(const struct spa_pod *pod)
Definition body.h:159
spa_pod_type_size
SPA_API_POD_BODY uint32_t spa_pod_type_size(uint32_t type)
Definition body.h:45
SPA_POD_BODY_LOAD_FIELD_ONCE
#define SPA_POD_BODY_LOAD_FIELD_ONCE(a, b, field)
Definition body.h:149
spa_pod_body_get_array
SPA_API_POD_BODY int spa_pod_body_get_array(const struct spa_pod *pod, const void *body, struct spa_pod_array *arr, const void **arr_body)
Definition body.h:357
spa_pod_body_get_double
SPA_API_POD_BODY int spa_pod_body_get_double(const struct spa_pod *pod, const void *body, double *value)
Definition body.h:221
spa_pod_body_copy_string
SPA_API_POD_BODY int spa_pod_body_copy_string(const struct spa_pod *pod, const void *body, char *dest, size_t maxlen)
Definition body.h:249
spa_pod_body_get_long
SPA_API_POD_BODY int spa_pod_body_get_long(const struct spa_pod *pod, const void *body, int64_t *value)
Definition body.h:190
spa_pod_body_get_object
SPA_API_POD_BODY int spa_pod_body_get_object(const struct spa_pod *pod, const void *body, struct spa_pod_object *object, const void **object_body)
Definition body.h:432
spa_pod_choice_body_get_values
SPA_API_POD_BODY const void * spa_pod_choice_body_get_values(const struct spa_pod_choice *pod, const void *body, uint32_t *n_values, uint32_t *choice, uint32_t *val_size, uint32_t *val_type)
Definition body.h:406
spa_pod_is_bytes
SPA_API_POD_BODY int spa_pod_is_bytes(const struct spa_pod *pod)
Definition body.h:262
spa_pod_body_get_int
SPA_API_POD_BODY int spa_pod_body_get_int(const struct spa_pod *pod, const void *body, int32_t *value)
Definition body.h:177
spa_pod_is_string
SPA_API_POD_BODY int spa_pod_is_string(const struct spa_pod *pod)
Definition body.h:231
SPA_POD_BODY_LOAD_ONCE
#define SPA_POD_BODY_LOAD_ONCE(a, b)
Definition body.h:147
spa_pod_body_get_float
SPA_API_POD_BODY int spa_pod_body_get_float(const struct spa_pod *pod, const void *body, float *value)
Definition body.h:206
spa_pod_body_get_rectangle
SPA_API_POD_BODY int spa_pod_body_get_rectangle(const struct spa_pod *pod, const void *body, struct spa_rectangle *value)
Definition body.h:316
spa_pod_body_get_bool
SPA_API_POD_BODY int spa_pod_body_get_bool(const struct spa_pod *pod, const void *body, bool *value)
Definition body.h:151
spa_pod_body_get_bitmap
SPA_API_POD_BODY int spa_pod_body_get_bitmap(const struct spa_pod *pod, const void *body, const uint8_t **value)
Definition body.h:344
spa_pod_body_from_data
SPA_API_POD_BODY int spa_pod_body_from_data(void *data, size_t maxsize, off_t offset, size_t size, struct spa_pod *pod, const void **body)
Definition body.h:118
spa_pod_body_get_choice
SPA_API_POD_BODY int spa_pod_body_get_choice(const struct spa_pod *pod, const void *body, struct spa_pod_choice *choice, const void **choice_body)
Definition body.h:393
spa_pod_body_get_fd
SPA_API_POD_BODY int spa_pod_body_get_fd(const struct spa_pod *pod, const void *body, int64_t *value)
Definition body.h:300
spa_pod_is_choice
SPA_API_POD_BODY int spa_pod_is_choice(const struct spa_pod *pod)
Definition body.h:389
spa_pod_body_get_id
SPA_API_POD_BODY int spa_pod_body_get_id(const struct spa_pod *pod, const void *body, uint32_t *value)
Definition body.h:164
spa_pod_is_float
SPA_API_POD_BODY int spa_pod_is_float(const struct spa_pod *pod)
Definition body.h:201
spa_pod_body_get_bytes
SPA_API_POD_BODY int spa_pod_body_get_bytes(const struct spa_pod *pod, const void *body, const void **value, uint32_t *len)
Definition body.h:267
SPA_POD_CHECK
#define SPA_POD_CHECK(pod, _type, _size)
Definition pod.h:53
spa_pod_is_long
SPA_API_POD_BODY int spa_pod_is_long(const struct spa_pod *pod)
Definition body.h:185
SPA_CHOICE_Step
@ SPA_CHOICE_Step
range with step: default, min, max, step
Definition pod.h:163
SPA_CHOICE_None
@ SPA_CHOICE_None
no choice, first value is current
Definition pod.h:161
SPA_CHOICE_Flags
@ SPA_CHOICE_Flags
flags: first value is flags
Definition pod.h:165
SPA_CHOICE_Range
@ SPA_CHOICE_Range
range: default, min, max
Definition pod.h:162
SPA_CHOICE_Enum
@ SPA_CHOICE_Enum
list: default, alternative,...
Definition pod.h:164
SPA_TYPE_Int
@ SPA_TYPE_Int
Definition type.h:45
SPA_TYPE_Rectangle
@ SPA_TYPE_Rectangle
Definition type.h:51
SPA_TYPE_Long
@ SPA_TYPE_Long
Definition type.h:46
SPA_TYPE_Bool
@ SPA_TYPE_Bool
Definition type.h:43
SPA_TYPE_Bytes
@ SPA_TYPE_Bytes
Definition type.h:50
SPA_TYPE_Pod
@ SPA_TYPE_Pod
Definition type.h:61
SPA_TYPE_Bitmap
@ SPA_TYPE_Bitmap
Definition type.h:53
SPA_TYPE_Object
@ SPA_TYPE_Object
Definition type.h:56
SPA_TYPE_Float
@ SPA_TYPE_Float
Definition type.h:47
SPA_TYPE_Fraction
@ SPA_TYPE_Fraction
Definition type.h:52
SPA_TYPE_None
@ SPA_TYPE_None
Definition type.h:42
SPA_TYPE_Sequence
@ SPA_TYPE_Sequence
Definition type.h:57
SPA_TYPE_Double
@ SPA_TYPE_Double
Definition type.h:48
SPA_TYPE_Id
@ SPA_TYPE_Id
Definition type.h:44
SPA_TYPE_Choice
@ SPA_TYPE_Choice
Definition type.h:60
SPA_TYPE_Pointer
@ SPA_TYPE_Pointer
Definition type.h:58
SPA_TYPE_Array
@ SPA_TYPE_Array
Definition type.h:54
SPA_TYPE_String
@ SPA_TYPE_String
Definition type.h:49
SPA_TYPE_Fd
@ SPA_TYPE_Fd
Definition type.h:59
SPA_TYPE_Struct
@ SPA_TYPE_Struct
Definition type.h:55
SPA_BARRIER
#define SPA_BARRIER
Definition defs.h:315
SPA_PTROFF
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition defs.h:222
pod.h
spa/pod/pod.h
spa_fraction
Definition defs.h:137
spa_pod_array_body
Definition pod.h:135
spa_pod_array_body::child
struct spa_pod child
Definition pod.h:136
spa_pod_array
Definition pod.h:140
spa_pod_array::pod
struct spa_pod pod
Definition pod.h:141
spa_pod_array::body
struct spa_pod_array_body body
Definition pod.h:142
spa_pod_choice_body
Definition pod.h:168
spa_pod_choice_body::type
uint32_t type
type of choice, one of enum spa_choice_type
Definition pod.h:169
spa_pod_choice
Definition pod.h:176
spa_pod_choice::body
struct spa_pod_choice_body body
Definition pod.h:178
spa_pod_choice::pod
struct spa_pod pod
Definition pod.h:177
spa_pod_frame
Definition body.h:38
spa_pod_frame::pod
struct spa_pod pod
Definition body.h:39
spa_pod_frame::offset
uint32_t offset
Definition body.h:41
spa_pod_frame::parent
struct spa_pod_frame * parent
Definition body.h:40
spa_pod_frame::flags
uint32_t flags
Definition body.h:42
spa_pod_object_body
Definition pod.h:196
spa_pod_object
Definition pod.h:202
spa_pod_pointer_body
Definition pod.h:207
spa_pod_pointer_body::value
const void * value
Definition pod.h:210
spa_pod_pointer_body::type
uint32_t type
pointer id, one of enum spa_type
Definition pod.h:208
spa_pod_sequence_body
Definition pod.h:264
spa_pod_sequence
a sequence of timed controls
Definition pod.h:271
spa_pod
Definition pod.h:57
spa_pod::type
uint32_t type
Definition pod.h:59
spa_pod::size
uint32_t size
Definition pod.h:58
spa_rectangle
Definition defs.h:116