Exclude ringbacktone stream from changing call active routing logic 27/237127/3 accepted/tizen/unified/20200710.114034 submit/tizen/20200709.084332
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jun 2020 07:05:26 +0000 (16:05 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 26 Jun 2020 00:52:22 +0000 (09:52 +0900)
stream_is_call_family() is also renamed to
is_stream_related_call_active_routing()

[Version] 13.0.20
[Issue Type] Bug fix

Change-Id: Iedee8a5c2e655d4bf4c9f0275c0ed8c0c5450621
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/stream-manager-dbus.c
src/stream-manager-priv.h
src/stream-manager.c

index fa7798e..3944878 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          13.0.19
+Version:          13.0.20
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 64adff1..a6e7506 100644 (file)
@@ -512,7 +512,7 @@ static ret_msg_t update_devices_and_trigger_routing(pa_stream_manager *m, stream
             pa_log_debug(" -- cur_highest_priority_stream->index[%u] belongs to this stream_parent[%p], do notify for the route change",
                         GET_STREAM_INDEX(cur_highest_priority_stream, type), sp);
             ret = do_notify(m, NOTIFY_COMMAND_CHANGE_ROUTE_START, type, false, cur_highest_priority_stream);
-            if (!ret && stream_is_call_family(PA_OBJECT(cur_highest_priority_stream)) && m->on_call) {
+            if (!ret && is_stream_related_call_active_routing(PA_OBJECT(cur_highest_priority_stream)) && m->on_call) {
                 pa_log_info("set active device for new call route device");
                 change_active_route_for_call(m, PA_OBJECT(cur_highest_priority_stream), false);
             }
index 6425e99..f78a063 100644 (file)
@@ -284,7 +284,7 @@ struct _stream_manager {
     } comm;
 };
 
-bool stream_is_call_family(pa_object *stream);
+bool is_stream_related_call_active_routing(pa_object *stream);
 bool is_active_device_of_stream(const void *stream, stream_type_t stream_type, const char *device_type);
 bool is_stream_ducked(stream_ducking *sd);
 int32_t get_route_type(void *stream, stream_type_t stream_type, bool is_new_data, stream_route_type_t *stream_route_type);
index cb89244..981d4c6 100644 (file)
@@ -137,7 +137,7 @@ static bool is_valid_process_command(process_command_type_t command) {
     return (command < sizeof(process_command_type_str) / sizeof(char *));
 }
 
-bool stream_is_call_family(pa_object *stream) {
+bool is_stream_related_call_active_routing(pa_object *stream) {
     const char *stream_role;
     pa_proplist *prop;
 
@@ -148,9 +148,15 @@ bool stream_is_call_family(pa_object *stream) {
     else
         prop = PA_SOURCE_OUTPUT(stream)->proplist;
 
-    stream_role = pa_proplist_gets(prop, PA_PROP_MEDIA_ROLE);
-    if (stream_role && IS_ROLE_COMMUNICATION(stream_role))
+    if (!(stream_role = pa_proplist_gets(prop, PA_PROP_MEDIA_ROLE)))
+        return false;
+
+    if (pa_safe_streq(stream_role, STREAM_ROLE_CALL_VOICE) ||
+        pa_safe_streq(stream_role, STREAM_ROLE_CALL_VIDEO) ||
+        pa_safe_streq(stream_role, STREAM_ROLE_VOIP)) {
+        pa_log_info("%s relates call active routing", stream_role);
         return true;
+     }
 
     return false;
 }
@@ -522,11 +528,6 @@ int change_active_route_for_call(pa_stream_manager *m, pa_object *stream, bool s
 
     stream_role = pa_proplist_gets(prop, PA_PROP_MEDIA_ROLE);
 
-    if (stream_is_call_family(stream) == false) {
-        pa_log_error("Not call family stream");
-        return -1;
-    }
-
     avail_device_types = get_avail_device_types(m, stream_role, GET_DIRECTION(stream));
     if (!avail_device_types) {
         pa_log_error("No avail device typs for [%s]", stream_role);
@@ -2495,7 +2496,7 @@ static pa_hook_result_t sink_input_put_cb(pa_core *core, pa_sink_input *i, pa_st
     process_stream(m, i, STREAM_SINK_INPUT, PROCESS_COMMAND_ADD_PARENT_ID, false);
     process_stream(m, i, STREAM_SINK_INPUT, PROCESS_COMMAND_APPLY_FILTER, false);
     process_stream(m, i, STREAM_SINK_INPUT, PROCESS_COMMAND_UPDATE_VOLUME, false);
-    if (stream_is_call_family(PA_OBJECT(i))) {
+    if (is_stream_related_call_active_routing(PA_OBJECT(i))) {
         change_active_route_for_call(m, PA_OBJECT(i), true);
         m->on_call = true;
     }
@@ -2511,7 +2512,7 @@ static pa_hook_result_t sink_input_unlink_cb(pa_core *core, pa_sink_input *i, pa
 
     pa_log_info("sink-input(%p, index:%u)", i, i->index);
 
-    if (stream_is_call_family(PA_OBJECT(i))) {
+    if (is_stream_related_call_active_routing(PA_OBJECT(i))) {
         m->on_call = false;
         set_media_active_device(m);
     }
@@ -2652,7 +2653,7 @@ static pa_hook_result_t source_output_put_cb(pa_core *core, pa_source_output *o,
     update_mirroring_streams(m, o, true);
     process_stream(m, o, STREAM_SOURCE_OUTPUT, PROCESS_COMMAND_ADD_PARENT_ID, false);
     process_stream(m, o, STREAM_SOURCE_OUTPUT, PROCESS_COMMAND_UPDATE_VOLUME, false);
-    if (stream_is_call_family(PA_OBJECT(o))) {
+    if (is_stream_related_call_active_routing(PA_OBJECT(o))) {
         change_active_route_for_call(m, PA_OBJECT(o), true);
         m->on_call = true;
     }
@@ -2666,7 +2667,7 @@ static pa_hook_result_t source_output_unlink_cb(pa_core *core, pa_source_output
 
     pa_log_info("source-output(%p, index:%u)", o, o->index);
 
-    if (stream_is_call_family(PA_OBJECT(o))) {
+    if (is_stream_related_call_active_routing(PA_OBJECT(o))) {
         m->on_call = false;
         set_media_active_device(m);
     }