Exclude ringbacktone stream from changing call active routing logic 59/237159/2 tizen_5.5
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:54:40 +0000 (09:54 +0900)
stream_is_call_family() is also renamed to
is_stream_related_call_active_routing()

[Version] 11.1.100
[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 58a40ccf62a5ac48c90cfea09aeec2b50941f8bb..78244a3e952c5821e092eb3e74fc802b6877508f 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          11.1.99
+Version:          11.1.100
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 487426b0f8a6aadeb8318776a5c0692fc59dd890..ef5a67a0896f8ed054d11e8c5224dd914d9ad346 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 6425e996224eed9ee88ae606a20e57c777d22fb8..f78a063f8ced5e584ff345a86c2bcc8be8d29b43 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 b706bd2c5bdd91dde932403aae1e49eef630b816..be46762298f50062fe5c04e862cfaa63cbd40b29 100644 (file)
@@ -127,7 +127,7 @@ static const char* notify_command_type_str[] = {
 #define STREAM_MAP_STREAM_AVAIL_OUT_DEVICES "avail-out-devices"
 #define STREAM_MAP_STREAM_AVAIL_FRAMEWORKS "avail-frameworks"
 
-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;
 
@@ -138,9 +138,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;
 }
@@ -512,11 +518,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);
@@ -2489,7 +2490,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;
     }
@@ -2505,7 +2506,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);
     }
@@ -2650,7 +2651,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;
     }
@@ -2664,7 +2665,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);
     }