/**
* @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 */
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;
/**
* @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;
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:
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);