[0.3.144] Add PLAYER_DISPLAY_OVERLAY_SYNC_UI type for sync UI and video
[platform/core/api/player.git] / src / player.c
index 7aa9419..461f6bb 100644 (file)
@@ -60,7 +60,6 @@ typedef struct {
        int int_data;
        callback_cb_info_s *cb_info;
        _player_recv_data *recv_data;
-       GMutex event_mutex;
 } _player_cb_data;
 
 typedef struct {
@@ -81,12 +80,11 @@ static int _player_deinit_memory_buffer(player_cli_s *pc);
 static void _player_event_queue_add(player_event_queue *ev, _player_cb_data *data);
 static bool _player_need_sync_context(int event_id);
 static void _player_remove_idle_event(callback_cb_info_s *cb_info, muse_player_event_e event_type, bool remove_all);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
 typedef void (*player_retrieve_buffer_cb)(void *user_data);
 static void __retrieve_buffer_cb(void *user_data);
+static void __player_media_packet_video_decoded_cb(media_packet_h packet, void *user_data);
 static int __player_set_retrieve_buffer_cb(player_h player, player_retrieve_buffer_cb callback, void *user_data);
 static int __player_unset_retrieve_buffer_cb(player_h player);
-#endif
 static void _player_release_internal_memory(player_cli_s *pc, bool deinit_server_mem);
 
 /*
@@ -178,8 +176,6 @@ static bool _player_get_param_value(char *buf, ...)
        char *param_name = NULL;
        void *value = NULL;
 
-       LOGE("ENTER");
-
        void *jobj = muse_core_msg_object_new(buf, NULL, &err);
 
        if (!jobj) {
@@ -513,6 +509,7 @@ static int __set_callback(muse_player_event_e type, player_h player, void *callb
        if (type == MUSE_PLAYER_EVENT_TYPE_BUFFERING) {
                if (!_player_check_network_availability())
                        return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
+               pc->cb_info->drop_buffering_message = FALSE;
        }
 
        if (!CALLBACK_INFO(pc))
@@ -587,14 +584,24 @@ static void __complete_cb_handler(callback_cb_info_s *cb_info, _player_recv_data
        ((player_completed_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
 }
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
+static void __player_media_packet_video_decoded_cb(media_packet_h packet, void *user_data)
+{
+       if (!packet || !user_data) {
+               LOGE("invalid param [packet:%p, user_data:%p]", packet, user_data);
+               return;
+       }
+
+       LOGD("render packet %p", packet);
+
+       mm_display_interface_evas_render(DP_INTERFACE((player_cli_s *)user_data), packet);
+}
+
 static void __retrieve_buffer_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
 
 {
        muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER;
        ((player_retrieve_buffer_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
 }
-#endif
 
 static void __interrupt_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
 {
@@ -630,8 +637,17 @@ static void __buffering_cb_handler(callback_cb_info_s *cb_info, _player_recv_dat
        int percent;
        muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_BUFFERING;
 
-       if (player_msg_get(percent, recv_data->buffer))
+       if (player_msg_get(percent, recv_data->buffer)) {
+               g_mutex_lock(&cb_info->buffering_cb_mutex);
+               if (cb_info->drop_buffering_message) {
+                       LOGD("Drop buffering callback");
+                       g_mutex_unlock(&cb_info->buffering_cb_mutex);
+                       return;
+               }
+               g_mutex_unlock(&cb_info->buffering_cb_mutex);
                ((player_buffering_cb)cb_info->user_cb[ev])(percent, cb_info->user_data[ev]);
+       }
+
 }
 
 static void __subtitle_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
@@ -694,8 +710,8 @@ static void __capture_cb_handler(callback_cb_info_s *cb_info, _player_recv_data
        }
 
 EXIT:
-       if (recv_data->tfd[0] > INVALID_DEFAULT_VALUE)
-               close(recv_data->tfd[0]);
+       PLAYER_CLOSE_FD(recv_data->tfd[0]);
+
        memset(recv_data->tfd, INVALID_DEFAULT_VALUE, sizeof(recv_data->tfd));
 
        if (bo)
@@ -712,11 +728,10 @@ EXIT:
 
 static void __seek_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
 {
+       int ret = MM_ERROR_NONE;
        muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_SEEK;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       void *dl_handle = NULL;
-       int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
        g_mutex_lock(&cb_info->seek_cb_mutex);
 
        switch (cb_info->seek_cb_state) {
@@ -727,24 +742,16 @@ static void __seek_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *re
                        break;
                }
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-               if (cb_info->evas_info && cb_info->evas_info->support_video) {
-                       if (cb_info->evas_info->handle && cb_info->evas_info->visible != EVAS_VISIBLE_FALSE) {
-                               dl_handle = dlopen(PATH_DISP_LIB, RTLD_LAZY);
-                               if (dl_handle) {
-                                       PLAYER_DISP_DLSYM(dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
-                                       int ret = p_disp_set_evas_display_visible(cb_info->evas_info->handle, true);
-                                       dlclose(dl_handle);
-                                       if (ret != MM_ERROR_NONE)
-                                               LOGW("failed to set visible at evas 0x%x", ret);
-                                       else
-                                               cb_info->evas_info->visible = EVAS_VISIBLE_TRUE;
-                               } else {
-                                       LOGW("not support video rendering");
-                               }
-                       }
+               ret = mm_display_interface_get_type(cb_info->dp_info.interface, &display_type);
+               if (ret == MM_ERROR_NONE && display_type == MM_DISPLAY_TYPE_EVAS &&
+                       cb_info->dp_info.visible != PLAYER_VISIBLE_INFO_FALSE) {
+                       LOGW("set display visible true for EVAS");
+                       if (mm_display_interface_evas_set_visible(cb_info->dp_info.interface, true) != MM_ERROR_NONE)
+                               LOGE("mm_display_interface_evas_set_visible failed");
+               } else {
+                       LOGW("get display type ret 0x%x, type %d", ret, display_type);
                }
-#endif
+
                LOGD("call seek cb");
                ((player_seek_completed_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
                set_null_user_cb(cb_info, ev);
@@ -772,7 +779,7 @@ static void __player_remove_tsurf_list(player_cli_s *pc)
                LOGD("total num of tsurf list = %d", g_list_length(pc->cb_info->tsurf_list));
 
                for (l = g_list_first(pc->cb_info->tsurf_list); l; l = g_list_next(l)) {
-                       player_tsurf_info_t *tmp = (player_tsurf_info_t *)l->data;
+                       player_tsurf_info_s *tmp = (player_tsurf_info_s *)l->data;
 
                        LOGD("%p will be removed", tmp);
                        if (tmp) {
@@ -790,15 +797,15 @@ static void __player_remove_tsurf_list(player_cli_s *pc)
        return;
 }
 
-static player_tsurf_info_t *__player_get_tsurf_from_list(callback_cb_info_s *cb_info, int *key, int height, int width)
+static player_tsurf_info_s *__player_get_tsurf_from_list(callback_cb_info_s *cb_info, intptr_t key, int height, int width)
 {
        GList *l = NULL;
 
        g_mutex_lock(&cb_info->data_mutex);
        for (l = g_list_first(cb_info->tsurf_list); l; l = g_list_next(l)) {
-               player_tsurf_info_t *tmp = (player_tsurf_info_t *)l->data;
-               if (tmp && key && (tmp->key[0] == key[0])) {
-                       LOGD("found tsurf_data of tbm_key %d", key[0]);
+               player_tsurf_info_s *tmp = (player_tsurf_info_s *)l->data;
+               if (tmp && key && (tmp->key == key)) {
+                       LOGD("found tsurf_data of tbm_key %" PRIdPTR, key);
 
                        /* need to check tsuf info to support DRC */
                        if ((tbm_surface_get_height(tmp->tsurf) != height) ||
@@ -847,17 +854,17 @@ static media_packet_rotate_method_e __convert_packet_orient_info(int orientation
 static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
 {
        tbm_bo bo[4] = { NULL, };
-       int key[4] = { INVALID_DEFAULT_VALUE, };
        tbm_surface_info_s sinfo;
        char *surface_info = (char *)&sinfo;
        media_packet_h pkt = NULL;
        tbm_surface_h tsurf = NULL;
-       player_tsurf_info_t *tsurf_data = NULL;
+       player_tsurf_info_s *tsurf_data = NULL;
        int bo_num = 0;
        media_format_mimetype_e mimetype = MEDIA_FORMAT_NV12;
        bool make_pkt_fmt = false;
        int ret = MEDIA_FORMAT_ERROR_NONE;
        _media_pkt_video_fin_data *fin_data = NULL;
+       intptr_t key = 0;
        intptr_t v_data = 0;
        uint64_t pts = 0;
        int i = 0, orientation = 0;
@@ -865,10 +872,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _
 
        void *jobj = muse_core_msg_object_new(recv_data->buffer, NULL, &err);
        if (!jobj ||
-               !muse_core_msg_object_get_value("key[0]", jobj, MUSE_TYPE_ANY, &key[0]) ||
-               !muse_core_msg_object_get_value("key[1]", jobj, MUSE_TYPE_ANY, &key[1]) ||
-               !muse_core_msg_object_get_value("key[2]", jobj, MUSE_TYPE_ANY, &key[2]) ||
-               !muse_core_msg_object_get_value("key[3]", jobj, MUSE_TYPE_ANY, &key[3]) ||
+               !muse_core_msg_object_get_value("key", jobj, MUSE_TYPE_POINTER, &key) ||
                !muse_core_msg_object_get_value("v_data", jobj, MUSE_TYPE_POINTER, &v_data) ||
                !muse_core_msg_object_get_value("mimetype", jobj, MUSE_TYPE_ANY, &mimetype) ||
                !muse_core_msg_object_get_value("pts", jobj, MUSE_TYPE_INT64, &pts) ||
@@ -910,25 +914,24 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _
                        bo[i] = tbm_bo_import_fd(cb_info->bufmgr, recv_data->tfd[i]);
                }
 
-               tsurf_data = g_new(player_tsurf_info_t, 1);
-               if (!tsurf_data) {
-                       LOGE("failed to alloc tsurf info");
-                       goto ERROR;
-               }
-               memset(tsurf_data->key, INVALID_DEFAULT_VALUE, sizeof(tsurf_data->key));
-
                tsurf = tbm_surface_internal_create_with_bos(&sinfo, bo, bo_num);
                if (!tsurf) {
                        LOGE("failed to create tbm surface");
-                       g_free(tsurf_data);
                        goto ERROR;
                }
-               memcpy(tsurf_data->key, key, sizeof(tsurf_data->key));
-               tsurf_data->tsurf = tsurf;
+
                if (cb_info->use_tsurf_pool) {
+                       tsurf_data = g_try_new(player_tsurf_info_s, 1);
+                       if (!tsurf_data) {
+                               LOGE("failed to alloc tsurf info");
+                               goto ERROR;
+                       }
+                       tsurf_data->key = key;
+                       tsurf_data->tsurf = tsurf;
+
                        g_mutex_lock(&cb_info->data_mutex);
                        cb_info->tsurf_list = g_list_append(cb_info->tsurf_list, tsurf_data);
-                       LOGD("key %d is added to the pool", key[0]);
+                       LOGD("key %" PRIdPTR " is added to the pool", key);
                        if (cb_info->video_frame_pool_size < g_list_length(cb_info->tsurf_list))
                                LOGE("need to check the pool size: %d < %d", cb_info->video_frame_pool_size, g_list_length(cb_info->tsurf_list));
                        g_mutex_unlock(&cb_info->data_mutex);
@@ -972,7 +975,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _
                }
        }
 
-       fin_data = g_new0(_media_pkt_video_fin_data, 1);
+       fin_data = g_try_new0(_media_pkt_video_fin_data, 1);
        if (!fin_data) {
                LOGE("failed to alloc fin_data");
                goto ERROR;
@@ -1008,10 +1011,9 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _
                media_packet_destroy(pkt);
        }
 
-       for (i = 0; i < MUSE_NUM_FD; i++) { /* if tsruf pool is enabled, bo_num can be zero. */
-               if (recv_data->tfd[i] > INVALID_DEFAULT_VALUE)
-                       close(recv_data->tfd[i]);
-       }
+       /* if tsruf pool is enabled, bo_num can be zero. */
+       for (i = 0; i < MUSE_NUM_FD; i++)
+               PLAYER_CLOSE_FD(recv_data->tfd[i]);
 
        for (i = 0; i < bo_num; i++) {
                if (bo[i])
@@ -1024,14 +1026,15 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _
 ERROR:
        if (pkt)
                media_packet_destroy(pkt);
+       else if (!tsurf_data && tsurf)
+               tbm_surface_destroy(tsurf);
 
        if (fin_data)
                g_free(fin_data);
 
-       for (i = 0; i < MUSE_NUM_FD; i++) { /* if tsruf pool is enabled, bo_num can be zero. */
-               if (recv_data->tfd[i] > INVALID_DEFAULT_VALUE)
-                       close(recv_data->tfd[i]);
-       }
+       /* if tsruf pool is enabled, bo_num can be zero. */
+       for (i = 0; i < MUSE_NUM_FD; i++)
+               PLAYER_CLOSE_FD(recv_data->tfd[i]);
 
        for (i = 0; i < bo_num; i++) {
                if (bo[i])
@@ -1134,8 +1137,8 @@ static void __media_packet_audio_frame_cb_handler(callback_cb_info_s *cb_info, _
        }
 
 EXIT:
-       if (recv_data->tfd[0] > INVALID_DEFAULT_VALUE)
-               close(recv_data->tfd[0]);
+       PLAYER_CLOSE_FD(recv_data->tfd[0]);
+
        memset(recv_data->tfd, INVALID_DEFAULT_VALUE, sizeof(recv_data->tfd));
 
        if (fmt)
@@ -1302,9 +1305,7 @@ static void (*_user_callbacks[MUSE_PLAYER_EVENT_TYPE_NUM])(callback_cb_info_s *c
        __media_stream_audio_seek_cb_handler,   /* MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK */
        NULL,   /* MUSE_PLAYER_EVENT_TYPE_AUDIO_STREAM_CHANGED */
        __video_stream_changed_cb_handler,              /* MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED */
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
        __retrieve_buffer_cb_handler,           /* MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER */
-#endif
        __disconnected_error_cb_handler,                /* MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED */
 };
 
@@ -1313,23 +1314,15 @@ gboolean _player_event_job_function(void *user_data)
        _player_cb_data *data = (_player_cb_data *)user_data;
        muse_player_event_e ev;
 
-       if (data == NULL) {
-               LOGE("data is null");
+       if (!data || !data->cb_info) {
+               LOGE("invalid user data");
                return FALSE;
        }
 
        ev = data->int_data;
        if ((ev != MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME) &&
                (ev != MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_AUDIO_FRAME))
-               LOGD("enter ev:%d", ev);
-
-       g_mutex_lock(&data->event_mutex);
-
-       if (data->cb_info == NULL) {
-               /* tried to remove before at _player_remove_idle_event */
-               LOGW("cb_info is NULL. event %d", data->int_data);
-               goto DONE;
-       }
+               LOGD("enter ev:%d(%p)", ev, data);
 
        /* remove event from list */
        g_mutex_lock(&data->cb_info->event_queue.idle_ev_mutex);
@@ -1345,17 +1338,6 @@ gboolean _player_event_job_function(void *user_data)
        else
                LOGW("user callback is unset. type : %d", ev);
 
-DONE:
-       /* unlock and release event */
-       g_mutex_unlock(&data->event_mutex);
-       g_mutex_clear(&data->event_mutex);
-
-       if (data->recv_data) {
-               g_free(data->recv_data->buffer);
-               g_free(data->recv_data);
-       }
-       g_free(data);
-
        return FALSE; /* remove from the event list */
 }
 
@@ -1374,6 +1356,26 @@ static bool _player_need_sync_context(int event_id)
        }
 }
 
+static void _destroy_event_data(gpointer user_data)
+{
+       _player_cb_data *data = (_player_cb_data *)user_data;
+
+       if (data == NULL) {
+               LOGW("data is null");
+               return;
+       }
+
+       LOGD("remove event data %p (%d)", data, data->int_data);
+       if (data->recv_data) {
+               g_free(data->recv_data->buffer);
+               data->recv_data->buffer = NULL;
+               g_free(data->recv_data);
+               data->recv_data = NULL;
+       }
+
+       g_free(data);
+}
+
 static void *_player_event_queue_loop(void *param)
 {
        if (!param) {
@@ -1399,46 +1401,53 @@ static void *_player_event_queue_loop(void *param)
                        g_mutex_lock(&ev->qlock);
                        event_data = (_player_cb_data *)g_queue_pop_head(ev->queue);
                        g_mutex_unlock(&ev->qlock);
-                       if (event_data) {
-                               muse_player_event_e event_type = event_data->int_data;
-
-                               if (event_type == MUSE_PLAYER_EVENT_TYPE_SEEK) {
-                                       g_mutex_lock(&cb_info->seek_cb_mutex);
-                                       if (cb_info->seek_cb_state == PLAYER_SEEK_CB_STATE_WAIT) {
-                                               /* push event into queue again. */
-                                               _player_event_queue_add(ev, event_data);
-                                               g_mutex_unlock(&cb_info->seek_cb_mutex);
-                                               break;
-                                       }
+
+                       if (!event_data)
+                               break;
+
+                       muse_player_event_e event_type = event_data->int_data;
+
+                       if (event_type == MUSE_PLAYER_EVENT_TYPE_SEEK) {
+                               g_mutex_lock(&cb_info->seek_cb_mutex);
+                               if (cb_info->seek_cb_state == PLAYER_SEEK_CB_STATE_WAIT) {
+                                       /* push event into queue again. */
+                                       _player_event_queue_add(ev, event_data);
                                        g_mutex_unlock(&cb_info->seek_cb_mutex);
+                                       break;
+                               }
+                               g_mutex_unlock(&cb_info->seek_cb_mutex);
+                       } else if (event_type == MUSE_PLAYER_EVENT_TYPE_BUFFERING) {
+                               g_mutex_lock(&cb_info->buffering_cb_mutex);
+                               if (cb_info->drop_buffering_message) {
+                                       LOGD("Drop buffering event");
+                                       g_mutex_unlock(&cb_info->buffering_cb_mutex);
+
+                                       _destroy_event_data(event_data);
+                                       break;
                                }
+                               g_mutex_unlock(&cb_info->buffering_cb_mutex);
+                       }
 
-                               if (_player_need_sync_context(event_type)) {
-                                       if ((cb_info->user_cb[event_type] || (event_type == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED)) &&
-                                               _user_callbacks[event_type]) {
-                                               g_mutex_lock(&ev->idle_ev_mutex);
-                                               ev->idle_ev_list = g_list_append(ev->idle_ev_list, (gpointer)event_data);
-                                               g_mutex_unlock(&ev->idle_ev_mutex);
-
-                                               LOGD("add ev %d to main loop", event_type);
-
-                                               g_idle_add_full(G_PRIORITY_DEFAULT,
-                                                                               (GSourceFunc)_player_event_job_function,
-                                                                               (gpointer)event_data,
-                                                                               NULL);
-                                       } else {
-                                               LOGW("there is no registered cb for ev:%d", event_type);
-                                               if (event_data->recv_data) {
-                                                       g_free(event_data->recv_data->buffer);
-                                                       g_free(event_data->recv_data);
-                                               }
-                                               g_free(event_data);
-                                       }
+                       if (_player_need_sync_context(event_type)) {
+                               if ((cb_info->user_cb[event_type] || (event_type == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED)) &&
+                                       _user_callbacks[event_type]) {
+                                       g_mutex_lock(&ev->idle_ev_mutex);
+                                       ev->idle_ev_list = g_list_append(ev->idle_ev_list, (gpointer)event_data);
+                                       g_mutex_unlock(&ev->idle_ev_mutex);
+
+                                       LOGD("add ev %d to main loop", event_type);
+
+                                       g_idle_add_full(G_PRIORITY_DEFAULT,
+                                                                       (GSourceFunc)_player_event_job_function,
+                                                                       (gpointer)event_data,
+                                                                       (GDestroyNotify)_destroy_event_data);
                                } else {
-                                       _player_event_job_function(event_data);
+                                       LOGW("there is no registered cb for ev:%d", event_type);
+                                       _destroy_event_data(event_data);
                                }
                        } else {
-                               break;
+                               _player_event_job_function(event_data);
+                               _destroy_event_data(event_data);
                        }
                }
        }
@@ -1497,44 +1506,19 @@ static void _player_remove_idle_event(callback_cb_info_s *cb_info, muse_player_e
                        continue;
                }
 
-               if (g_mutex_trylock(&event_data->event_mutex)) {
-
-                       gboolean ret = FALSE;
-                       if (remove_all || (event_data->int_data == event_type)) {
-
-                               LOGD("remove idle event [%p:%d]", event_data, event_data->int_data);
-
-                               ret = g_idle_remove_by_data(event_data);
-                               if (ret == FALSE) {
-                                       /* will be handled at _player_event_job_function() as an exception */
-                                       event_data->cb_info = NULL;
-                                       LOGW("failed to remove, idle callback will be called later");
-                               }
+               if ((event_data->int_data != event_type) && !remove_all)
+                       continue;
 
-                               /* set cb to null */
-                               set_null_user_cb(cb_info, event_data->int_data);
-                               ev->idle_ev_list = g_list_remove(ev->idle_ev_list, (gpointer)event_data);
+               LOGD("remove idle event [%p:%d]", event_data, event_data->int_data);
 
-                               g_mutex_unlock(&event_data->event_mutex);
+               /* set cb to null */
+               if (remove_all)
+                       set_null_user_cb(cb_info, event_data->int_data);
 
-                               if (ret == TRUE) {
-                                       g_mutex_clear(&event_data->event_mutex);
-                                       if (event_data->recv_data) {
-                                               g_free(event_data->recv_data->buffer);
-                                               g_free(event_data->recv_data);
-                                       }
-                                       g_free(event_data);
-                                       event_data = NULL;
-                                       LOGD("remove idle event done");
-                               } /* else : will be handled if the cb is called. */
-                       } else {
-                               g_mutex_unlock(&event_data->event_mutex);
-                       }
-               } else {
-                       LOGW("event(%d) lock failed. it's being called...", event_data->int_data);
-               }
+               ev->idle_ev_list = g_list_remove(ev->idle_ev_list, (gpointer)event_data);
 
-               /* continue: keep checking next event_data */
+               if (!g_idle_remove_by_data(event_data))
+                       LOGW("failed to find source with %p", event_data);
        }
 
        if (remove_all) {
@@ -1618,7 +1602,7 @@ static bool _user_callback_handler(callback_cb_info_s *cb_info, muse_player_even
        /* LOGD("get event %d", event); */
 
        if (event < MUSE_PLAYER_EVENT_TYPE_NUM) {
-               if (cb_info->user_cb[event] && _user_callbacks[event]){
+               if (cb_info->user_cb[event] && _user_callbacks[event]) {
                        _player_cb_data *data = NULL;
                        data = g_new(_player_cb_data, 1);
                        if (!data) {
@@ -1628,7 +1612,6 @@ static bool _user_callback_handler(callback_cb_info_s *cb_info, muse_player_even
                        data->int_data = (int)event;
                        data->cb_info = cb_info;
                        data->recv_data = recv_data;
-                       g_mutex_init(&data->event_mutex);
                        _player_event_queue_add(&cb_info->event_queue, data);
 
                        return true;
@@ -1708,7 +1691,6 @@ static void _notify_disconnected(callback_cb_info_s *cb_info)
                data->int_data = (int)event;
                data->cb_info = cb_info;
                data->recv_data = NULL;
-               g_mutex_init(&data->event_mutex);
                _player_event_queue_add(&cb_info->event_queue, data);
        }
 }
@@ -1830,6 +1812,8 @@ static callback_cb_info_s *callback_new(gint sockfd)
 
        g_mutex_init(&cb_info->data_mutex);
        g_mutex_init(&cb_info->seek_cb_mutex);
+       g_mutex_init(&cb_info->buffering_cb_mutex);
+       cb_info->drop_buffering_message = FALSE;
 
        buff = &cb_info->buff;
        buff->recvMsg = g_new(char, MUSE_MSG_MAX_LENGTH + 1);
@@ -1840,8 +1824,9 @@ static callback_cb_info_s *callback_new(gint sockfd)
 
        g_atomic_int_set(&cb_info->running, 1);
        cb_info->fd = sockfd;
-       cb_info->thread = g_thread_new("callback_thread", client_cb_handler, (gpointer) cb_info);
        cb_info->tfd = INVALID_DEFAULT_VALUE;
+       cb_info->data_fd = INVALID_DEFAULT_VALUE;
+       cb_info->thread = g_thread_new("callback_thread", client_cb_handler, (gpointer) cb_info);
 
        return cb_info;
 }
@@ -1880,10 +1865,12 @@ static void callback_destroy(callback_cb_info_s *cb_info)
 
        g_mutex_clear(&cb_info->data_mutex);
        g_mutex_clear(&cb_info->seek_cb_mutex);
+       g_mutex_clear(&cb_info->buffering_cb_mutex);
 
        g_free(cb_info->buff.recvMsg);
        _remove_all_ret_msg(cb_info);
        g_free(cb_info->buff.part_of_msg);
+
        g_free(cb_info);
 }
 
@@ -1995,9 +1982,8 @@ int player_create(player_h *player)
        muse_player_api_e api = MUSE_PLAYER_API_CREATE;
        int module_index = INVALID_DEFAULT_VALUE;
        player_cli_s *pc = NULL;
-       char *ret_buf = NULL;
+       gchar *ret_buf = NULL;
        int retry_count = CONNECTION_RETRY;
-       bool retry = false;
 
        PLAYER_INSTANCE_CHECK(player);
 
@@ -2007,19 +1993,19 @@ int player_create(player_h *player)
        if (pc == NULL)
                return PLAYER_ERROR_OUT_OF_MEMORY;
 
-       while (--retry_count) {
+       while (retry_count--) {
                ret = PLAYER_ERROR_NONE;
                sock_fd = muse_client_new();
                if (sock_fd <= INVALID_DEFAULT_VALUE) {
                        LOGE("connection failure %d", errno);
                        ret = PLAYER_ERROR_INVALID_OPERATION;
-                       retry = true;
                        usleep(CONNECTION_TIME_OUT * G_TIME_SPAN_MILLISECOND);
-                       goto ERROR;
+                       goto ERROR_RETRY;
                }
 
                if (muse_client_get_module_index(MODULE_NAME, &module_index) != MM_ERROR_NONE) {
                        LOGE("muse client get module index failed");
+                       ret = PLAYER_ERROR_INVALID_OPERATION;
                        goto ERROR;
                }
 
@@ -2037,11 +2023,8 @@ int player_create(player_h *player)
                }
 
                ret = client_wait_for_server_ack(api, pc->cb_info, CREATE_CB_TIME_OUT);
-               if (ret == PLAYER_ERROR_INVALID_OPERATION) {
-                       retry = true;
-                       goto ERROR;
-               }
-               retry = false;
+               if (ret == PLAYER_ERROR_INVALID_OPERATION)
+                       goto ERROR_RETRY;
 
                if (!_player_event_queue_new(pc->cb_info)) {
                        LOGE("fail to create event queue");
@@ -2077,21 +2060,13 @@ int player_create(player_h *player)
                } else {
                        goto ERROR;
                }
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-               pc->cb_info->evas_info = g_new0(player_evas_info_s, 1);
-               if (pc->cb_info->evas_info == NULL) {
-                       ret = PLAYER_ERROR_OUT_OF_MEMORY;
-                       goto ERROR;
-               }
-               EVAS_INFO(pc)->visible = EVAS_VISIBLE_NONE;
-#endif
+
                pc->cb_info->bufmgr = tbm_bufmgr_init(-1);
                pc->push_media_stream = FALSE;
-               pc->support_video = FALSE;
-               EVAS_INFO(pc)->support_video = FALSE;
-               pc->is_audio_only = FALSE;
 
-               PLAYER_DISP_DLOPEN(pc); /* update supported_video */
+               /* get display interface handle */
+               if (mm_display_interface_init(&DP_INTERFACE(pc)) != MM_ERROR_NONE)
+                       LOGW("display interface init failed");
 
                g_free(ret_buf);
 
@@ -2099,6 +2074,8 @@ int player_create(player_h *player)
                return ret;
 
 ERROR:
+               retry_count = 0;
+ERROR_RETRY:
                if (pc && pc->cb_info) {
                        if (pc->cb_info->event_queue.running)
                                _player_event_queue_destroy(pc->cb_info);
@@ -2108,11 +2085,10 @@ ERROR:
                        muse_client_close(sock_fd);
                }
                sock_fd = INVALID_DEFAULT_VALUE;
+
                g_free(ret_buf);
                ret_buf = NULL;
                LOGE("ret value : %d, retry #%d", ret, CONNECTION_RETRY - retry_count);
-               if (!retry)
-                       break;
        }
        g_free(pc);
        pc = NULL;
@@ -2128,10 +2104,7 @@ int player_destroy(player_h player)
        muse_player_api_e api = MUSE_PLAYER_API_DESTROY;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
-
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_destroy_evas_display)(void **) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
 
@@ -2142,18 +2115,17 @@ int player_destroy(player_h player)
        set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_PREPARE);
        _player_release_internal_memory(pc, true);
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (CALLBACK_INFO(pc) && EVAS_INFO(pc)) {
-               if (EVAS_INFO(pc)->support_video && EVAS_HANDLE(pc)) {
+       if (DP_INTERFACE(pc)) {
+               PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+               if (display_type == MM_DISPLAY_TYPE_EVAS) {
                        player_unset_media_packet_video_frame_decoded_cb(player);
-                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroy_evas_display, "disp_destroy_evas_display");
-                       if (p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
-                               LOGW("fail to unset evas client");
                        __player_unset_retrieve_buffer_cb(player);
                }
-               g_free(EVAS_INFO(pc));
+
+               mm_display_interface_deinit(DP_INTERFACE(pc));
+               DP_INTERFACE(pc) = NULL;
        }
-#endif
 
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
 
@@ -2166,9 +2138,6 @@ int player_destroy(player_h player)
                callback_destroy(CALLBACK_INFO(pc));
        }
 
-       if (pc->dl_handle)
-               PLAYER_DISP_DLCLOSE(pc->dl_handle); /* update supported_video */
-
        g_free(pc);
        pc = NULL;
 
@@ -2242,11 +2211,12 @@ int player_prepare(player_h player)
 int player_unprepare(player_h player)
 {
        int ret = PLAYER_ERROR_NONE;
+       int mm_ret = MM_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_UNPREPARE;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
-       int (*p_disp_evas_display_retrieve_all_packets)(void *, bool) = NULL;
        player_state_e state = PLAYER_STATE_NONE;
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
 
@@ -2269,21 +2239,35 @@ int player_unprepare(player_h player)
        set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_SEEK);
        set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_PREPARE);
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_INFO(pc)->support_video && EVAS_HANDLE(pc)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_evas_display_retrieve_all_packets, "disp_evas_display_retrieve_all_packets");
-               ret = p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(pc), false);
-               if (ret != PLAYER_ERROR_NONE)
-                       LOGI("mm_evas_renderer_retrieve_all_packets returned error");
+       if (!DP_INTERFACE(pc))
+               goto _PLAYER_UNPREPARE;
+
+
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type != MM_DISPLAY_TYPE_EVAS)
+               goto _PLAYER_UNPREPARE;
+
+       if (CALLBACK_INFO(pc)->dp_info.visible != PLAYER_VISIBLE_INFO_FALSE) {
+               mm_ret = mm_display_interface_evas_set_visible(DP_INTERFACE(pc), false);
+               if (mm_ret != MM_ERROR_NONE) {
+                       LOGE("mm_display_interface_evas_set_visible failed 0x%x", mm_ret);
+                       return PLAYER_ERROR_INVALID_OPERATION;
+               }
+       }
+
+       mm_ret = mm_display_interface_evas_flush(DP_INTERFACE(pc), false);
+       if (mm_ret != MM_ERROR_NONE) {
+               LOGE("mm_display_interface_evas_flush failed 0x%x", mm_ret);
+               return PLAYER_ERROR_INVALID_OPERATION;
        }
-#endif
 
+_PLAYER_UNPREPARE:
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
 
        _player_release_internal_memory(pc, false);
        pc->cb_info->video_frame_pool_size = 0;
        __player_remove_tsurf_list(pc);
-       pc->is_audio_only = FALSE;
 
        g_free(ret_buf);
 
@@ -2424,8 +2408,7 @@ int player_set_memory_buffer(player_h player, const void *data, int size)
        pc->push_media_stream = FALSE;
 
  EXIT:
-       if (tfd > INVALID_DEFAULT_VALUE)
-               close(tfd);
+       PLAYER_CLOSE_FD(tfd);
 
        tbm_bo_unref(bo);
 
@@ -2626,30 +2609,43 @@ int player_start(player_h player)
        muse_player_api_e api = MUSE_PLAYER_API_START;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
 
        LOGD("ENTER %p", pc);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-
-       if (CALLBACK_INFO(pc) && EVAS_INFO(pc)->support_video) {
-               if (EVAS_HANDLE(pc) && (EVAS_INFO(pc)->visible == EVAS_VISIBLE_NONE
-                       || EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE)) {
-                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
-                       ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), true);
-                       if (ret != MM_ERROR_NONE) {
-                               LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
-                               return PLAYER_ERROR_INVALID_OPERATION;
-                       }
-                       /* avoid setting true at all times, when player is resumed */
-                       EVAS_INFO(pc)->visible = EVAS_VISIBLE_TRUE;
-               }
+
+       if (!DP_INTERFACE(pc))
+               goto _PLAYER_START;
+
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type != MM_DISPLAY_TYPE_EVAS ||
+               CALLBACK_INFO(pc)->dp_info.visible == PLAYER_VISIBLE_INFO_FALSE)
+               goto _PLAYER_START;
+
+       /* set proper visible to evas renderer */
+       if (mm_display_interface_evas_set_visible(DP_INTERFACE(pc), true) != MM_ERROR_NONE) {
+               LOGE("mm_display_interface_evas_set_visible failed");
+               return PLAYER_ERROR_INVALID_OPERATION;
        }
-#endif
+
+       /* avoid setting true at all times, when player is resumed */
+       CALLBACK_INFO(pc)->dp_info.visible = PLAYER_VISIBLE_INFO_TRUE;
+
+_PLAYER_START:
+       g_mutex_lock(&pc->cb_info->buffering_cb_mutex);
+       pc->cb_info->drop_buffering_message = TRUE;
+       g_mutex_unlock(&pc->cb_info->buffering_cb_mutex);
+
+       _player_remove_idle_event(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_BUFFERING, false);
 
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
 
+       g_mutex_lock(&pc->cb_info->buffering_cb_mutex);
+       pc->cb_info->drop_buffering_message = FALSE;
+       g_mutex_unlock(&pc->cb_info->buffering_cb_mutex);
+
        g_free(ret_buf);
 
        LOGD("LEAVE 0x%X", ret);
@@ -2659,13 +2655,12 @@ int player_start(player_h player)
 int player_stop(player_h player)
 {
        int ret = PLAYER_ERROR_NONE;
+       int mm_ret = MM_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_STOP;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
        player_state_e state = PLAYER_STATE_NONE;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
 
@@ -2682,20 +2677,22 @@ int player_stop(player_h player)
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (CALLBACK_INFO(pc) && EVAS_HANDLE(pc) &&
-               EVAS_INFO(pc)->support_video && (EVAS_INFO(pc)->visible == EVAS_VISIBLE_NONE
-               || EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
-               ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), false);
-               if (ret != MM_ERROR_NONE) {
-                       LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
-                       return PLAYER_ERROR_INVALID_OPERATION;
-               }
-               /* do not update EVAS_INFO(pc)->visible to set visible true if start again */
+       if (!DP_INTERFACE(pc))
+               goto _PLAYER_STOP;
+
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type != MM_DISPLAY_TYPE_EVAS ||
+               CALLBACK_INFO(pc)->dp_info.visible == PLAYER_VISIBLE_INFO_FALSE)
+               goto _PLAYER_STOP;
+
+       mm_ret = mm_display_interface_evas_set_visible(DP_INTERFACE(pc), false);
+       if (mm_ret != MM_ERROR_NONE) {
+               LOGE("mm_display_interface_evas_set_visible failed 0x%x", mm_ret);
+               return PLAYER_ERROR_INVALID_OPERATION;
        }
-#endif
 
+_PLAYER_STOP:
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
        if (ret == PLAYER_ERROR_NONE)
                set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_SEEK);
