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

@ -264,7 +264,7 @@ spa_ffmpeg_enc_node_port_enum_params(struct spa_node *node,
SPA_PARAM_Format };
if (*index < SPA_N_ELEMENTS(list))
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id,
":", SPA_PARAM_LIST_id, "I", list[*index]);
else
return 0;
@ -462,7 +462,7 @@ static const struct spa_node ffmpeg_enc_node = {
};
static int
spa_ffmpeg_enc_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface)
spa_ffmpeg_enc_get_interface(struct spa_handle *handle, uint32_t type, void **interface)
{
struct impl *this;
@ -471,7 +471,7 @@ spa_ffmpeg_enc_get_interface(struct spa_handle *handle, uint32_t interface_id, v
this = (struct impl *) handle;
if (interface_id == SPA_ID_INTERFACE_Node)
if (type == SPA_TYPE_INTERFACE_Node)
*interface = &this->node;
else
return -ENOENT;
@ -492,7 +492,7 @@ spa_ffmpeg_enc_init(struct spa_handle *handle,
this = (struct impl *) handle;
for (i = 0; i < n_support; i++) {
if (support[i].type == SPA_ID_INTERFACE_Log)
if (support[i].type == SPA_TYPE_INTERFACE_Log)
this->log = support[i].data;
}