tizenaudio-publish: publish only built-in devices 84/238684/4 accepted/tizen/unified/20200817.134629 submit/tizen/20200814.044955
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 13 Jul 2020 02:13:47 +0000 (11:13 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Fri, 14 Aug 2020 02:19:24 +0000 (11:19 +0900)
[Version] 13.0.24
[Issue Type] Update

Change-Id: I69753da561c813c80c35df7690d4efc1efc48a43

packaging/pulseaudio-modules-tizen.spec
src/module-tizenaudio-publish.c

index 78eccb1..9324ca1 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          13.0.23
+Version:          13.0.24
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 480b98f..cdead84 100644 (file)
@@ -329,14 +329,30 @@ static void service_free(struct service *s) {
     pa_xfree(s);
 }
 
+static bool is_builtin_device(pa_proplist *pl)
+{
+    /* FIXME: Determining the built-in device should be retrieved from device-manager.  */
+    return pa_safe_streq(pa_proplist_gets(pl, PA_PROP_DEVICE_FORM_FACTOR), "internal");
+}
+
 static bool shall_ignore(pa_object *o) {
     pa_object_assert_ref(o);
 
-    if (pa_sink_isinstance(o))
+    if (pa_sink_isinstance(o)) {
+        if (!is_builtin_device(PA_SINK(o)->proplist)) {
+            pa_log_error("sink [%s] is not an internal, skip this", PA_SINK(o)->name);
+            return true;
+        }
         return !!(PA_SINK(o)->flags & PA_SINK_NETWORK);
+    }
 
-    if (pa_source_isinstance(o))
+    if (pa_source_isinstance(o)) {
+        if (!is_builtin_device(PA_SOURCE(o)->proplist)) {
+            pa_log_error("source [%s] is not an internal, skip this", PA_SOURCE(o)->name);
+            return true;
+        }
         return PA_SOURCE(o)->monitor_of || (PA_SOURCE(o)->flags & PA_SOURCE_NETWORK);
+    }
 
     pa_assert_not_reached();
 }