@@ -3018,7 +3015,7 @@ int player_get_duration_nsec(player_h player, int64_t *nanoseconds)
 }
 
 /* The player_display_type_e is different at wearable profile */
-int _player_convert_display_type(player_display_type_e type, player_private_display_type_e *out_type)
+int _player_convert_display_type(player_display_type_e type, mm_display_type_e *out_type)
 {
        int ret = PLAYER_ERROR_NONE;
 
@@ -3026,13 +3023,16 @@ int _player_convert_display_type(player_display_type_e type, player_private_disp
 
        switch (type) {
        case PLAYER_DISPLAY_TYPE_OVERLAY:
-               *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY;
+               *out_type = MM_DISPLAY_TYPE_OVERLAY;
+               break;
+       case PLAYER_DISPLAY_TYPE_OVERLAY_SYNC_UI:
+               *out_type = MM_DISPLAY_TYPE_OVERLAY_SYNC_UI;
                break;
        case PLAYER_DISPLAY_TYPE_EVAS:
-               *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS;
+               *out_type = MM_DISPLAY_TYPE_EVAS;
                break;
        case PLAYER_DISPLAY_TYPE_NONE:
-               *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_NONE;
+               *out_type = MM_DISPLAY_TYPE_NONE;
                break;
        default:
                ret = PLAYER_ERROR_INVALID_PARAMETER;
@@ -3040,43 +3040,40 @@ int _player_convert_display_type(player_display_type_e type, player_private_disp
        }
 
        LOGD("display type(%d) -> (%d)", type, *out_type);
+
        return ret;
 }
 
 int player_set_display(player_h player, player_display_type_e type, player_display_h display)
 {
        int ret = PLAYER_ERROR_NONE;
+       int mm_ret = MM_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
        wl_win_msg_type wl_win;
        char *wl_win_msg = (char *)&wl_win;
-       int wl_surface_id;
-       player_private_display_type_e conv_type = PLAYER_DISPLAY_TYPE_NONE;
-       unsigned int (*p_disp_set_wl_display)(int, void *) = NULL;
+       mm_display_type_e conv_type = MM_DISPLAY_TYPE_NONE;
        int arr_msg_len = 0;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_destroy_evas_display)(void **) = NULL;
-       int (*p_disp_create_evas_display)(void *, void **) = NULL;
-       int (*p_disp_set_evas_display_old_info)(void *, void *, int, int, int) = NULL;
-       int (*p_disp_set_evas_display_roi_area)(void *, int, int, int, int) = NULL;
-       void (*p_disp_media_packet_video_decode_cb)(media_packet_h, void *) = NULL;
-#endif
        pid_t pid = getpid();
        pid_t tid = syscall(SYS_gettid);
 
        PLAYER_INSTANCE_CHECK(player);
 
-       LOGD("ENTER");
+       if (type != PLAYER_DISPLAY_TYPE_NONE) {
+               LOGD("Check if API is called in main thread. pid [%d], tid [%d]", pid, tid);
+               if (pid != tid) {
+                       LOGE("API isn't called in main thread");
+                       return PLAYER_ERROR_INVALID_OPERATION;
+               }
+       }
 
-       LOGD("Check if API is called in main thread. pid [%d], tid [%d]", pid, tid);
-       if (pid != tid) {
-               LOGE("API isn't called in main thread");
+       /* check display interface handle */
+       if (!DP_INTERFACE(pc)) {
+               LOGE("display interface not supported");
                return PLAYER_ERROR_INVALID_OPERATION;
        }
 
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-
        LOGD("ENTER type: %d", type);
 
        /* before setting display, player state have to be checked. */
@@ -3086,76 +3083,73 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
        if (ret != PLAYER_ERROR_NONE)
                return ret;
 
-       if (conv_type != PLAYER_PRIVATE_DISPLAY_TYPE_NONE) {
-               if (!display)
+       if (conv_type != MM_DISPLAY_TYPE_NONE) {
+               if (!display) {
+                       LOGE("type[%d] NULL handle for display", type);
                        return PLAYER_ERROR_INVALID_PARAMETER;
-
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-               /**
-                * To support repeating play and stop, Evas_handle should not be destroyed in player_unprepare.
-                * When the display type changes, Player need to destroy Evas_handle to set values of video output,
-                * Otherwise, the values is not set because of checking Evas_handle.
-                */
-               if (CALLBACK_INFO(pc) && EVAS_HANDLE(pc)) {
-                       LOGW("evas client already exists");
-                       player_unset_media_packet_video_frame_decoded_cb(player);
-                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroy_evas_display, "disp_destroy_evas_display");
-                       if (p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
-                               LOGW("fail to unset evas client");
-                       __player_unset_retrieve_buffer_cb(player);
-                       /* need to set display information again to new handle */
-                       EVAS_INFO(pc)->update_needed = TRUE;
                }
-#endif
-               /* set evas_render or wayland */
-               if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY) {
-                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_wl_display, "disp_set_wl_display");
-                       wl_surface_id = p_disp_set_wl_display(ELM_WAYLAND_WIN, display);
-                       if (wl_surface_id > 0) {
-                               wl_win.surface_id = wl_surface_id;
-                               wl_win.type = conv_type;
-                       } else return PLAYER_ERROR_INVALID_OPERATION;
+
+               mm_ret = mm_display_interface_set_display(DP_INTERFACE(pc), conv_type, display, &wl_win.surface_id);
+               if (mm_ret != MM_ERROR_NONE) {
+                       LOGE("[INVALID_OPERATION] set display failed[0x%x]", mm_ret);
+                       return PLAYER_ERROR_INVALID_OPERATION;
                }
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-               else if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_EVAS) {
-                       if (!CALLBACK_INFO(pc)) {
-                               LOGE("there is no cb info in player handle");
+
+               if (conv_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+                       g_strlcpy(wl_win.exported_shell_handle, (char *)display, MAX_EXPORTED_SHELL_HANDLE_LEN);
+               } else if (conv_type == MM_DISPLAY_TYPE_EVAS) {
+                       /* before evas handle is created, user could set display information */
+                       player_display_mode_e mode = PLAYER_DISPLAY_MODE_LETTER_BOX;
+                       player_display_rotation_e rotation = PLAYER_DISPLAY_ROTATION_NONE;
+                       bool visible = false;
+
+                       ret = player_get_display_mode(player, &mode);
+                       ret |= player_get_display_rotation(player, &rotation);
+                       ret |= player_is_display_visible(player, &visible);
+
+                       if (ret != PLAYER_ERROR_NONE) {
+                               LOGE("get current display settings");
                                return PLAYER_ERROR_INVALID_OPERATION;
                        }
 
-                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_create_evas_display, "disp_create_evas_display");
-                       ret = p_disp_create_evas_display(display, &EVAS_HANDLE(pc));
-                       if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
+                       LOGD("current setting : mode %d, rotation %d, visible %d, roi %d,%d,%dx%d",
+                               mode, rotation, visible,
+                               CALLBACK_INFO(pc)->dp_info.roi_x,
+                               CALLBACK_INFO(pc)->dp_info.roi_y,
+                               CALLBACK_INFO(pc)->dp_info.roi_w,
+                               CALLBACK_INFO(pc)->dp_info.roi_h);
+
+                       mm_ret = mm_display_interface_evas_set_mode(DP_INTERFACE(pc), mode);
+                       mm_ret |= mm_display_interface_evas_set_rotation(DP_INTERFACE(pc), rotation);
+                       mm_ret |= mm_display_interface_evas_set_visible(DP_INTERFACE(pc), visible);
+                       if (mode == PLAYER_DISPLAY_MODE_DST_ROI) {
+                               mm_ret |= mm_display_interface_evas_set_roi_area(DP_INTERFACE(pc),
+                                       CALLBACK_INFO(pc)->dp_info.roi_x, CALLBACK_INFO(pc)->dp_info.roi_y,
+                                       CALLBACK_INFO(pc)->dp_info.roi_w, CALLBACK_INFO(pc)->dp_info.roi_h);
+                       }
+
+                       if (mm_ret != MM_ERROR_NONE) {
+                               LOGE("set mm_display_interface failed");
+                               return PLAYER_ERROR_INVALID_OPERATION;
+                       }
 
-                       /* before evas handle is created, user could set display information */
-                       if (EVAS_INFO(pc)->update_needed) {
-                               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_old_info, "disp_set_evas_display_old_info");
-                               ret = p_disp_set_evas_display_old_info(display, EVAS_HANDLE(pc), EVAS_INFO(pc)->mode, EVAS_INFO(pc)->rotation, EVAS_INFO(pc)->visible);
-                               if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
-                               if (EVAS_INFO(pc)->mode == PLAYER_DISPLAY_MODE_DST_ROI) {
-                                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_roi_area, "disp_set_evas_display_roi_area");
-                                       ret = p_disp_set_evas_display_roi_area(EVAS_HANDLE(pc), EVAS_INFO(pc)->roi_x, EVAS_INFO(pc)->roi_y, EVAS_INFO(pc)->roi_w, EVAS_INFO(pc)->roi_h);
-                                       if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
-                               }
-                               EVAS_INFO(pc)->update_needed = FALSE;
+                       if (player_set_media_packet_video_frame_decoded_cb(player,
+                               __player_media_packet_video_decoded_cb, player) != MM_ERROR_NONE) {
+                               LOGE("fail to set decoded callback");
+                               return PLAYER_ERROR_INVALID_OPERATION;
                        }
 
-                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_media_packet_video_decode_cb, "disp_media_packet_video_decode_cb");
-                       ret = player_set_media_packet_video_frame_decoded_cb(player, p_disp_media_packet_video_decode_cb, (void *)EVAS_HANDLE(pc));
-                       if (ret != PLAYER_ERROR_NONE)
-                               LOGW("fail to set decoded callback");
                        if (__player_set_retrieve_buffer_cb(player, __retrieve_buffer_cb, pc))
                                LOGW("fail to set __retrieve_buffer_cb");
                }
-#endif
-       } else {        /* PLAYER_DISPLAY_TYPE_NONE */
-               LOGI("Wayland surface type is NONE");
-               wl_win.type = conv_type;
        }
 
+       wl_win.type = conv_type;
+
        arr_msg_len = (sizeof(wl_win_msg_type) / sizeof(int) + (sizeof(wl_win_msg_type) % sizeof(int) ? 1 : 0));
        PLAYER_SEND_MSG(api, pc, ret_buf, ret,
-                                       MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg);
+               MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg);
+
        g_free(ret_buf);
 
        return ret;
@@ -3164,34 +3158,36 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
 int player_set_display_mode(player_h player, player_display_mode_e mode)
 {
        int ret = PLAYER_ERROR_NONE;
+       int mm_ret = MM_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_MODE;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_set_evas_display_disp_mode)(void *, int) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_RANGE_ARG_CHECK(mode, PLAYER_DISPLAY_MODE_LETTER_BOX, PLAYER_DISPLAY_MODE_DST_ROI);
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
 
        LOGD("ENTER");
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_disp_mode, "disp_set_evas_display_disp_mode");
-               ret = p_disp_set_evas_display_disp_mode(EVAS_HANDLE(pc), mode);
-               if (ret != MM_ERROR_NONE)
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+               LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+               return PLAYER_ERROR_NOT_AVAILABLE;
+       }
+
+       if (display_type == MM_DISPLAY_TYPE_EVAS) {
+               mm_ret = mm_display_interface_evas_set_mode(DP_INTERFACE(pc), mode);
+               if (mm_ret != MM_ERROR_NONE) {
+                       LOGE("mm_display_interface_evas_set_mode failed 0x%x", mm_ret);
                        return PLAYER_ERROR_INVALID_OPERATION;
-               else
-                       return PLAYER_ERROR_NONE;
-       } else {
-               EVAS_INFO(pc)->mode = mode;
-               EVAS_INFO(pc)->update_needed = TRUE;
+               }
        }
