Fix NULL stream data for camera_attr_get_preview_frame_meta() 65/316065/1 accepted/tizen/7.0/unified/20240814.182606
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 13 Aug 2024 05:47:32 +0000 (14:47 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 13 Aug 2024 05:47:32 +0000 (14:47 +0900)
[Version] 0.4.110
[Issue Type] Bug fix

Change-Id: Ie6a7db724776f08d927af9ce7bf69c642fe77795
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/capi-media-camera.spec
src/camera.c

index dea874b..1bd95d9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-camera
 Summary:    A Camera API
-Version:    0.4.109
+Version:    0.4.110
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 9221e19..e846bf4 100644 (file)
@@ -433,6 +433,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)) {
@@ -460,9 +463,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);
@@ -480,8 +480,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)
@@ -572,6 +570,8 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv
        g_mutex_unlock(&cb_info->bridge_lock);
 
 _PREVIEW_CB_HANDLER_DONE:
+       cb_info->stream_data = NULL;
+
        /* send PREVIEW_CB_RETURN message if zero copy buffer is used(num_buffer_fd is bigger than 0)
           and preview callback(normal or media packet) is set. */
        if (num_buffer_fd > 0 &&