From e92ea30804225b730894efec9cf9d3a78e5b213e Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Mon, 7 Nov 2016 20:14:56 +0900 Subject: [PATCH] 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 --- packaging/capi-media-camera.spec | 2 +- src/camera.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) 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, ¤t_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; } -- 2.7.4