-#endif
+
        PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "mode", (int)mode);
+
        g_free(ret_buf);
+
        return ret;
 }
 
@@ -3202,35 +3198,29 @@ int player_get_display_mode(player_h player, player_display_mode_e *pmode)
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
        int mode = -1;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_get_evas_display_disp_mode)(void *, int *) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(pmode);
 
        LOGD("ENTER");
 
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_disp_mode, "disp_get_evas_display_disp_mode");
-               ret = p_disp_get_evas_display_disp_mode(EVAS_HANDLE(pc), &mode);
-               *pmode = (player_display_mode_e) mode;
-               if (ret != MM_ERROR_NONE)
-                       return PLAYER_ERROR_INVALID_OPERATION;
-               else
-                       return PLAYER_ERROR_NONE;
+       if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+               LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+               return PLAYER_ERROR_NOT_AVAILABLE;
        }
-#endif
+
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
        if (ret == PLAYER_ERROR_NONE) {
                player_msg_get_type(mode, ret_buf, INT);
                *pmode = mode;
        }
 
        g_free(ret_buf);
+
        return ret;
 }
 
@@ -3241,14 +3231,23 @@ int player_set_video_roi_area(player_h player, double x_scale, double y_scale,
        muse_player_api_e api = MUSE_PLAYER_API_SET_VIDEO_ROI_AREA;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
 
        LOGD("ENTER");
 
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-       PLAYER_CHECK_CONDITION(CALLBACK_INFO(pc) != NULL && EVAS_HANDLE(pc) == NULL,
-                       PLAYER_ERROR_INVALID_OPERATION, "Display type is EVAS, video display interface is not supported");
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+               LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+               return PLAYER_ERROR_NOT_AVAILABLE;
+       }
+
+       if (display_type == MM_DISPLAY_TYPE_EVAS) {
+               LOGE("Display type is EVAS, video display interface is not supported");
+               return PLAYER_ERROR_INVALID_OPERATION;
+       }
 
        if (!_player_video_roi_area_is_valid(x_scale, y_scale, w_scale, h_scale))
                return PLAYER_ERROR_INVALID_PARAMETER;
