mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
don't force a MEDIA_ROLE property
The application has to set a media role.
This commit is contained in:
parent
6469663265
commit
1bd31c1cf1
2 changed files with 24 additions and 25 deletions
|
|
@ -419,8 +419,6 @@ static int snd_pcm_pipewire_prepare(snd_pcm_ioplug_t *io)
|
||||||
pw_properties_set(props, PW_KEY_MEDIA_CATEGORY,
|
pw_properties_set(props, PW_KEY_MEDIA_CATEGORY,
|
||||||
io->stream == SND_PCM_STREAM_PLAYBACK ?
|
io->stream == SND_PCM_STREAM_PLAYBACK ?
|
||||||
"Playback" : "Capture");
|
"Playback" : "Capture");
|
||||||
if (pw_properties_get(props, PW_KEY_MEDIA_ROLE) == NULL)
|
|
||||||
pw_properties_set(props, PW_KEY_MEDIA_ROLE, "Music");
|
|
||||||
|
|
||||||
pw->stream = pw_stream_new(pw->core, pw->node_name, props);
|
pw->stream = pw_stream_new(pw->core, pw->node_name, props);
|
||||||
if (pw->stream == NULL)
|
if (pw->stream == NULL)
|
||||||
|
|
|
||||||
|
|
@ -970,28 +970,28 @@ static int create_stream(pa_stream_direction_t direction,
|
||||||
devid = PW_ID_ANY;
|
devid = PW_ID_ANY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) == NULL)
|
if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) != NULL) {
|
||||||
str = "Music";
|
if (strcmp(str, "video") == 0)
|
||||||
else if (strcmp(str, "video") == 0)
|
str = "Movie";
|
||||||
str = "Movie";
|
else if (strcmp(str, "music") == 0)
|
||||||
else if (strcmp(str, "music") == 0)
|
str = "Music";
|
||||||
str = "Music";
|
else if (strcmp(str, "game") == 0)
|
||||||
else if (strcmp(str, "game") == 0)
|
str = "Game";
|
||||||
str = "Game";
|
else if (strcmp(str, "event") == 0)
|
||||||
else if (strcmp(str, "event") == 0)
|
str = "Notification";
|
||||||
str = "Notification";
|
else if (strcmp(str, "phone") == 0)
|
||||||
else if (strcmp(str, "phone") == 0)
|
str = "Communication";
|
||||||
str = "Communication";
|
else if (strcmp(str, "animation") == 0)
|
||||||
else if (strcmp(str, "animation") == 0)
|
str = "Movie";
|
||||||
str = "Movie";
|
else if (strcmp(str, "production") == 0)
|
||||||
else if (strcmp(str, "production") == 0)
|
str = "Production";
|
||||||
str = "Production";
|
else if (strcmp(str, "a11y") == 0)
|
||||||
else if (strcmp(str, "a11y") == 0)
|
str = "Accessibility";
|
||||||
str = "Accessibility";
|
else if (strcmp(str, "test") == 0)
|
||||||
else if (strcmp(str, "test") == 0)
|
str = "Test";
|
||||||
str = "Test";
|
else
|
||||||
else
|
str = "Music";
|
||||||
str = "Music";
|
}
|
||||||
|
|
||||||
stride = pa_frame_size(&s->sample_spec);
|
stride = pa_frame_size(&s->sample_spec);
|
||||||
if (direction == PA_STREAM_RECORD)
|
if (direction == PA_STREAM_RECORD)
|
||||||
|
|
@ -1004,7 +1004,8 @@ static int create_stream(pa_stream_direction_t direction,
|
||||||
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_CATEGORY,
|
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_CATEGORY,
|
||||||
direction == PA_STREAM_PLAYBACK ?
|
direction == PA_STREAM_PLAYBACK ?
|
||||||
"Playback" : monitor ? "Monitor" : "Capture");
|
"Playback" : monitor ? "Monitor" : "Capture");
|
||||||
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_ROLE, str);
|
if (str != NULL)
|
||||||
|
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_ROLE, str);
|
||||||
if (monitor)
|
if (monitor)
|
||||||
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_STREAM_MONITOR, "true");
|
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_STREAM_MONITOR, "true");
|
||||||
if (no_remix)
|
if (no_remix)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue