From: Amlan Chowdhury Date: Mon, 4 Jul 2016 14:09:11 +0000 (+0600) Subject: [TBT][Video][TSAM-4917][TBT Video updated for wearable devices] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F22%2F78222%2F1;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][Video][TSAM-4917][TBT Video updated for wearable devices] Signed-off-by: Amlan Chowdhury Change-Id: Icd0abb1e829e0e71cbf2fe087adf0d27998f5227 --- diff --git a/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk index ba867c0..ea08c4a 100644 Binary files a/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk index f24aec7..d3e8c93 100644 Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ diff --git a/tbtcoreapp/src/view/tbt-local-view.c b/tbtcoreapp/src/view/tbt-local-view.c index b4969a4..996130b 100644 --- a/tbtcoreapp/src/view/tbt-local-view.c +++ b/tbtcoreapp/src/view/tbt-local-view.c @@ -49,6 +49,9 @@ struct _local_view bool play; player_h player; + Evas_Object *main_win; + + Evas_Object *bg; Evas_Object *rect; Evas_Object *win; Evas_Object *video_rect; @@ -79,7 +82,8 @@ static char* get_local_view_error(player_error_e error_state); static void _app_destroy_cb(void* this); static void _start_player_cb(void *data, Evas_Object *obj, void *event_info); static void _stop_player_cb(void *data, Evas_Object *obj, void *event_info); -static void _pause_player_cb(void *data, Evas_Object *obj, void *event_info); +static void _pause_player_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); +//static void _pause_player_cb(void *data, Evas_Object *obj, void *event_info); static void _on_app_pause_resume_cb(bool resume); static void create_render_rect_and_bg(local_view *this); @@ -159,10 +163,45 @@ static void _on_app_pause_resume_cb(bool resume ) } +static void win_del(local_view *this) +{ + evas_object_del(this->win); + this->win = NULL; +} + +static void create_win(local_view *this) +{ + int w = 0; + int h = 0; + + //g_print("[%s][%d] name=%s\n", __func__, __LINE__, name); + + this->win = elm_win_add(NULL, "Video", ELM_WIN_BASIC); + if (this->win) { + elm_win_title_set(this->win, "Video"); + elm_win_borderless_set(this->win, EINA_TRUE); + //evas_object_smart_callback_add(eo, "delete,request", win_del, NULL); + elm_win_screen_size_get(this->win, NULL, NULL, &w, &h); + //g_print("window size :%d,%d", w, h); + evas_object_resize(this->win, w, h); + //elm_win_autodel_set(this->win, EINA_TRUE); + elm_win_alpha_set(this->win, EINA_TRUE); + } +} + static void create_render_rect_and_bg(local_view *this) { RETM_IF(!this, "View is empty"); + if(this->win == NULL) + { + create_win(this); + this->bg = elm_bg_add(this->win); + elm_win_resize_object_add(this->win, this->bg); + evas_object_size_hint_weight_set(this->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(this->bg); + } + if(this->rect == NULL) { this->rect = evas_object_rectangle_add(evas_object_evas_get(this->win)); @@ -175,11 +214,17 @@ static void create_render_rect_and_bg(local_view *this) evas_object_size_hint_weight_set(this->rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(this->rect); evas_object_show(this->win); + elm_win_activate(this->win); + evas_object_show(this->win); this->video_rect = this->win; __is_efl_test_running = true; eext_object_event_callback_add(this->rect, EEXT_CALLBACK_BACK, _stop_player_cb, this); evas_object_event_callback_add(this->rect, EVAS_CALLBACK_MOUSE_DOWN, _pause_player_cb, this); + + eext_object_event_callback_add(this->view->navi, EEXT_CALLBACK_BACK, _stop_player_cb, this); + evas_object_event_callback_add(this->view->navi, EVAS_CALLBACK_MOUSE_DOWN, _pause_player_cb, this); + } } @@ -190,6 +235,16 @@ static void destroy_render_rect_and_bg(local_view *this) eext_object_event_callback_del(this->rect, EEXT_CALLBACK_BACK, _stop_player_cb); evas_object_event_callback_del(this->rect, EVAS_CALLBACK_MOUSE_DOWN, _pause_player_cb); + eext_object_event_callback_del(this->view->navi, EEXT_CALLBACK_BACK, _stop_player_cb); + evas_object_event_callback_del(this->view->navi, EVAS_CALLBACK_MOUSE_DOWN, _pause_player_cb); + + if(this->bg) + { + elm_win_resize_object_del(this->win, this->bg); + evas_object_del(this->bg); + this->bg = NULL; + } + if(this->rect) { RETM_IF(!this, "View is empty"); @@ -197,6 +252,11 @@ static void destroy_render_rect_and_bg(local_view *this) evas_object_del(this->rect); this->rect = NULL; } + + if(this->win) + { + win_del(this); + } } @@ -227,8 +287,12 @@ local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->win = win; + this->main_win = win; + + this->win = NULL; + this->bg = NULL; this->rect = NULL; + this->video_rect = NULL; this->is_feature_supported = true; #ifdef DEVICE_TYPE_MOBILE @@ -247,7 +311,7 @@ local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite //this->video_rect = elm_win_util_standard_add("Video", "Video"); #endif - evas_object_show(this->video_rect); + //evas_object_show(this->video_rect); #ifdef DEVICE_TYPE_MOBILE elm_object_part_content_set(this->view->layout, "video_view", this->video_rect); #endif @@ -549,6 +613,7 @@ static void _start_player_cb(void *data, Evas_Object *obj, void *event_info) local_view *view = NULL; view = (local_view*)data; RETM_IF(NULL == view, "view is NULL"); + evas_object_hide(view->main_win); start_player(view); disable_control_button(view, true, false, false); } @@ -570,6 +635,8 @@ static void _stop_player_cb(void *data, Evas_Object *obj, void *event_info) destroy_player(view); destroy_render_rect_and_bg(view); disable_control_button(view, false, true, true); + evas_object_show(view->main_win); + was_playing = false; } @@ -580,7 +647,8 @@ static void _stop_player_cb(void *data, Evas_Object *obj, void *event_info) * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer * @return static void */ -static void _pause_player_cb(void *data, Evas_Object *obj, void *event_info) +static void _pause_player_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +//static void _pause_player_cb(void *data, Evas_Object *obj, void *event_info) { RETM_IF(NULL == data, "data is NULL");