From 6c9e1e1cc6c0b618b8642647d2da5a81fd849531 Mon Sep 17 00:00:00 2001 From: NAMJEONGYOON Date: Tue, 8 Nov 2016 17:07:02 +0900 Subject: [PATCH] [v0.3.31] handle visible in player api Change-Id: Ie1166819b16e6ce1896d3110fa3d04c3ff1d914a --- include/player_private.h | 8 +++++++- src/player.c | 14 +++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/player_private.h b/include/player_private.h index 914b79a..c5e7fc9 100644 --- a/include/player_private.h +++ b/include/player_private.h @@ -88,9 +88,15 @@ typedef struct { tbm_surface_h tsurf; } player_tsurf_info_t; #ifdef TIZEN_FEATURE_EVAS_RENDERER +typedef enum { + EVAS_VISIBLE_NONE, /* if user dont set visibility, it will be changed to true */ + EVAS_VISIBLE_TRUE, + EVAS_VISIBLE_FALSE +} visible_info_e; + typedef struct { void *handle; - gboolean visible; + visible_info_e visible; player_display_rotation_e rotation; player_display_mode_e mode; gboolean update_needed; diff --git a/src/player.c b/src/player.c index 2e22b11..ce13aea 100644 --- a/src/player.c +++ b/src/player.c @@ -1703,7 +1703,7 @@ int player_create(player_h * player) ret = PLAYER_ERROR_OUT_OF_MEMORY; goto ERROR; } - EVAS_INFO(pc)->visible = -1; + EVAS_INFO(pc)->visible = EVAS_VISIBLE_NONE; #endif pc->cb_info->bufmgr = tbm_bufmgr_init(-1); pc->push_media_stream = FALSE; @@ -2128,10 +2128,10 @@ int player_start(player_h player) LOGD("ENTER"); #ifdef TIZEN_FEATURE_EVAS_RENDERER - if (EVAS_HANDLE(pc)) { - ret = mm_evas_renderer_update_param(EVAS_HANDLE(pc)); + if (EVAS_HANDLE(pc) && EVAS_INFO(pc)->visible == EVAS_VISIBLE_NONE) { + ret = mm_evas_renderer_set_visible(EVAS_HANDLE(pc), true); if (ret != MM_ERROR_NONE) { - LOGE("mm_evas_renderer_update_param err 0x%x", ret); + LOGE("mm_evas_renderer_set_visible err 0x%x", ret); return PLAYER_ERROR_INVALID_OPERATION; } } @@ -2445,8 +2445,8 @@ int player_set_display(player_h player, player_display_type_e type, player_displ ret = mm_evas_renderer_set_geometry(EVAS_HANDLE(pc), EVAS_INFO(pc)->mode); ret |= mm_evas_renderer_set_rotation(EVAS_HANDLE(pc), EVAS_INFO(pc)->rotation); /* if user didn't set visible, it will be set to true in player_start */ - if (EVAS_INFO(pc)->visible != -1) - ret |= mm_evas_renderer_set_visible(EVAS_HANDLE(pc), (EVAS_INFO(pc)->visible == 1) ? true : false); + if (EVAS_INFO(pc)->visible != EVAS_VISIBLE_NONE) + ret |= mm_evas_renderer_set_visible(EVAS_HANDLE(pc), (EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE) ? true : false); if (ret != MM_ERROR_NONE) { LOGW("fail to set evas information"); return PLAYER_ERROR_INVALID_OPERATION; @@ -2671,7 +2671,7 @@ int player_set_display_visible(player_h player, bool visible) else return PLAYER_ERROR_NONE; } else { - EVAS_INFO(pc)->visible = visible ? 1 : 0; + EVAS_INFO(pc)->visible = visible ? EVAS_VISIBLE_TRUE : EVAS_VISIBLE_FALSE; EVAS_INFO(pc)->update_needed = TRUE; } #endif -- 2.7.4