[pulseaudio-commits] 2 commits - src/modules src/pulse src/utils

Arun Raghavan arun at kemper.freedesktop.org
Tue Aug 16 00:42:40 PDT 2011


 src/modules/alsa/alsa-sink.c |   10 +++++++---
 src/pulse/def.h              |    4 ++++
 src/utils/pactl.c            |    3 ++-
 3 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit e25e31fc80c3775f8288a9ddf2293022d5a6306b
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Tue Aug 16 11:11:46 2011 +0530

    alsa: Set SET_FORMATS flag when appropriate

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 44331a3..eec38d8 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1906,7 +1906,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
     uint32_t nfrags, frag_size, buffer_size, tsched_size, tsched_watermark, rewind_safeguard;
     snd_pcm_uframes_t period_frames, buffer_frames, tsched_frames;
     size_t frame_size;
-    pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, sync_volume = FALSE;
+    pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, sync_volume = FALSE, set_formats = FALSE;
     pa_sink_new_data data;
     pa_alsa_profile_set *profile_set = NULL;
 
@@ -2076,6 +2076,9 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
     if (u->use_tsched)
         pa_log_info("Successfully enabled timer-based scheduling mode.");
 
+    if (is_iec958(u) || is_hdmi(u))
+        set_formats = TRUE;
+
     /* ALSA might tweak the sample spec, so recalculate the frame size */
     frame_size = pa_frame_size(&ss);
 
@@ -2127,7 +2130,8 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
     if (u->mixer_path_set)
         pa_alsa_add_ports(&data.ports, u->mixer_path_set);
 
-    u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY|(u->use_tsched ? PA_SINK_DYNAMIC_LATENCY : 0));
+    u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE | PA_SINK_LATENCY | (u->use_tsched ? PA_SINK_DYNAMIC_LATENCY : 0) |
+                          (set_formats ? PA_SINK_SET_FORMATS : 0));
     pa_sink_new_data_done(&data);
 
     if (!u->sink) {
@@ -2233,7 +2237,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
     if ((data.volume_is_set || data.muted_is_set) && u->sink->write_volume)
         u->sink->write_volume(u->sink);
 
-    if (is_iec958(u) || is_hdmi(u)) {
+    if (set_formats) {
         /* For S/PDIF and HDMI, allow getting/setting custom formats */
         pa_format_info *format;
 

commit fb67016844843230b04cab10b3e39908c6b2cca6
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Tue Aug 16 11:11:34 2011 +0530

    sink: Add a SET_FORMATS flag
    
    This adds a PA_SINK_SET_FORMATS flag to the pa_sink_flags enum,
    signalling that a sink allows the set of supported formats to be set
    externally. The idea is for clients to be able to know what sinks
    support this ability and adapt their UI appropriately.

diff --git a/src/pulse/def.h b/src/pulse/def.h
index 32169de..96aea19 100644
--- a/src/pulse/def.h
+++ b/src/pulse/def.h
@@ -756,6 +756,10 @@ typedef enum pa_sink_flags {
      * sinks). */
 /** \endcond */
 
+    PA_SINK_SET_FORMATS = 0x0400U,
+    /**< The sink allows setting what formats are supported by the connected
+     * hardware. The actual functionality to do this might be provided by an
+     * extension. \since 1.0 */
 } pa_sink_flags_t;
 
 /** \cond fulldocs */
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 947c6e9..21ceece 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -271,7 +271,7 @@ static void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_
              "\tBase Volume: %s%s%s\n"
              "\tMonitor Source: %s\n"
              "\tLatency: %0.0f usec, configured %0.0f usec\n"
-             "\tFlags: %s%s%s%s%s%s\n"
+             "\tFlags: %s%s%s%s%s%s%s\n"
              "\tProperties:\n\t\t%s\n"),
            i->index,
            state_table[1+i->state],
@@ -297,6 +297,7 @@ static void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_
            i->flags & PA_SINK_HW_VOLUME_CTRL ? "HW_VOLUME_CTRL " : "",
            i->flags & PA_SINK_DECIBEL_VOLUME ? "DECIBEL_VOLUME " : "",
            i->flags & PA_SINK_LATENCY ? "LATENCY " : "",
+           i->flags & PA_SINK_SET_FORMATS ? "SET_FORMATS " : "",
            pl = pa_proplist_to_string_sep(i->proplist, "\n\t\t"));
 
     pa_xfree(pl);



More information about the pulseaudio-commits mailing list