diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2018-08-06 14:01:02 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2018-08-08 10:01:00 +0900 |
commit | 3ae1b45de761912374c69ee3656b65cf9d7eb57a (patch) | |
tree | d1a1d46c591e187b3d7bd386060f312f876d9906 | |
parent | 51f92f5b810ba99414af15d55b454ad660eb5290 (diff) | |
download | camera-3ae1b45de761912374c69ee3656b65cf9d7eb57a.tar.gz camera-3ae1b45de761912374c69ee3656b65cf9d7eb57a.tar.bz2 camera-3ae1b45de761912374c69ee3656b65cf9d7eb57a.zip |
[ACR-1279] Add new preview format and update preview data structuresubmit/tizen/20180810.054330accepted/tizen/unified/20180813.061353
[Version] 0.4.12
[Profile] Common
[Issue Type] ACR
[Dependency module] N/A
Change-Id: I6cd9cf7c32a3027daf58b05893894d0ba4119c7c
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r-- | include/camera.h | 54 | ||||
-rw-r--r-- | include/camera_private.h | 2 | ||||
-rw-r--r-- | packaging/capi-media-camera.spec | 2 | ||||
-rw-r--r-- | src/camera.c | 11 |
4 files changed, 44 insertions, 25 deletions
diff --git a/include/camera.h b/include/camera.h index 21e6610..c25ecc9 100644 --- a/include/camera.h +++ b/include/camera.h @@ -100,6 +100,8 @@ typedef enum { /** * @brief Enumeration for the camera pixel format. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks If #CAMERA_PIXEL_FORMAT_INVZ is set, the type of display should be #CAMERA_DISPLAY_TYPE_NONE. \n + * Otherwise, camera_start_preview() will return #CAMERA_ERROR_INVALID_OPERATION. (Since 5.0) */ typedef enum { CAMERA_PIXEL_FORMAT_INVALID = -1, /**< Invalid pixel format */ @@ -118,6 +120,7 @@ typedef enum { CAMERA_PIXEL_FORMAT_ARGB, /**< ARGB pixel format */ 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_e; /** @@ -224,37 +227,42 @@ typedef struct { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef struct { - camera_pixel_format_e format; /**< The format of the frame pixel */ - int width; /**< The width of the frame */ - int height; /**< The height of the frame */ - int num_of_planes; /**< The number of planes */ - unsigned int timestamp; /**< The timestamp of the frame */ + camera_pixel_format_e format; /**< The format of the frame pixel */ + int width; /**< The width of the frame */ + int height; /**< The height of the frame */ + int num_of_planes; /**< The number of planes */ + unsigned int timestamp; /**< The timestamp of the frame */ union { struct { - unsigned char *yuv; /**< The yuv data pointer */ - unsigned int size; /**< The size of data */ - } single_plane; /**< single plane frame data */ + unsigned char *yuv; /**< The yuv data pointer */ + unsigned int size; /**< The size of data */ + } single_plane; /**< Single plane frame data */ struct { - unsigned char *y; /**< The y data pointer */ - unsigned char *uv; /**< The uv data pointer */ - unsigned int y_size; /**< The size of y data */ - unsigned int uv_size; /**< The size of uv data */ - } double_plane; /**< double plane frame data */ + unsigned char *y; /**< The y data pointer */ + unsigned char *uv; /**< The uv data pointer */ + unsigned int y_size; /**< The size of y data */ + unsigned int uv_size; /**< The size of uv data */ + } double_plane; /**< Double plane frame data */ struct { - unsigned char *y; /**< The y data pointer */ - unsigned char *u; /**< The u data pointer */ - unsigned char *v; /**< The v data pointer */ - unsigned int y_size; /**< The size of y data */ - unsigned int u_size; /**< The size of u data */ - unsigned int v_size; /**< The size of v data */ - } triple_plane; /**< triple plane frame data */ + unsigned char *y; /**< The y data pointer */ + unsigned char *u; /**< The u data pointer */ + unsigned char *v; /**< The v data pointer */ + unsigned int y_size; /**< The size of y data */ + unsigned int u_size; /**< The size of u data */ + unsigned int v_size; /**< The size of v data */ + } triple_plane; /**< Triple plane frame data */ struct { - unsigned char *data; /**< The encoded data pointer */ - unsigned int size; /**< The size of encoded data */ - } encoded_plane; + unsigned char *data; /**< The encoded data pointer */ + unsigned int size; /**< The size of encoded data */ + } encoded_plane; /**< Encoded plane frame data */ + + struct { + unsigned char *data; /**< The depth data pointer */ + unsigned int size; /**< The size of depth data */ + } depth_plane; /**< Depth plane frame data (Since 5.0) */ } data; } camera_preview_data_s; diff --git a/include/camera_private.h b/include/camera_private.h index 2539101..27bc050 100644 --- a/include/camera_private.h +++ b/include/camera_private.h @@ -80,7 +80,7 @@ typedef struct _camera_stream_data_s { struct { unsigned char *data; unsigned int length_data; - } encoded; + } encoded, depth; } data; /**< pointer of captured stream */ int data_type; /**< data type */ unsigned int length_total; /**< total length of stream buffer (in byte)*/ diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 9d8afe1..07b0e55 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.11 +Version: 0.4.12 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index eb0787e..e23cf86 100644 --- a/src/camera.c +++ b/src/camera.c @@ -875,6 +875,10 @@ static void _camera_preview_frame_create(camera_stream_data_s *stream, int num_b 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) { + 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 { switch (stream->num_planes) { case 1: @@ -2596,6 +2600,13 @@ int camera_start_preview(camera_h camera) LOGD("Enter : preview format %d, display type %d", pc->cb_info->preview_format, pc->cb_info->dp_type); + if (pc->cb_info->preview_format == CAMERA_PIXEL_FORMAT_INVZ && + pc->cb_info->dp_type != CAMERA_DISPLAY_TYPE_NONE) { + LOGE("CAMERA_DISPLAY_TYPE_NONE[current %d] should be set with INVZ format", + pc->cb_info->dp_type); + return CAMERA_ERROR_INVALID_OPERATION; + } + _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_NO_TIMEOUT); if (ret == CAMERA_ERROR_NONE && CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) { ret = _camera_start_evas_rendering(camera); |