More type cleanups

SPA_ID_* -> SPA_TYPE_*. We use 'type' for all registered types.
ID refers to either a registered type or an enum.
Improve introspection of object ids. Make 0 an invalid enum and
use it to look up the object id type.
Move some type-info files together.
Swap type and id of the object, we first specify the type and then
the id because the meaning of the id depends on the object type.
This commit is contained in:
Wim Taymans 2018-08-27 15:03:11 +02:00
parent 281b65934e
commit 90c1a95eef
117 changed files with 1198 additions and 1272 deletions

View file

@ -168,7 +168,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
data->stride = SPA_ROUND_UP_N(data->format.size.width * BPP, 4);
params[0] = spa_pod_builder_object(&b,
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
":", SPA_PARAM_BUFFERS_buffers, "iru", 2,
SPA_POD_PROP_MIN_MAX(1, 32),
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
@ -177,12 +177,12 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
":", SPA_PARAM_BUFFERS_align, "i", 16);
params[1] = spa_pod_builder_object(&b,
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
":", SPA_PARAM_META_type, "I", SPA_META_Header,
":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header));
params[2] = spa_pod_builder_object(&b,
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
":", SPA_PARAM_META_type, "I", SPA_META_VideoDamage,
":", SPA_PARAM_META_size, "iru", sizeof(struct spa_meta_region) * 16,
SPA_POD_PROP_MIN_MAX(sizeof(struct spa_meta_region) * 1,
@ -223,7 +223,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
NULL));
params[0] = spa_pod_builder_object(&b,
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
"I", SPA_MEDIA_TYPE_video,
"I", SPA_MEDIA_SUBTYPE_raw,
":", SPA_FORMAT_VIDEO_format, "I", SPA_VIDEO_FORMAT_RGB,