From: h2.seo Date: Wed, 12 Sep 2012 04:23:44 +0000 (+0900) Subject: Fix camera start bs issue X-Git-Tag: 2.0_alpha^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;p=apps%2Fhome%2Fcamera.git Fix camera start bs issue --- diff --git a/edc/cam_guideline_edje.edc b/edc/cam_guideline_edje.edc index fcb6cbc..aaa29b8 100644 --- a/edc/cam_guideline_edje.edc +++ b/edc/cam_guideline_edje.edc @@ -50,6 +50,7 @@ group { name: "guide_line1_outline1_1"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (GUIDE_LINE_W1 - 1)/MAIN_W 0.0; } @@ -65,6 +66,7 @@ group { name: "guide_line1"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: GUIDE_LINE_W1/MAIN_W 0.0; } @@ -76,8 +78,8 @@ group { } description { state: "ver_default" 0.0; - rel1 { relative: VER_GUIDE_LINE_W1/VER_MAIN_W 0.1; } - rel2 { relative: (VER_GUIDE_LINE_W1 + GUIDE_LINE_GAP)/VER_MAIN_W 0.9; } + rel1 { relative: VER_GUIDE_LINE_W1/VER_MAIN_W 0.125; } + rel2 { relative: (VER_GUIDE_LINE_W1 + GUIDE_LINE_GAP)/VER_MAIN_W 0.875; } image{ normal: GUDIE_LINE_1_IMAGE ; } @@ -99,6 +101,7 @@ group { name: "guide_line1_outline1_2"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (GUIDE_LINE_W1 + GUIDE_LINE_GAP)/MAIN_W 0.0; } @@ -115,6 +118,7 @@ group { name: "guide_line2_outline2_1"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (GUIDE_LINE_W1 + GUIDE_LINE_GAP + GUIDE_LINE_W2 - 1)/MAIN_W 0.0; } @@ -130,6 +134,7 @@ group { name: "guide_line2"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (GUIDE_LINE_W1 + GUIDE_LINE_GAP + GUIDE_LINE_W2)/MAIN_W 0.0; } @@ -141,8 +146,8 @@ group { } description { state: "ver_default" 0.0; - rel1 { relative: (VER_GUIDE_LINE_W1 + GUIDE_LINE_GAP + VER_GUIDE_LINE_W2)/VER_MAIN_W 0.1; } - rel2 { relative: (VER_GUIDE_LINE_W1 + GUIDE_LINE_GAP + VER_GUIDE_LINE_W2 + GUIDE_LINE_GAP)/VER_MAIN_W 0.9; } + rel1 { relative: (VER_GUIDE_LINE_W1 + GUIDE_LINE_GAP + VER_GUIDE_LINE_W2)/VER_MAIN_W 0.125; } + rel2 { relative: (VER_GUIDE_LINE_W1 + GUIDE_LINE_GAP + VER_GUIDE_LINE_W2 + GUIDE_LINE_GAP)/VER_MAIN_W 0.875; } image{ normal: GUDIE_LINE_1_IMAGE ; } @@ -164,6 +169,7 @@ group { name: "guide_line2_outline2_2"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (GUIDE_LINE_W1 + GUIDE_LINE_GAP + GUIDE_LINE_W2 + GUIDE_LINE_GAP)/MAIN_W 0.0; } @@ -179,6 +185,7 @@ group { name: "guide_line3_outline3_1"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (GUIDE_LINE_H1 - 1)/MAIN_W 0.0; } @@ -194,10 +201,11 @@ group { name: "guide_line3"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; - rel1 { relative: 0.1 GUIDE_LINE_H1/MAIN_H; } - rel2 { relative: 0.9 (GUIDE_LINE_H1 + GUIDE_LINE_GAP)/MAIN_H; } + rel1 { relative: 0.125 GUIDE_LINE_H1/MAIN_H; } + rel2 { relative: 0.875 (GUIDE_LINE_H1 + GUIDE_LINE_GAP)/MAIN_H; } image{ normal: GUDIE_LINE_2_IMAGE ; } @@ -227,6 +235,7 @@ group { name: "guide_line3_outline3_2"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (GUIDE_LINE_H1 + GUIDE_LINE_GAP)/MAIN_W 0.0; } @@ -243,6 +252,7 @@ group { name: "guide_line4_outline4_1"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (GUIDE_LINE_H1 + GUIDE_LINE_GAP + GUIDE_LINE_H2 - 1)/MAIN_W 0.0; } @@ -258,10 +268,11 @@ group { name: "guide_line4"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; - rel1 { relative: 0.1 (GUIDE_LINE_H1 + GUIDE_LINE_GAP + GUIDE_LINE_H2)/MAIN_H; } - rel2 { relative: 0.9 (GUIDE_LINE_H1 + GUIDE_LINE_GAP + GUIDE_LINE_H2 + GUIDE_LINE_GAP)/MAIN_H; } + rel1 { relative: 0.125 (GUIDE_LINE_H1 + GUIDE_LINE_GAP + GUIDE_LINE_H2)/MAIN_H; } + rel2 { relative: 0.875 (GUIDE_LINE_H1 + GUIDE_LINE_GAP + GUIDE_LINE_H2 + GUIDE_LINE_GAP)/MAIN_H; } image{ normal: GUDIE_LINE_2_IMAGE ; } @@ -291,6 +302,7 @@ group { name: "guide_line4_outline4_2"; type: IMAGE; mouse_events: 0; + scale: 1; description { state: "default" 0.0; rel1 { relative: (VER_GUIDE_LINE_H1 + GUIDE_LINE_GAP + VER_GUIDE_LINE_H2 + GUIDE_LINE_GAP)/MAIN_W 0.0; } diff --git a/include/cam.h b/include/cam.h index 08f79af..da6c90d 100755 --- a/include/cam.h +++ b/include/cam.h @@ -346,8 +346,6 @@ struct appdata { GQueue *file_reg_queue; #endif - pthread_t camera_start_thread; - ui_gadget_h imageviewer_ug; gboolean ug_is_deleting_process; /*note: now ug is deleting process, and run into camera preview process*/ service_h imageviewer_service; diff --git a/include/cam_app.h b/include/cam_app.h index 711c7a5..0a6fa42 100755 --- a/include/cam_app.h +++ b/include/cam_app.h @@ -242,7 +242,7 @@ int cam_appdata_init(void *data); int cam_appdata_fini(void *data); CamAppData *cam_handle_get(void); -gboolean cam_app_start(void *data); +Eina_Bool cam_app_start(void *data); Eina_Bool cam_app_stop(void *data); gboolean cam_app_resume(void *data); gboolean cam_app_pause(void *data); @@ -420,7 +420,6 @@ void cam_app_update_quickview_icon(void *data); void cam_utils_remove_idler_all(void *data); gdouble _get_current_time(void); void cam_remove_tmp_file(); -Eina_Bool cam_continuous_af_start(void *data); Eina_Bool cam_elm_cache_flush(); void cam_app_mdm_syspopup(void *data); diff --git a/packaging/org.tizen.camera-app.spec b/packaging/org.tizen.camera-app.spec index 66bc921..3363e35 100644 --- a/packaging/org.tizen.camera-app.spec +++ b/packaging/org.tizen.camera-app.spec @@ -4,7 +4,7 @@ Name: org.tizen.camera-app Summary: camera application -Version: 0.3.34 +Version: 0.3.35 Release: 1 Group: misc License: Flora diff --git a/src/cam.c b/src/cam.c index 744987a..cd18b20 100755 --- a/src/cam.c +++ b/src/cam.c @@ -322,19 +322,6 @@ static void cam_resume(void *data) } -void *cam_start_thread_run(void *data) -{ - struct appdata *ad = (struct appdata *)data; - cam_retv_if(ad == NULL, NULL); - - if (cam_app_start(ad) == FALSE) - cam_critical(LOG_CAM, "cam_app_start failed"); - - pthread_exit(NULL); - - return NULL; -} - static void cam_service(service_h service, void *user_data) { CAM_TA_ACUM_ITEM_BEGIN("==cam_service==", 0); @@ -434,21 +421,11 @@ static void cam_service(service_h service, void *user_data) if (ad->launch_type == CAM_LAUNCH_FIRST) { debug_fenter(LOG_CAM); - if (!cam_condition_check_to_start_camera(ad)) { - cam_critical(LOG_CAM, "cannot start camera"); - return; - } - if (!open_cam_handle((void*)ad)) { cam_critical(LOG_CAM, "open_cam_handle failed"); return; } - if (pthread_create(&(ad->camera_start_thread), NULL, cam_start_thread_run, (void *)ad) < 0) { - cam_critical(LOG_CAM, "Create camera start thread failed"); - return; - } - #ifdef ENABLE_CAM_POWER_CONTROL power_lock_state(POWER_STATE_NORMAL, 0); #endif @@ -468,6 +445,8 @@ static void cam_service(service_h service, void *user_data) return; } CAM_TA_ACUM_ITEM_END(" cam_layout_init", 0); + + ecore_idler_add(cam_app_start, ad); } else { /* RELUNCHING!! //in paused -> Camera process is called by External process */ @@ -489,16 +468,6 @@ static void cam_service(service_h service, void *user_data) if (ad->exe_args == NULL) return; - if (!cam_condition_check_to_start_camera(ad)) { - cam_critical(LOG_CAM, "cannot start camera"); - return; - } - - if (pthread_create(&(ad->camera_start_thread), NULL, cam_start_thread_run, (void *)ad) < 0) { - cam_critical(LOG_CAM, "Create camera start thread failed"); - return; - } - ResetCaps(); CAM_TA_ACUM_ITEM_BEGIN(" cam_layout_init", 0); @@ -509,6 +478,7 @@ static void cam_service(service_h service, void *user_data) CAM_TA_ACUM_ITEM_END(" cam_layout_init", 0); evas_object_raise(ad->win_main); + ecore_idler_add(cam_app_start, ad); } cam_debug(LOG_UI, "############## cam_service END##############"); diff --git a/src/cam_app.c b/src/cam_app.c index ddd9620..276afe9 100755 --- a/src/cam_app.c +++ b/src/cam_app.c @@ -688,7 +688,7 @@ gboolean cam_app_init(void *data) return TRUE; } -gboolean cam_app_start(void *data) +Eina_Bool cam_app_start(void *data) { CAM_TA_ACUM_ITEM_BEGIN("#########cam_app_start", 0); @@ -698,9 +698,14 @@ gboolean cam_app_start(void *data) debug_fenter(LOG_CAM); - cam_retvm_if(ad == NULL, FALSE, "appdata is NULL"); + cam_retvm_if(ad == NULL, ECORE_CALLBACK_CANCEL, "appdata is NULL"); camapp = ad->camapp_handle; - cam_retvm_if(camapp == NULL, FALSE, "camapp_handle is NULL"); + cam_retvm_if(camapp == NULL, ECORE_CALLBACK_CANCEL, "camapp_handle is NULL"); + + if (!cam_condition_check_to_start_camera(ad)) { + cam_critical(LOG_CAM, "cannot start camera"); + return ECORE_CALLBACK_CANCEL; + } /*init guideline value*/ #ifdef GUIDE_LINE_ENALBE @@ -712,7 +717,7 @@ gboolean cam_app_start(void *data) if (!cam_mm_create(CAM_DEVICE_MEGA, camapp->camera_mode)) { cam_critical(LOG_MM, "cam_mm_create failed"); cam_app_notice_popup(ad, "UNABLE TO LAUNCH CAMERA", cam_app_timeout_notice_response_cb); - return FALSE; + return ECORE_CALLBACK_CANCEL; } } CAM_TA_ACUM_ITEM_END(" cam_mm_create", 0); @@ -721,7 +726,7 @@ gboolean cam_app_start(void *data) if (!cam_callback_init(ad)) { cam_critical(LOG_CAM, "cam_init_mm_callback failed"); cam_app_notice_popup(ad, "UNABLE TO START PREVIEW", cam_app_timeout_notice_response_cb); - return FALSE; + return ECORE_CALLBACK_CANCEL; } CAM_TA_ACUM_ITEM_END(" cam_callback_init", 0); @@ -738,18 +743,17 @@ gboolean cam_app_start(void *data) * TODO: this func dealt with efl ui api, but cam_app_start is called in thread. * We should consider it carefully. */ - cam_continuous_af_start(ad); if (!cam_app_preview_start(ad)) { if (ad->is_calling == CAMERA_ERROR_SOUND_POLICY ||ad->is_calling == RECORDER_ERROR_SOUND_POLICY) { DEBUG_TRACE(" MM CAMCARORDER ERROR\n"); cam_app_black_screen_show(ad, 2); ecore_timer_add(0.01, cam_delay_popup, (void *)ad); - return FALSE; + return ECORE_CALLBACK_CANCEL; } cam_critical(LOG_MM, "cam_app_preview_start failed"); cam_app_notice_popup(ad, "UNABLE TO START PREVIEW", cam_app_timeout_notice_response_cb); - return FALSE; + return ECORE_CALLBACK_CANCEL; } CAM_TA_ACUM_ITEM_END(" cam_app_preview_start", 0); @@ -763,7 +767,7 @@ gboolean cam_app_start(void *data) #endif CAM_TA_ACUM_ITEM_END("#########cam_app_start", 0); - return TRUE; + return ECORE_CALLBACK_CANCEL; } gboolean cam_app_pause(void *data) @@ -2032,7 +2036,6 @@ gboolean cam_mode_change(void *data, int to_mode) cam_app_get_preview_offset_coordinate(ad); - cam_continuous_af_start(ad); if (!cam_app_preview_start(ad)) { cam_critical(LOG_MM, "cam_app_preview_start failed"); goto MODE_CHANGE_FAILED; @@ -2215,7 +2218,6 @@ gboolean cam_recording_mode_change(void *data, int rec_mode) return FALSE; } - cam_continuous_af_start(ad); if (!cam_app_preview_start(ad)) { cam_critical(LOG_MM, "cam_app_preview_start failed"); cam_app_notice_popup(ad, "PREVIEW START FAILED !!", cam_app_timeout_notice_response_cb); @@ -2299,8 +2301,6 @@ gboolean cam_shooting_mode_change(void *data) } cam_mm_get_video_size( &camapp->default_preview_width, &camapp->default_preview_height); DEBUG_TRACE("default_width = %d,default_height = %d", camapp->default_preview_width, camapp->default_preview_height); - - cam_continuous_af_start(ad); } g_value_init(&value, G_TYPE_INT); @@ -3056,50 +3056,6 @@ gboolean cam_camera_key_release(void *data) return TRUE; } -Eina_Bool cam_continuous_af_start(void *data) -{ - - struct appdata *ad = (struct appdata *)data; - cam_retvm_if(ad == NULL, ECORE_CALLBACK_CANCEL, "appdata is NULL"); - - CamAppData *camapp = NULL; - camapp = ad->camapp_handle; - cam_retvm_if(camapp == NULL, ECORE_CALLBACK_CANCEL, "camapp_handle is NULL"); - - DEBUG_TRACE("cam_continuous_af_start"); - - /* init */ - ad->af_x = (ad->win_width / 2) - ad->preview_offset_x; - ad->af_y = (ad->win_height / 2) - ad->preview_offset_y; - - ad->af_x = (ad->af_x * ad->camfw_video_width) / ad->preview_w; - ad->af_y = (ad->af_y * ad->camfw_video_height) / ad->preview_h; - /* init */ - ad->touch_lcd_x = (ad->win_height / 2); - ad->touch_lcd_y = (ad->win_width / 2); - - cam_app_draw_af_box(ad); - camapp->focus_state = CAM_FOCUS_STATUS_RELEASED; - cam_app_focus_guide_update(ad); - - evas_object_show(ad->focus_edje); - - camapp->focus_mode = CAM_FOCUS_MODE_CONTINUOUS; - - /* cam_mm_set_af_area include init focusing */ - DEBUG_TRACE("start continuous AF"); - if (cam_mm_set_af_area(ad->af_x, ad->af_y, ad->camera_focus_w, ad->camera_focus_h)) { - DEBUG_TRACE("cam_mm_set_af_area success!"); - /*focus guide update*/ - } else { - DEBUG_TRACE("cam_mm_set_af_area error!"); - } - if (!cam_mm_start_focusing(camapp->focus_mode)) { - cam_critical(LOG_MM, "cam_mm_start_focusing error"); - } - return ECORE_CALLBACK_CANCEL; -} - Eina_Bool cam_volume_key_press(void *data) { struct appdata *ad = (struct appdata *)data; @@ -4050,7 +4006,6 @@ static void __cam_focus_cb(camera_focus_state_e state, void *user_data) { DEBUG_TRACE("start caf"); cam_app_focus_guide_create(ad); cam_app_focus_guide_update(ad); - ad->continuous_af_timer= ecore_timer_add(FOCUS_FOCUSED_TIME_OUT, cam_continuous_af_start, ad); } } break; @@ -4065,7 +4020,6 @@ static void __cam_focus_cb(camera_focus_state_e state, void *user_data) { DEBUG_TRACE("start caf"); cam_app_focus_guide_create(ad); cam_app_focus_guide_update(ad); - ad->continuous_af_timer= ecore_timer_add(FOCUS_FAILED_TIME_OUT, cam_continuous_af_start, ad); } } break; diff --git a/src/cam_menu_composer.c b/src/cam_menu_composer.c index 5e49608..c3e3bbf 100755 --- a/src/cam_menu_composer.c +++ b/src/cam_menu_composer.c @@ -48,10 +48,10 @@ void cam_compose_setting_menu(cam_menu_composer* composer) unsigned int capacity = 0; GetCamDevFuncCaps(&capacity, NULL); - +#if 0 if(capacity & CAM_CP_FUNC_EDIR_SHORTCUT) eina_array_push(composer->array, (void*)&setting[0]); - +#endif if(capacity & CAM_CP_FUNC_TIMER) eina_array_push(composer->array, (void*)&setting[1]); diff --git a/src/cam_rec.c b/src/cam_rec.c index 225ba5d..856b71b 100755 --- a/src/cam_rec.c +++ b/src/cam_rec.c @@ -89,7 +89,6 @@ static gchar *__get_tmpfile_name() if (g_file_test(tmpfile_name, G_FILE_TEST_EXISTS)) { DEBUG_TRACE("Error : tmp file exist on the %s", file_path); cam_remove_tmp_file(); - return NULL; } return g_strdup(tmpfile_name); diff --git a/src/edc-callback/cam_toolbar_edc_callback.c b/src/edc-callback/cam_toolbar_edc_callback.c index 5f93afe..ccef60c 100755 --- a/src/edc-callback/cam_toolbar_edc_callback.c +++ b/src/edc-callback/cam_toolbar_edc_callback.c @@ -1288,7 +1288,6 @@ void cam_toolbar_update(struct appdata *ad) } else { if (ad->is_recording) { edje_object_signal_emit(_EDJ(ad->toolbar_edje), "toolbar_bg,hide", "program"); - __toolbar_recording_capture_button_create(ad); __toolbar_menu_item_update(ad, TOOLBAR_ITEM_STATE_INVISIBLE); __toolbar_mode_item_hide(ad); __toolbar_shutter_button_hide(ad); @@ -1300,7 +1299,6 @@ void cam_toolbar_update(struct appdata *ad) } } else { edje_object_signal_emit(_EDJ(ad->toolbar_edje), "toolbar_bg,show", "program"); - __toolbar_recording_capture_button_destroy(ad); __toolbar_menu_item_update(ad, TOOLBAR_ITEM_STATE_NORMAL); __toolbar_mode_item_update(ad); __toolbar_shutter_button_update(ad); @@ -1602,17 +1600,46 @@ int cam_guideline_rotate(struct appdata *ad) if (wide_mode) { DEBUG_TRACE("hor,wide_mode"); - edje_object_signal_emit(_EDJ(ad->guideline_edje), - "guide_line,1,2,normal", "prog_guideline"); - edje_object_signal_emit(_EDJ(ad->guideline_edje), + switch (ad->target_direction) { + case CAM_TARGET_DIRECTION_LANDSCAPE: + case CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE: + DEBUG_TRACE("landscape"); + edje_object_signal_emit(_EDJ(ad->guideline_edje), + "guide_line,1,2,normal", "prog_guideline"); + edje_object_signal_emit(_EDJ(ad->guideline_edje), "guide_line,3,4,wide", "prog_guideline"); + break; + case CAM_TARGET_DIRECTION_PORTRAIT: + case CAM_TARGET_DIRECTION_PORTRAIT_INVERSE: + DEBUG_TRACE("portrait"); + edje_object_signal_emit(_EDJ(ad->guideline_edje), + "guide_line,1,2,vertical,wide", "prog_guideline"); + edje_object_signal_emit(_EDJ(ad->guideline_edje), + "guide_line,3,4,vertical,normal", "prog_guideline"); + break; + } } else { DEBUG_TRACE("hor,normal mode"); - edje_object_signal_emit(_EDJ(ad->guideline_edje), - "guide_line,1,2,normal", "prog_guideline"); - edje_object_signal_emit(_EDJ(ad->guideline_edje), + switch (ad->target_direction) { + case CAM_TARGET_DIRECTION_LANDSCAPE: + case CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE: + DEBUG_TRACE("landscape"); + edje_object_signal_emit(_EDJ(ad->guideline_edje), + "guide_line,1,2,normal", "prog_guideline"); + edje_object_signal_emit(_EDJ(ad->guideline_edje), "guide_line,3,4,normal", "prog_guideline"); + break; + case CAM_TARGET_DIRECTION_PORTRAIT: + case CAM_TARGET_DIRECTION_PORTRAIT_INVERSE: + DEBUG_TRACE("portrait"); + edje_object_signal_emit(_EDJ(ad->guideline_edje), + "guide_line,1,2,vertical,normal", "prog_guideline"); + edje_object_signal_emit(_EDJ(ad->guideline_edje), + "guide_line,3,4,vertical,normal", "prog_guideline"); + break; + } + } /*evas_object_lower(ad->guideline_edje);*/