Make media type and subtype properties

This is easier to debug and we only want properties in objects
in the future.
This commit is contained in:
Wim Taymans 2018-08-29 18:08:52 +02:00
parent 514528f2c7
commit ff6a244d8f
45 changed files with 151 additions and 124 deletions

View file

@ -329,8 +329,8 @@ static int port_enum_formats(struct spa_node *node,
} else {
*param = spa_pod_builder_object(builder,
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
"I", SPA_MEDIA_TYPE_audio,
"I", SPA_MEDIA_SUBTYPE_raw,
":", SPA_FORMAT_mediaType, "I", SPA_MEDIA_TYPE_audio,
":", SPA_FORMAT_mediaSubtype, "I", SPA_MEDIA_SUBTYPE_raw,
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
":", SPA_FORMAT_AUDIO_rate, "iru", 44100,

View file

@ -124,7 +124,7 @@ static struct monitor_item *add_item(struct pw_spa_monitor *this,
}
flags = PW_SPA_NODE_FLAG_ACTIVATE;
flags |= (state == SPA_MONITOR_ITEM_STATE_AVAILABLE) ? 0 : PW_SPA_NODE_FLAG_DISABLE;
flags |= (state == SPA_MONITOR_ITEM_STATE_Available) ? 0 : PW_SPA_NODE_FLAG_DISABLE;
mitem = calloc(1, sizeof(struct monitor_item));
mitem->id = strdup(id);
@ -197,13 +197,15 @@ static void change_item(struct pw_spa_monitor *this, struct spa_pod *item, uint6
return;
switch (state) {
case SPA_MONITOR_ITEM_STATE_AVAILABLE:
case SPA_MONITOR_ITEM_STATE_Available:
pw_node_set_enabled(mitem->node, true);
break;
case SPA_MONITOR_ITEM_STATE_DISABLED:
case SPA_MONITOR_ITEM_STATE_UNAVAILABLE:
case SPA_MONITOR_ITEM_STATE_Disabled:
case SPA_MONITOR_ITEM_STATE_Unavailable:
pw_node_set_enabled(mitem->node, false);
break;
default:
break;
}
}