[v0.6.28] Enhance session backward compatibility
[platform/core/multimedia/libmm-player.git] / src / mm_player_priv.c
index b2c6d2d..3755568 100644 (file)
@@ -4532,13 +4532,14 @@ ERROR:
 
 void __mmplayer_gst_set_audiosink_property(mm_player_t* player, MMHandleType attrs)
 {
-       #define MAX_PROPS_LEN 64
+       #define MAX_PROPS_LEN 128
        gint latency_mode = 0;
        gchar *stream_type = NULL;
        gchar *latency = NULL;
        gint stream_id = 0;
        gchar stream_props[MAX_PROPS_LEN] = {0,};
        GstStructure *props = NULL;
+       gint stream_focus_status = 0;
 
        /* set volume table
         * It should be set after player creation through attribute.
@@ -4551,10 +4552,14 @@ void __mmplayer_gst_set_audiosink_property(mm_player_t* player, MMHandleType att
        if (!stream_type) {
                LOGE("stream_type is null.\n");
        } else {
-               snprintf(stream_props, sizeof(stream_props)-1, "props,media.role=%s, media.parent_id=%d", stream_type, stream_id);
+               if (_mmplayer_is_using_internal_sound_focus(&player->sound_focus))
+                       stream_focus_status = 1;
+
+               snprintf(stream_props, sizeof(stream_props)-1, "props,media.role=%s, media.parent_id=%d, media.focus_status=%d",
+                               stream_type, stream_id, stream_focus_status);
                props = gst_structure_from_string(stream_props, NULL);
                g_object_set(player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "stream-properties", props, NULL);
-               LOGD("stream_id[%d], stream_type[%s], result[%s].\n", stream_id, stream_type, stream_props);
+               LOGI("stream_id[%d], stream_type[%s], stream_focus[%d], result[%s].\n", stream_id, stream_type, stream_focus_status, stream_props);
        }
 
        mm_attrs_get_int_by_name(attrs, "sound_latency_mode", &latency_mode);