mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05:00
alsa: remove UMP flag from control format
Don't set the UMP type flag on the format. Use the negotiated types flag to decide what format to output. Add support for output to old style midi. Set the UMP type flag only on the new mixer and JACK when UMP is enabled. This ensures that only new (or explicitly requesting) apps get UMP and old apps receive old midi. This makes JACK running on 1.2 in flatpaks work with midi again.
This commit is contained in:
parent
76db05a0f8
commit
06941f7315
6 changed files with 157 additions and 77 deletions
|
|
@ -2549,11 +2549,28 @@ static int param_enum_format(struct client *c, struct port *p,
|
|||
case TYPE_ID_UMP:
|
||||
case TYPE_ID_OSC:
|
||||
case TYPE_ID_MIDI:
|
||||
*param = spa_pod_builder_add_object(b,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
|
||||
{
|
||||
struct spa_pod_frame f;
|
||||
int32_t types = 0;
|
||||
|
||||
spa_pod_builder_push_object(b, &f,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);
|
||||
spa_pod_builder_add(b,
|
||||
SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_application),
|
||||
SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_control));
|
||||
SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_control),
|
||||
0);
|
||||
if (p->object->port.type_id == TYPE_ID_UMP)
|
||||
types |= 1u<<SPA_CONTROL_UMP;
|
||||
if (p->object->port.type_id == TYPE_ID_OSC)
|
||||
types |= 1u<<SPA_CONTROL_OSC;
|
||||
if (types != 0)
|
||||
spa_pod_builder_add(b,
|
||||
SPA_FORMAT_CONTROL_types, SPA_POD_CHOICE_FLAGS_Int(types),
|
||||
0);
|
||||
|
||||
*param = spa_pod_builder_pop(b, &f);
|
||||
break;
|
||||
}
|
||||
case TYPE_ID_VIDEO:
|
||||
*param = spa_pod_builder_add_object(b,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue