Add private function of set application pid 86/48186/3 accepted/tizen/mobile/20150918.024630 accepted/tizen/tv/20150918.024649 accepted/tizen/wearable/20150918.024704 submit/tizen/20150917.021316 submit/tizen/20150917.064134
authorHyongtaek Lim <hyongtaek.lim@samsung.com>
Tue, 15 Sep 2015 23:46:57 +0000 (08:46 +0900)
committerHyongtaek Lim <hyongtaek.lim@samsung.com>
Wed, 16 Sep 2015 04:40:47 +0000 (13:40 +0900)
Signed-off-by: Hyongtaek Lim <hyongtaek.lim@samsung.com>
Change-Id: I564d7a21d6df39188a6c62157f76ac37320ba688

CMakeLists.txt
include/player_private.h
src/player_internal.c
src/player_priv.c [new file with mode: 0644]

index faacc27..aed3bce 100644 (file)
@@ -52,7 +52,7 @@ ENDIF(TIZEN_MOBILE)
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 
 #aux_source_directory(src SOURCES)
-SET(SOURCES src/player.c src/player_internal.c)
+SET(SOURCES src/player.c src/player_internal.c src/player_priv.c)
 
 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
 
index d83991d..f4c247e 100644 (file)
@@ -133,6 +133,7 @@ typedef struct _player_s{
 
 int __player_convert_error_code(int code, char* func_name);
 bool __player_state_validate(player_s * handle, player_state_e threshold);
+int player_sound_register(player_h player, int pid);
 
 /**
  * @brief Called when the video sink bin is crated.
index 2eb7e36..bef6e82 100644 (file)
@@ -22,7 +22,6 @@
 #include <mm.h>
 #include <mm_player.h>
 #include <mm_player_internal.h>
-#include <mm_player_mused.h>
 #include <mm_types.h>
 #include <player.h>
 #include <player_internal.h>
@@ -98,352 +97,3 @@ int player_set_pcm_spec(player_h player, const char *format, int samplerate, int
 
        return PLAYER_ERROR_NONE;
 }
-
-/*
-* Internal Implementation for mused
-*/
-int player_set_shm_stream_path_for_mused (player_h player, const char *stream_path)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(stream_path);
-
-       player_s * handle = (player_s *) player;
-
-       if(mm_player_set_shm_stream_path(handle->mm_handle, stream_path)
-                       != MM_ERROR_NONE) {
-               LOGE("Fail to set attribute stream path");
-               return PLAYER_ERROR_INVALID_OPERATION;
-       }
-       return PLAYER_ERROR_NONE;
-}
-
-static MMDisplaySurfaceType __player_mused_convet_display_type(player_display_type_e type)
-{
-       switch(type) {
-       case PLAYER_DISPLAY_TYPE_OVERLAY:
-               return MM_DISPLAY_SURFACE_REMOTE;
-#ifdef TIZEN_MOBILE
-       case PLAYER_DISPLAY_TYPE_EVAS:
-               return MM_DISPLAY_SURFACE_REMOTE;
-#endif
-       case PLAYER_DISPLAY_TYPE_NONE:
-               return MM_DISPLAY_SURFACE_NULL;
-       default :
-               return MM_DISPLAY_SURFACE_NULL;
-       }
-}
-
-
-#ifdef HAVE_WAYLAND
-int player_set_display_wl_for_mused(player_h player, player_display_type_e type, intptr_t surface,
-               int x, int y, int w, int h)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       player_s * handle = (player_s *) player;
-       void *set_handle = NULL;
-       MMDisplaySurfaceType mmType = __player_mused_convet_display_type(type);
-       MMDisplaySurfaceType mmClientType = MM_DISPLAY_SURFACE_NULL;
-
-       int ret;
-       if (!__player_state_validate(handle, PLAYER_STATE_IDLE))
-       {
-               LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
-               return PLAYER_ERROR_INVALID_STATE;
-       }
-       if (handle->is_set_pixmap_cb)
-       {
-               if (handle->state < PLAYER_STATE_READY)
-               {
-                       /* just set below and go to "changing surface case" */
-                       handle->is_set_pixmap_cb = false;
-               }
-               else
-               {
-                       LOGE("[%s] pixmap callback was set, try it again after calling player_unprepare()" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION);
-                       LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION);
-                       return PLAYER_ERROR_INVALID_OPERATION;
-               }
-       }
-
-       void* temp = NULL;
-       if (type == PLAYER_DISPLAY_TYPE_NONE)
-       {
-               /* NULL surface */
-               handle->display_handle = 0;
-               handle->display_type = type;
-               set_handle = NULL;
-       }
-       else
-       {
-               /* get handle from overlay or evas surface */
-               temp = handle->display_handle;
-               if (type == PLAYER_DISPLAY_TYPE_OVERLAY)
-               {
-                       LOGI("Wayland overlay surface type");
-                       handle->display_handle = (void *)surface;
-                       set_handle = &(handle->display_handle);
-                       mmClientType = MM_DISPLAY_SURFACE_X;
-               } else if (type == PLAYER_DISPLAY_TYPE_EVAS)
-               {
-                       LOGI("Evas surface type");
-                       handle->display_handle = (void *)surface;
-                       set_handle = &(handle->display_handle);
-                       mmClientType = MM_DISPLAY_SURFACE_EVAS;
-               } else {
-                       LOGE("invalid surface type");
-                       return PLAYER_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       /* set display handle */
-       if (handle->display_type == PLAYER_DISPLAY_TYPE_NONE || type == handle->display_type) // first time or same type
-       {
-               LOGW("first time or same type");
-               ret = mm_player_set_attribute(handle->mm_handle, NULL,
-                       "display_surface_type", mmType,
-                       "display_surface_client_type", mmClientType,
-                       "display_overlay", set_handle,
-                       sizeof(void *), (char*)NULL);
-
-               if (ret != MM_ERROR_NONE)
-               {
-                       handle->display_handle = temp;
-                       LOGE("[%s] Failed to display surface change :%d",__FUNCTION__,ret);
-               }
-               else
-               {
-                       if (type != PLAYER_DISPLAY_TYPE_NONE)
-                       {
-                               handle->display_type = type;
-                               LOGI("[%s] video display has been changed- type :%d, addr : 0x%x",
-                                       __FUNCTION__,handle->display_type, handle->display_handle);
-                       }
-                       else
-                               LOGI("NULL surface");
-               }
-               LOGI("get window rectangle: x(%d) y(%d) width(%d) height(%d)", x, y, w, h);
-               ret = mm_player_set_attribute(handle->mm_handle, NULL,
-                       "wl_window_render_x", x,
-                       "wl_window_render_y", y,
-                       "wl_window_render_width", w,
-                       "wl_window_render_height", h,
-                       (char*)NULL);
-
-               if (ret != MM_ERROR_NONE)
-               {
-                       handle->display_handle = temp;
-                       LOGE("[%s] Failed to set wl_window render rectangle :%d",__FUNCTION__,ret);
-               }
-       }
-       else //changing surface case
-       {
-               ret = mm_player_change_videosink(handle->mm_handle, mmType, set_handle);
-               if (ret != MM_ERROR_NONE)
-               {
-                       handle->display_handle = temp;
-                       if(ret == MM_ERROR_NOT_SUPPORT_API)
-                       {
-                               LOGE("[%s] change video sink is not available.",__FUNCTION__);
-                               ret = PLAYER_ERROR_NONE;
-                       }
-                       else
-                       {
-                               LOGE("[%s] Failed to display surface change :%d",__FUNCTION__,ret);
-                       }
-               }
-               else
-               {
-                       handle->display_type = type;
-                       LOGI("[%s] video display has been changed- type :%d, addr : 0x%x",
-                               __FUNCTION__,handle->display_type, handle->display_handle);
-               }
-       }
-
-       if(ret != MM_ERROR_NONE)
-       {
-               handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
-               return __player_convert_error_code(ret,(char*)__FUNCTION__);
-       }
-       else
-       {
-               return PLAYER_ERROR_NONE;
-       }
-}
-
-#else
-
-int player_set_display_for_mused(player_h player, player_display_type_e type, unsigned int xhandle)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       player_s * handle = (player_s *) player;
-       void *set_handle = NULL;
-       MMDisplaySurfaceType mmType = __player_mused_convet_display_type(type);
-
-       int ret;
-       if (!__player_state_validate(handle, PLAYER_STATE_IDLE))
-       {
-               LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
-               return PLAYER_ERROR_INVALID_STATE;
-       }
-
-       if (handle->is_set_pixmap_cb)
-       {
-               if (handle->state < PLAYER_STATE_READY)
-               {
-                       /* just set below and go to "changing surface case" */
-                       handle->is_set_pixmap_cb = false;
-               }
-               else
-               {
-                       LOGE("[%s] pixmap callback was set, try it again after calling player_unprepare()" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION);
-                       LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION);
-                       return PLAYER_ERROR_INVALID_OPERATION;
-               }
-       }
-
-       void* temp = NULL;
-       if (type == PLAYER_DISPLAY_TYPE_NONE)
-       {
-               /* NULL surface */
-               handle->display_handle = 0;
-               handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
-               set_handle = NULL;
-       }
-       else
-       {
-               /* get handle from overlay or evas surface */
-               temp = handle->display_handle;
-               if (type == PLAYER_DISPLAY_TYPE_OVERLAY /*&& !strcmp(object_type, "elm_win")*/)
-               {
-                       /* x window overlay surface */
-                       LOGI("overlay surface type");
-                       handle->display_handle = (void *)xhandle;
-                       set_handle = &(handle->display_handle);
-               }
-               else
-               {
-                       LOGE("invalid surface type");
-                       return PLAYER_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       /* set display handle */
-       if (handle->display_type == PLAYER_DISPLAY_TYPE_NONE || type == handle->display_type) // first time or same type
-       {
-               ret = mm_player_set_attribute(handle->mm_handle, NULL,
-                       "display_surface_type", mmType,
-                       "display_overlay", set_handle,
-                       sizeof(xhandle), (char*)NULL);
-
-               if (ret != MM_ERROR_NONE)
-               {
-                       handle->display_handle = temp;
-                       LOGE("[%s] Failed to display surface change :%d",__FUNCTION__,ret);
-               }
-               else
-               {
-                       if (type != PLAYER_DISPLAY_TYPE_NONE)
-                       {
-                               handle->display_type = type;
-                               LOGI("[%s] video display has been changed- type :%d, addr : 0x%x",
-                                       __FUNCTION__,handle->display_type, handle->display_handle);
-                       }
-                       else
-                               LOGI("NULL surface");
-               }
-       }
-       else //changing surface case
-       {
-               ret = mm_player_change_videosink(handle->mm_handle, mmType, set_handle);
-               if (ret != MM_ERROR_NONE)
-               {
-                       handle->display_handle = temp;
-                       if(ret == MM_ERROR_NOT_SUPPORT_API)
-                       {
-                               LOGE("[%s] change video sink is not available.",__FUNCTION__);
-                               ret = PLAYER_ERROR_NONE;
-                       }
-                       else
-                       {
-                               LOGE("[%s] Failed to display surface change :%d",__FUNCTION__,ret);
-                       }
-               }
-               else
-               {
-                       handle->display_type = type;
-                       LOGI("[%s] video display has been changed- type :%d, addr : 0x%x",
-                               __FUNCTION__,handle->display_type, handle->display_handle);
-               }
-       }
-
-       if(ret != MM_ERROR_NONE)
-       {
-               handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
-               return __player_convert_error_code(ret,(char*)__FUNCTION__);
-       }
-       else
-       {
-               return PLAYER_ERROR_NONE;
-       }
-}
-#endif
-
-int player_set_audio_policy_info_for_mused(player_h player,
-       char *stream_type, int stream_index)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       player_s * handle = (player_s *) player;
-       int ret;
-
-       PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-
-       ret = mm_player_set_attribute(handle->mm_handle, NULL,
-                       "sound_stream_type", stream_type, strlen(stream_type),
-                       "sound_stream_index", stream_index,
-                       NULL);
-
-       if(ret != MM_ERROR_NONE)
-               return __player_convert_error_code(ret,(char*)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
-}
-
-int player_get_raw_video_caps(player_h player, char **caps)
-{
-       int ret;
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(caps);
-       player_s * handle = (player_s *) player;
-
-       ret = mm_player_get_raw_video_caps(handle->mm_handle, caps);
-       if(ret != MM_ERROR_NONE) {
-               return __player_convert_error_code(ret,(char*)__FUNCTION__);
-       }
-
-       return PLAYER_ERROR_NONE;
-}
-
-int player_set_video_bin_created_cb(player_h player, player_video_bin_created_cb callback, void *user_data)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(callback);
-       int type = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
-
-       player_s * handle = (player_s *) player;
-       handle->user_cb[type] = callback;
-       handle->user_data[type] = user_data;
-       LOGI("[%s] Event type : %d ",__FUNCTION__, type);
-       return PLAYER_ERROR_NONE;
-}
-
-int player_unset_video_bin_created_cb(player_h player)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       player_s * handle = (player_s *) player;
-       int type = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
-
-       handle->user_cb[type] = NULL;
-       handle->user_data[type] = NULL;
-       LOGI("[%s] Event type : %d ",__FUNCTION__, type);
-       return PLAYER_ERROR_NONE;
-}
diff --git a/src/player_priv.c b/src/player_priv.c
new file mode 100644 (file)
index 0000000..ef66767
--- /dev/null
@@ -0,0 +1,393 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dlog.h>
+
+#include <mm.h>
+#include <mm_player.h>
+#include <mm_player_internal.h>
+#include <mm_player_mused.h>
+#include <mm_types.h>
+#include <player.h>
+#include <player_internal.h>
+#include <player_private.h>
+
+/*
+* Implementation for mused
+*/
+int player_set_shm_stream_path_for_mused (player_h player, const char *stream_path)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(stream_path);
+
+       player_s * handle = (player_s *) player;
+
+       if(mm_player_set_shm_stream_path(handle->mm_handle, stream_path)
+                       != MM_ERROR_NONE) {
+               LOGE("Fail to set attribute stream path");
+               return PLAYER_ERROR_INVALID_OPERATION;
+       }
+       return PLAYER_ERROR_NONE;
+}
+
+static MMDisplaySurfaceType __player_mused_convet_display_type(player_display_type_e type)
+{
+       switch(type) {
+       case PLAYER_DISPLAY_TYPE_OVERLAY:
+               return MM_DISPLAY_SURFACE_REMOTE;
+#ifdef TIZEN_MOBILE
+       case PLAYER_DISPLAY_TYPE_EVAS:
+               return MM_DISPLAY_SURFACE_REMOTE;
+#endif
+       case PLAYER_DISPLAY_TYPE_NONE:
+               return MM_DISPLAY_SURFACE_NULL;
+       default :
+               return MM_DISPLAY_SURFACE_NULL;
+       }
+}
+
+
+#ifdef HAVE_WAYLAND
+int player_set_display_wl_for_mused(player_h player, player_display_type_e type, intptr_t surface,
+               int x, int y, int w, int h)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       player_s * handle = (player_s *) player;
+       void *set_handle = NULL;
+       MMDisplaySurfaceType mmType = __player_mused_convet_display_type(type);
+       MMDisplaySurfaceType mmClientType = MM_DISPLAY_SURFACE_NULL;
+
+       int ret;
+       if (!__player_state_validate(handle, PLAYER_STATE_IDLE))
+       {
+               LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
+               return PLAYER_ERROR_INVALID_STATE;
+       }
+       if (handle->is_set_pixmap_cb)
+       {
+               if (handle->state < PLAYER_STATE_READY)
+               {
+                       /* just set below and go to "changing surface case" */
+                       handle->is_set_pixmap_cb = false;
+               }
+               else
+               {
+                       LOGE("[%s] pixmap callback was set, try it again after calling player_unprepare()" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION);
+                       LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION);
+                       return PLAYER_ERROR_INVALID_OPERATION;
+               }
+       }
+
+       void* temp = NULL;
+       if (type == PLAYER_DISPLAY_TYPE_NONE)
+       {
+               /* NULL surface */
+               handle->display_handle = 0;
+               handle->display_type = type;
+               set_handle = NULL;
+       }
+       else
+       {
+               /* get handle from overlay or evas surface */
+               temp = handle->display_handle;
+               if (type == PLAYER_DISPLAY_TYPE_OVERLAY)
+               {
+                       LOGI("Wayland overlay surface type");
+                       handle->display_handle = (void *)surface;
+                       set_handle = &(handle->display_handle);
+                       mmClientType = MM_DISPLAY_SURFACE_X;
+               } else if (type == PLAYER_DISPLAY_TYPE_EVAS)
+               {
+                       LOGI("Evas surface type");
+                       handle->display_handle = (void *)surface;
+                       set_handle = &(handle->display_handle);
+                       mmClientType = MM_DISPLAY_SURFACE_EVAS;
+               } else {
+                       LOGE("invalid surface type");
+                       return PLAYER_ERROR_INVALID_PARAMETER;
+               }
+       }
+
+       /* set display handle */
+       if (handle->display_type == PLAYER_DISPLAY_TYPE_NONE || type == handle->display_type) // first time or same type
+       {
+               LOGW("first time or same type");
+               ret = mm_player_set_attribute(handle->mm_handle, NULL,
+                       "display_surface_type", mmType,
+                       "display_surface_client_type", mmClientType,
+                       "display_overlay", set_handle,
+                       sizeof(void *), (char*)NULL);
+
+               if (ret != MM_ERROR_NONE)
+               {
+                       handle->display_handle = temp;
+                       LOGE("[%s] Failed to display surface change :%d",__FUNCTION__,ret);
+               }
+               else
+               {
+                       if (type != PLAYER_DISPLAY_TYPE_NONE)
+                       {
+                               handle->display_type = type;
+                               LOGI("[%s] video display has been changed- type :%d, addr : 0x%x",
+                                       __FUNCTION__,handle->display_type, handle->display_handle);
+                       }
+                       else
+                               LOGI("NULL surface");
+               }
+               LOGI("get window rectangle: x(%d) y(%d) width(%d) height(%d)", x, y, w, h);
+               ret = mm_player_set_attribute(handle->mm_handle, NULL,
+                       "wl_window_render_x", x,
+                       "wl_window_render_y", y,
+                       "wl_window_render_width", w,
+                       "wl_window_render_height", h,
+                       (char*)NULL);
+
+               if (ret != MM_ERROR_NONE)
+               {
+                       handle->display_handle = temp;
+                       LOGE("[%s] Failed to set wl_window render rectangle :%d",__FUNCTION__,ret);
+               }
+       }
+       else //changing surface case
+       {
+               ret = mm_player_change_videosink(handle->mm_handle, mmType, set_handle);
+               if (ret != MM_ERROR_NONE)
+               {
+                       handle->display_handle = temp;
+                       if(ret == MM_ERROR_NOT_SUPPORT_API)
+                       {
+                               LOGE("[%s] change video sink is not available.",__FUNCTION__);
+                               ret = PLAYER_ERROR_NONE;
+                       }
+                       else
+                       {
+                               LOGE("[%s] Failed to display surface change :%d",__FUNCTION__,ret);
+                       }
+               }
+               else
+               {
+                       handle->display_type = type;
+                       LOGI("[%s] video display has been changed- type :%d, addr : 0x%x",
+                               __FUNCTION__,handle->display_type, handle->display_handle);
+               }
+       }
+
+       if(ret != MM_ERROR_NONE)
+       {
+               handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
+               return __player_convert_error_code(ret,(char*)__FUNCTION__);
+       }
+       else
+       {
+               return PLAYER_ERROR_NONE;
+       }
+}
+
+#else
+
+int player_set_display_for_mused(player_h player, player_display_type_e type, unsigned int xhandle)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       player_s * handle = (player_s *) player;
+       void *set_handle = NULL;
+       MMDisplaySurfaceType mmType = __player_mused_convet_display_type(type);
+
+       int ret;
+       if (!__player_state_validate(handle, PLAYER_STATE_IDLE))
+       {
+               LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
+               return PLAYER_ERROR_INVALID_STATE;
+       }
+
+       if (handle->is_set_pixmap_cb)
+       {
+               if (handle->state < PLAYER_STATE_READY)
+               {
+                       /* just set below and go to "changing surface case" */
+                       handle->is_set_pixmap_cb = false;
+               }
+               else
+               {
+                       LOGE("[%s] pixmap callback was set, try it again after calling player_unprepare()" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION);
+                       LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION);
+                       return PLAYER_ERROR_INVALID_OPERATION;
+               }
+       }
+
+       void* temp = NULL;
+       if (type == PLAYER_DISPLAY_TYPE_NONE)
+       {
+               /* NULL surface */
+               handle->display_handle = 0;
+               handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
+               set_handle = NULL;
+       }
+       else
+       {
+               /* get handle from overlay or evas surface */
+               temp = handle->display_handle;
+               if (type == PLAYER_DISPLAY_TYPE_OVERLAY /*&& !strcmp(object_type, "elm_win")*/)
+               {
+                       /* x window overlay surface */
+                       LOGI("overlay surface type");
+                       handle->display_handle = (void *)xhandle;
+                       set_handle = &(handle->display_handle);
+               }
+               else
+               {
+                       LOGE("invalid surface type");
+                       return PLAYER_ERROR_INVALID_PARAMETER;
+               }
+       }
+
+       /* set display handle */
+       if (handle->display_type == PLAYER_DISPLAY_TYPE_NONE || type == handle->display_type) // first time or same type
+       {
+               ret = mm_player_set_attribute(handle->mm_handle, NULL,
+                       "display_surface_type", mmType,
+                       "display_overlay", set_handle,
+                       sizeof(xhandle), (char*)NULL);
+
+               if (ret != MM_ERROR_NONE)
+               {
+                       handle->display_handle = temp;
+                       LOGE("[%s] Failed to display surface change :%d",__FUNCTION__,ret);
+               }
+               else
+               {
+                       if (type != PLAYER_DISPLAY_TYPE_NONE)
+                       {
+                               handle->display_type = type;
+                               LOGI("[%s] video display has been changed- type :%d, addr : 0x%x",
+                                       __FUNCTION__,handle->display_type, handle->display_handle);
+                       }
+                       else
+                               LOGI("NULL surface");
+               }
+       }
+       else //changing surface case
+       {
+               ret = mm_player_change_videosink(handle->mm_handle, mmType, set_handle);
+               if (ret != MM_ERROR_NONE)
+               {
+                       handle->display_handle = temp;
+                       if(ret == MM_ERROR_NOT_SUPPORT_API)
+                       {
+                               LOGE("[%s] change video sink is not available.",__FUNCTION__);
+                               ret = PLAYER_ERROR_NONE;
+                       }
+                       else
+                       {
+                               LOGE("[%s] Failed to display surface change :%d",__FUNCTION__,ret);
+                       }
+               }
+               else
+               {
+                       handle->display_type = type;
+                       LOGI("[%s] video display has been changed- type :%d, addr : 0x%x",
+                               __FUNCTION__,handle->display_type, handle->display_handle);
+               }
+       }
+
+       if(ret != MM_ERROR_NONE)
+       {
+               handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
+               return __player_convert_error_code(ret,(char*)__FUNCTION__);
+       }
+       else
+       {
+               return PLAYER_ERROR_NONE;
+       }
+}
+#endif
+
+int player_set_audio_policy_info_for_mused(player_h player,
+       char *stream_type, int stream_index)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       player_s * handle = (player_s *) player;
+       int ret;
+
+       PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
+
+       ret = mm_player_set_attribute(handle->mm_handle, NULL,
+                       "sound_stream_type", stream_type, strlen(stream_type),
+                       "sound_stream_index", stream_index,
+                       NULL);
+
+       if(ret != MM_ERROR_NONE)
+               return __player_convert_error_code(ret,(char*)__FUNCTION__);
+       else
+               return PLAYER_ERROR_NONE;
+}
+
+int player_get_raw_video_caps(player_h player, char **caps)
+{
+       int ret;
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(caps);
+       player_s * handle = (player_s *) player;
+
+       ret = mm_player_get_raw_video_caps(handle->mm_handle, caps);
+       if(ret != MM_ERROR_NONE) {
+               return __player_convert_error_code(ret,(char*)__FUNCTION__);
+       }
+
+       return PLAYER_ERROR_NONE;
+}
+
+int player_set_video_bin_created_cb(player_h player, player_video_bin_created_cb callback, void *user_data)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(callback);
+       int type = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
+
+       player_s * handle = (player_s *) player;
+       handle->user_cb[type] = callback;
+       handle->user_data[type] = user_data;
+       LOGI("[%s] Event type : %d ",__FUNCTION__, type);
+       return PLAYER_ERROR_NONE;
+}
+
+int player_unset_video_bin_created_cb(player_h player)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       player_s * handle = (player_s *) player;
+       int type = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
+
+       handle->user_cb[type] = NULL;
+       handle->user_data[type] = NULL;
+       LOGI("[%s] Event type : %d ",__FUNCTION__, type);
+       return PLAYER_ERROR_NONE;
+}
+
+int player_sound_register(player_h player, int pid)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       player_s * handle = (player_s *) player;
+       int ret;
+
+       PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
+
+       ret = mm_player_sound_register(handle->mm_handle, pid);
+       if(ret != MM_ERROR_NONE)
+               return __player_convert_error_code(ret,(char*)__FUNCTION__);
+
+       return PLAYER_ERROR_NONE;
+}