summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2022-05-11 14:47:32 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2022-05-11 15:04:04 +0900
commit50887d474bb0e9f21df206ffbe578949c336cb57 (patch)
tree371edea135132b6fef8ae2cb93d5daaf734b22d7
parente0d104327e827d34ceba7d6af58a212c8c9274af (diff)
downloadcamera-50887d474bb0e9f21df206ffbe578949c336cb57.tar.gz
camera-50887d474bb0e9f21df206ffbe578949c336cb57.tar.bz2
camera-50887d474bb0e9f21df206ffbe578949c336cb57.zip
- The thread for preview callback is created in camera_start_preview(), but, it could be skipped with recorder_prepare() when video recording. [Version] 0.4.77 [Issue Type] Bug fix Change-Id: I89aeaea03b392226a2c19c224445237599f6ce43 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--packaging/capi-media-camera.spec2
-rw-r--r--src/camera.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index 66bd4ec..2a7afe8 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.4.76
+Version: 0.4.77
Release: 0
Group: Multimedia/API
License: Apache-2.0
diff --git a/src/camera.c b/src/camera.c
index 787aff8..56cf058 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -1828,6 +1828,16 @@ static void __camera_add_msg_to_queue(camera_cb_info_s *cb_info, int api, int ev
api, event, event_class);
if (event == MUSE_CAMERA_EVENT_TYPE_PREVIEW) {
+ if (!cb_info->preview_cb_info.thread) {
+ LOGI("The thread for preview cb is not created yet, create it now");
+ if (!__create_msg_handler_thread(&cb_info->preview_cb_info,
+ CAMERA_MESSAGE_HANDLER_TYPE_PREVIEW_CB, "cam:preview_cb", cb_info)) {
+ CAM_LOG_ERROR("failed to create thread for preview cb");
+ g_free(cam_msg);
+ return;
+ }
+ }
+
g_mutex_lock(&cb_info->preview_cb_info.mutex);
g_queue_push_tail(cb_info->preview_cb_info.queue, (gpointer)cam_msg);
g_cond_signal(&cb_info->preview_cb_info.cond);