5#ifndef SPA_DEBUG_FORMAT_H
6#define SPA_DEBUG_FORMAT_H
14#include <spa/param/type-info.h>
26#ifndef SPA_API_DEBUG_FORMAT
28 #define SPA_API_DEBUG_FORMAT SPA_API_IMPL
30 #define SPA_API_DEBUG_FORMAT static inline
37 uint32_t type,
void *body, uint32_t size)
46 uint32_t value = *(uint32_t *) body;
50 snprintf(tmp,
sizeof(tmp),
"%" PRIu32, value);
94 info = info && info->values ? info->values : info;
115 uint32_t type,
void *body, uint32_t size)
128 const char *media_type;
129 const char *media_subtype;
131 uint32_t mtype, mstype;
152 uint32_t i,
type, size, n_vals, choice;
167 if (type < SPA_TYPE_None || type >=
_SPA_TYPE_LAST || n_vals < 1 ||
173 key = ti ? ti->name : NULL;
183 const char *ssep, *esep, *sep;
203 for (i = 1; i < n_vals; i++) {
uint32_t int int const char int r
Definition core.h:447
SPA_API_DEBUG_TYPES const char * spa_debug_type_find_short_name(const struct spa_type_info *info, uint32_t type)
Definition types.h:68
#define spa_debugn(_fmt,...)
Definition context.h:29
#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_FORMAT int spa_debug_format(int indent, const struct spa_type_info *info, const struct spa_pod *format)
Definition format.h:223
SPA_API_DEBUG_FORMAT int spa_debug_format_value(const struct spa_type_info *info, uint32_t type, void *body, uint32_t size)
Definition format.h:121
SPA_API_DEBUG_FORMAT int spa_debug_strbuf_format_value(struct spa_strbuf *buffer, const struct spa_type_info *info, uint32_t type, void *body, uint32_t size)
Definition format.h:43
#define SPA_API_DEBUG_FORMAT
Definition format.h:37
SPA_API_DEBUG_FORMAT int spa_debugc_format(struct spa_debug_context *ctx, int indent, const struct spa_type_info *info, const struct spa_pod *format)
Definition format.h:132
SPA_API_DEBUG_TYPES const char * spa_debug_type_short_name(const char *name)
Definition types.h:56
SPA_API_DEBUG_TYPES const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition types.h:61
static const struct spa_type_info spa_type_media_subtype[]
Definition format-types.h:55
static const struct spa_type_info spa_type_format[]
Definition format-types.h:148
SPA_API_FORMAT_UTILS int spa_format_parse(const struct spa_pod *format, uint32_t *media_type, uint32_t *media_subtype)
Definition format-utils.h:37
static const struct spa_type_info spa_type_media_type[]
Definition format-types.h:39
@ SPA_FORMAT_mediaType
media type (Id enum spa_media_type)
Definition format.h:99
@ SPA_FORMAT_mediaSubtype
media subtype (Id enum spa_media_subtype)
Definition format.h:100
SPA_API_POD_ITER struct spa_pod * spa_pod_get_values(const struct spa_pod *pod, uint32_t *n_vals, uint32_t *choice)
Definition iter.h:229
#define SPA_POD_OBJECT_FOREACH(obj, iter)
Definition iter.h:118
#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_ARRAY_BODY_FOREACH(body, _size, iter)
Definition iter.h:89
@ 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
SPA_API_STRING int spa_strbuf_append(struct spa_strbuf *buf, const char *fmt,...)
Definition string.h:390
SPA_API_STRING void spa_strbuf_init(struct spa_strbuf *buf, char *buffer, size_t maxsize)
Definition string.h:380
static const struct spa_type_info spa_types[]
Definition type-info.h:36
@ 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_LAST
not part of ABI
Definition type.h:62
@ SPA_TYPE_Double
Definition type.h:48
@ SPA_TYPE_Id
Definition type.h:44
@ SPA_TYPE_Array
Definition type.h:54
@ SPA_TYPE_String
Definition type.h:49
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition defs.h:222
uint32_t num
Definition defs.h:138
uint32_t denom
Definition defs.h:139
struct spa_pod child
Definition pod.h:136
uint32_t key
key of property, list of valid keys depends on the object type
Definition pod.h:228
struct spa_pod value
Definition pod.h:249
uint32_t type
Definition pod.h:59
uint32_t size
Definition pod.h:58
uint32_t type
Definition type.h:155
const struct spa_type_info * values
Definition type.h:158