[polypaudio-commits] r661 - in /trunk/src: polyp/def.h polyp/introspect.c polyp/introspect.h polypcore/protocol-native.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Apr 7 16:02:49 PDT 2006


Author: lennart
Date: Sat Apr  8 01:02:48 2006
New Revision: 661

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=661&root=polypaudio&view=rev
Log:
add new introspection data field for sinks/sources: a flags field which specifies whether the sink/source supports hw volume control and latency querying

Modified:
    trunk/src/polyp/def.h
    trunk/src/polyp/introspect.c
    trunk/src/polyp/introspect.h
    trunk/src/polypcore/protocol-native.c

Modified: trunk/src/polyp/def.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/def.h?rev=661&root=polypaudio&r1=660&r2=661&view=diff
==============================================================================
--- trunk/src/polyp/def.h (original)
+++ trunk/src/polyp/def.h Sat Apr  8 01:02:48 2006
@@ -273,6 +273,18 @@
     PA_SEEK_RELATIVE_END = 3,       /**< Seek relatively to the current end of the buffer queue. */
 } pa_seek_mode_t;
 
+/** Special sink flags. \since 0.8  */
+typedef enum pa_sink_flags {
+    PA_SINK_HW_VOLUME_CTRL = 1,   /**< Supports hardware volume control */
+    PA_SINK_LATENCY = 2           /**< Supports latency querying */
+} pa_sink_flags_t;
+
+/** Special source flags. \since 0.8  */
+typedef enum pa_source_flags {
+    PA_SOURCE_HW_VOLUME_CTRL = 1,  /**< Supports hardware volume control */
+    PA_SOURCE_LATENCY = 2          /**< Supports latency querying */
+} pa_source_flags_t;
+
 PA_C_DECL_END
 
 #endif

Modified: trunk/src/polyp/introspect.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/introspect.c?rev=661&root=polypaudio&r1=660&r2=661&view=diff
==============================================================================
--- trunk/src/polyp/introspect.c (original)
+++ trunk/src/polyp/introspect.c Sat Apr  8 01:02:48 2006
@@ -135,6 +135,7 @@
 
         eol = -1;
     } else {
+        uint32_t flags;
         
         while (!pa_tagstruct_eof(t)) {
             pa_sink_info i;
@@ -150,11 +151,14 @@
                 pa_tagstruct_getu32(t, &i.monitor_source) < 0 ||
                 pa_tagstruct_gets(t, &i.monitor_source_name) < 0 ||
                 pa_tagstruct_get_usec(t, &i.latency) < 0 ||
-                pa_tagstruct_gets(t, &i.driver) < 0) {
+                pa_tagstruct_gets(t, &i.driver) < 0 ||
+                pa_tagstruct_getu32(t, &flags) < 0) {
                 
                 pa_context_fail(o->context, PA_ERR_PROTOCOL);
                 goto finish;
             }
+
+            i.flags = (pa_sink_flags_t) flags;
 
             if (o->callback) {
                 pa_sink_info_cb_t cb = (pa_sink_info_cb_t) o->callback;
@@ -242,6 +246,7 @@
         
         while (!pa_tagstruct_eof(t)) {
             pa_source_info i;
+            uint32_t flags;
             
             if (pa_tagstruct_getu32(t, &i.index) < 0 ||
                 pa_tagstruct_gets(t, &i.name) < 0 ||
@@ -254,11 +259,14 @@
                 pa_tagstruct_getu32(t, &i.monitor_of_sink) < 0 ||
                 pa_tagstruct_gets(t, &i.monitor_of_sink_name) < 0 ||
                 pa_tagstruct_get_usec(t, &i.latency) < 0 ||
-                pa_tagstruct_gets(t, &i.driver) < 0) {
+                pa_tagstruct_gets(t, &i.driver) < 0 ||
+                pa_tagstruct_getu32(t, &flags) < 0) {
                 
                 pa_context_fail(o->context, PA_ERR_PROTOCOL);
                 goto finish;
             }
+
+            i.flags = (pa_source_flags_t) flags;
 
             if (o->callback) {
                 pa_source_info_cb_t cb = (pa_source_info_cb_t) o->callback;

Modified: trunk/src/polyp/introspect.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/introspect.h?rev=661&root=polypaudio&r1=660&r2=661&view=diff
==============================================================================
--- trunk/src/polyp/introspect.h (original)
+++ trunk/src/polyp/introspect.h Sat Apr  8 01:02:48 2006
@@ -63,6 +63,7 @@
     const char *monitor_source_name;   /**< The name of the monitor source */
     pa_usec_t latency;                 /**< Length of filled playback buffer of this sink */
     const char *driver;                /**< Driver name. \since 0.8 */
+    pa_sink_flags_t flags;             /**< Flags \since 0.8 */
 } pa_sink_info;
 
 /** Callback prototype for pa_context_get_sink_info_by_name() and friends */
@@ -91,6 +92,7 @@
     const char *monitor_of_sink_name;   /**< Name of the owning sink, or PA_INVALID_INDEX */
     pa_usec_t latency;                  /**< Length of filled record buffer of this source. \since 0.5 */
     const char *driver;                 /**< Driver name \since 0.8 */
+    pa_source_flags_t flags;            /**< Flags \since 0.8 */
 } pa_source_info;
 
 /** Callback prototype for pa_context_get_source_info_by_name() and friends */

Modified: trunk/src/polypcore/protocol-native.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/protocol-native.c?rev=661&root=polypaudio&r1=660&r2=661&view=diff
==============================================================================
--- trunk/src/polypcore/protocol-native.c (original)
+++ trunk/src/polypcore/protocol-native.c Sat Apr  8 01:02:48 2006
@@ -1232,6 +1232,7 @@
         PA_TAG_STRING, sink->monitor_source->name,
         PA_TAG_USEC, pa_sink_get_latency(sink),
         PA_TAG_STRING, sink->driver,
+        PA_TAG_U32, (sink->get_hw_volume ? PA_SINK_HW_VOLUME_CTRL : 0) | (sink->get_latency ? PA_SINK_LATENCY : 0),
         PA_TAG_INVALID);
 }
 
@@ -1251,6 +1252,7 @@
         PA_TAG_STRING, source->monitor_of ? source->monitor_of->name : NULL,
         PA_TAG_USEC, pa_source_get_latency(source),
         PA_TAG_STRING, source->driver,
+        PA_TAG_U32, (source->get_hw_volume ? PA_SOURCE_HW_VOLUME_CTRL : 0) | (source->get_latency ? PA_SOURCE_LATENCY : 0),
         PA_TAG_INVALID);
 }
 




More information about the pulseaudio-commits mailing list