Type changes

Only allow properties inside objects, this makes it easier to
iterate the object, which is needed for efficiently processing
control streams.
Add a choice type to mark variable properties.
SPA_TYPE_Enum -> SPA_TYPE_Id to avoid confusion with choice enum
Make it easier to allocate and initialize properties on the stack
Make more efficient methods to make objects.
This commit is contained in:
Wim Taymans 2018-09-05 16:41:07 +02:00
parent 03fdabd155
commit cc842cbdc8
63 changed files with 2253 additions and 1880 deletions

View file

@ -38,7 +38,7 @@ static const struct spa_type_info spa_type_monitor_event_id[] = {
};
static const struct spa_type_info spa_type_monitor_event[] = {
{ 0, SPA_TYPE_MONITOR_EVENT_BASE, SPA_TYPE_Enum, spa_type_monitor_event_id },
{ 0, SPA_TYPE_MONITOR_EVENT_BASE, SPA_TYPE_Id, spa_type_monitor_event_id },
{ 0, NULL, },
};
@ -66,9 +66,9 @@ static const struct spa_type_info spa_type_monitor_item_state[] = {
static const struct spa_type_info spa_type_monitor_item[] = {
{ SPA_MONITOR_ITEM_START, SPA_TYPE_MONITOR_ITEM_BASE, SPA_TYPE_Int, },
{ SPA_MONITOR_ITEM_id, SPA_TYPE_MONITOR_ITEM_BASE "id", SPA_TYPE_String, },
{ SPA_MONITOR_ITEM_flags, SPA_TYPE_MONITOR_ITEM_BASE "flags", SPA_TYPE_Enum,
{ SPA_MONITOR_ITEM_flags, SPA_TYPE_MONITOR_ITEM_BASE "flags", SPA_TYPE_Id,
spa_type_monitor_item_flags },
{ SPA_MONITOR_ITEM_state, SPA_TYPE_MONITOR_ITEM_BASE "state", SPA_TYPE_Enum,
{ SPA_MONITOR_ITEM_state, SPA_TYPE_MONITOR_ITEM_BASE "state", SPA_TYPE_Id,
spa_type_monitor_item_state },
{ SPA_MONITOR_ITEM_name, SPA_TYPE_MONITOR_ITEM_BASE "name", SPA_TYPE_String, },
{ SPA_MONITOR_ITEM_class, SPA_TYPE_MONITOR_ITEM_BASE "class", SPA_TYPE_String, },