@@ -3273,8 +3272,16 @@ int player_get_video_roi_area(player_h player, double *x_scale, double *y_scale,
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
        double scale_x = 0, scale_y = 0, scale_w = 0, scale_h = 0;
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+               LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+               return PLAYER_ERROR_NOT_AVAILABLE;
+       }
+
        PLAYER_NULL_ARG_CHECK(x_scale && y_scale && w_scale && h_scale);
 
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
@@ -3307,40 +3314,30 @@ int player_get_video_roi_area(player_h player, double *x_scale, double *y_scale,
 int player_set_display_roi_area(player_h player, int x, int y, int width, int height)
 {
        int ret = PLAYER_ERROR_NONE;
+       int mm_ret = MM_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_ROI_AREA;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
        wl_win_msg_type wl_win;
        char *wl_win_msg = (char *)&wl_win;
        int arr_msg_len = 0;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_set_evas_display_roi_area)(void *, int, int, int, int) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_CHECK_CONDITION(width > 0 && height > 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
 
        LOGD("ENTER");
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_roi_area, "disp_set_evas_display_roi_area");
-               ret = p_disp_set_evas_display_roi_area(EVAS_HANDLE(pc), x, y, width, height);
-               if (ret == MM_ERROR_EVASRENDER_INVALID_ARGUMENT)
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type == MM_DISPLAY_TYPE_EVAS) {
+               mm_ret = mm_display_interface_evas_set_roi_area(DP_INTERFACE(pc), x, y, width, height);
+               if (mm_ret == MM_ERROR_EVASRENDER_INVALID_ARGUMENT)
                        return PLAYER_ERROR_INVALID_PARAMETER;
-               else if (ret != MM_ERROR_NONE)
+               else if (mm_ret != MM_ERROR_NONE)
                        return PLAYER_ERROR_INVALID_OPERATION;
-               else
-                       return PLAYER_ERROR_NONE;
-       } else {
-               EVAS_INFO(pc)->roi_x = x;
-               EVAS_INFO(pc)->roi_y = y;
-               EVAS_INFO(pc)->roi_w = width;
-               EVAS_INFO(pc)->roi_h = height;
-               EVAS_INFO(pc)->update_needed = TRUE;
        }
