keys: add stream to avoid remixing channels

This commit is contained in:
Wim Taymans 2020-07-28 10:16:04 +02:00
parent e35586cd15
commit 6184c0fe32
2 changed files with 5 additions and 2 deletions

View file

@ -922,9 +922,9 @@ static int create_stream(pa_stream_direction_t direction,
const char *str; const char *str;
uint32_t devid, n_items; uint32_t devid, n_items;
struct global *g; struct global *g;
struct spa_dict_item items[6]; struct spa_dict_item items[7];
char latency[64]; char latency[64];
bool monitor; bool monitor, no_remix;
const char *name; const char *name;
pa_context *c = s->context; pa_context *c = s->context;
@ -997,6 +997,7 @@ static int create_stream(pa_stream_direction_t direction,
if (flags & PA_STREAM_DONT_MOVE) if (flags & PA_STREAM_DONT_MOVE)
fl |= PW_STREAM_FLAG_DONT_RECONNECT; fl |= PW_STREAM_FLAG_DONT_RECONNECT;
monitor = (flags & PA_STREAM_PEAK_DETECT); monitor = (flags & PA_STREAM_PEAK_DETECT);
no_remix = (flags & PA_STREAM_NO_REMIX_CHANNELS);
if (pa_sample_spec_valid(&s->sample_spec)) { if (pa_sample_spec_valid(&s->sample_spec)) {
params[n_params++] = get_param(s, &s->sample_spec, &s->channel_map, &b); params[n_params++] = get_param(s, &s->sample_spec, &s->channel_map, &b);
@ -1092,6 +1093,7 @@ static int create_stream(pa_stream_direction_t direction,
"Playback" : "Capture"); "Playback" : "Capture");
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_ROLE, str); items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_ROLE, str);
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_STREAM_MONITOR, monitor ? "true" : "false"); items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_STREAM_MONITOR, monitor ? "true" : "false");
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_STREAM_DONT_REMIX, no_remix ? "true" : "false");
if (devid == PW_ID_ANY && dev != NULL) if (devid == PW_ID_ANY && dev != NULL)
items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_TARGET, dev); items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_TARGET, dev);
pw_stream_update_properties(s->stream, &SPA_DICT_INIT(items, n_items)); pw_stream_update_properties(s->stream, &SPA_DICT_INIT(items, n_items));

View file

@ -222,6 +222,7 @@ extern "C" {
#define PW_KEY_STREAM_MONITOR "stream.monitor" /**< Indicates that the stream is monitoring #define PW_KEY_STREAM_MONITOR "stream.monitor" /**< Indicates that the stream is monitoring
* and might select a less accurate but faster * and might select a less accurate but faster
* conversion algorithm. */ * conversion algorithm. */
#define PW_KEY_STREAM_DONT_REMIX "stream.dont-remix" /**< don't remix channels */
/** object properties */ /** object properties */
#define PW_KEY_OBJECT_LINGER "object.linger" /**< the object lives on even after the client #define PW_KEY_OBJECT_LINGER "object.linger" /**< the object lives on even after the client