Add interface for audio latency mode setting, fixed TDIS-1656
authorZhang,Vivian <vivian.zhang@intel.com>
Mon, 7 Jan 2013 08:17:30 +0000 (16:17 +0800)
committerZhang,Vivian <vivian.zhang@intel.com>
Mon, 7 Jan 2013 08:17:30 +0000 (16:17 +0800)
Change-Id: I717105550903fa1e0173256f0e97a7fb3e7722d2

src/mm_player_attrs.c
src/mm_player_priv.c

index 3e2d63f..1d511d5 100755 (executable)
@@ -817,6 +817,15 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        2
                },
                {
+                       "audio_latency_mode",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       (void *) 1,                     // 0: low latency, 1: middle latency 2: high latency
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       0,
+                       2
+               },
+               {
                        "pcm_extraction",               // enable pcm extraction
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
index ec0b5eb..e7d17c5 100755 (executable)
@@ -3036,6 +3036,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                        gint audio_route = 0;
                        gint sound_priority = FALSE;
                        gint is_spk_out_only = 0;
+                       gint latency_mode = 0;
 
                        /* set volume table
                         * It should be set after player creation through attribute.
@@ -3045,6 +3046,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                        mm_attrs_get_int_by_name(attrs, "sound_route", &audio_route);
                        mm_attrs_get_int_by_name(attrs, "sound_priority", &sound_priority);
                        mm_attrs_get_int_by_name(attrs, "sound_spk_out_only", &is_spk_out_only);
+                       mm_attrs_get_int_by_name(attrs, "audio_latency_mode", &latency_mode);
 
                        /* hook sound_type if emergency case */
                        if ( player->sm.event == ASM_EVENT_EMERGENCY)
@@ -3058,10 +3060,11 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                                                                "audio-route", audio_route,
                                                                "priority", sound_priority,
                                                                "user-route", is_spk_out_only,
+                                                               "latency", latency_mode,
                                                                NULL);
 
-                       debug_log("audiosink property status...volume type:%d, route:%d, priority=%d, user-route=%d\n",
-                               volume_type, audio_route, sound_priority, is_spk_out_only);
+                       debug_log("audiosink property status...volume type:%d, route:%d, priority=%d, user-route=%d, latency=%d\n",
+                               volume_type, audio_route, sound_priority, is_spk_out_only, latency_mode);
                }
 
                /* Antishock can be enabled when player is resumed by soundCM.