From: Jeongmo Yang Date: Tue, 8 Mar 2016 02:15:51 +0000 (+0900) Subject: [Release version 0.2.45] Fix TSAM-1058 - Distorted Camera View in Landscape X-Git-Tag: accepted/tizen/common/20160308.142729^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11ad0097af83e0d9c5b378b91dc0f7d97f5cd926;p=platform%2Fcore%2Fapi%2Fcamera.git [Release version 0.2.45] Fix TSAM-1058 - Distorted Camera View in Landscape Change-Id: Ib4dea4f61504147c27c71613e4d4acadcc864e77 Signed-off-by: Jeongmo Yang --- diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 2b4a184..d296c70 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -3,7 +3,7 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.2.44 +Version: 0.2.45 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index 99c7f39..f3d8be4 100644 --- a/src/camera.c +++ b/src/camera.c @@ -179,6 +179,8 @@ int _get_wl_info(Evas_Object *obj, camera_wl_info_s *wl_info) wl_display_roundtrip(display); if (wl_info->parent_id > 0) { + int rotation = 0; + Ecore_Evas *ecore_evas = NULL; ret = CAMERA_ERROR_NONE; wl_info->evas_obj = obj; @@ -186,8 +188,23 @@ int _get_wl_info(Evas_Object *obj, camera_wl_info_s *wl_info) evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y, &wl_info->window_width, &wl_info->window_height); - LOGD("evas object : %p, parent id : %u, window : %d,%d,%dx%d", - wl_info->evas_obj, wl_info->parent_id, + ecore_evas = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); + if (ecore_evas) { + rotation = ecore_evas_rotation_get(ecore_evas); + if (rotation == 90 || rotation == 270) { + int temp = wl_info->window_width; + + LOGD("swap width and height %d, %d", wl_info->window_width, wl_info->window_height); + + wl_info->window_width = wl_info->window_height; + wl_info->window_height = temp; + } + } else { + LOGW("failed to get ecore_evas.. skip rotation check"); + } + + LOGD("evas object : %p, rotation : %d, parent id : %u, window : %d,%d,%dx%d", + wl_info->evas_obj, rotation, wl_info->parent_id, wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height); } else {