summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaesu Gwon <haesu.gwon@samsung.com>2016-04-21 11:19:42 +0900
committerHaesu Gwon <haesu.gwon@samsung.com>2016-04-21 14:27:45 +0900
commitf32b05bd60ea52c47a47ad5c7de695b420a95e0b (patch)
tree6851717b1ae6f4a13885573ddd7988648170b570
parenta6cb1df5d449b7b1ab9c5d8c2e032bcb63736bc2 (diff)
downloadcamera-f32b05bd60ea52c47a47ad5c7de695b420a95e0b.tar.gz
camera-f32b05bd60ea52c47a47ad5c7de695b420a95e0b.tar.bz2
camera-f32b05bd60ea52c47a47ad5c7de695b420a95e0b.zip
[Release version 0.2.51] Update get/set display flip code for EVAS surface.
Change-Id: I901eca5d218af4ae1f423f690a221dabb0038340 Signed-off-by: Haesu Gwon <haesu.gwon@samsung.com>
-rw-r--r--packaging/capi-media-camera.spec2
-rw-r--r--src/camera.c39
2 files changed, 34 insertions, 7 deletions
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index c3b332a..fca52aa 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.50
+Version: 0.2.51
Release: 0
Group: Multimedia/API
License: Apache-2.0
diff --git a/src/camera.c b/src/camera.c
index 159957f..b70bd41 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -2669,7 +2669,8 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
LOGD("current setting : flip %d, mode %d, rotation %d, visible %d",
flip, mode, rotation, visible);
- ret = mm_evas_renderer_set_geometry(cb_info->evas_info, mode);
+ ret = mm_evas_renderer_set_flip(cb_info->evas_info, flip);
+ ret |= mm_evas_renderer_set_geometry(cb_info->evas_info, mode);
ret |= mm_evas_renderer_set_rotation(cb_info->evas_info, rotation);
ret |= mm_evas_renderer_set_visible(cb_info->evas_info, visible);
}
@@ -2958,6 +2959,19 @@ int camera_set_display_flip(camera_h camera, camera_flip_e flip)
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
+ g_mutex_lock(&pc->cb_info->evas_mutex);
+
+ ret = mm_evas_renderer_set_flip(pc->cb_info->evas_info, flip);
+
+ g_mutex_unlock(&pc->cb_info->evas_mutex);
+
+ if (ret!= MM_ERROR_NONE) {
+ LOGE("failed to set flip for evas surface 0x%x", ret);
+ return CAMERA_ERROR_INVALID_OPERATION;
+ }
+ }
+
muse_camera_msg_send1(MUSE_CAMERA_API_SET_DISPLAY_FLIP,
pc->cb_info->fd, pc->cb_info, ret, INT, set_flip);
@@ -2982,12 +2996,25 @@ int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
return CAMERA_ERROR_INVALID_PARAMETER;
}
- muse_camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_FLIP,
- pc->cb_info->fd, pc->cb_info, ret);
+ if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
+ g_mutex_lock(&pc->cb_info->evas_mutex);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_flip, pc->cb_info->recv_msg);
- *flip = (camera_flip_e)get_flip;
+ ret = mm_evas_renderer_get_flip(pc->cb_info->evas_info, (int *)flip);
+
+ g_mutex_unlock(&pc->cb_info->evas_mutex);
+
+ if (ret != MM_ERROR_NONE) {
+ LOGE("failed to get flip for evas surface 0x%x", ret);
+ return CAMERA_ERROR_INVALID_OPERATION;
+ }
+ } else {
+ muse_camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_FLIP,
+ pc->cb_info->fd, pc->cb_info, ret);
+
+ if (ret == CAMERA_ERROR_NONE) {
+ muse_camera_msg_get(get_flip, pc->cb_info->recv_msg);
+ *flip = (camera_flip_e)get_flip;
+ }
}
return ret;