diff --git a/spa/include/spa/param/props.h b/spa/include/spa/param/props.h index de1521356..e7d8b2693 100644 --- a/spa/include/spa/param/props.h +++ b/spa/include/spa/param/props.h @@ -42,6 +42,7 @@ enum spa_prop_info { * is of the type of the property, the second * one is a string with a user readable label * for the value. */ + SPA_PROP_INFO_container, /**< type of container if any */ }; /** predefined properties for SPA_TYPE_OBJECT_Props */ diff --git a/spa/include/spa/param/type-info.h b/spa/include/spa/param/type-info.h index e96b26ef2..948998696 100644 --- a/spa/include/spa/param/type-info.h +++ b/spa/include/spa/param/type-info.h @@ -117,6 +117,7 @@ static const struct spa_type_info spa_type_prop_info[] = { { SPA_PROP_INFO_name, SPA_TYPE_String, SPA_TYPE_INFO_PROP_INFO_BASE "name", NULL }, { SPA_PROP_INFO_type, SPA_TYPE_Pod, SPA_TYPE_INFO_PROP_INFO_BASE "type", NULL }, { SPA_PROP_INFO_labels, SPA_TYPE_Struct, SPA_TYPE_INFO_PROP_INFO_BASE "labels", NULL }, + { SPA_PROP_INFO_container, SPA_TYPE_Id, SPA_TYPE_INFO_PROP_INFO_BASE "container", NULL }, { 0, 0, NULL, NULL }, }; diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index 5949ea32f..29c960939 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -345,14 +345,16 @@ static int impl_node_enum_params(void *object, int seq, SPA_TYPE_OBJECT_PropInfo, id, SPA_PROP_INFO_id, SPA_POD_Id(SPA_PROP_channelVolumes), SPA_PROP_INFO_name, SPA_POD_String("Channel Volumes"), - SPA_PROP_INFO_type, SPA_POD_CHOICE_RANGE_Float(p->volume, 0.0, 10.0)); + SPA_PROP_INFO_type, SPA_POD_CHOICE_RANGE_Float(p->volume, 0.0, 10.0), + SPA_PROP_INFO_container, SPA_POD_Id(SPA_TYPE_Array)); break; case 3: param = spa_pod_builder_add_object(&b, SPA_TYPE_OBJECT_PropInfo, id, SPA_PROP_INFO_id, SPA_POD_Id(SPA_PROP_channelMap), SPA_PROP_INFO_name, SPA_POD_String("Channel Map"), - SPA_PROP_INFO_type, SPA_POD_Id(SPA_AUDIO_CHANNEL_UNKNOWN)); + SPA_PROP_INFO_type, SPA_POD_Id(SPA_AUDIO_CHANNEL_UNKNOWN), + SPA_PROP_INFO_container, SPA_POD_Id(SPA_TYPE_Array)); break; default: return 0; diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index b70d22f5c..916e69c18 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -909,9 +909,8 @@ static int node_event_param(void *object, int seq, { struct control *c; const struct spa_pod *type, *pod; - uint32_t iid, choice, n_vals; + uint32_t iid, choice, n_vals, container = SPA_ID_INVALID; float *vals, bool_range[3] = { 1.0, 0.0, 1.0 }; - const struct spa_type_info *tinfo; if (spa_pod_parse_object(param, SPA_TYPE_OBJECT_PropInfo, NULL, @@ -932,7 +931,8 @@ static int node_event_param(void *object, int seq, if (spa_pod_parse_object(c->info, SPA_TYPE_OBJECT_PropInfo, NULL, SPA_PROP_INFO_name, SPA_POD_String(&c->control.name), - SPA_PROP_INFO_type, SPA_POD_PodChoice(&type)) < 0) { + SPA_PROP_INFO_type, SPA_POD_PodChoice(&type), + SPA_PROP_INFO_container, SPA_POD_OPT_Id(&container)) < 0) { free(c); return -EINVAL; } @@ -953,8 +953,7 @@ static int node_event_param(void *object, int seq, else return -ENOTSUP; - tinfo = spa_debug_type_find(spa_type_props, iid); - c->container = tinfo ? tinfo->parent : c->type; + c->container = container != SPA_ID_INVALID ? container : c->type; switch (choice) { case SPA_CHOICE_None: