From: Sangchul Lee Date: Thu, 25 Jun 2020 07:05:26 +0000 (+0900) Subject: Exclude ringbacktone stream from changing call active routing logic X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_5.5;p=platform%2Fcore%2Fmultimedia%2Fpulseaudio-modules-tizen.git Exclude ringbacktone stream from changing call active routing logic 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 --- diff --git a/packaging/pulseaudio-modules-tizen.spec b/packaging/pulseaudio-modules-tizen.spec index 58a40cc..78244a3 100644 --- a/packaging/pulseaudio-modules-tizen.spec +++ b/packaging/pulseaudio-modules-tizen.spec @@ -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+ diff --git a/src/stream-manager-dbus.c b/src/stream-manager-dbus.c index 487426b..ef5a67a 100644 --- a/src/stream-manager-dbus.c +++ b/src/stream-manager-dbus.c @@ -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); } diff --git a/src/stream-manager-priv.h b/src/stream-manager-priv.h index 6425e99..f78a063 100644 --- a/src/stream-manager-priv.h +++ b/src/stream-manager-priv.h @@ -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); diff --git a/src/stream-manager.c b/src/stream-manager.c index b706bd2..be46762 100644 --- a/src/stream-manager.c +++ b/src/stream-manager.c @@ -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); }