From: Jeongmo Yang Date: Tue, 13 Aug 2024 05:47:32 +0000 (+0900) Subject: Fix NULL stream data for camera_attr_get_preview_frame_meta() X-Git-Tag: accepted/tizen/unified/20240826.233023^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F316293%2F1;p=platform%2Fcore%2Fapi%2Fcamera.git Fix NULL stream data for camera_attr_get_preview_frame_meta() [Version] 1.1.3 [Issue Type] Bug fix Change-Id: Ie6a7db724776f08d927af9ce7bf69c642fe77795 Signed-off-by: Jeongmo Yang --- diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 8a17051..c481803 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: 1.1.2 +Version: 1.1.3 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index e38382c..11780ed 100644 --- a/src/camera.c +++ b/src/camera.c @@ -414,6 +414,9 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv stream->frame_meta.ts_aux, stream->frame_meta.td_aux, stream->frame_meta.seqnum, stream->frame_meta.flags); + /* set stream data for camera_attr_get_preview_frame_rotation() and camera_attr_get_preview_frame_meta() */ + cb_info->stream_data = stream; + if (num_buffer_fd == 0 && CAMERA_IS_FD_VALID(tfd[1])) { /* import tbm data_bo and get virtual address */ if (!__camera_import_tbm_fd(cb_info->bufmgr, tfd[1], &data_bo, &data_bo_handle)) { @@ -441,9 +444,6 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv (cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_EXTRA_PREVIEW] && stream->extra_stream_id >= MM_CAMCORDER_VIDEO_STREAM_ID_EXTRA_MIN)) { camera_create_preview_frame(stream, num_buffer_fd, buffer_bo_handle, &data_bo_handle, &frame); - /* set stream data for camera_get_preview_frame_rotation() */ - cb_info->stream_data = stream; - if (stream->extra_stream_id < MM_CAMCORDER_VIDEO_STREAM_ID_EXTRA_MIN) { monitoring_info = cb_info->monitoring_info_preview; __camera_preview_cb_monitoring_info_start(monitoring_info); @@ -461,8 +461,6 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv } __camera_preview_cb_monitoring_info_end(monitoring_info); - - cb_info->stream_data = NULL; } if (stream->extra_stream_id >= MM_CAMCORDER_VIDEO_STREAM_ID_EXTRA_MIN) @@ -553,6 +551,8 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv } _PREVIEW_CB_HANDLER_DONE: + cb_info->stream_data = NULL; + /* send PREVIEW_CB_RETURN message if zero copy buffer is used */ if (num_buffer_fd > 0) _camera_msg_send(MUSE_CAMERA_API_PREVIEW_CB_RETURN, NULL, cb_info, NULL, 0);