* @param[in] item of the main tbt menu
* @return Pointer of camera on success, otherwise NULL
*/
-camera_view *camera_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+camera_view *camera_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item, Evas_Object *win);
#endif
#endif // __TBT_CAMERA_VIEW_H__
* @param[in] navi Parent naviframe
* @return Pointer of genlist on success, otherwise NULL
*/
-Evas_Object *tbt_genlist_view_create(Evas_Object *navi);
+Evas_Object *tbt_genlist_view_create(Evas_Object *navi, Evas_Object *win);
#endif /* __TBT_GENLIST_VIEW_H__ */
* @param[in] item Is the selected item of the Application home genlist
* @return Pointer of local_view on success, otherwise NULL
*/
-local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item, Evas_Object *win);
#endif
#endif // __TBT_LOCAL_VIEW_H__
#include <Evas.h>
+struct _window
+{
+ Evas_Object *win;
+ Evas_Object *bg;
+ Evas_Object *layout;
+ Evas_Object *conform;
+};
+
typedef struct _window window;
/*
// #endif
- ad->genlist = tbt_genlist_view_create(ad->navi);
+ ad->genlist = tbt_genlist_view_create(ad->navi, ad->win->win);
RETVM_IF(NULL == ad->genlist, false, "getlist creation is failed");
return true;
recorder_h recorder;
Eina_Bool recording;
+ Eina_Bool playing;
Evas_Object *image;
Evas_Object *cam_label;
Evas_Object *image_label;
+ Evas_Object *rect;
+ Evas_Object *win;
Evas_Object *video_rect;
Evas_Object *camera_rect;
Evas_Object *capture_btn;
char* get_camera_error(int error_code);
char* get_recorder_error(int error_code);
+static void create_render_rect_and_bg(camera_view *this);
+static void destroy_render_rect_and_bg(camera_view *this);
+
+
+static void create_render_rect_and_bg(camera_view *this)
+{
+ RETM_IF(!this, "View is empty");
+
+ if(this->rect == NULL)
+ {
+ this->rect = evas_object_rectangle_add(evas_object_evas_get(this->win));
+ RETM_IF(!this, "evas_object_rectangle_add");
+
+ evas_object_color_set(this->rect, 0, 0, 0, 0);
+ evas_object_render_op_set(this->rect, EVAS_RENDER_COPY);
+
+ elm_win_resize_object_add(this->win, this->rect);
+ evas_object_size_hint_weight_set(this->rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(this->rect);
+ 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, _capture_button_pressed_cb, this);
+ }
+}
+
+static void destroy_render_rect_and_bg(camera_view *this)
+{
+
+ __is_efl_test_running = false;
+ eext_object_event_callback_del(this->rect, EEXT_CALLBACK_BACK, _capture_button_pressed_cb);
+
+ if(this->rect)
+ {
+ RETM_IF(!this, "View is empty");
+ elm_win_resize_object_del(this->win, this->rect);
+ evas_object_del(this->rect);
+ this->rect = NULL;
+ }
+}
/**
* @function camera_view_add
* @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
* @return camera_view*
*/
-camera_view *camera_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+camera_view *camera_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item, Evas_Object *win)
{
RETVM_IF(NULL == navi, NULL, "navi is null");
RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null");
this = calloc(1, sizeof(camera_view));
RETVM_IF(NULL == this, NULL, "calloc failed");
+ this->win = win;
+ this->rect = NULL;
this->camera = NULL;
this->player = NULL;
this->recorder = NULL;
this->file_path = NULL;
this->recording = EINA_FALSE;
+ this->playing = EINA_FALSE;
this->view = calloc(1, sizeof(common_view));
RETVM_IF(!this->view, NULL, "calloc failed");
int width, height;
system_info_get_platform_int("tizen.org/feature/screen.width", &width);
system_info_get_platform_int("tizen.org/feature/screen.height", &height);
- this->video_rect = elm_win_util_standard_add("Video", "Video");
-
- Evas_Coord x, y, w, h;
- Evas_Object *edje= elm_layout_edje_get(this->view->layout);
- int title_height = 0;
- if(edje_object_part_geometry_get(edje,"1txt_2cnt",&x,&y,&w,&h))
- {
- DBG("edje_object_part_geometry_get %d %d %d %d", x,y,w,h);
- if(get_device_type() == DEVICE_WEARABLE_360_360)
- {
- title_height = device_height-(h/0.50);
- }
- }
- if(get_device_type() == DEVICE_WEARABLE_320_320)
- {
- evas_object_resize(this->video_rect, (4/3)*(height*0.16), (height*0.16));
- evas_object_move(this->video_rect, width*0.75-((4/3)*(height*0.16)*0.5), height*0.26);
- }
- else if(get_device_type() == DEVICE_WEARABLE_360_360)
- {
- evas_object_resize(this->video_rect, (4/3)*(height*0.40), (height*0.22));
- evas_object_move(this->video_rect, width*0.75-((4/3)*(height*0.40)*0.5), height*0.39);
- }
- else
- {
- evas_object_resize(this->video_rect, 110, 83);
- evas_object_move(this->video_rect, width*0.5-55, height*0.44);
- }
+// this->video_rect = elm_win_util_standard_add("Video", "Video");
- Evas *evas_canvas = evas_object_evas_get(this->video_rect);
- Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
- evas_object_render_op_set(bg, EVAS_RENDER_COPY);
- evas_object_color_set(bg, 0, 0, 0, 0);
- evas_object_resize(bg, width*0.20, height*0.20); // covers full canvas
- evas_object_show(bg);
+// Evas_Coord x, y, w, h;
+// Evas_Object *edje= elm_layout_edje_get(this->view->layout);
+// int title_height = 0;
+// if(edje_object_part_geometry_get(edje,"1txt_2cnt",&x,&y,&w,&h))
+// {
+// DBG("edje_object_part_geometry_get %d %d %d %d", x,y,w,h);
+// if(get_device_type() == DEVICE_WEARABLE_360_360)
+// {
+// title_height = device_height-(h/0.50);
+// }
+// }
+// if(get_device_type() == DEVICE_WEARABLE_320_320)
+// {
+// evas_object_resize(this->video_rect, (4/3)*(height*0.16), (height*0.16));
+// evas_object_move(this->video_rect, width*0.75-((4/3)*(height*0.16)*0.5), height*0.26);
+// }
+// else if(get_device_type() == DEVICE_WEARABLE_360_360)
+// {
+// evas_object_resize(this->video_rect, (4/3)*(height*0.40), (height*0.22));
+// evas_object_move(this->video_rect, width*0.75-((4/3)*(height*0.40)*0.5), height*0.39);
+// }
+// else
+// {
+// evas_object_resize(this->video_rect, 110, 83);
+// evas_object_move(this->video_rect, width*0.5-55, height*0.44);
+// }
+//
+// Evas *evas_canvas = evas_object_evas_get(this->video_rect);
+// Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
+// evas_object_render_op_set(bg, EVAS_RENDER_COPY);
+// evas_object_color_set(bg, 0, 0, 0, 0);
+// evas_object_resize(bg, width*0.20, height*0.20); // covers full canvas
+// evas_object_show(bg);
#endif
evas_object_show(this->video_rect);
}
else if (view->view->tbt_info->apptype == TBT_APP_CAMERA_RECORD)
{
- if (view->recording)
+ if (view->playing)
+ {
+ view->playing = EINA_FALSE;
+
+ destroy_player(view);
+ destroy_render_rect_and_bg(view);
+
+ elm_object_text_set(view->capture_btn, format_string("<p align=center><font_size=%d>Record</font_size></p>", font_size));
+
+ }
+ else if (view->recording)
{
view->recording = EINA_FALSE;
+ view->playing = EINA_TRUE;
stop_video_recorder(view);
+ create_render_rect_and_bg(view);
start_player(view);
elm_object_text_set(view->capture_btn, format_string("<p align=center><font_size=%d>Record</font_size></p>", font_size));
}
else
{
- RETM_IF(NULL == view->camera, "view is NULL");
-
view->recording = EINA_TRUE;
start_video_recorder(view);
if (view)
{
view->recording = EINA_FALSE;
+ view->playing = EINA_TRUE;
stop_video_recorder(view);
- destroy_video_recorder(view);
- destroy_camera(view);
- destroy_player(view);
+ //destroy_video_recorder(view);
+ //destroy_camera(view);
+ //destroy_player(view);
- start_camera(view);
+ //start_camera(view);
+ create_render_rect_and_bg(view);
start_player(view);
- elm_object_text_set(view->capture_btn, "Record");
+ elm_object_text_set(view->capture_btn, format_string("<p align=center><font_size=%d>Record</font_size></p>", font_size));
evas_object_size_hint_expand_set(view->capture_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
}
}
if (view->view->tbt_info->apptype == TBT_APP_CAMERA_RECORD)
{
- evas_object_del(view->video_rect);
+ //evas_object_del(view->video_rect);
}
if (view->view->tbt_info->apptype == TBT_APP_CAMERA_FACE_DETECT)
{
destroy_player(view);
destroy_video_recorder(view);
- #ifdef DEVICE_TYPE_WEARABLE
- if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360))
- {
- elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj"));
- }
- #endif
+// #ifdef DEVICE_TYPE_WEARABLE
+// if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360))
+// {
+// elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj"));
+// }
+// #endif
SAFE_DELETE(view->view);
SAFE_DELETE(view);
typedef struct
{
Evas_Object *navi;
+ Evas_Object *win;
Evas_Object *genlist;
Elm_Object_Item *navi_item;
}genlist_view;
* @parameter Evas_Object*: Evas Object Pointer
* @return Evas_Object*
*/
-Evas_Object *tbt_genlist_view_create(Evas_Object *navi)
+Evas_Object *tbt_genlist_view_create(Evas_Object *navi, Evas_Object *win)
{
RETVM_IF(NULL == navi, NULL, "navi is null");
#endif
view->navi = navi;
+ view->win = win;
view->genlist = elm_genlist_add(view->navi);
if(!view->genlist)
{
{
#ifdef TBT_MODULE_CAMERA
case TBT_APP_CAMERA_CAPTURE:
- camera_view_add(view->navi, info, it);
+ camera_view_add(view->navi, info, it, view->win);
break;
case TBT_APP_CAMERA_RECORD:
- camera_view_add(view->navi, info, it);
+ camera_view_add(view->navi, info, it, view->win);
break;
case TBT_APP_CAMERA_FACE_DETECT:
- camera_view_add(view->navi, info, it);
+ camera_view_add(view->navi, info, it, view->win);
break;
case TBT_APP_CAMERA_HDR_CAPTURE:
- camera_view_add(view->navi, info, it);
+ camera_view_add(view->navi, info, it, view->win);
break;
#endif
#ifdef TBT_MODULE_LOCAL
case TBT_APP_LOCAL_MPEG4:
- local_view_add(view->navi, info, it);
+ local_view_add(view->navi, info, it, view->win);
break;
case TBT_APP_LOCAL_H263:
- local_view_add(view->navi, info, it);
+ local_view_add(view->navi, info, it, view->win);
break;
case TBT_APP_LOCAL_H264:
- local_view_add(view->navi, info, it);
+ local_view_add(view->navi, info, it, view->win);
break;
#endif
bool play;
player_h player;
+
+ Evas_Object *rect;
+ Evas_Object *win;
Evas_Object *video_rect;
Evas_Object *play_btn;
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 _on_app_pause_resume_cb(bool resume);
+
+static void create_render_rect_and_bg(local_view *this);
+static void destroy_render_rect_and_bg(local_view *this);
+
static bool was_playing;
static local_view *view;
}
+static void create_render_rect_and_bg(local_view *this)
+{
+ RETM_IF(!this, "View is empty");
+
+ if(this->rect == NULL)
+ {
+ this->rect = evas_object_rectangle_add(evas_object_evas_get(this->win));
+ RETM_IF(!this, "evas_object_rectangle_add");
+
+ evas_object_color_set(this->rect, 0, 0, 0, 0);
+ evas_object_render_op_set(this->rect, EVAS_RENDER_COPY);
+
+ elm_win_resize_object_add(this->win, this->rect);
+ evas_object_size_hint_weight_set(this->rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(this->rect);
+ 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);
+ }
+}
+
+static void destroy_render_rect_and_bg(local_view *this)
+{
+
+ __is_efl_test_running = false;
+ 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);
+
+ if(this->rect)
+ {
+ RETM_IF(!this, "View is empty");
+ elm_win_resize_object_del(this->win, this->rect);
+ evas_object_del(this->rect);
+ this->rect = NULL;
+ }
+}
+
/**
* @function local_view_add
* @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
* @return local_view*
*/
-local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item, Evas_Object *win)
{
RETVM_IF(NULL == navi, NULL, "navi is null");
local_view *this = NULL;
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->rect = NULL;
this->is_feature_supported = true;
-// #ifdef DEVICE_TYPE_WEARABLE
-// if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360))
-// {
-// elm_theme_overlay_add(NULL, get_edje_path("custom_button.edj"));
-// }
-// #endif
-
#ifdef DEVICE_TYPE_MOBILE
Evas *evas = evas_object_evas_get(this->view->navi);
this->video_rect = evas_object_image_filled_add(evas);
RETVM_IF(SYSTEM_INFO_ERROR_NONE!=ret, NULL, "system_info_get_platform_int failed %s", get_system_error(ret));
RETVM_IF(height <= 0, NULL, "height is zero or negative");
- this->video_rect = elm_win_util_standard_add("Video", "Video");
-
-
- if(get_device_type() == DEVICE_WEARABLE_320_320)
- {
- evas_object_resize(this->video_rect, (4/3)*(height*0.21), (height*0.21));
- evas_object_move(this->video_rect, width*0.50-((4/3)*(height*0.22)*0.5), height*0.20);
- }
- else if(get_device_type() == DEVICE_WEARABLE_360_360)
- {
- evas_object_resize(this->video_rect, (4/3)*(height*0.45), (height*0.25));
- evas_object_move(this->video_rect, width*0.5-((4/3)*(height*0.45)*0.5), height*0.35);
- }
- else
- {
- evas_object_resize(this->video_rect, 110, 83);
- evas_object_move(this->video_rect, width*0.5-55, height*0.20);
- }
-
-
-
- //Evas *evas_canvas = evas_object_evas_get(this->video_rect);
- //Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
- //evas_object_render_op_set(bg, EVAS_RENDER_COPY);
- //evas_object_color_set(bg, 0, 0, 0, 0);
- //evas_object_resize(bg, width*0.23, height*0.23); // covers full canvas
- //evas_object_show(bg);
-
+ //this->video_rect = elm_win_util_standard_add("Video", "Video");
#endif
evas_object_show(this->video_rect);
{
RETM_IF(NULL == this, "this is NULL");
int result;
+ create_render_rect_and_bg(this);
if(!this->player)
{
this->player = create_player(this);
DBG( "player_get_state fail > Error = %s", get_local_view_error(result));
if(state != PLAYER_STATE_PLAYING)
{
- result = player_set_display_mode(this->player, PLAYER_DISPLAY_MODE_ORIGIN_SIZE);
+ result = player_set_display_mode(this->player, PLAYER_DISPLAY_MODE_FULL_SCREEN);
RETM_IF(result != PLAYER_ERROR_NONE, "player_set_display_mode fail > Error = %s", get_local_view_error(result));
result = player_set_display_visible(this->player, true);
RETM_IF(result != PLAYER_ERROR_NONE, "player_set_display_visible fail > Error = %s", get_local_view_error(result));
result = player_pause(this->player);
RETM_IF(result != PLAYER_ERROR_NONE, "player_pause fail > Error = %s", get_local_view_error(result));
}
+ else if(state == PLAYER_STATE_PAUSED)
+ {
+ result = player_start(this->player);
+ RETM_IF(result != PLAYER_ERROR_NONE, "player_start fail > Error = %s", get_local_view_error(result));
+ }
}
}
this->play_btn = ui_utils_push_button_add(this, table, "Play", _start_player_cb);
elm_table_pack(table, this->play_btn, 0, 0, 1, 1);
- this->pause_btn = ui_utils_push_button_add(this, table, "Pause", _pause_player_cb);
- elm_table_pack(table, this->pause_btn, 1, 0, 1, 1);
+ //this->pause_btn = ui_utils_push_button_add(this, table, "Pause", _pause_player_cb);
+ //elm_table_pack(table, this->pause_btn, 1, 0, 1, 1);
- this->stop_btn = ui_utils_push_button_add(this, table, "Stop", _stop_player_cb);
- elm_table_pack(table, this->stop_btn, 2, 0, 1, 1);
+ //this->stop_btn = ui_utils_push_button_add(this, table, "Stop", _stop_player_cb);
+ //elm_table_pack(table, this->stop_btn, 2, 0, 1, 1);
disable_control_button(this, false, true, true);
{
RETM_IF(NULL == this, "view is NULL");
- elm_object_disabled_set(this->play_btn, play);
- elm_object_disabled_set(this->pause_btn, pause);
- elm_object_disabled_set(this->stop_btn, stop);
+ //elm_object_disabled_set(this->play_btn, play);
+ //elm_object_disabled_set(this->pause_btn, pause);
+ //elm_object_disabled_set(this->stop_btn, stop);
}
elm_genlist_item_update(view->view->item);
}
- #ifdef DEVICE_TYPE_WEARABLE
- if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360))
- {
- elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj"));
- }
- #endif
+// #ifdef DEVICE_TYPE_WEARABLE
+// if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360))
+// {
+// elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj"));
+// }
+// #endif
_tbt_pause_resume_cb = NULL;
_tbt_app_terminate_cb = NULL;
- #ifndef DEVICE_TYPE_MOBILE
- evas_object_del(view->video_rect);
- #endif
+// #ifndef DEVICE_TYPE_MOBILE
+// evas_object_del(view->video_rect);
+// #endif
destroy_player(view);
+ destroy_render_rect_and_bg(view);
SAFE_DELETE(view->view);
SAFE_DELETE(view);
}
local_view *view = NULL;
view = (local_view*)data;
RETM_IF(NULL == view, "view is NULL");
- stop_player(view);
+ destroy_player(view);
+ destroy_render_rect_and_bg(view);
disable_control_button(view, false, true, true);
}
#define APP_NAME "tbtcoreapp"
-struct _window
-{
- Evas_Object *win;
- Evas_Object *bg;
- Evas_Object *layout;
- Evas_Object *conform;
-};
-
/**
* @function win_get_win_handle