[PATCH v2 17/21] sink-input, source-output: Add req_formats to pa_sink_input/pa_source_output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The requested formats will be needed when doing format negotiation
without access to the new data.
---
 src/pulsecore/sink-input.c    | 5 +++++
 src/pulsecore/sink-input.h    | 1 +
 src/pulsecore/source-output.c | 5 +++++
 src/pulsecore/source-output.h | 1 +
 4 files changed, 12 insertions(+)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 3bb6a5e..4264c5f 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -344,6 +344,8 @@ int pa_sink_input_new(
         goto fail;
     }
 
+    i->req_formats = pa_idxset_copy(data->req_formats, (pa_copy_func_t) pa_format_info_copy);
+
     if (data->driver && !pa_utf8_valid(data->driver)) {
         ret = -PA_ERR_INVALID;
         goto fail;
@@ -841,6 +843,9 @@ static void sink_input_free(pa_object *o) {
     if (i->format)
         pa_format_info_free(i->format);
 
+    if (i->req_formats)
+        pa_idxset_free(i->req_formats, (pa_free_cb_t) pa_format_info_free);
+
     if (i->proplist)
         pa_proplist_free(i->proplist);
 
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index 546afc0..85d3518 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.h
@@ -94,6 +94,7 @@ struct pa_sink_input {
 
     pa_sample_spec sample_spec;
     pa_channel_map channel_map;
+    pa_idxset *req_formats;
     pa_format_info *format;
 
     pa_sink_input *sync_prev, *sync_next;
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 68795a4..e92e546 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -277,6 +277,8 @@ int pa_source_output_new(
         goto fail;
     }
 
+    o->req_formats = pa_idxset_copy(data->req_formats, (pa_copy_func_t) pa_format_info_copy);
+
     if (data->driver && !pa_utf8_valid(data->driver)) {
         ret = -PA_ERR_INVALID;
         goto fail;
@@ -745,6 +747,9 @@ static void source_output_free(pa_object* mo) {
     if (o->format)
         pa_format_info_free(o->format);
 
+    if (o->req_formats)
+        pa_idxset_free(o->req_formats, (pa_free_cb_t) pa_format_info_free);
+
     if (o->proplist)
         pa_proplist_free(o->proplist);
 
diff --git a/src/pulsecore/source-output.h b/src/pulsecore/source-output.h
index 3012ea4..371a27e 100644
--- a/src/pulsecore/source-output.h
+++ b/src/pulsecore/source-output.h
@@ -87,6 +87,7 @@ struct pa_source_output {
 
     pa_sample_spec sample_spec;
     pa_channel_map channel_map;
+    pa_idxset *req_formats;
     pa_format_info *format;
 
     /* Also see http://pulseaudio.org/wiki/InternalVolumes */
-- 
1.8.3.1



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux