[ACR-1634] Add new pixel format - VP8, VP9 96/259396/2 accepted/tizen/unified/20210615.120241 submit/tizen/20210615.011749
authorJeongmo Yang <jm80.yang@samsung.com>
Mon, 7 Jun 2021 07:40:49 +0000 (16:40 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 7 Jun 2021 07:57:24 +0000 (16:57 +0900)
[Version] 0.4.57
[Issue Type] New feature

Change-Id: I9b1ad416b37f0b4e8aa5f67db531d6cf4e051ac9
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
include/camera.h
packaging/capi-media-camera.spec
test/camera_test.c

index d7dded2..a59999c 100644 (file)
@@ -121,7 +121,9 @@ typedef enum {
        CAMERA_PIXEL_FORMAT_JPEG,           /**< Encoded pixel format */
        CAMERA_PIXEL_FORMAT_H264 = 15,      /**< Encoded pixel format : H264 (Since 3.0) */
        CAMERA_PIXEL_FORMAT_INVZ,           /**< Depth pixel format : INVZ (Since 5.0) */
-       CAMERA_PIXEL_FORMAT_MJPEG           /**< Encoded pixel format : Motion JPEG for preview (Since 6.0) */
+       CAMERA_PIXEL_FORMAT_MJPEG,          /**< Encoded pixel format : Motion JPEG for preview (Since 6.0) */
+       CAMERA_PIXEL_FORMAT_VP8,            /**< Encoded pixel format : VP8 (Since 6.5) */
+       CAMERA_PIXEL_FORMAT_VP9             /**< Encoded pixel format : VP9 (Since 6.5) */
 } camera_pixel_format_e;
 
 /**
index 144730f..75186ae 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-camera
 Summary:    A Camera API
-Version:    0.4.56
+Version:    0.4.57
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 181d885..3d061da 100644 (file)
@@ -519,14 +519,25 @@ static void _dump_preview_data(camera_preview_data_s *frame, const char *file_na
                return;
        }
 
-       if (frame->format == CAMERA_PIXEL_FORMAT_RGBA ||
-               frame->format == CAMERA_PIXEL_FORMAT_ARGB) {
+       switch (frame->format) {
+       case CAMERA_PIXEL_FORMAT_RGBA:
+               /* fall through */
+       case CAMERA_PIXEL_FORMAT_ARGB:
                fwrite(frame->data.rgb_plane.data, 1, frame->data.rgb_plane.size, fp);
-       } else if (frame->format == CAMERA_PIXEL_FORMAT_INVZ) {
+               break;
+       case CAMERA_PIXEL_FORMAT_INVZ:
                fwrite(frame->data.depth_plane.data, 1, frame->data.depth_plane.size, fp);
-       } else if (frame->format == CAMERA_PIXEL_FORMAT_MJPEG) {
+               break;
+       case CAMERA_PIXEL_FORMAT_H264:
+               /* fall through */
+       case CAMERA_PIXEL_FORMAT_MJPEG:
+               /* fall through */
+       case CAMERA_PIXEL_FORMAT_VP8:
+               /* fall through */
+       case CAMERA_PIXEL_FORMAT_VP9:
                fwrite(frame->data.encoded_plane.data, 1, frame->data.encoded_plane.size, fp);
-       } else {
+               break;
+       default:
                switch (frame->num_of_planes) {
                case 1:
                        fwrite(frame->data.single_plane.yuv, 1, frame->data.single_plane.size, fp);
@@ -543,6 +554,7 @@ static void _dump_preview_data(camera_preview_data_s *frame, const char *file_na
                default:
                        break;
                }
+               break;
        }
 
        g_print("[DUMP_PREVIEW_DATA] file[%s] write done\n", dump_path);