-#endif
+
        wl_win.win_roi_x = x;
        wl_win.win_roi_y = y;
        wl_win.win_roi_width = width;
@@ -3348,9 +3345,17 @@ int player_set_display_roi_area(player_h player, int x, int y, int width, int he
 
        arr_msg_len = (sizeof(wl_win_msg_type) / sizeof(int) + (sizeof(wl_win_msg_type) % sizeof(int) ? 1 : 0));
        PLAYER_SEND_MSG(api, pc, ret_buf, ret,
-                                       MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg);
+               MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg);
+
+       if (ret == PLAYER_ERROR_NONE) {
+               CALLBACK_INFO(pc)->dp_info.roi_x = x;
+               CALLBACK_INFO(pc)->dp_info.roi_y = y;
+               CALLBACK_INFO(pc)->dp_info.roi_w = width;
+               CALLBACK_INFO(pc)->dp_info.roi_h = height;
+       }
 
        g_free(ret_buf);
+
        return ret;
 }
 
@@ -3376,34 +3381,36 @@ int player_set_playback_rate(player_h player, float rate)
 int player_set_display_rotation(player_h player, player_display_rotation_e rotation)
 {
        int ret = PLAYER_ERROR_NONE;
+       int mm_ret = MM_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_ROTATION;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_set_evas_display_rotation)(void *, int) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_RANGE_ARG_CHECK(rotation, PLAYER_DISPLAY_ROTATION_NONE, PLAYER_DISPLAY_ROTATION_270);
 
        LOGD("ENTER");
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_rotation, "disp_set_evas_display_rotation");
-               ret = p_disp_set_evas_display_rotation(EVAS_HANDLE(pc), rotation);
-               if (ret != MM_ERROR_NONE)
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+               LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+               return PLAYER_ERROR_NOT_AVAILABLE;
+       }
+
+       if (display_type == MM_DISPLAY_TYPE_EVAS) {
+               mm_ret = mm_display_interface_evas_set_rotation(DP_INTERFACE(pc), rotation);
+               if (mm_ret != MM_ERROR_NONE) {
+                       LOGE("mm_display_interface_evas_set_rotation failed 0x%x", mm_ret);
                        return PLAYER_ERROR_INVALID_OPERATION;
-               else
-                       return PLAYER_ERROR_NONE;
-       } else {
-               EVAS_INFO(pc)->rotation = rotation;
-               EVAS_INFO(pc)->update_needed = TRUE;
+               }
        }
