+++ /dev/null
-/*
-* 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 <glib.h>
-#include <string.h>
-#include <dlog.h>
-#include <mm_error.h>
-#include <mm_types.h>
-#include <mm_debug.h>
-#include <media_packet.h>
-#include <Evas.h>
-#include <Ecore_Evas.h>
-#include <Ecore_Wl2.h>
-#include <tizen-extension-client-protocol.h>
-#include "player_display.h"
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
-#include <mm_evas_renderer.h>
-#endif
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_PLAYER"
-
-typedef enum {
- ELM_WAYLAND_WIN = 1,
- ECORE_WAYLAND_WIN
-} wl_window_type;
-
-typedef enum {
- DISP_EVAS_VISIBLE_NONE, /* if user dont set visibility, it will be changed to true */
- DISP_EVAS_VISIBLE_TRUE,
- DISP_EVAS_VISIBLE_FALSE
-} evas_visible_info_e;
-
-typedef struct {
- struct wl_display *display;
- struct wl_registry *registry;
- struct tizen_surface *tz_surface;
- struct tizen_resource *tz_resource;
-} wl_client;
-
-static int _wl_client_create(wl_client **wlclient);
-static int _wl_client_get_wl_window_wl_surface_id(wl_client *wlclient, struct wl_surface *surface, struct wl_display *display);
-static void _wl_client_finalize(wl_client *wlclient);
-
-
-/*elm wayland window use display and ecore wayland window use ecore_win */
-int disp_set_wl_display(int wl_win_type, void *win)
-{
- Evas_Object *obj = NULL;
- const char *object_type = NULL;
- struct wl_surface *wl_surface;
- struct wl_display *wl_display;
- Ecore_Wl2_Window *wl_window = NULL;
- Ecore_Evas *ee = NULL;
- Ecore_Wl2_Display *e_wl2_display = NULL;
- int wl_surface_id = 0;
- Evas *e;
- wl_client *wlclient;
- int ret = 0;
-
- /* get wl_window */
- if (wl_win_type == ELM_WAYLAND_WIN) {
- /* elm win */
- obj = (Evas_Object *)win;
- object_type = evas_object_type_get(obj);
- return_val_if_fail(object_type != NULL, FALSE);
-
- if (!strcmp(object_type, "elm_win")) {
- e = evas_object_evas_get(obj);
- return_val_if_fail(e != NULL, FALSE);
-
- ee = ecore_evas_ecore_evas_get(e);
- return_val_if_fail(ee != NULL, FALSE);
-
- wl_window = ecore_evas_wayland2_window_get(ee);
- return_val_if_fail(wl_window != NULL, FALSE);
- LOGI("ELM Wayland overlay surface type");
-
- } else {
- return 0;
- }
- } else if (wl_win_type == ECORE_WAYLAND_WIN) {
- /* ecore win */
- wl_window = (Ecore_Wl2_Window *)win;
- LOGD("Ecore Wayland Window handle(%p)", wl_window);
- LOGI("ECORE Wayland overlay surface type");
- } else {
- return 0;
- }
-
-
- /* Need to let wayland-server know that video is rendered in this wl_window
- so that wayland-server sets alpha in this wl_window */
- ecore_wl2_window_video_has(wl_window, EINA_TRUE);
-
- /* get wl_surface */
- wl_surface = (struct wl_surface *)ecore_wl2_window_surface_get(wl_window);
- return_val_if_fail(wl_surface != NULL, FALSE);
-
- /* get wl_display */
- e_wl2_display = ecore_wl2_connected_display_get(NULL);
- return_val_if_fail(e_wl2_display != NULL, FALSE);
- wl_display = (struct wl_display *)ecore_wl2_display_get(e_wl2_display);
- return_val_if_fail(wl_display != NULL, FALSE);
- LOGD("surface = %p, wl_display = %p", wl_surface, wl_display);
-
- ret = _wl_client_create(&wlclient);
- if (ret != MM_ERROR_NONE) {
- LOGE("Wayland client create failure");
- return ret;
- }
-
- /* get wl_surface_id */
- wl_surface_id = _wl_client_get_wl_window_wl_surface_id(wlclient, wl_surface, wl_display);
- LOGD("wl_surface_id = %d", wl_surface_id);
- /* need to free always */
- g_free(wlclient);
-
- return_val_if_fail(wl_surface_id > 0, FALSE);
-
- return wl_surface_id;
-}
-
-void disp_get_evas_display_geometry_info(void *display, int *x, int *y, int *width, int *height)
-{
- Evas_Object *obj = NULL;
- return_if_fail(display != NULL)
- int e_x = 0, e_y = 0, e_w = 0, e_h = 0;
- obj = (Evas_Object *)display;
- evas_object_geometry_get(obj, &e_x, &e_y, &e_w, &e_h);
- *x = e_x;
- *y = e_y;
- *width = e_w;
- *height = e_h;
-}
-
-int disp_evas_display_retrieve_all_packets(MMHandleType evas_handle, bool keep_screen)
-{
- int ret = MM_ERROR_NONE;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- ret = mm_evas_renderer_retrieve_all_packets(evas_handle, keep_screen);
- return ret;
-}
-
-
-int disp_get_evas_display_rotation(MMHandleType evas_handle, int *p_rotate)
-{
- int ret = MM_ERROR_NONE;
- int rotate = -1;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- ret = mm_evas_renderer_get_rotation(evas_handle, &rotate);
- *p_rotate = rotate;
- return ret;
-}
-
-int disp_set_evas_display_rotation(MMHandleType evas_handle, int rotate)
-{
- int ret = MM_ERROR_NONE;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- ret = mm_evas_renderer_set_rotation(evas_handle, rotate);
- return ret;
-}
-
-int disp_get_evas_display_disp_mode(MMHandleType evas_handle, int *p_mode)
-{
- int ret = MM_ERROR_NONE;
- int mode = -1;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- ret = mm_evas_renderer_get_geometry(evas_handle, &mode);
- *p_mode = mode;
-
- return ret;
-}
-
-int disp_set_evas_display_disp_mode(MMHandleType evas_handle, int mode)
-{
- int ret = MM_ERROR_NONE;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- ret = mm_evas_renderer_set_geometry(evas_handle, mode);
- return ret;
-}
-
-int disp_get_evas_display_visible(MMHandleType evas_handle, bool *p_visible)
-{
- int ret = MM_ERROR_NONE;
- bool visible = -1;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- ret = mm_evas_renderer_get_visible(evas_handle, &visible);
- *p_visible = visible;
- return ret;
-
-}
-
-int disp_set_evas_display_visible(MMHandleType evas_handle, bool visible)
-{
- int ret = MM_ERROR_NONE;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- ret = mm_evas_renderer_set_visible(evas_handle, visible);
- return ret;
-}
-
-
-int disp_set_evas_display_roi_area(MMHandleType evas_handle, int x, int y, int width, int height)
-{
- int ret = MM_ERROR_NONE;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- LOGW("set roi (%d, %d) %d*%d", x, y, width, height);
- ret = mm_evas_renderer_set_roi_area(evas_handle, x, y, width, height);
- return ret;
-}
-
-int disp_set_evas_display_old_info(void *display, MMHandleType evas_handle, int mode, int rotation, int visible)
-{
- int ret = MM_ERROR_NONE;
- return_val_if_fail(display != NULL, MM_ERROR_INVALID_ARGUMENT);
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- LOGW("set evas information mode %d, rotation %d, visible %d", mode, rotation, visible);
- ret = mm_evas_renderer_set_geometry(evas_handle, mode);
- ret |= mm_evas_renderer_set_rotation(evas_handle, rotation);
- /* if user didn't set visible, it will be set to true in player_start */
- if (visible != DISP_EVAS_VISIBLE_NONE)
- ret |= mm_evas_renderer_set_visible(evas_handle, (visible == DISP_EVAS_VISIBLE_TRUE) ? true : false);
-
- return ret;
-}
-int disp_destroy_evas_display(MMHandleType *evas_handle)
-{
- int ret = MM_ERROR_NONE;
- return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
-
- /* need to set display information again to new handle */
- ret = mm_evas_renderer_destroy(evas_handle);
- return ret;
-}
-int disp_create_evas_display(void *display, MMHandleType *evas_handle)
-{
- int ret = MM_ERROR_NONE;
- Evas_Object *obj = NULL;
- const char *object_type = NULL;
- return_val_if_fail(display != NULL, MM_ERROR_INVALID_ARGUMENT);
-
- obj = (Evas_Object *)display;
- return_val_if_fail(obj != NULL, MM_ERROR_INVALID_ARGUMENT);
-
- object_type = evas_object_type_get(obj);
- return_val_if_fail(object_type != NULL, MM_ERROR_INVALID_ARGUMENT);
-
- if (!strcmp(object_type, "image")) {
- LOGI("evas surface type");
- ret = mm_evas_renderer_create(evas_handle, obj);
- } else
- return MM_ERROR_UNKNOWN;
-
- return ret;
-}
-
-void disp_media_packet_video_decode_cb(media_packet_h packet, void *evas_handle)
-{
- return_if_fail(packet != NULL);
- return_if_fail(evas_handle != NULL);
- mm_evas_renderer_write(packet, evas_handle);
-}
-
-#define goto_if_fail(expr, label) \
-{ \
- if (!(expr)) { \
- debug_error(" failed [%s]\n", #expr); \
- goto label; \
- } \
-}
-
-static void handle_resource_id(void *data, struct tizen_resource *tizen_resource, uint32_t id)
-{
- *((int *)data) = (int)id;
- LOGD("[CLIENT] got wl_surface_id(%d) from server\n", id);
-}
-
-static const struct tizen_resource_listener tz_resource_listener = {
- handle_resource_id,
-};
-
-static void handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
-{
- return_if_fail(data != NULL);
- wl_client *wlclient = data;
-
- if (strcmp(interface, "tizen_surface") == 0) {
- LOGD("binding tizen_surface");
- wlclient->tz_surface = wl_registry_bind(registry, name, &tizen_surface_interface, version);
- return_if_fail(wlclient->tz_surface != NULL);
- }
-}
-
-static void handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
-{
- LOGD("Removed global object: name(%d)", name);
-}
-
-
-static const struct wl_registry_listener registry_listener = {
- handle_global,
- handle_global_remove
-};
-
-static int _wl_client_create(wl_client ** wlclient)
-{
- wl_client *ptr = NULL;
-
- ptr = g_malloc0(sizeof(wl_client));
- if (!ptr) {
- LOGE("Cannot allocate memory for wlclient\n");
- goto ERROR;
- } else {
- *wlclient = ptr;
- LOGD("Success create wlclient(%p)", *wlclient);
- }
- return MM_ERROR_NONE;
-
-ERROR:
- *wlclient = NULL;
- return MM_ERROR_PLAYER_NO_FREE_SPACE;
-}
-
-static int _wl_client_get_wl_window_wl_surface_id(wl_client *wlclient, struct wl_surface *surface, struct wl_display *display)
-{
- goto_if_fail(wlclient != NULL, failed);
- goto_if_fail(surface != NULL, failed);
- goto_if_fail(display != NULL, failed);
-
- int wl_surface_id = 0;
-
- wlclient->display = display;
- goto_if_fail(wlclient->display != NULL, failed);
-
- wlclient->registry = wl_display_get_registry(wlclient->display);
- goto_if_fail(wlclient->registry != NULL, failed);
-
- wl_registry_add_listener(wlclient->registry, ®istry_listener, wlclient);
- wl_display_dispatch(wlclient->display);
- wl_display_roundtrip(wlclient->display);
-
- /* check global objects */
- goto_if_fail(wlclient->tz_surface != NULL, failed);
-
- /* Get wl_surface_id which is unique in a entire systemw. */
- wlclient->tz_resource = tizen_surface_get_tizen_resource(wlclient->tz_surface, surface);
- goto_if_fail(wlclient->tz_resource != NULL, failed);
-
- tizen_resource_add_listener(wlclient->tz_resource, &tz_resource_listener, &wl_surface_id);
- wl_display_roundtrip(wlclient->display);
- goto_if_fail(wl_surface_id > 0, failed);
-
- _wl_client_finalize(wlclient);
-
- return wl_surface_id;
-
-failed:
- LOGE("Failed to get wl_surface_id");
-
- return 0;
-}
-
-static void _wl_client_finalize(wl_client *wlclient)
-{
- LOGD("start finalize wlclient");
- return_if_fail(wlclient != NULL)
-
- if (wlclient->tz_surface)
- tizen_surface_destroy(wlclient->tz_surface);
-
- if (wlclient->tz_resource)
- tizen_resource_destroy(wlclient->tz_resource);
-
- /* destroy registry */
- if (wlclient->registry)
- wl_registry_destroy(wlclient->registry);
-
- return;
-}
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);
/*
((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)
{
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) {
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");
- if (p_disp_set_evas_display_visible) {
- if (p_disp_set_evas_display_visible(cb_info->evas_info->handle, true) != MM_ERROR_NONE)
- LOGW("failed to set visible");
- else
- cb_info->evas_info->visible = EVAS_VISIBLE_TRUE;
- dlclose(dl_handle);
- }
- } 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);
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) {
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, int *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;
+ player_tsurf_info_s *tmp = (player_tsurf_info_s *)l->data;
if (tmp && key && (tmp->key[0] == key[0])) {
LOGD("found tsurf_data of tbm_key %d", key[0]);
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;
bo[i] = tbm_bo_import_fd(cb_info->bufmgr, recv_data->tfd[i]);
}
- tsurf_data = g_new(player_tsurf_info_t, 1);
+ tsurf_data = g_new(player_tsurf_info_s, 1);
if (!tsurf_data) {
LOGE("failed to alloc tsurf info");
goto ERROR;
__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 */
};
g_free(cb_info->buff.recvMsg);
_remove_all_ret_msg(cb_info);
g_free(cb_info->buff.part_of_msg);
+
g_free(cb_info);
}
} 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);
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);
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 ||
- p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE) {
- LOGW("fail to unset evas client");
- return PLAYER_ERROR_INVALID_OPERATION;
- }
__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);
callback_destroy(CALLBACK_INFO(pc));
}
- if (pc->dl_handle)
- PLAYER_DISP_DLCLOSE(pc->dl_handle); /* update supported_video */
-
g_free(pc);
pc = NULL;
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;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_evas_display_retrieve_all_packets)(void *, bool) = NULL;
- int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-#endif
player_state_e state = PLAYER_STATE_NONE;
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
PLAYER_INSTANCE_CHECK(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)) {
- if (EVAS_INFO(pc)->visible != EVAS_VISIBLE_FALSE) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- if (!p_disp_set_evas_display_visible ||
- p_disp_set_evas_display_visible(EVAS_HANDLE(pc), false) != MM_ERROR_NONE) {
- LOGE("mm_evas_renderer_set_visible err");
- return PLAYER_ERROR_INVALID_OPERATION;
- }
- }
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_evas_display_retrieve_all_packets, "disp_evas_display_retrieve_all_packets");
- if (!p_disp_evas_display_retrieve_all_packets ||
- p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(pc), false) != PLAYER_ERROR_NONE) {
- LOGE("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;
}
}
-#endif
+ 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;
+ }
+
+_PLAYER_UNPREPARE:
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
_player_release_internal_memory(pc, false);
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_FALSE) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- if (!p_disp_set_evas_display_visible ||
- p_disp_set_evas_display_visible(EVAS_HANDLE(pc), true) != MM_ERROR_NONE) {
- LOGE("mm_evas_renderer_set_visible err");
- 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);
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);
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_FALSE) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- if (!p_disp_set_evas_display_visible ||
- p_disp_set_evas_display_visible(EVAS_HANDLE(pc), false) != MM_ERROR_NONE) {
- LOGE("mm_evas_renderer_set_visible err");
- 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);
}
/* 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;
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_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;
}
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) {
}
}
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
+ /* check display interface handle */
+ if (!DP_INTERFACE(pc)) {
+ LOGE("display interface not supported");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
LOGD("ENTER type: %d", type);
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 ||
- p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE) {
- LOGW("fail to unset evas client");
- return PLAYER_ERROR_INVALID_OPERATION;
- }
- __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");
- if (!p_disp_set_wl_display)
- return PLAYER_ERROR_INVALID_OPERATION;
- 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_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");
- if (!p_disp_create_evas_display ||
- p_disp_create_evas_display(display, &EVAS_HANDLE(pc)) != 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);
+ }
- /* 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");
- if (!p_disp_set_evas_display_old_info ||
- p_disp_set_evas_display_old_info(display, EVAS_HANDLE(pc), EVAS_INFO(pc)->mode, EVAS_INFO(pc)->rotation, EVAS_INFO(pc)->visible) != 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");
- if (!p_disp_set_evas_display_roi_area ||
- 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) != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
- }
- EVAS_INFO(pc)->update_needed = FALSE;
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("set mm_display_interface failed");
+ return PLAYER_ERROR_INVALID_OPERATION;
}
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_media_packet_video_decode_cb, "disp_media_packet_video_decode_cb");
- if (!p_disp_media_packet_video_decode_cb ||
- player_set_media_packet_video_frame_decoded_cb(player, p_disp_media_packet_video_decode_cb, (void *)EVAS_HANDLE(pc)) != MM_ERROR_NONE) {
+ 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;
}
+
if (__player_set_retrieve_buffer_cb(player, __retrieve_buffer_cb, pc))
LOGW("fail to set __retrieve_buffer_cb");
-
- wl_win.type = conv_type;
}
-#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;
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");
- if (!p_disp_set_evas_display_disp_mode ||
- p_disp_set_evas_display_disp_mode(EVAS_HANDLE(pc), mode) != MM_ERROR_NONE)
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ 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;
}
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
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(pmode);
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_disp_mode, "disp_get_evas_display_disp_mode");
- if (!p_disp_get_evas_display_disp_mode ||
- p_disp_get_evas_display_disp_mode(EVAS_HANDLE(pc), &mode) != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
-
- *pmode = (player_display_mode_e) mode;
-
- return PLAYER_ERROR_NONE;
- }
-#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;
}
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_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;
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");
- if (!p_disp_set_evas_display_roi_area)
- return PLAYER_ERROR_INVALID_OPERATION;
- 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;
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;
}
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");
- if (!p_disp_set_evas_display_rotation ||
- p_disp_set_evas_display_rotation(EVAS_HANDLE(pc), rotation) != MM_ERROR_NONE)
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ 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;
}
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
PLAYER_INSTANCE_CHECK(player);
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");
- if (!p_disp_get_evas_display_rotation ||
- p_disp_get_evas_display_rotation(EVAS_HANDLE(pc), &rotation) != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
- *protation = (player_display_rotation_e) rotation;
-
- 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");
- if (!p_disp_set_evas_display_visible ||
- p_disp_set_evas_display_visible(EVAS_HANDLE(pc), visible) != 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;
}
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");
- if (!p_disp_get_evas_display_visible ||
- p_disp_get_evas_display_visible(EVAS_HANDLE(pc), &visible) != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
- if (visible)
- *pvisible = TRUE;
- else
- *pvisible = FALSE;
- 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);
}
g_free(ret_buf);
+
return ret;
}
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");
- if (!p_disp_evas_display_retrieve_all_packets ||
- p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(player), gapless) != PLAYER_ERROR_NONE)
- LOGE("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)
{
return __unset_callback(MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER, player);
}
-#endif
int player_unset_completed_cb(player_h player)
{
muse_player_api_e api = MUSE_PLAYER_API_SET_AUDIO_ONLY;
char *ret_buf = NULL;
player_state_e state = PLAYER_STATE_NONE;
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
PLAYER_INSTANCE_CHECK(player);
return PLAYER_ERROR_INVALID_STATE;
}
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
+ if (mm_display_interface_get_type(DP_INTERFACE(pc), &display_type) == MM_ERROR_NONE &&
+ display_type == MM_DISPLAY_TYPE_EVAS) {
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)
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int audio_only = 0;
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(paudio_only);
LOGD("ENTER");
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
+
+ if (mm_display_interface_get_type(DP_INTERFACE(pc), &display_type) == MM_ERROR_NONE &&
+ display_type == MM_DISPLAY_TYPE_EVAS) {
*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;
}