summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2016-11-07 20:14:56 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2016-11-07 20:14:56 +0900
commite92ea30804225b730894efec9cf9d3a78e5b213e (patch)
treede502465b30be26aa0d366dc05a823bcfe1a3d92
parente977273bbc37b4e2ae102bc6354f93d6e0966127 (diff)
downloadcamera-e92ea30804225b730894efec9cf9d3a78e5b213e.tar.gz
camera-e92ea30804225b730894efec9cf9d3a78e5b213e.tar.bz2
camera-e92ea30804225b730894efec9cf9d3a78e5b213e.zip
Stop evas rendering when change preview resolution while previewing
Without stopping evas rendering, the last camera buffer will not returned to camerasrc, so timeout is occurred in camerasrc. [Version] 0.2.83 [Profile] Common [Issue Type] Bug fix [Dependency module] N/A [Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-mobile_20161101.3] Change-Id: I5f8aeac23b11a0887b926717b9f5c17967f468b0 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--packaging/capi-media-camera.spec2
-rw-r--r--src/camera.c20
2 files changed, 21 insertions, 1 deletions
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index 08a950d..0deac73 100644
--- a/packaging/capi-media-camera.spec
+++ b/packaging/capi-media-camera.spec
@@ -1,6 +1,6 @@
Name: capi-media-camera
Summary: A Camera API
-Version: 0.2.82
+Version: 0.2.83
Release: 0
Group: Multimedia/API
License: Apache-2.0
diff --git a/src/camera.c b/src/camera.c
index 9ece7f4..7d3db69 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -3196,6 +3196,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
int camera_set_preview_resolution(camera_h camera, int width, int height)
{
int ret = CAMERA_ERROR_NONE;
+ camera_state_e current_state = CAMERA_STATE_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
camera_msg_param param;
@@ -3206,6 +3207,20 @@ int camera_set_preview_resolution(camera_h camera, int width, int height)
return CAMERA_ERROR_INVALID_PARAMETER;
}
+ if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
+ ret = camera_get_state(camera, &current_state);
+ if (ret != CAMERA_ERROR_NONE) {
+ LOGE("failed to get current state 0x%x", ret);
+ return ret;
+ }
+
+ if (current_state == CAMERA_STATE_PREVIEW) {
+ ret = _camera_stop_evas_rendering(camera, false);
+ if (ret != CAMERA_ERROR_NONE)
+ return ret;
+ }
+ }
+
value = (width << 16) | height;
CAMERA_MSG_PARAM_SET(param, INT, value);
@@ -3215,6 +3230,11 @@ int camera_set_preview_resolution(camera_h camera, int width, int height)
LOGD("ret : 0x%x", ret);
+ if (current_state == CAMERA_STATE_PREVIEW) {
+ LOGW("restart evas rendering");
+ _camera_start_evas_rendering(camera);
+ }
+
return ret;
}