[pulseaudio-commits] r1988 - in /trunk/src: modules/module-esound-sink.c modules/module-tunnel.c modules/module-zeroconf-publish.c pulse/def.h pulsecore/cli-text.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Oct 29 14:23:09 PDT 2007


Author: lennart
Date: Mon Oct 29 22:23:08 2007
New Revision: 1988

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1988&root=pulseaudio&view=rev
Log:
ignore network sinks/sources

Modified:
    trunk/src/modules/module-esound-sink.c
    trunk/src/modules/module-tunnel.c
    trunk/src/modules/module-zeroconf-publish.c
    trunk/src/pulse/def.h
    trunk/src/pulsecore/cli-text.c

Modified: trunk/src/modules/module-esound-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-esound-sink.c?rev=1988&root=pulseaudio&r1=1987&r2=1988&view=diff
==============================================================================
--- trunk/src/modules/module-esound-sink.c (original)
+++ trunk/src/modules/module-esound-sink.c Mon Oct 29 22:23:08 2007
@@ -559,7 +559,7 @@
 
     u->sink->parent.process_msg = sink_process_msg;
     u->sink->userdata = u;
-    u->sink->flags = PA_SINK_LATENCY;
+    u->sink->flags = PA_SINK_LATENCY|PA_SINK_NETWORK;
 
     pa_sink_set_module(u->sink, m);
     pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);

Modified: trunk/src/modules/module-tunnel.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-tunnel.c?rev=1988&root=pulseaudio&r1=1987&r2=1988&view=diff
==============================================================================
--- trunk/src/modules/module-tunnel.c (original)
+++ trunk/src/modules/module-tunnel.c Mon Oct 29 22:23:08 2007
@@ -1100,6 +1100,7 @@
     u->sink->get_mute = sink_get_mute;
     u->sink->set_volume = sink_set_volume;
     u->sink->set_mute = sink_set_mute;
+    u->sink->flags = PA_SINK_NETWORK|PA_SINK_LATENCY|PA_SINK_HW_VOLUME_CTRL;
 
     pa_sink_set_module(u->sink, m);
     pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
@@ -1121,6 +1122,7 @@
     u->source->userdata = u;
     u->source->set_state = source_set_state;
     u->source->get_latency = source_get_latency;
+    u->source->flags = PA_SOURCE_NETWORK|PA_SOURCE_LATENCY;
 
     pa_source_set_module(u->source, m);
     pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);

Modified: trunk/src/modules/module-zeroconf-publish.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-zeroconf-publish.c?rev=1988&root=pulseaudio&r1=1987&r2=1988&view=diff
==============================================================================
--- trunk/src/modules/module-zeroconf-publish.c (original)
+++ trunk/src/modules/module-zeroconf-publish.c Mon Oct 29 22:23:08 2007
@@ -335,11 +335,24 @@
     pa_xfree(s);
 }
 
+static pa_bool_t is_network(pa_object *o) {
+    pa_object_assert_ref(o);
+
+    if (pa_sink_isinstance(o))
+        return !!(PA_SINK(o)->flags & PA_SINK_NETWORK);
+
+    if (pa_source_isinstance(o))
+        return !!(PA_SOURCE(o)->flags & PA_SOURCE_NETWORK);
+
+    pa_assert_not_reached();
+}
+
 static pa_hook_result_t device_new_or_changed_cb(pa_core *c, pa_object *o, struct userdata *u) {
     pa_assert(c);
     pa_object_assert_ref(o);
 
-    publish_service(get_service(u, o));
+    if (!is_network(o))
+        publish_service(get_service(u, o));
 
     return PA_HOOK_OK;
 }
@@ -449,10 +462,12 @@
     pa_log_debug("Publishing services in Zeroconf");
 
     for (sink = PA_SINK(pa_idxset_first(u->core->sinks, &idx)); sink; sink = PA_SINK(pa_idxset_next(u->core->sinks, &idx)))