-#endif
+
        PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "rotation", (int)rotation);
+
        g_free(ret_buf);
+
        return ret;
 }
 
@@ -3414,69 +3421,62 @@ int player_get_display_rotation(player_h player, player_display_rotation_e *prot
        muse_player_api_e api = MUSE_PLAYER_API_GET_DISPLAY_ROTATION;
        char *ret_buf = NULL;
        int rotation = -1;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_get_evas_display_rotation)(void *, int *) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+       if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+               LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+               return PLAYER_ERROR_NOT_AVAILABLE;
+       }
+
        PLAYER_NULL_ARG_CHECK(protation);
 
        LOGD("ENTER");
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_rotation, "disp_get_evas_display_rotation");
-               ret = p_disp_get_evas_display_rotation(EVAS_HANDLE(pc), &rotation);
-               *protation = (player_display_rotation_e) rotation;
-               if (ret != MM_ERROR_NONE)
-                       return PLAYER_ERROR_INVALID_OPERATION;
-               else
-                       return PLAYER_ERROR_NONE;
-       }
-#endif
+
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
        if (ret == PLAYER_ERROR_NONE) {
                player_msg_get_type(rotation, ret_buf, INT);
                *protation = rotation;
        }
 
        g_free(ret_buf);
+
        return ret;
 }
 
 int player_set_display_visible(player_h player, bool visible)
 {
        int ret = PLAYER_ERROR_NONE;
+       int mm_ret = MM_ERROR_NONE;
        player_cli_s *pc = (player_cli_s *)player;
        muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_VISIBLE;
        char *ret_buf = NULL;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-#endif
+       mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
 
        PLAYER_INSTANCE_CHECK(player);
 
        LOGD("ENTER");
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
-               ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), visible);
-               if (ret != MM_ERROR_NONE)
-                       return PLAYER_ERROR_INVALID_OPERATION;
+       PLAYER_GET_DISPLAY_TYPE(pc, display_type);
 
