mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
loopback: Make stream names and roles configurable.
This commit is contained in:
parent
9b6c84ad6e
commit
614eef8331
1 changed files with 34 additions and 7 deletions
|
|
@ -53,7 +53,11 @@ PA_MODULE_USAGE(
|
||||||
"format=<sample format> "
|
"format=<sample format> "
|
||||||
"rate=<sample rate> "
|
"rate=<sample rate> "
|
||||||
"channels=<number of channels> "
|
"channels=<number of channels> "
|
||||||
"channel_map=<channel map>");
|
"channel_map=<channel map> "
|
||||||
|
"sink_input_name=<custom name for the sink input> "
|
||||||
|
"source_output_name=<custom name for the source output> "
|
||||||
|
"sink_input_role=<media.role for the sink input> "
|
||||||
|
"source_output_role=<media.role for the source output>");
|
||||||
|
|
||||||
#define DEFAULT_LATENCY_MSEC 200
|
#define DEFAULT_LATENCY_MSEC 200
|
||||||
|
|
||||||
|
|
@ -107,6 +111,10 @@ static const char* const valid_modargs[] = {
|
||||||
"rate",
|
"rate",
|
||||||
"channels",
|
"channels",
|
||||||
"channel_map",
|
"channel_map",
|
||||||
|
"sink_input_name",
|
||||||
|
"source_output_name",
|
||||||
|
"sink_input_role",
|
||||||
|
"source_output_role",
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -669,11 +677,20 @@ int pa__init(pa_module *m) {
|
||||||
sink_input_data.module = m;
|
sink_input_data.module = m;
|
||||||
sink_input_data.sink = sink;
|
sink_input_data.sink = sink;
|
||||||
|
|
||||||
pa_proplist_setf(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "Loopback of %s",
|
if ((n = pa_modargs_get_value(ma, "sink_input_name", NULL)))
|
||||||
pa_strnull(pa_proplist_gets(source->proplist, PA_PROP_DEVICE_DESCRIPTION)));
|
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, n);
|
||||||
|
else
|
||||||
|
pa_proplist_setf(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "Loopback from %s",
|
||||||
|
pa_strnull(pa_proplist_gets(source->proplist, PA_PROP_DEVICE_DESCRIPTION)));
|
||||||
|
|
||||||
|
if ((n = pa_modargs_get_value(ma, "sink_input_role", NULL)))
|
||||||
|
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, n);
|
||||||
|
else
|
||||||
|
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "abstract");
|
||||||
|
|
||||||
if ((n = pa_proplist_gets(source->proplist, PA_PROP_DEVICE_ICON_NAME)))
|
if ((n = pa_proplist_gets(source->proplist, PA_PROP_DEVICE_ICON_NAME)))
|
||||||
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ICON_NAME, n);
|
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ICON_NAME, n);
|
||||||
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "abstract");
|
|
||||||
pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
|
pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
|
||||||
pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
|
pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
|
||||||
sink_input_data.flags = PA_SINK_INPUT_VARIABLE_RATE;
|
sink_input_data.flags = PA_SINK_INPUT_VARIABLE_RATE;
|
||||||
|
|
@ -702,11 +719,21 @@ int pa__init(pa_module *m) {
|
||||||
source_output_data.driver = __FILE__;
|
source_output_data.driver = __FILE__;
|
||||||
source_output_data.module = m;
|
source_output_data.module = m;
|
||||||
source_output_data.source = source;
|
source_output_data.source = source;
|
||||||
pa_proplist_setf(source_output_data.proplist, PA_PROP_MEDIA_NAME, "Loopback to %s",
|
|
||||||
pa_strnull(pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_DESCRIPTION)));
|
if ((n = pa_modargs_get_value(ma, "source_output_name", NULL)))
|
||||||
|
pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_NAME, n);
|
||||||
|
else
|
||||||
|
pa_proplist_setf(source_output_data.proplist, PA_PROP_MEDIA_NAME, "Loopback to %s",
|
||||||
|
pa_strnull(pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_DESCRIPTION)));
|
||||||
|
|
||||||
|
if ((n = pa_modargs_get_value(ma, "source_output_role", NULL)))
|
||||||
|
pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ROLE, n);
|
||||||
|
else
|
||||||
|
pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ROLE, "abstract");
|
||||||
|
|
||||||
if ((n = pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_ICON_NAME)))
|
if ((n = pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_ICON_NAME)))
|
||||||
pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ICON_NAME, n);
|
pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ICON_NAME, n);
|
||||||
pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ROLE, "abstract");
|
|
||||||
pa_source_output_new_data_set_sample_spec(&source_output_data, &ss);
|
pa_source_output_new_data_set_sample_spec(&source_output_data, &ss);
|
||||||
pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
|
pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue