summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-05-17 21:56:10 +0100
committerColin Guthrie <colin@mageia.org>2011-06-22 21:55:27 +0100
commit5d35375aa758fde7d9f3d6467e2506aca9784597 (patch)
tree13a5eef2e1a06d0d5a9a76a83f0c90d085819e06 /src/modules
parent30597b7c2747a52b1025e1172d73825e148fdec9 (diff)
capture: Add the passthrough format negotiation to capture streams.
This helps to keep the API more symmetrical and also potentially allows support for passthrough monitor sources at some point in the future.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/echo-cancel/module-echo-cancel.c2
-rw-r--r--src/modules/module-device-manager.c7
-rw-r--r--src/modules/module-intended-roles.c6
-rw-r--r--src/modules/module-loopback.c2
-rw-r--r--src/modules/module-stream-restore.c5
-rw-r--r--src/modules/module-virtual-source.c2
-rw-r--r--src/modules/rtp/module-rtp-send.c2
7 files changed, 11 insertions, 15 deletions
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 96eb9ef1..3d22ef84 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -1599,7 +1599,7 @@ int pa__init(pa_module*m) {
pa_source_output_new_data_init(&source_output_data);
source_output_data.driver = __FILE__;
source_output_data.module = m;
- source_output_data.source = source_master;
+ pa_source_output_new_data_set_source(&source_output_data, source_master, FALSE);
source_output_data.destination_source = u->source;
/* FIXME
source_output_data.flags = PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND; */
diff --git a/src/modules/module-device-manager.c b/src/modules/module-device-manager.c
index 4138794c..272fad2b 100644
--- a/src/modules/module-device-manager.c
+++ b/src/modules/module-device-manager.c
@@ -871,10 +871,9 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
if (PA_INVALID_INDEX != device_index) {
pa_source *source;
- if ((source = pa_idxset_get_by_index(u->core->sources, device_index))) {
- new_data->source = source;
- new_data->save_source = FALSE;
- }
+ if ((source = pa_idxset_get_by_index(u->core->sources, device_index)))
+ if (!pa_source_output_new_data_set_source(new_data, source, FALSE))
+ pa_log_debug("Not restoring device for stream because no supported format was found");
}
}
}
diff --git a/src/modules/module-intended-roles.c b/src/modules/module-intended-roles.c
index 90385622..2f9bba4b 100644
--- a/src/modules/module-intended-roles.c
+++ b/src/modules/module-intended-roles.c
@@ -162,8 +162,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
/* Prefer the default source over any other source, just in case... */
if ((def = pa_namereg_get_default_source(c)))
if (role_match(def->proplist, role)) {
- new_data->source = def;
- new_data->save_source = FALSE;
+ pa_source_output_new_data_set_source(new_data, def, FALSE);
return PA_HOOK_OK;
}
@@ -179,8 +178,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
/* @todo: favour the highest priority device, not the first one we find? */
if (role_match(s->proplist, role)) {
- new_data->source = s;
- new_data->save_source = FALSE;
+ pa_source_output_new_data_set_source(new_data, s, FALSE);
return PA_HOOK_OK;
}
}
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index a5b08bd5..936133fc 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -755,7 +755,7 @@ int pa__init(pa_module *m) {
pa_source_output_new_data_init(&source_output_data);
source_output_data.driver = __FILE__;
source_output_data.module = m;
- source_output_data.source = source;
+ pa_source_output_new_data_set_source(&source_output_data, source, FALSE);
if ((n = pa_modargs_get_value(ma, "source_output_name", NULL)))
pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_NAME, n);
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index fa2c0210..617de5bb 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -1217,7 +1217,7 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
if (source_output->save_source) {
pa_strlcpy(entry.device, source_output->source->name, sizeof(entry.device));
- entry.device_valid = source_output->save_source;
+ entry.device_valid = TRUE;
device_updated = !created_new_entry && (!old->device_valid || !pa_streq(entry.device, old->device));
@@ -1399,8 +1399,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
interfere with that */
if (s && PA_SOURCE_IS_LINKED(pa_source_get_state(s))) {
pa_log_info("Restoring device for stream %s.", name);
- new_data->source = s;
- new_data->save_source = TRUE;
+ pa_source_output_new_data_set_source(new_data, s, TRUE);
}
pa_xfree(e);
diff --git a/src/modules/module-virtual-source.c b/src/modules/module-virtual-source.c
index 835cf3ce..170fa4e0 100644
--- a/src/modules/module-virtual-source.c
+++ b/src/modules/module-virtual-source.c
@@ -630,7 +630,7 @@ int pa__init(pa_module*m) {
pa_source_output_new_data_init(&source_output_data);
source_output_data.driver = __FILE__;
source_output_data.module = m;
- source_output_data.source = master;
+ pa_source_output_new_data_set_source(&source_output_data, master, FALSE);
source_output_data.destination_source = u->source;
/* FIXME
source_output_data.flags = PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND; */
diff --git a/src/modules/rtp/module-rtp-send.c b/src/modules/rtp/module-rtp-send.c
index f53020d1..e0fed997 100644
--- a/src/modules/rtp/module-rtp-send.c
+++ b/src/modules/rtp/module-rtp-send.c
@@ -325,7 +325,7 @@ int pa__init(pa_module*m) {
pa_proplist_setf(data.proplist, "rtp.ttl", "%lu", (unsigned long) ttl);
data.driver = __FILE__;
data.module = m;
- data.source = s;
+ pa_source_output_new_data_set_source(&data, s, FALSE);
pa_source_output_new_data_set_sample_spec(&data, &ss);
pa_source_output_new_data_set_channel_map(&data, &cm);
data.flags = PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND;