mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
drivers: video: Rearchitect video driver
Rearchitect video driver: - Define two video I/F(struct imgsensor_ops_s and struct imgdata_ops_s), and support them. - CISIF driver supports new video I/F struct imgdata_ops_s. - ISX012 driver supports new video I/F struct imgsensor_ops_s. - Move ISX012 driver to general driver directory.
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/video/imgdata.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_VIDEO_IMGDATA_H
|
||||
#define __INCLUDE_NUTTX_VIDEO_IMGDATA_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Format definition for start_capture() and validate_frame_setting */
|
||||
|
||||
#define IMGDATA_FMT_MAX (2)
|
||||
#define IMGDATA_FMT_MAIN (0)
|
||||
#define IMGDATA_FMT_SUB (1)
|
||||
#define IMGDATA_PIX_FMT_UYVY (0)
|
||||
#define IMGDATA_PIX_FMT_RGB565 (1)
|
||||
#define IMGDATA_PIX_FMT_JPEG (2)
|
||||
#define IMGDATA_PIX_FMT_JPEG_WITH_SUBIMG (3)
|
||||
#define IMGDATA_PIX_FMT_SUBIMG_UYVY (4)
|
||||
#define IMGDATA_PIX_FMT_SUBIMG_RGB565 (5)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/* structure for validate_frame_setting() and start_capture() */
|
||||
|
||||
typedef struct imgdata_format_s
|
||||
{
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint32_t pixelformat;
|
||||
} imgdata_format_t;
|
||||
|
||||
typedef struct imgdata_interval_s
|
||||
{
|
||||
uint32_t numerator;
|
||||
uint32_t denominator;
|
||||
} imgdata_interval_t;
|
||||
|
||||
typedef int (*imgdata_capture_t)(uint8_t result, uint32_t size);
|
||||
|
||||
/* Structure for Data Control I/F */
|
||||
|
||||
struct imgdata_ops_s
|
||||
{
|
||||
CODE int (*init)(void);
|
||||
CODE int (*uninit)(void);
|
||||
|
||||
CODE int (*validate_buf)(uint8_t *addr, uint32_t size);
|
||||
CODE int (*set_buf)(uint8_t *addr, uint32_t size);
|
||||
|
||||
CODE int (*validate_frame_setting)(uint8_t nr_datafmts,
|
||||
FAR imgdata_format_t *datafmts,
|
||||
FAR imgdata_interval_t *interval);
|
||||
CODE int (*start_capture)(uint8_t nr_datafmts,
|
||||
FAR imgdata_format_t *datafmts,
|
||||
FAR imgdata_interval_t *interval,
|
||||
FAR imgdata_capture_t callback);
|
||||
CODE int (*stop_capture)(void);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/* Register image data operations. */
|
||||
|
||||
void imgdata_register(const FAR struct imgdata_ops_s *ops);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_IMGDATA_H */
|
||||
@@ -0,0 +1,350 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/video/imgsensor.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_VIDEO_IMGSENSOR_H
|
||||
#define __INCLUDE_NUTTX_VIDEO_IMGSENSOR_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Camera parameter IDs */
|
||||
|
||||
#define IMGSENSOR_ID_BRIGHTNESS (0x00000000)
|
||||
#define IMGSENSOR_ID_CONTRAST (0x00000001)
|
||||
#define IMGSENSOR_ID_SATURATION (0x00000002)
|
||||
#define IMGSENSOR_ID_HUE (0x00000003)
|
||||
#define IMGSENSOR_ID_AUTO_WHITE_BALANCE (0x00000004)
|
||||
#define IMGSENSOR_ID_RED_BALANCE (0x00000005)
|
||||
#define IMGSENSOR_ID_BLUE_BALANCE (0x00000006)
|
||||
#define IMGSENSOR_ID_GAMMA (0x00000007)
|
||||
#define IMGSENSOR_ID_GAMMA_CURVE (0x00000008)
|
||||
#define IMGSENSOR_ID_EXPOSURE (0x00000009)
|
||||
#define IMGSENSOR_ID_HFLIP_VIDEO (0x0000000a)
|
||||
#define IMGSENSOR_ID_VFLIP_VIDEO (0x0000000b)
|
||||
#define IMGSENSOR_ID_HFLIP_STILL (0x0000000c)
|
||||
#define IMGSENSOR_ID_VFLIP_STILL (0x0000000d)
|
||||
#define IMGSENSOR_ID_SHARPNESS (0x0000000e)
|
||||
#define IMGSENSOR_ID_COLOR_KILLER (0x0000000f)
|
||||
#define IMGSENSOR_ID_COLORFX (0x00000010)
|
||||
#define IMGSENSOR_ID_AUTOBRIGHTNESS (0x00000011)
|
||||
#define IMGSENSOR_ID_ROTATE (0x00000012)
|
||||
#define IMGSENSOR_ID_EXPOSURE_AUTO (0x00010000)
|
||||
#define IMGSENSOR_ID_EXPOSURE_ABSOLUTE (0x00010001)
|
||||
#define IMGSENSOR_ID_FOCUS_ABSOLUTE (0x00010002)
|
||||
#define IMGSENSOR_ID_FOCUS_RELATIVE (0x00010003)
|
||||
#define IMGSENSOR_ID_FOCUS_AUTO (0x00010004)
|
||||
#define IMGSENSOR_ID_ZOOM_ABSOLUTE (0x00010005)
|
||||
#define IMGSENSOR_ID_ZOOM_RELATIVE (0x00010006)
|
||||
#define IMGSENSOR_ID_ZOOM_CONTINUOUS (0x00010007)
|
||||
#define IMGSENSOR_ID_IRIS_ABSOLUTE (0x00010008)
|
||||
#define IMGSENSOR_ID_IRIS_RELATIVE (0x00010009)
|
||||
#define IMGSENSOR_ID_AUTO_N_PRESET_WB (0x0001000a)
|
||||
#define IMGSENSOR_ID_WIDE_DYNAMIC_RANGE (0x0001000b)
|
||||
#define IMGSENSOR_ID_IMG_STABILIZATION (0x0001000c)
|
||||
#define IMGSENSOR_ID_ISO_SENSITIVITY (0x0001000d)
|
||||
#define IMGSENSOR_ID_ISO_SENSITIVITY_AUTO (0x0001000e)
|
||||
#define IMGSENSOR_ID_EXPOSURE_METERING (0x0001000f)
|
||||
#define IMGSENSOR_ID_3A_LOCK (0x00010011)
|
||||
#define IMGSENSOR_ID_AUTO_FOCUS_START (0x00010012)
|
||||
#define IMGSENSOR_ID_AUTO_FOCUS_STOP (0x00010013)
|
||||
#define IMGSENSOR_ID_3A_PARAMETER (0x00010014)
|
||||
#define IMGSENSOR_ID_3A_STATUS (0x00010015)
|
||||
#define IMGSENSOR_ID_FLASH_LED_MODE (0x00020000)
|
||||
#define IMGSENSOR_ID_JPEG_QUALITY (0x00030000)
|
||||
|
||||
/* bit definition for IMGSENSOR_ID_3A_LOCK */
|
||||
|
||||
#define IMGSENSOR_LOCK_EXPOSURE (1 << 0)
|
||||
#define IMGSENSOR_LOCK_WHITE_BALANCE (1 << 1)
|
||||
#define IMGSENSOR_LOCK_FOCUS (1 << 2)
|
||||
|
||||
/* Status bit definition for IMGSENSOR_ID_3A_STATUS */
|
||||
|
||||
#define IMGSENSOR_3A_STATUS_STABLE (0)
|
||||
#define IMGSENSOR_3A_STATUS_AE_OPERATING (1 << 0)
|
||||
#define IMGSENSOR_3A_STATUS_AWB_OPERATING (1 << 1)
|
||||
#define IMGSENSOR_3A_STATUS_AF_OPERATING (1 << 2)
|
||||
|
||||
/* Format definition for start_capture() and validate_frame_setting */
|
||||
|
||||
#define IMGSENSOR_FMT_MAX (2)
|
||||
#define IMGSENSOR_FMT_MAIN (0)
|
||||
#define IMGSENSOR_FMT_SUB (1)
|
||||
#define IMGSENSOR_PIX_FMT_UYVY (0)
|
||||
#define IMGSENSOR_PIX_FMT_RGB565 (1)
|
||||
#define IMGSENSOR_PIX_FMT_JPEG (2)
|
||||
#define IMGSENSOR_PIX_FMT_JPEG_WITH_SUBIMG (3)
|
||||
#define IMGSENSOR_PIX_FMT_SUBIMG_UYVY (4)
|
||||
#define IMGSENSOR_PIX_FMT_SUBIMG_RGB565 (5)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/* enumeration for VIDEO_ID_COLORFX */
|
||||
|
||||
typedef enum imgsensor_colorfx_e
|
||||
{
|
||||
IMGSENSOR_COLORFX_NONE = 0,
|
||||
IMGSENSOR_COLORFX_BW = 1,
|
||||
IMGSENSOR_COLORFX_SEPIA = 2,
|
||||
IMGSENSOR_COLORFX_NEGATIVE = 3,
|
||||
IMGSENSOR_COLORFX_EMBOSS = 4,
|
||||
IMGSENSOR_COLORFX_SKETCH = 5,
|
||||
IMGSENSOR_COLORFX_SKY_BLUE = 6,
|
||||
IMGSENSOR_COLORFX_GRASS_GREEN = 7,
|
||||
IMGSENSOR_COLORFX_SKIN_WHITEN = 8,
|
||||
IMGSENSOR_COLORFX_VIVID = 9,
|
||||
IMGSENSOR_COLORFX_AQUA = 10,
|
||||
IMGSENSOR_COLORFX_ART_FREEZE = 11,
|
||||
IMGSENSOR_COLORFX_SILHOUETTE = 12,
|
||||
IMGSENSOR_COLORFX_SOLARIZATION = 13,
|
||||
IMGSENSOR_COLORFX_ANTIQUE = 14,
|
||||
IMGSENSOR_COLORFX_SET_CBCR = 15,
|
||||
IMGSENSOR_COLORFX_PASTEL = 16,
|
||||
} imgsensor_colorfx_t;
|
||||
|
||||
/* enumeration for IMGSENSOR_ID_EXPOSURE_AUTO */
|
||||
|
||||
typedef enum imgsensor_exposure_auto_type_e
|
||||
{
|
||||
/* exposure time:auto, iris aperture:auto */
|
||||
|
||||
IMGSENSOR_EXPOSURE_AUTO = 0,
|
||||
|
||||
/* exposure time:manual, iris aperture:manual */
|
||||
|
||||
IMGSENSOR_EXPOSURE_MANUAL = 1,
|
||||
|
||||
/* exposure time:manual, iris aperture:auto */
|
||||
|
||||
IMGSENSOR_EXPOSURE_SHUTTER_PRIORITY = 2,
|
||||
|
||||
/* exposure time:auto, iris aperture:manual */
|
||||
|
||||
IMGSENSOR_EXPOSURE_APERTURE_PRIORITY = 3
|
||||
} imgsensor_exposure_auto_type_t;
|
||||
|
||||
/* enumeration for IMGSENSOR_ID_AUTO_N_PRESET_WHITE_BALANCE */
|
||||
|
||||
typedef enum imgsensor_white_balance_e
|
||||
{
|
||||
IMGSENSOR_WHITE_BALANCE_MANUAL = 0,
|
||||
IMGSENSOR_WHITE_BALANCE_AUTO = 1,
|
||||
IMGSENSOR_WHITE_BALANCE_INCANDESCENT = 2,
|
||||
IMGSENSOR_WHITE_BALANCE_FLUORESCENT = 3,
|
||||
IMGSENSOR_WHITE_BALANCE_FLUORESCENT_H = 4,
|
||||
IMGSENSOR_WHITE_BALANCE_HORIZON = 5,
|
||||
IMGSENSOR_WHITE_BALANCE_DAYLIGHT = 6,
|
||||
IMGSENSOR_WHITE_BALANCE_FLASH = 7,
|
||||
IMGSENSOR_WHITE_BALANCE_CLOUDY = 8,
|
||||
IMGSENSOR_WHITE_BALANCE_SHADE = 9,
|
||||
} imgsensor_white_balance_t;
|
||||
|
||||
/* enumeration for IMGSENSOR_ID_ISO_SENSITIVITY_AUTO */
|
||||
|
||||
typedef enum imgsensor_iso_sensitivity_auto_type_e
|
||||
{
|
||||
IMGSENSOR_ISO_SENSITIVITY_MANUAL = 0,
|
||||
IMGSENSOR_ISO_SENSITIVITY_AUTO = 1,
|
||||
} imgsensor_iso_sensitivity_auto_type_t;
|
||||
|
||||
/* enumeration for IMGSENSOR_ID_EXPOSURE_METERING */
|
||||
|
||||
typedef enum imgsensor_exposure_metering_e
|
||||
{
|
||||
IMGSENSOR_EXPOSURE_METERING_AVERAGE = 0,
|
||||
IMGSENSOR_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
|
||||
IMGSENSOR_EXPOSURE_METERING_SPOT = 2,
|
||||
IMGSENSOR_EXPOSURE_METERING_MATRIX = 3,
|
||||
} imgsensor_exposure_metering_t;
|
||||
|
||||
/* enumeration for IMGSENSOR_ID_FLASH_LED_MODE */
|
||||
|
||||
typedef enum imgsensor_flash_led_mode_e
|
||||
{
|
||||
IMGSENSOR_FLASH_LED_MODE_NONE = 0,
|
||||
IMGSENSOR_FLASH_LED_MODE_FLASH = 1,
|
||||
IMGSENSOR_FLASH_LED_MODE_TORCH = 2,
|
||||
} imgsensor_flash_led_mode_t;
|
||||
|
||||
/* enumeration for get_supported_value() */
|
||||
|
||||
typedef enum imgsensor_ctrl_type_e
|
||||
{
|
||||
IMGSENSOR_CTRL_TYPE_INTEGER = 1,
|
||||
IMGSENSOR_CTRL_TYPE_BOOLEAN = 2,
|
||||
IMGSENSOR_CTRL_TYPE_INTEGER64 = 5,
|
||||
IMGSENSOR_CTRL_TYPE_BITMASK = 8,
|
||||
IMGSENSOR_CTRL_TYPE_INTEGER_MENU = 9,
|
||||
IMGSENSOR_CTRL_TYPE_U8FIXEDPOINT_Q7 = 10,
|
||||
IMGSENSOR_CTRL_TYPE_U16FIXEDPOINT_Q8 = 11,
|
||||
IMGSENSOR_CTRL_TYPE_INTEGER_TIMES_3 = 12,
|
||||
IMGSENSOR_CTRL_TYPE_U8 = 0x0100,
|
||||
IMGSENSOR_CTRL_TYPE_U16 = 0x0101,
|
||||
IMGSENSOR_CTRL_TYPE_U32 = 0x0102,
|
||||
} imgsensor_ctrl_type_t;
|
||||
|
||||
/* enumeration for stream */
|
||||
|
||||
typedef enum imgsensor_stream_type_e
|
||||
{
|
||||
IMGSENSOR_STREAM_TYPE_VIDEO = 0,
|
||||
IMGSENSOR_STREAM_TYPE_STILL = 1,
|
||||
} imgsensor_stream_type_t;
|
||||
|
||||
/* structure for validate_frame_setting() and start_capture() */
|
||||
|
||||
typedef struct imgsensor_format_s
|
||||
{
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint32_t pixelformat;
|
||||
} imgsensor_format_t;
|
||||
|
||||
typedef struct imgsensor_interval_s
|
||||
{
|
||||
uint32_t numerator;
|
||||
uint32_t denominator;
|
||||
} imgsensor_interval_t;
|
||||
|
||||
/* structure for get_supported_value() */
|
||||
|
||||
typedef struct imgsensor_capability_range_s
|
||||
{
|
||||
int64_t minimum;
|
||||
int64_t maximum;
|
||||
uint64_t step;
|
||||
int64_t default_value;
|
||||
} imgsensor_capability_range_t;
|
||||
|
||||
typedef struct imgsensor_capability_discrete_s
|
||||
{
|
||||
int8_t nr_values;
|
||||
int32_t *values;
|
||||
int32_t default_value;
|
||||
} imgsensor_capability_discrete_t;
|
||||
|
||||
typedef struct imgsensor_capability_elems_s
|
||||
{
|
||||
uint32_t nr_elems;
|
||||
int64_t minimum;
|
||||
int64_t maximum;
|
||||
uint64_t step;
|
||||
} imgsensor_capability_elems_t;
|
||||
|
||||
typedef struct imgsensor_supported_value_s
|
||||
{
|
||||
imgsensor_ctrl_type_t type; /* control type */
|
||||
union
|
||||
{
|
||||
/* Use 'range' member in the following types cases.
|
||||
* IMGSENSOR_CTRL_TYPE_INTEGER
|
||||
* IMGSENSOR_CTRL_TYPE_BOOLEAN
|
||||
* IMGSENSOR_CTRL_TYPE_INTEGER64
|
||||
* IMGSENSOR_CTRL_TYPE_BITMASK
|
||||
* IMGSENSOR_CTRL_TYPE_U8FIXEDPOINT_Q7
|
||||
* IMGSENSOR_CTRL_TYPE_U16FIXEDPOINT_Q8
|
||||
* IMGSENSOR_CTRL_TYPE_INTEGER_TIMES_3
|
||||
*/
|
||||
|
||||
imgsensor_capability_range_t range;
|
||||
|
||||
/* Use 'discrete' member in the following type case.
|
||||
* IMGSENSOR_CTRL_TYPE_INTEGER_MENU
|
||||
*/
|
||||
|
||||
imgsensor_capability_discrete_t discrete;
|
||||
|
||||
/* Use 'elems' member in the following types cases.
|
||||
* IMGSENSOR_CTRL_TYPE_U8
|
||||
* IMGSENSOR_CTRL_TYPE_U16
|
||||
* IMGSENSOR_CTRL_TYPE_U32
|
||||
*/
|
||||
|
||||
imgsensor_capability_elems_t elems;
|
||||
} u;
|
||||
} imgsensor_supported_value_t;
|
||||
|
||||
typedef union imgsensor_value_u
|
||||
{
|
||||
int32_t value32;
|
||||
int64_t value64;
|
||||
uint8_t *p_u8;
|
||||
uint16_t *p_u16;
|
||||
uint32_t *p_u32;
|
||||
} imgsensor_value_t;
|
||||
|
||||
/* Structure for Image Sensor I/F */
|
||||
|
||||
struct imgsensor_ops_s
|
||||
{
|
||||
CODE int (*init)(void);
|
||||
CODE int (*uninit)(void);
|
||||
|
||||
CODE int (*validate_frame_setting)(imgsensor_stream_type_t type,
|
||||
uint8_t nr_datafmts,
|
||||
FAR imgsensor_format_t *datafmts,
|
||||
FAR imgsensor_interval_t *interval);
|
||||
CODE int (*start_capture)(imgsensor_stream_type_t type,
|
||||
uint8_t nr_datafmts,
|
||||
FAR imgsensor_format_t *datafmts,
|
||||
FAR imgsensor_interval_t *interval);
|
||||
CODE int (*stop_capture)(imgsensor_stream_type_t type);
|
||||
|
||||
CODE int (*get_supported_value)(uint32_t id,
|
||||
FAR imgsensor_supported_value_t *value);
|
||||
CODE int (*get_value)(uint32_t id,
|
||||
uint32_t size,
|
||||
FAR imgsensor_value_t *value);
|
||||
CODE int (*set_value)(uint32_t id,
|
||||
uint32_t size,
|
||||
imgsensor_value_t value);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/* Register image sensor operations. */
|
||||
|
||||
void imgsensor_register(const FAR struct imgsensor_ops_s *ops);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_HALIF_H */
|
||||
@@ -49,7 +49,7 @@ extern "C"
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct video_devops_s *isx012_initialize(void);
|
||||
int isx012_initialize(FAR struct i2c_master_s *i2c);
|
||||
int isx012_uninitialize(void);
|
||||
|
||||
#undef EXTERN
|
||||
|
||||
@@ -1,323 +0,0 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/video/isx012_range.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
#include "isx012_reg.h"
|
||||
|
||||
#ifndef __DRIVERS_VIDEO_ISX012_RANGE_H
|
||||
#define __DRIVERS_VIDEO_ISX012_RANGE_H
|
||||
|
||||
/* Definition for control brightness */
|
||||
|
||||
#define ISX012_TYPE_BRIGHTNESS V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_BRIGHTNESS "Brightness"
|
||||
#define ISX012_DEF_BRIGHTNESS (0)
|
||||
#define ISX012_MIN_BRIGHTNESS (-128)
|
||||
#define ISX012_MAX_BRIGHTNESS (127)
|
||||
#define ISX012_STEP_BRIGHTNESS (1)
|
||||
#define ISX012_REG_BRIGHTNESS UIBRIGHTNESS
|
||||
#define ISX012_SIZE_BRIGHTNESS (1)
|
||||
|
||||
/* Definition for control contrast */
|
||||
|
||||
#define ISX012_TYPE_CONTRAST V4L2_CTRL_TYPE_U8FIXEDPOINT_Q7
|
||||
#define ISX012_NAME_CONTRAST "Contrast"
|
||||
#define ISX012_DEF_CONTRAST (0x80)
|
||||
#define ISX012_MIN_CONTRAST (0x00)
|
||||
#define ISX012_MAX_CONTRAST (0xFF)
|
||||
#define ISX012_STEP_CONTRAST (1)
|
||||
#define ISX012_REG_CONTRAST UICONTRAST
|
||||
#define ISX012_SIZE_CONTRAST (1)
|
||||
|
||||
/* Definition for control saturation */
|
||||
|
||||
#define ISX012_TYPE_SATURATION V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_SATURATION "Saturation"
|
||||
#define ISX012_DEF_SATURATION (0)
|
||||
#define ISX012_MIN_SATURATION (0)
|
||||
#define ISX012_MAX_SATURATION (255)
|
||||
#define ISX012_STEP_SATURATION (1)
|
||||
#define ISX012_REG_SATURATION UISATURATION_TYPE1
|
||||
#define ISX012_SIZE_SATURATION (1)
|
||||
|
||||
/* Definition for control hue */
|
||||
|
||||
#define ISX012_TYPE_HUE V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_HUE "Hue"
|
||||
#define ISX012_DEF_HUE (0)
|
||||
#define ISX012_MIN_HUE (0)
|
||||
#define ISX012_MAX_HUE (255)
|
||||
#define ISX012_STEP_HUE (1)
|
||||
#define ISX012_REG_HUE UIHUE_TYPE1
|
||||
#define ISX012_SIZE_HUE (1)
|
||||
|
||||
/* Definition for control auto white balance */
|
||||
|
||||
#define ISX012_TYPE_AUTOWB V4L2_CTRL_TYPE_BOOLEAN
|
||||
#define ISX012_NAME_AUTOWB "Automatic white balance"
|
||||
#define ISX012_DEF_AUTOWB true
|
||||
#define ISX012_MIN_AUTOWB false
|
||||
#define ISX012_MAX_AUTOWB true
|
||||
#define ISX012_STEP_AUTOWB (1)
|
||||
#define ISX012_REG_AUTOWB CPUEXT
|
||||
#define ISX012_SIZE_AUTOWB (1)
|
||||
|
||||
/* Definition for control red balance */
|
||||
|
||||
#define ISX012_TYPE_REDBALANCE V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_REDBALANCE "Red balance"
|
||||
#define ISX012_DEF_REDBALANCE (0)
|
||||
#define ISX012_MIN_REDBALANCE (0)
|
||||
#define ISX012_MAX_REDBALANCE (65535)
|
||||
#define ISX012_STEP_REDBALANCE (1)
|
||||
#define ISX012_REG_REDBALANCE RATIO_R_AUTO
|
||||
#define ISX012_SIZE_REDBALANCE (2)
|
||||
|
||||
/* Definition for control blue balance */
|
||||
|
||||
#define ISX012_TYPE_BLUEBALANCE V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_BLUEBALANCE "Red balance"
|
||||
#define ISX012_DEF_BLUEBALANCE (0)
|
||||
#define ISX012_MIN_BLUEBALANCE (0)
|
||||
#define ISX012_MAX_BLUEBALANCE (65535)
|
||||
#define ISX012_STEP_BLUEBALANCE (1)
|
||||
#define ISX012_REG_BLUEBALANCE RATIO_B_AUTO
|
||||
#define ISX012_SIZE_BLUEBALANCE (2)
|
||||
|
||||
/* Definition for control gamma curve */
|
||||
|
||||
#define ISX012_TYPE_GAMMACURVE V4L2_CTRL_TYPE_U16
|
||||
#define ISX012_NAME_GAMMACURVE "Gamma adjustment(curve)"
|
||||
#define ISX012_DEF_GAMMACURVE (0)
|
||||
#define ISX012_MIN_GAMMACURVE (0)
|
||||
#define ISX012_MAX_GAMMACURVE (511)
|
||||
#define ISX012_STEP_GAMMACURVE (1)
|
||||
#define ISX012_ELEMSIZE_GAMMACURVE (1)
|
||||
#define ISX012_ELEMS_GAMMACURVE (19)
|
||||
#define ISX012_REG_GAMMACURVE GAMMA_BASE
|
||||
#define ISX012_SIZE_GAMMACURVE (2)
|
||||
|
||||
/* Definition for control exposure value */
|
||||
|
||||
#define ISX012_TYPE_EXPOSURE V4L2_CTRL_TYPE_INTEGER_TIMES_3
|
||||
#define ISX012_NAME_EXPOSURE "Exposure value"
|
||||
#define ISX012_DEF_EXPOSURE (0)
|
||||
#define ISX012_MIN_EXPOSURE (-6)
|
||||
#define ISX012_MAX_EXPOSURE (6)
|
||||
#define ISX012_STEP_EXPOSURE (1)
|
||||
#define ISX012_REG_EXPOSURE EVSEL
|
||||
#define ISX012_SIZE_EXPOSURE (1)
|
||||
|
||||
/* Definition for control horizontal mirroring(V4L2_BUF_TYPE_VIDEO_CAPTURE) */
|
||||
|
||||
#define ISX012_TYPE_HFLIP V4L2_CTRL_TYPE_BOOLEAN
|
||||
#define ISX012_NAME_HFLIP "Mirror horizontally(VIDEO)"
|
||||
#define ISX012_DEF_HFLIP false
|
||||
#define ISX012_MIN_HFLIP false
|
||||
#define ISX012_MAX_HFLIP true
|
||||
#define ISX012_STEP_HFLIP (1)
|
||||
#define ISX012_REG_HFLIP READVECT_MONI
|
||||
#define ISX012_SIZE_HFLIP (1)
|
||||
|
||||
/* Definition for control vertical mirroring(V4L2_BUF_TYPE_VIDEO_CAPTURE) */
|
||||
|
||||
#define ISX012_TYPE_VFLIP V4L2_CTRL_TYPE_BOOLEAN
|
||||
#define ISX012_NAME_VFLIP "Mirror vertically(VIDEO)"
|
||||
#define ISX012_DEF_VFLIP false
|
||||
#define ISX012_MIN_VFLIP false
|
||||
#define ISX012_MAX_VFLIP true
|
||||
#define ISX012_STEP_VFLIP (1)
|
||||
#define ISX012_REG_VFLIP READVECT_MONI
|
||||
#define ISX012_SIZE_VFLIP (1)
|
||||
|
||||
/* Definition for control horizontal mirroring(V4L2_BUF_TYPE_STILL_CAPTURE) */
|
||||
|
||||
#define ISX012_TYPE_HFLIP_STILL V4L2_CTRL_TYPE_BOOLEAN
|
||||
#define ISX012_NAME_HFLIP_STILL "Mirror horizontally(STILL)"
|
||||
#define ISX012_DEF_HFLIP_STILL false
|
||||
#define ISX012_MIN_HFLIP_STILL false
|
||||
#define ISX012_MAX_HFLIP_STILL true
|
||||
#define ISX012_STEP_HFLIP_STILL (1)
|
||||
#define ISX012_REG_HFLIP_STILL READVECT_CAP
|
||||
#define ISX012_SIZE_HFLIP_STILL (1)
|
||||
|
||||
/* Definition for control vertical mirroring(V4L2_BUF_TYPE_STILL_CAPTURE) */
|
||||
|
||||
#define ISX012_TYPE_VFLIP_STILL V4L2_CTRL_TYPE_BOOLEAN
|
||||
#define ISX012_NAME_VFLIP_STILL "Mirror vertically(STILL)"
|
||||
#define ISX012_DEF_VFLIP_STILL false
|
||||
#define ISX012_MIN_VFLIP_STILL false
|
||||
#define ISX012_MAX_VFLIP_STILL true
|
||||
#define ISX012_STEP_VFLIP_STILL (1)
|
||||
#define ISX012_REG_VFLIP_STILL READVECT_CAP
|
||||
#define ISX012_SIZE_VFLIP_STILL (1)
|
||||
|
||||
/* Definition for control sharpness */
|
||||
|
||||
#define ISX012_TYPE_SHARPNESS V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_SHARPNESS "Sharpness"
|
||||
#define ISX012_DEF_SHARPNESS (0)
|
||||
#define ISX012_MIN_SHARPNESS (0)
|
||||
#define ISX012_MAX_SHARPNESS (255)
|
||||
#define ISX012_STEP_SHARPNESS (1)
|
||||
#define ISX012_REG_SHARPNESS UISHARPNESS_POS_TYPE1
|
||||
#define ISX012_SIZE_SHARPNESS (1)
|
||||
|
||||
/* Definition for control color killer */
|
||||
|
||||
#define ISX012_TYPE_COLORKILLER V4L2_CTRL_TYPE_BOOLEAN
|
||||
#define ISX012_NAME_COLORKILLER "Color killer"
|
||||
#define ISX012_DEF_COLORKILLER false
|
||||
#define ISX012_MIN_COLORKILLER false
|
||||
#define ISX012_MAX_COLORKILLER true
|
||||
#define ISX012_STEP_COLORKILLER (1)
|
||||
#define ISX012_REG_COLORKILLER FMODE
|
||||
#define ISX012_SIZE_COLORKILLER (1)
|
||||
|
||||
/* Definition for control color effect */
|
||||
|
||||
#define ISX012_TYPE_COLOREFFECT V4L2_CTRL_TYPE_INTEGER_MENU
|
||||
#define ISX012_NAME_COLOREFFECT "Color effect"
|
||||
#define ISX012_DEF_COLOREFFECT V4L2_COLORFX_NONE
|
||||
#define ISX012_MIN_COLOREFFECT (0)
|
||||
#define ISX012_MAX_COLOREFFECT (6)
|
||||
#define ISX012_STEP_COLOREFFECT (1)
|
||||
#define ISX012_REG_COLOREFFECT FMODE
|
||||
#define ISX012_SIZE_COLOREFFECT (1)
|
||||
|
||||
/* Definition for control auto exposure */
|
||||
|
||||
#define ISX012_TYPE_EXPOSUREAUTO V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_EXPOSUREAUTO "Auto Exposure"
|
||||
#define ISX012_DEF_EXPOSUREAUTO (0)
|
||||
#define ISX012_MIN_EXPOSUREAUTO (0)
|
||||
#define ISX012_MAX_EXPOSUREAUTO (1)
|
||||
#define ISX012_STEP_EXPOSUREAUTO (1)
|
||||
|
||||
#define ISX012_REG_EXPOSUREAUTOVALUE_LSB SHT_TIME_AUTO_L
|
||||
#define ISX012_REG_EXPOSUREAUTOVALUE_MSB SHT_TIME_AUTO_H
|
||||
#define ISX012_SIZE_EXPOSUREAUTOVALUE (2)
|
||||
|
||||
/* Definition for control exposure time */
|
||||
|
||||
#define ISX012_TYPE_EXPOSURETIME V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_EXPOSURETIME "Exposure time(usec)"
|
||||
#define ISX012_DEF_EXPOSURETIME (0)
|
||||
#define ISX012_MIN_EXPOSURETIME (1)
|
||||
#define ISX012_MAX_EXPOSURETIME (10000)
|
||||
#define ISX012_STEP_EXPOSURETIME (1)
|
||||
#define ISX012_REG_EXPOSURETIME SHT_PREMODE_TYPE1
|
||||
#define ISX012_SIZE_EXPOSURETIME (2)
|
||||
|
||||
#define ISX012_UNIT_EXPOSURETIME_US (100)
|
||||
|
||||
/* Definition for control photometry */
|
||||
|
||||
#define ISX012_TYPE_PHOTOMETRY V4L2_CTRL_TYPE_INTEGER_MENU
|
||||
#define ISX012_NAME_PHOTOMETRY "Photometry"
|
||||
#define ISX012_DEF_PHOTOMETRY V4L2_EXPOSURE_METERING_AVERAGE
|
||||
#define ISX012_MIN_PHOTOMETRY (0)
|
||||
#define ISX012_MAX_PHOTOMETRY (3)
|
||||
#define ISX012_STEP_PHOTOMETRY (1)
|
||||
#define ISX012_REG_PHOTOMETRY AE_SUB_SN1
|
||||
#define ISX012_SIZE_PHOTOMETRY (1)
|
||||
|
||||
/* Definition for control zoom */
|
||||
|
||||
#define ISX012_TYPE_ZOOM V4L2_CTRL_TYPE_U16FIXEDPOINT_Q8
|
||||
#define ISX012_NAME_ZOOM "Zoom"
|
||||
#define ISX012_DEF_ZOOM (0x0100)
|
||||
#define ISX012_MIN_ZOOM (0x0100)
|
||||
#define ISX012_MAX_ZOOM (0x1000)
|
||||
#define ISX012_STEP_ZOOM (1)
|
||||
#define ISX012_REG_ZOOM EZOOM_MAG
|
||||
#define ISX012_SIZE_ZOOM (2)
|
||||
|
||||
/* Definition for control preset white balance */
|
||||
|
||||
#define ISX012_TYPE_PRESETWB V4L2_CTRL_TYPE_INTEGER_MENU
|
||||
#define ISX012_NAME_PRESETWB "Preset white balance"
|
||||
#define ISX012_DEF_PRESETWB V4L2_WHITE_BALANCE_AUTO
|
||||
#define ISX012_MIN_PRESETWB (0)
|
||||
#define ISX012_MAX_PRESETWB (5)
|
||||
#define ISX012_STEP_PRESETWB (1)
|
||||
#define ISX012_REG_PRESETWB AWB_SN1
|
||||
#define ISX012_SIZE_PRESETWB (2)
|
||||
|
||||
/* Definition for control YGAMMA adujust */
|
||||
|
||||
#define ISX012_TYPE_YGAMMA V4L2_CTRL_TYPE_BOOLEAN
|
||||
#define ISX012_NAME_YGAMMA "Wide dynamic range"
|
||||
#define ISX012_DEF_YGAMMA (false)
|
||||
#define ISX012_MIN_YGAMMA (false)
|
||||
#define ISX012_MAX_YGAMMA (true)
|
||||
#define ISX012_STEP_YGAMMA (1)
|
||||
#define ISX012_REG_YGAMMA YGAMMA_MODE
|
||||
#define ISX012_SIZE_YGAMMA (1)
|
||||
|
||||
/* Definition for control ISO sensitivity */
|
||||
|
||||
#define ISX012_TYPE_ISO V4L2_CTRL_TYPE_INTEGER_MENU
|
||||
#define ISX012_NAME_ISO "ISO sensitivity"
|
||||
#define ISX012_DEF_ISO (0)
|
||||
#define ISX012_MIN_ISO (0)
|
||||
#define ISX012_MAX_ISO (18)
|
||||
#define ISX012_STEP_ISO (1)
|
||||
#define ISX012_REG_ISO ISO_TYPE1
|
||||
#define ISX012_SIZE_ISO (1)
|
||||
|
||||
/* Definition for control ISO automatic */
|
||||
|
||||
#define ISX012_TYPE_ISOAUTO V4L2_CTRL_TYPE_INTEGER_MENU
|
||||
#define ISX012_NAME_ISOAUTO "Automatic ISO sensitivity"
|
||||
#define ISX012_DEF_ISOAUTO (false)
|
||||
#define ISX012_MIN_ISOAUTO (0)
|
||||
#define ISX012_MAX_ISOAUTO (1)
|
||||
#define ISX012_STEP_ISOAUTO (1)
|
||||
#define ISX012_REG_ISOAUTO ISO_TYPE1
|
||||
#define ISX012_SIZE_ISOAUTO (1)
|
||||
#define ISX012_REG_ISOAUTOVALUE ISOSENS_OUT
|
||||
#define ISX012_SIZE_ISOAUTOVALUE (1)
|
||||
|
||||
/* Definition for control 3A lock */
|
||||
|
||||
#define ISX012_TYPE_3ALOCK V4L2_CTRL_TYPE_BITMASK
|
||||
#define ISX012_NAME_3ALOCK "Lock AWB/AE"
|
||||
#define ISX012_DEF_3ALOCK (0)
|
||||
#define ISX012_MIN_3ALOCK (0)
|
||||
#define ISX012_MAX_3ALOCK (3)
|
||||
#define ISX012_STEP_3ALOCK (1)
|
||||
#define ISX012_REG_3ALOCK CPUEXT
|
||||
#define ISX012_SIZE_3ALOCK (1)
|
||||
|
||||
/* Definition for control JPEG compression quality */
|
||||
|
||||
#define ISX012_TYPE_JPGQUALITY V4L2_CTRL_TYPE_INTEGER
|
||||
#define ISX012_NAME_JPGQUALITY "JPEG compression quality"
|
||||
#define ISX012_DEF_JPGQUALITY (75)
|
||||
#define ISX012_MIN_JPGQUALITY (1)
|
||||
#define ISX012_MAX_JPGQUALITY (100)
|
||||
#define ISX012_STEP_JPGQUALITY (1)
|
||||
#define ISX012_REG_JPGQUALITY INT_QLTY2
|
||||
#define ISX012_SIZE_JPGQUALITY (1)
|
||||
|
||||
#endif /* __DRIVERS_VIDEO_ISX012_RANGE_H */
|
||||
File diff suppressed because it is too large
Load Diff
+71
-46
@@ -25,10 +25,8 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/compiler.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include "video_controls.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -150,6 +148,30 @@ extern "C"
|
||||
|
||||
#define VIDIOC_CANCEL_DQBUF _VIDIOC(0x0016)
|
||||
|
||||
/* Query control for scene parameter
|
||||
* Address pointing to struct v4s_query_ext_ctrl_scene
|
||||
*/
|
||||
|
||||
#define V4SIOC_QUERY_EXT_CTRL_SCENE _VIDIOC(0x0017)
|
||||
|
||||
/* Query menu for scene parameter
|
||||
* Address pointing to struct v4s_querymenu_scene
|
||||
*/
|
||||
|
||||
#define V4SIOC_QUERYMENU_SCENE _VIDIOC(0x0018)
|
||||
|
||||
/* Get current control value
|
||||
* Address pointing to struct v4s_ext_controls_scene
|
||||
*/
|
||||
|
||||
#define V4SIOC_G_EXT_CTRLS_SCENE _VIDIOC(0x0019)
|
||||
|
||||
/* Set control value
|
||||
* Address pointing to struct v4s_ext_controls_scene
|
||||
*/
|
||||
|
||||
#define V4SIOC_S_EXT_CTRLS_SCENE _VIDIOC(0x001a)
|
||||
|
||||
#define VIDEO_HSIZE_QVGA (320) /* QVGA horizontal size */
|
||||
#define VIDEO_VSIZE_QVGA (240) /* QVGA vertical size */
|
||||
#define VIDEO_HSIZE_VGA (640) /* VGA horizontal size */
|
||||
@@ -188,6 +210,14 @@ extern "C"
|
||||
|
||||
#define V4L2_PIX_FMT_JPEG_WITH_SUBIMG v4l2_fourcc('J', 'S', 'U', 'B')
|
||||
|
||||
/* YUV 4:2:2 for sub image */
|
||||
|
||||
#define V4L2_PIX_FMT_SUBIMG_UYVY v4l2_fourcc('S', 'Y', 'U', 'V')
|
||||
|
||||
/* RGB565 for sub image */
|
||||
|
||||
#define V4L2_PIX_FMT_SUBIMG_RGB565 v4l2_fourcc('S', 'R', 'G', 'B')
|
||||
|
||||
/* MAX length of v4l2_fmtdesc description string */
|
||||
|
||||
#define V4L2_FMT_DSC_MAX (32)
|
||||
@@ -343,14 +373,13 @@ struct v4l2_fmtdesc
|
||||
uint32_t flags;
|
||||
char description[V4L2_FMT_DSC_MAX]; /* Description string */
|
||||
uint32_t pixelformat; /* Format fourcc */
|
||||
uint32_t subimg_pixelformat; /* Format fourcc */
|
||||
};
|
||||
|
||||
enum v4l2_frmsizetypes
|
||||
{
|
||||
V4L2_FRMSIZE_TYPE_DISCRETE = 1, /* Discrete value */
|
||||
V4L2_FRMSIZE_TYPE_DISCRETE = 1, /* Discrete value */
|
||||
V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, /* Continuous value */
|
||||
V4L2_FRMSIZE_TYPE_STEPWISE = 3, /* Step value */
|
||||
V4L2_FRMSIZE_TYPE_STEPWISE = 3, /* Step value */
|
||||
};
|
||||
|
||||
struct v4l2_frmsize_discrete
|
||||
@@ -375,33 +404,16 @@ struct v4l2_frmsizeenum
|
||||
uint32_t buf_type; /* enum #v4l2_buf_type */
|
||||
uint32_t pixel_format; /* Pixel format */
|
||||
uint32_t type; /* Frame size type the device supports. */
|
||||
union
|
||||
{ /* Frame size */
|
||||
struct v4l2_frmsize_discrete discrete; /* Use in type =
|
||||
* V4L2_FRMSIZE_TYPE_DISCRETE
|
||||
* case
|
||||
*/
|
||||
struct v4l2_frmsize_stepwise stepwise; /* Use in type =
|
||||
* V4L2_FRMSIZE_TYPE_CONTINUOUS
|
||||
* or V4L2_FRMSIZE_TYPE_STEPWISE
|
||||
* case
|
||||
*/
|
||||
};
|
||||
uint32_t subimg_pixel_format; /* Pixel format of sub image */
|
||||
uint32_t subimg_type; /* Frame size type of subimage. */
|
||||
|
||||
/* In type == V4L2_FRMSIZE_TYPE_DISCRETE case, use discrete.
|
||||
* Otherwise, use stepwise.
|
||||
*/
|
||||
|
||||
union
|
||||
{ /* Frame size of subimage */
|
||||
struct v4l2_frmsize_discrete discrete; /* Use in subimg_type =
|
||||
* V4L2_FRMSIZE_TYPE_DISCRETE
|
||||
* case
|
||||
*/
|
||||
struct v4l2_frmsize_stepwise stepwise; /* Use in subimg_type =
|
||||
* V4L2_FRMSIZE_TYPE_CONTINUOUS
|
||||
* or V4L2_FRMSIZE_TYPE_STEPWISE
|
||||
* case
|
||||
*/
|
||||
} subimg;
|
||||
{
|
||||
struct v4l2_frmsize_discrete discrete;
|
||||
struct v4l2_frmsize_stepwise stepwise;
|
||||
};
|
||||
};
|
||||
|
||||
/* type of frame interval enumeration */
|
||||
@@ -437,9 +449,6 @@ struct v4l2_frmivalenum
|
||||
uint32_t pixel_format; /* Pixel format */
|
||||
uint16_t width; /* Frame width */
|
||||
uint16_t height; /* Frame height */
|
||||
uint32_t subimg_pixel_format; /* Pixel format for sub image */
|
||||
uint16_t subimg_width; /* Frame width for sub image */
|
||||
uint16_t subimg_height; /* Frame height for sub image */
|
||||
uint32_t type; /* Frame interval type */
|
||||
union
|
||||
{ /* Frame interval */
|
||||
@@ -455,9 +464,6 @@ struct v4l2_pix_format
|
||||
uint16_t width; /* Image width in pixels */
|
||||
uint16_t height; /* Image height in pixels */
|
||||
uint32_t pixelformat; /* The pixel format or type of compression. */
|
||||
uint16_t subimg_width; /* sub image width in pixels in case of pixelformat = V4L2_PIX_FMT_JPEG_WITH_SUBIMG */
|
||||
uint16_t subimg_height; /* sub image height in pixels in case of pixelformat = V4L2_PIX_FMT_JPEG_WITH_SUBIMG */
|
||||
uint32_t subimg_pixelformat; /* The pixel format of sub image in case of pixelformat = V4L2_PIX_FMT_JPEG_WITH_SUBIMG */
|
||||
uint32_t field; /* enum #v4l2_field */
|
||||
uint32_t bytesperline; /* for padding, zero if unused */
|
||||
uint32_t sizeimage; /* Size in bytes of the buffer to hold a complete image */
|
||||
@@ -556,7 +562,7 @@ struct v4l2_query_ext_ctrl
|
||||
uint32_t dims[V4L2_CTRL_MAX_DIMS]; /* Dimensions */
|
||||
};
|
||||
|
||||
begin_packed_struct struct v4l2_querymenu
|
||||
struct v4l2_querymenu
|
||||
{
|
||||
uint16_t ctrl_class; /* camera control class */
|
||||
uint16_t id; /* camera control id */
|
||||
@@ -566,7 +572,7 @@ begin_packed_struct struct v4l2_querymenu
|
||||
char name[32]; /* name of menu */
|
||||
int64_t value; /* value of menu */
|
||||
};
|
||||
} end_packed_struct;
|
||||
};
|
||||
|
||||
struct v4l2_control
|
||||
{
|
||||
@@ -578,7 +584,7 @@ struct v4l2_control
|
||||
* ioctl(VIDIOC_G_EXT_CTRLS / VIDIOC_S_EXT_CTRLS)
|
||||
*/
|
||||
|
||||
begin_packed_struct struct v4l2_ext_control
|
||||
struct v4l2_ext_control
|
||||
{
|
||||
uint16_t id; /* camera control id */
|
||||
uint16_t size; /* size of value(not use) */
|
||||
@@ -592,7 +598,7 @@ begin_packed_struct struct v4l2_ext_control
|
||||
uint32_t *p_u32; /* QUERY_EXT_CTRL type = U32 */
|
||||
void *ptr;
|
||||
};
|
||||
} end_packed_struct;
|
||||
};
|
||||
|
||||
struct v4l2_ext_controls
|
||||
{
|
||||
@@ -606,9 +612,29 @@ struct v4l2_ext_controls
|
||||
struct v4l2_ext_control *controls; /* each control information */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
/* Structure for V4SIOC_S_EXT_CTRLS and V4SIOC_G_EXT_CTRLS */
|
||||
|
||||
struct v4s_ext_controls_scene
|
||||
{
|
||||
enum v4l2_scene_mode mode; /* scene mode to be controled */
|
||||
struct v4l2_ext_controls control; /* same as VIDIOC_S_EXT_CTRLS */
|
||||
};
|
||||
|
||||
/* Structure for V4SIOC_QUERY_EXT_CTRL */
|
||||
|
||||
struct v4s_query_ext_ctrl_scene
|
||||
{
|
||||
enum v4l2_scene_mode mode; /* scene mode to be queried */
|
||||
struct v4l2_query_ext_ctrl control; /* same as VIDIOC_QUERY_EXT_CTRL */
|
||||
};
|
||||
|
||||
/* Structure for V4SIOC_QUERYMENU */
|
||||
|
||||
struct v4s_querymenu_scene
|
||||
{
|
||||
enum v4l2_scene_mode mode; /* scene mode to be queried */
|
||||
struct v4l2_querymenu menu; /* same as VIDIOC_QUERYMENU */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
@@ -622,8 +648,7 @@ struct v4l2_ext_controls
|
||||
* negative value is returned.
|
||||
*/
|
||||
|
||||
int video_initialize(FAR const char *devpath,
|
||||
FAR const struct video_devops_s *devops);
|
||||
int video_initialize(FAR const char *devpath);
|
||||
|
||||
/* Uninitialize video driver.
|
||||
*
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/video/video_halif.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_VIDEO_HALIF_H
|
||||
#define __INCLUDE_NUTTX_VIDEO_HALIF_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
#include <nuttx/video/video.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct video_devops_s
|
||||
{
|
||||
CODE int (*open)(FAR void *video_priv);
|
||||
CODE int (*close)(void);
|
||||
|
||||
CODE int (*do_halfpush)(bool enable);
|
||||
CODE int (*set_buftype)(enum v4l2_buf_type type);
|
||||
CODE int (*set_buf)(uint32_t bufaddr, uint32_t bufsize);
|
||||
CODE int (*cancel_dma)(void);
|
||||
CODE int (*get_range_of_fmt)(FAR struct v4l2_fmtdesc *format);
|
||||
CODE int (*get_range_of_framesize)(FAR struct v4l2_frmsizeenum *frmsize);
|
||||
CODE int (*try_format)(FAR struct v4l2_format *format);
|
||||
CODE int (*set_format)(FAR struct v4l2_format *format);
|
||||
CODE int (*get_range_of_frameinterval)
|
||||
(FAR struct v4l2_frmivalenum *frmival);
|
||||
CODE int (*set_frameinterval)(FAR struct v4l2_streamparm *parm);
|
||||
CODE int (*get_range_of_ctrlvalue)(FAR struct v4l2_query_ext_ctrl *range);
|
||||
CODE int (*get_menu_of_ctrlvalue)(FAR struct v4l2_querymenu *menu);
|
||||
CODE int (*get_ctrlvalue)(uint16_t ctrl_class,
|
||||
FAR struct v4l2_ext_control *control);
|
||||
CODE int (*set_ctrlvalue)(uint16_t ctrl_class,
|
||||
FAR struct v4l2_ext_control *control);
|
||||
CODE int (*refresh)(void);
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
int video_common_notify_dma_done(uint8_t err_code,
|
||||
uint32_t buf_type,
|
||||
uint32_t datasize,
|
||||
FAR void *priv);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_HALIF_H */
|
||||
Reference in New Issue
Block a user