-               EVAS_INFO(pc)->visible = visible ? EVAS_VISIBLE_TRUE : EVAS_VISIBLE_FALSE;
-               return PLAYER_ERROR_NONE;
-       } else {
-               EVAS_INFO(pc)->visible = visible ? EVAS_VISIBLE_TRUE : EVAS_VISIBLE_FALSE;
-               EVAS_INFO(pc)->update_needed = TRUE;
+       if (display_type == MM_DISPLAY_TYPE_EVAS) {
+               mm_ret = mm_display_interface_evas_set_visible(DP_INTERFACE(pc), visible);
+               if (mm_ret != MM_ERROR_NONE) {
+                       LOGE("mm_display_interface_evas_set_visible failed 0x%x", mm_ret);
+                       return PLAYER_ERROR_INVALID_OPERATION;
+               }
        }
-#endif
 
        PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "visible", (int)visible);
+
        g_free(ret_buf);
+
+       if (ret == PLAYER_ERROR_NONE)
+               CALLBACK_INFO(pc)->dp_info.visible = visible ? PLAYER_VISIBLE_INFO_TRUE : PLAYER_VISIBLE_INFO_FALSE;
+
        return ret;
 }
 
@@ -3487,33 +3487,14 @@ int player_is_display_visible(player_h player, bool *pvisible)
        muse_player_api_e api = MUSE_PLAYER_API_IS_DISPLAY_VISIBLE;
        char *ret_buf = NULL;
        int value = -1;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       bool visible = 0;
-       int (*p_disp_get_evas_display_visible)(void *, bool *) = NULL;
-#endif
 
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(pvisible);
 
        LOGD("ENTER");
