Set win rotate before set focus coordinate in layout init
authorh2.seo <h2.seo@samsung.com>
Mon, 10 Sep 2012 08:51:17 +0000 (17:51 +0900)
committerh2.seo <h2.seo@samsung.com>
Mon, 10 Sep 2012 08:51:17 +0000 (17:51 +0900)
src/cam.c

index f5e0c9c..014990c 100755 (executable)
--- a/src/cam.c
+++ b/src/cam.c
@@ -86,6 +86,26 @@ static int _is_running(void)
 #endif
 }
 
+static int __convert_orientation_to_angle(app_device_orientation_e orientation)
+{
+       switch (orientation) {
+       case APP_DEVICE_ORIENTATION_0:
+               return 0;
+               break;
+       case APP_DEVICE_ORIENTATION_180:
+               return 180;
+               break;
+       case APP_DEVICE_ORIENTATION_270:
+               return 270;
+               break;
+       case APP_DEVICE_ORIENTATION_90:
+               return 90;
+               break;
+       default:
+               return 0;
+       }
+}
+
 static bool cam_create(void *data)
 {
        CAM_TA_ACUM_ITEM_BEGIN("==cam_create==", 0);
@@ -137,6 +157,17 @@ static bool cam_create(void *data)
 
        /*add camera exteral engine lib load*/
        open_cam_ext_handle();
+
+       ad->rot_current = app_get_device_orientation();
+       ad->rot_previous = ad->rot_current;
+       int win_angle = elm_win_rotation_get(ad->win_main);
+       ad->angle = __convert_orientation_to_angle(ad->rot_current);
+
+       if(win_angle != ad->angle) {
+               cam_critical(LOG_UI, "win_angle:%d device_angle:%d ", win_angle, ad->angle);
+               elm_win_rotation_with_resize_set(ad->win_main, ad->angle);
+       }
+
        evas_object_show(ad->win_main);
 
        cam_debug(LOG_UI, "******** cam_create END**********");