/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __QCAMERA_TYPES_H__
#define __QCAMERA_TYPES_H__
#include <stdint.h>
#include <pthread.h>
#include <inttypes.h>
#include <media/msmb_camera.h>
#define CAM_MAX_NUM_BUFS_PER_STREAM 64
#define MAX_METADATA_PAYLOAD_SIZE 1024
#define CEILING32(X) (((X) + 0x0001F) & 0xFFFFFFE0)
#define CEILING16(X) (((X) + 0x000F) & 0xFFF0)
#define CEILING4(X) (((X) + 0x0003) & 0xFFFC)
#define CEILING2(X) (((X) + 0x0001) & 0xFFFE)
#define MAX_ZOOMS_CNT 64
#define MAX_SIZES_CNT 24
#define MAX_EXP_BRACKETING_LENGTH 32
#define MAX_ROI 5
#define MAX_STREAM_NUM_IN_BUNDLE 4
#define MAX_NUM_STREAMS 8
#define MAX_TEST_PATTERN_CNT 8
#define MAX_AVAILABLE_CAPABILITIES 6
#define GPS_PROCESSING_METHOD_SIZE 33
typedef enum {
CAM_HAL_V1 = 1,
CAM_HAL_V3 = 3
} cam_hal_version_t;
typedef enum {
CAM_STATUS_SUCCESS, /* Operation Succeded */
CAM_STATUS_FAILED, /* Failure in doing operation */
CAM_STATUS_INVALID_PARM, /* Inavlid parameter provided */
CAM_STATUS_NOT_SUPPORTED, /* Parameter/operation not supported */
CAM_STATUS_ACCEPTED, /* Parameter accepted */
CAM_STATUS_MAX,
} cam_status_t;
typedef enum {
CAM_POSITION_BACK,
CAM_POSITION_FRONT
} cam_position_t;
typedef enum {
CAM_FLICKER_NONE,
CAM_FLICKER_50_HZ,
CAM_FLICKER_60_HZ
} cam_flicker_t;
typedef enum {
CAM_FORMAT_JPEG = 0,
CAM_FORMAT_YUV_420_NV12 = 1,
CAM_FORMAT_YUV_420_NV21,
CAM_FORMAT_YUV_420_NV21_ADRENO,
CAM_FORMAT_YUV_420_YV12,
CAM_FORMAT_YUV_422_NV16,
CAM_FORMAT_YUV_422_NV61,
CAM_FORMAT_YUV_420_NV12_VENUS,
/* Please note below are the defintions for raw image.
* Any format other than raw image format should be declared
* before this line!!!!!!!!!!!!! */
/* Note: For all raw formats, each scanline needs to be 16 bytes aligned */
/* Packed YUV/YVU raw format, 16 bpp: 8 bits Y and 8 bits UV.
* U and V are interleaved with Y: YUYV or YVYV */
CAM_FORMAT_YUV_RAW_8BIT_YUYV,
CAM_FORMAT_YUV_RAW_8BIT_YVYU,
CAM_FORMAT_YUV_RAW_8BIT_UYVY,
CAM_FORMAT_YUV_RAW_8BIT_VYUY,
/* QCOM RAW formats where data is packed into 64bit word.
* 8BPP: 1 64-bit word contains 8 pixels p0 - p7, where p0 is
* stored at LSB.
* 10BPP: 1 64-bit word contains 6 pixels p0 - p5, where most
* significant 4 bits are set to 0. P0 is stored at LSB.
* 12BPP: 1 64-bit word contains 5 pixels p0 - p4, where most
* significant 4 bits are set to 0. P0 is stored at LSB. */
CAM_FORMAT_BAYER_QCOM_RAW_8BPP_GBRG,
CAM_FORMAT_BAYER_QCOM_RAW_8BPP_GRBG,
CAM_FORMAT_BAYER_QCOM_RAW_8BPP_RGGB,
CAM_FORMAT_BAYER_QCOM_RAW_8BPP_BGGR,
CAM_FORMAT_BAYER_QCOM_RAW_10BPP_GBRG,
CAM_FORMAT_BAYER_QCOM_RAW_10BPP_GRBG,
CAM_FORMAT_BAYER_QCOM_RAW_10BPP_RGGB,
CAM_FORMAT_BAYER_QCOM_RAW_10BPP_BGGR,
CAM_FORMAT_BAYER_QCOM_RAW_12BPP_GBRG,
CAM_FORMAT_BAYER_QCOM_RAW_12BPP_GRBG,
CAM_FORMAT_BAYER_QCOM_RAW_12BPP_RGGB,
CAM_FORMAT_BAYER_QCOM_RAW_12BPP_BGGR,
/* MIPI RAW formats based on MIPI CSI-2 specifiction.
* 8BPP: Each pixel occupies one bytes, starting at LSB.
* Output with of image has no restrictons.
* 10BPP: Four pixels are held in every 5 bytes. The output
* with of image must be a multiple of 4 pixels.
* 12BPP: Two pixels are held in every 3 bytes. The output
* width of image must be a multiple of 2 pixels. */
CAM_FORMAT_BAYER_MIPI_RAW_8BPP_GBRG,
CAM_FORMAT_BAYER_MIPI_RAW_8BPP_GRBG,
CAM_FORMAT_BAYER_MIPI_RAW_8BPP_RGGB,
CAM_FORMAT_BAYER_MIPI_RAW_8BPP_BGGR,
CAM_FORMAT_BAYER_MIPI_RAW_10BPP_GBRG,
CAM_FORMAT_BAYER_MIPI_RAW_10BPP_GRBG,
CAM_FORMAT_BAYER_MIPI_RAW_10BPP_RGGB,
CAM_FORMAT_BAYER_MIPI_RAW_10BPP_BGGR,
CAM_FORMAT_BAYER_MIPI_RAW_12BPP_GBRG,
CAM_FORMAT_BAYER_MIPI_RAW_12BPP_GRBG,
CAM_FORMAT_BAYER_MIPI_RAW_12BPP_RGGB,
CAM_FORMAT_BAYER_MIPI_RAW_12BPP_BGGR,
/* Ideal raw formats where image data has gone through black
* correction, lens rolloff, demux/channel gain, bad pixel
* correction, and ABF.
* Ideal raw formats could output any of QCOM_RAW and MIPI_RAW
* formats, plus plain8 8bbp, plain16 800, plain16 10bpp, and
* plain 16 12bpp */
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN8_8BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN8_8BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN8_8BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN8_8BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_8BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_8BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_8BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_8BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_10BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_10BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_10BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_10BPP_BGGR,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_12BPP_GBRG,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_12BPP_GRBG,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_12BPP_RGGB,
CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_12BPP_BGGR,
/* generic 8-bit raw */
CAM_FORMAT_JPEG_RAW_8BIT,
CAM_FORMAT_META_RAW_8BIT,
CAM_FORMAT_MAX
} cam_format_t;
typedef enum {
/* applies to HAL 1 */
CAM_STREAM_TYPE_DEFAULT,