-        publish_service(get_service(u, PA_OBJECT(sink)));
+        if (!is_network(PA_OBJECT(sink)))
+            publish_service(get_service(u, PA_OBJECT(sink)));
 
     for (source = PA_SOURCE(pa_idxset_first(u->core->sources, &idx)); source; source = PA_SOURCE(pa_idxset_next(u->core->sources, &idx)))
-        publish_service(get_service(u, PA_OBJECT(source)));
+        if (!is_network(PA_OBJECT(source)))
+            publish_service(get_service(u, PA_OBJECT(source)));
 
     if (publish_main_service(u) < 0)
         goto fail;

Modified: trunk/src/pulse/def.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/def.h?rev=1988&root=pulseaudio&r1=1987&r2=1988&view=diff
==============================================================================
--- trunk/src/pulse/def.h (original)
+++ trunk/src/pulse/def.h Mon Oct 29 22:23:08 2007
@@ -300,14 +300,16 @@
 typedef enum pa_sink_flags {
     PA_SINK_HW_VOLUME_CTRL = 1,   /**< Supports hardware volume control */
     PA_SINK_LATENCY = 2,          /**< Supports latency querying */
-    PA_SINK_HARDWARE = 4          /**< Is a hardware sink of some kind, in contrast to "virtual"/software sinks \since 0.9.3 */
+    PA_SINK_HARDWARE = 4,         /**< Is a hardware sink of some kind, in contrast to "virtual"/software sinks \since 0.9.3 */
+    PA_SINK_NETWORK = 8           /**< Is a networked sink of some kind. \since 0.9.7 */
 } 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_HARDWARE = 4         /**< Is a hardware source of some kind, in contrast to "virtual"/software source \since 0.9.3 */
+    PA_SOURCE_HARDWARE = 4,        /**< Is a hardware source of some kind, in contrast to "virtual"/software source \since 0.9.3 */
+    PA_SOURCE_NETWORK = 8          /**< Is a networked sink of some kind. \since 0.9.7 */
 } pa_source_flags_t;
 
 /** A generic free() like callback prototype */

Modified: trunk/src/pulsecore/cli-text.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/cli-text.c?rev=1988&root=pulseaudio&r1=1987&r2=1988&view=diff
==============================================================================
--- trunk/src/pulsecore/cli-text.c (original)
+++ trunk/src/pulsecore/cli-text.c Mon Oct 29 22:23:08 2007
@@ -111,7 +111,7 @@
             "  %c index: %u\n"
             "\tname: <%s>\n"
             "\tdriver: <%s>\n"
-            "\tflags: %s%s%s\n"
+            "\tflags: %s%s%s%s\n"
             "\tstate: %s\n"
             "\tvolume: <%s>\n"
             "\tmute: <%i>\n"
@@ -128,6 +128,7 @@
             sink->flags & PA_SINK_HW_VOLUME_CTRL ? "HW_VOLUME_CTRL " : "",
             sink->flags & PA_SINK_LATENCY ? "LATENCY " : "",
             sink->flags & PA_SINK_HARDWARE ? "HARDWARE " : "",
+            sink->flags & PA_SINK_NETWORK ? "NETWORK " : "",
             state_table[pa_sink_get_state(sink)],
             pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink)),
             !!pa_sink_get_mute(sink),
@@ -172,7 +173,7 @@
             "  %c index: %u\n"
             "\tname: <%s>\n"
             "\tdriver: <%s>\n"
-            "\tflags: %s%s%s\n"
+            "\tflags: %s%s%s%s\n"
             "\tstate: %s\n"
             "\tvolume: <%s>\n"
             "\tmute: <%u>\n"
@@ -188,6 +189,7 @@
             source->flags & PA_SOURCE_HW_VOLUME_CTRL ? "HW_VOLUME_CTRL " : "",
             source->flags & PA_SOURCE_LATENCY ? "LATENCY " : "",
             source->flags & PA_SOURCE_HARDWARE ? "HARDWARE " : "",
+            source->flags & PA_SOURCE_NETWORK ? "NETWORK " : "",
             state_table[pa_source_get_state(source)],
             pa_cvolume_snprint(cv, sizeof(cv), pa_source_get_volume(source)),
             !!pa_source_get_mute(source),




More information about the pulseaudio-commits mailing list