-       PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_visible, "disp_get_evas_display_visible");
-               ret = p_disp_get_evas_display_visible(EVAS_HANDLE(pc), &visible);
-               if (visible)
-                       *pvisible = TRUE;
-               else
-                       *pvisible = FALSE;
 
-               if (ret != MM_ERROR_NONE)
-                       return PLAYER_ERROR_INVALID_OPERATION;
-               else
-                       return PLAYER_ERROR_NONE;
-       }
-#endif
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
        if (ret == PLAYER_ERROR_NONE) {
                player_msg_get_type(value, ret_buf, INT);
 
@@ -3524,6 +3505,7 @@ int player_is_display_visible(player_h player, bool *pvisible)
        }
 
        g_free(ret_buf);
+
        return ret;
 }
 
@@ -3765,8 +3747,7 @@ EXIT:
 
        g_free(ret_buf);
 
-       if (tfd > INVALID_DEFAULT_VALUE)
-               close(tfd);
+       PLAYER_CLOSE_FD(tfd);
 
        if (CALLBACK_INFO(pc))
                pc->cb_info->tfd = INVALID_DEFAULT_VALUE;
@@ -4122,24 +4103,21 @@ int player_set_completed_cb(player_h player, player_completed_cb callback, void
        return __set_callback(MUSE_PLAYER_EVENT_TYPE_COMPLETE, player, callback, user_data);
 }
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
 static void __retrieve_buffer_cb(void *user_data)
 {
        player_cli_s *player = (player_cli_s *)user_data;
        int ret = PLAYER_ERROR_NONE;
        bool gapless = false;
-       int (*p_disp_evas_display_retrieve_all_packets)(void *, bool) = NULL;
 
-       ret = player_is_gapless((player_h)user_data, &gapless);
+       ret = player_is_gapless((player_h)player, &gapless);
        if (ret != PLAYER_ERROR_NONE) {
                LOGW("player_is_gapless is failed");
                return;
        }
 
-       PLAYER_DISP_DLSYM(player->dl_handle, p_disp_evas_display_retrieve_all_packets, "disp_evas_display_retrieve_all_packets");
-       ret = p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(player), gapless);
-       if (ret != PLAYER_ERROR_NONE)
-               LOGI("mm_evas_renderer_retrieve_all_packets returned error");
+       ret = mm_display_interface_evas_flush(DP_INTERFACE(player), gapless);
+
+       LOGW("flush all packet : 0x%x [gapless %d]", ret, gapless);
 }
 
 static int __player_set_retrieve_buffer_cb(player_h player, player_retrieve_buffer_cb callback, void *user_data)
@@ -4151,7 +4129,6 @@ static int __player_unset_retrieve_buffer_cb(player_h player)
 {
        return __unset_callback(MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER, player);
 }
-#endif
 
 int player_unset_completed_cb(player_h player)
 {
@@ -4388,22 +4365,22 @@ int player_push_media_stream(player_h player, media_packet_h packet)
 
        LOGD("ENTER");
 
-       if(media_packet_get_buffer_data_ptr(packet, (void **)&buf) != MEDIA_PACKET_ERROR_NONE) {
+       if (media_packet_get_buffer_data_ptr(packet, (void **)&buf) != MEDIA_PACKET_ERROR_NONE) {
                LOGE("failed to get buffer data ptr");
                return PLAYER_ERROR_INVALID_OPERATION;
        }
 
-       if(media_packet_get_buffer_size(packet, &push_media.size) != MEDIA_PACKET_ERROR_NONE) {
+       if (media_packet_get_buffer_size(packet, &push_media.size) != MEDIA_PACKET_ERROR_NONE) {
                LOGE("failed to get buffer size");
                return PLAYER_ERROR_INVALID_OPERATION;
        }
 
-       if(media_packet_get_pts(packet, &push_media.pts) != MEDIA_PACKET_ERROR_NONE) {
+       if (media_packet_get_pts(packet, &push_media.pts) != MEDIA_PACKET_ERROR_NONE) {
                LOGE("failed to get buffer pts");
                return PLAYER_ERROR_INVALID_OPERATION;
        }
 
-       if(media_packet_get_format(packet, &format) != MEDIA_PACKET_ERROR_NONE) {   /* format ref count is increased */
+       if (media_packet_get_format(packet, &format) != MEDIA_PACKET_ERROR_NONE) {   /* format ref count is increased */
                LOGE("failed to get media format");
                return PLAYER_ERROR_INVALID_OPERATION;
        }
@@ -4413,9 +4390,11 @@ int player_push_media_stream(player_h player, media_packet_h packet)
        packet_ret |= media_packet_is_audio(packet, &is_audio);
        packet_ret |= media_packet_is_end_of_stream(packet, &is_eos);
        if (is_video)
-               packet_ret |= media_format_get_video_info(format, &push_media.mimetype, &push_media.width, &push_media.height, NULL, NULL);
+               packet_ret |= media_format_get_video_info(format, &push_media.mimetype,
+                                                       &push_media.width, &push_media.height, NULL, NULL);
        else if (is_audio)
-               packet_ret |= media_format_get_audio_info(format, &push_media.mimetype, NULL, NULL, NULL, NULL);
+               packet_ret |= media_format_get_audio_info(format, &push_media.mimetype,
+                                                       &push_media.channels, &push_media.samplerate, NULL, NULL);
 
        media_format_unref(format);
 
@@ -4488,8 +4467,8 @@ int player_push_media_stream(player_h player, media_packet_h packet)
 
 #ifdef __UN_USED
 ERROR:
-       if (tfd > INVALID_DEFAULT_VALUE)
-               close(tfd);
+
+       PLAYER_CLOSE_FD(tfd);
 
        if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM)
                tbm_bo_unref(bo);
@@ -4902,18 +4881,13 @@ int player_set_audio_only(player_h player, bool audio_only)
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               pc->is_audio_only = (gboolean)audio_only;
-               return PLAYER_ERROR_NONE;
-       }
-#endif
        PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "audio_only", (int)audio_only);
+
        g_free(ret_buf);
 
        LOGD("LEAVE 0x%X", ret);
-       return ret;
 
+       return ret;
 }
 
 int player_is_audio_only(player_h player, bool *paudio_only)
@@ -4928,21 +4902,18 @@ int player_is_audio_only(player_h player, bool *paudio_only)
        PLAYER_NULL_ARG_CHECK(paudio_only);
 
        LOGD("ENTER");
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (EVAS_HANDLE(pc)) {
-               *paudio_only = (bool)pc->is_audio_only;
-               return PLAYER_ERROR_NONE;
-       }
-#endif
 
        PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
        if (ret == PLAYER_ERROR_NONE) {
                player_msg_get(audio_only, ret_buf);
                *paudio_only = (bool)audio_only;
        }
+
        g_free(ret_buf);
 
        LOGD("LEAVE 0x%X", ret);
+
        return ret;
 }
 
@@ -5510,3 +5481,50 @@ int player_audio_offload_is_activated(player_h player, bool *activated)
        g_free(ret_buf);
        return ret;
 }
+
+int player_set_audio_codec_type(player_h player, player_codec_type_e codec_type)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_RANGE_ARG_CHECK(codec_type, PLAYER_CODEC_TYPE_HW, PLAYER_CODEC_TYPE_SW);
+
+       int ret = PLAYER_ERROR_NONE;
+       muse_player_api_e api = MUSE_PLAYER_API_SET_CODEC_TYPE;
+       player_cli_s *pc = (player_cli_s *)player;
+       char *ret_buf = NULL;
+
+       LOGD("ENTER codec: %d", codec_type);
+
+       PLAYER_SEND_MSG(api, pc, ret_buf, ret,
+                       MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_AUDIO,
+                       MUSE_TYPE_INT, "codec_type", codec_type);
+
+       g_free(ret_buf);
+       LOGD("LEAVE");
+       return ret;
+
+}
+
+int player_get_audio_codec_type(player_h player, player_codec_type_e *codec_type)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(codec_type);
+
+       int ret = PLAYER_ERROR_NONE;
+       muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_TYPE;
+       player_cli_s *pc = (player_cli_s *)player;
+       char *ret_buf = NULL;
+       int type = 0;
+
+       LOGD("ENTER");
+
+       PLAYER_SEND_MSG(api, pc, ret_buf, ret,
+                       MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_AUDIO);
+       if (ret == PLAYER_ERROR_NONE) {
+               player_msg_get(type, ret_buf);
+               *codec_type = type;
+       }
+
+       g_free(ret_buf);
+       LOGD("LEAVE codec: %d", *codec_type);
+       return ret;
+}