25#ifndef SPA_API_DEBUG_POD
27 #define SPA_API_DEBUG_POD SPA_API_IMPL
29 #define SPA_API_DEBUG_POD static inline
35 uint32_t type,
void *body, uint32_t size)
39 spa_debugc(ctx,
"%*s" "Bool %s", indent,
"", (*(int32_t *) body) ?
"true" :
"false");
42 spa_debugc(ctx,
"%*s" "Id %-8" PRIu32
" (%s)", indent,
"", *(uint32_t *) body,
46 spa_debugc(ctx,
"%*s" "Int %" PRId32, indent,
"", *(int32_t *) body);
49 spa_debugc(ctx,
"%*s" "Long %" PRIi64
"", indent,
"", *(int64_t *) body);
52 spa_debugc(ctx,
"%*s" "Float %f", indent,
"", *(
float *) body);
55 spa_debugc(ctx,
"%*s" "Double %f", indent,
"", *(
double *) body);
58 spa_debugc(ctx,
"%*s" "String \"%s\"", indent,
"", (
char *) body);
61 spa_debugc(ctx,
"%*s" "Fd %d", indent,
"", *(
int *) body);
66 spa_debugc(ctx,
"%*s" "Pointer %s %p", indent,
"",
73 spa_debugc(ctx,
"%*s" "Rectangle %" PRIu32
"x%" PRIu32
"", indent,
"",
r->width,
r->height);
79 spa_debugc(ctx,
"%*s" "Fraction %" PRIu32
"/%" PRIu32
"", indent,
"", f->
num, f->
denom);
92 spa_debugc(ctx,
"%*s" "Array: child.size %" PRIu32
", child.type %s", indent,
"",
93 b->
child.
size, ti ? ti->name :
"unknown");
96 spa_debugc(ctx,
"%*s" " INVALID child.size < %" PRIu32, indent,
"", min_size);
98 info = info && info->values ? info->values : info;
111 spa_debugc(ctx,
"%*s" "Choice: type %s, flags %08" PRIx32
" %" PRIu32
" %" PRIu32, indent,
"",
115 spa_debugc(ctx,
"%*s" "INVALID child.size < %" PRIu32, indent,
"", min_size);
128 if (p->size < min_size) {
129 spa_debugc(ctx,
"%*s" "INVALID child.size < %" PRIu32, indent,
"", min_size);
146 spa_debugc(ctx,
"%*s" "Object: size %" PRIu32
", type %s (%" PRIu32
"), id %s (%" PRIu32
")",
147 indent,
"", size, ti ? ti->name :
"unknown", b->
type, ii ? ii->name :
"unknown", b->
id);
149 info = ti ? ti->
values : info;
153 char custom_name[
sizeof(custom_prefix) + 16];
154 const char *name =
"unknown";
161 snprintf(custom_name,
sizeof(custom_name),
166 spa_debugc(ctx,
"%*s" "Prop: key %s (%" PRIu32
"), flags %08" PRIx32,
167 indent+2,
"", name, p->
key, p->
flags);
170 spa_debugc(ctx,
"%*s" "INVALID value.size < %" PRIu32, indent,
"", min_size);
188 spa_debugc(ctx,
"%*s" "Sequence: size %" PRIu32
", unit %s", indent,
"", size,
189 ti ? ti->name :
"unknown");
196 spa_debugc(ctx,
"%*s" "Control: offset %" PRIu32
", type %s", indent+2,
"",
197 c->
offset, ii ? ii->name :
"unknown");
200 spa_debugc(ctx,
"%*s" "INVALID value.size < %" PRIu32, indent,
"", min_size);
219 spa_debugc(ctx,
"%*s" "unhandled POD type %" PRIu32, indent,
"",
type);
236 uint32_t
type,
void *body, uint32_t size)
uint32_t int int const char int r
Definition core.h:447
static const struct spa_type_info spa_type_control[]
Definition type-info.h:32
SPA_API_DEBUG_MEM int spa_debugc_mem(struct spa_debug_context *ctx, int indent, const void *data, size_t size)
Definition mem.h:36
#define SPA_API_DEBUG_POD
Definition pod.h:36
#define spa_debugc(_c, _fmt,...)
Definition context.h:50
SPA_API_DEBUG_TYPES const struct spa_type_info * spa_debug_type_find(const struct spa_type_info *info, uint32_t type)
Definition types.h:37
SPA_API_DEBUG_POD int spa_debug_pod_value(int indent, const struct spa_type_info *info, uint32_t type, void *body, uint32_t size)
Definition pod.h:242
SPA_API_DEBUG_POD int spa_debug_pod(int indent, const struct spa_type_info *info, const struct spa_pod *pod)
Definition pod.h:248
SPA_API_DEBUG_POD int spa_debugc_pod(struct spa_debug_context *ctx, int indent, const struct spa_type_info *info, const struct spa_pod *pod)
Definition pod.h:232
SPA_API_DEBUG_POD int spa_debugc_pod_value(struct spa_debug_context *ctx, int indent, const struct spa_type_info *info, uint32_t type, void *body, uint32_t size)
Definition pod.h:41
SPA_API_DEBUG_TYPES const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition types.h:61
#define SPA_TYPE_INFO_PROPS_BASE
Definition props-types.h:30
@ SPA_PROP_START_CUSTOM
Definition props.h:121
#define SPA_POD_OBJECT_BODY_FOREACH(body, size, iter)
Definition iter.h:113
#define SPA_POD_CHOICE_BODY_FOREACH(body, _size, iter)
Definition iter.h:97
#define SPA_POD_BODY(pod)
Definition pod.h:44
SPA_API_POD_BODY uint32_t spa_pod_type_size(uint32_t type)
Definition body.h:45
#define SPA_POD_FOREACH(pod, size, iter)
Definition iter.h:105
#define SPA_POD_CONTENTS(type, pod)
Definition pod.h:40
#define SPA_POD_SEQUENCE_BODY_FOREACH(body, size, iter)
Definition iter.h:121
#define SPA_POD_ARRAY_BODY_FOREACH(body, _size, iter)
Definition iter.h:89
static const struct spa_type_info spa_type_choice[]
Definition enum-types.h:41
#define SPA_TYPE_ROOT
Definition type-info.h:33
@ SPA_TYPE_Int
Definition type.h:45
@ SPA_TYPE_Rectangle
Definition type.h:51
@ SPA_TYPE_Long
Definition type.h:46
@ SPA_TYPE_Bool
Definition type.h:43
@ SPA_TYPE_Bytes
Definition type.h:50
@ SPA_TYPE_Bitmap
Definition type.h:53
@ SPA_TYPE_Object
Definition type.h:56
@ SPA_TYPE_Float
Definition type.h:47
@ SPA_TYPE_Fraction
Definition type.h:52
@ SPA_TYPE_None
Definition type.h:42
@ SPA_TYPE_Sequence
Definition type.h:57
@ SPA_TYPE_Double
Definition type.h:48
@ SPA_TYPE_Id
Definition type.h:44
@ SPA_TYPE_Choice
Definition type.h:60
@ SPA_TYPE_Pointer
Definition type.h:58
@ SPA_TYPE_Array
Definition type.h:54
@ SPA_TYPE_String
Definition type.h:49
@ SPA_TYPE_Fd
Definition type.h:59
@ SPA_TYPE_Struct
Definition type.h:55
uint32_t num
Definition defs.h:138
uint32_t denom
Definition defs.h:139
struct spa_pod child
Definition pod.h:136
struct spa_pod child
Definition pod.h:171
uint32_t type
type of choice, one of enum spa_choice_type
Definition pod.h:169
uint32_t flags
extra flags
Definition pod.h:170
struct spa_pod value
control value, depends on type
Definition pod.h:260
uint32_t type
type of control, enum spa_control_type
Definition pod.h:259
uint32_t offset
media offset
Definition pod.h:258
uint32_t type
one of enum spa_type
Definition pod.h:197
uint32_t id
id of the object, depends on the object type
Definition pod.h:198
const void * value
Definition pod.h:210
uint32_t type
pointer id, one of enum spa_type
Definition pod.h:208
uint32_t key
key of property, list of valid keys depends on the object type
Definition pod.h:228
uint32_t flags
flags for property
Definition pod.h:248
struct spa_pod value
Definition pod.h:249
uint32_t unit
Definition pod.h:265
uint32_t type
Definition pod.h:59
uint32_t size
Definition pod.h:58
const struct spa_type_info * values
Definition type.h:158