Add missed frame information for VP8 and VP9 formats 76/260676/2 accepted/tizen/unified/20210702.133335 submit/tizen/20210702.012854
authorJeongmo Yang <jm80.yang@samsung.com>
Thu, 1 Jul 2021 02:42:52 +0000 (11:42 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Thu, 1 Jul 2021 03:32:57 +0000 (12:32 +0900)
[Version] 0.4.61
[Issue Type] Bug fix

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

index ac6a1dd..dd6b891 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-camera
 Summary:    A Camera API
-Version:    0.4.60
+Version:    0.4.61
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index df3b09d..71db289 100644 (file)
@@ -90,25 +90,35 @@ void camera_create_preview_frame(camera_stream_data_s *stream, int num_buffer_fd
 
                buf_pos = data_bo_handle->ptr;
 
-               if (stream->format == MM_PIXEL_FORMAT_ENCODED_H264) {
+               switch (stream->format) {
+               case MM_PIXEL_FORMAT_ENCODED_H264:
+                       /* fall through */
+               case MM_PIXEL_FORMAT_ENCODED_MJPEG:
+                       /* fall through */
+               case MM_PIXEL_FORMAT_ENCODED_VP8:
+                       /* fall through */
+               case MM_PIXEL_FORMAT_ENCODED_VP9:
                        frame->data.encoded_plane.data = buf_pos;
                        frame->data.encoded_plane.size = stream->data.encoded.length_data;
                        frame->data.encoded_plane.is_delta_frame = (bool)stream->data.encoded.is_delta_frame;
                        total_size = stream->data.encoded.length_data;
-               } else if (stream->format == MM_PIXEL_FORMAT_ENCODED_MJPEG) {
-                       frame->data.encoded_plane.data = buf_pos;
-                       frame->data.encoded_plane.size = stream->data.encoded.length_data;
-                       total_size = stream->data.encoded.length_data;
-               } else if (stream->format == MM_PIXEL_FORMAT_INVZ) {
+                       break;
+
+               case MM_PIXEL_FORMAT_INVZ:
                        frame->data.depth_plane.data = buf_pos;
                        frame->data.depth_plane.size = stream->data.depth.length_data;
                        total_size = stream->data.depth.length_data;
-               } else if (stream->format == MM_PIXEL_FORMAT_RGBA ||
-                       stream->format == MM_PIXEL_FORMAT_ARGB) {
+                       break;
+
+               case MM_PIXEL_FORMAT_RGBA:
+                       /* fall through */
+               case MM_PIXEL_FORMAT_ARGB:
                        frame->data.rgb_plane.data = buf_pos;
                        frame->data.rgb_plane.size = stream->data.rgb.length_data;
                        total_size = stream->data.rgb.length_data;
-               } else {
+                       break;
+
+               default:
                        switch (stream->num_planes) {
                        case 1:
                                frame->data.single_plane.yuv = buf_pos;
@@ -140,6 +150,7 @@ void camera_create_preview_frame(camera_stream_data_s *stream, int num_buffer_fd
                        default:
                                break;
                        }
+                       break;
                }
 //LCOV_EXCL_STOP
        } else {