linux/include/uapi/linux/videodev2.h

/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
/*
 *  Video for Linux Two header file
 *
 *  Copyright (C) 1999-2012 the contributors
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  Alternatively you can redistribute this file under the terms of the
 *  BSD license as stated below:
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *  1. Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *  2. 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.
 *  3. The names of its contributors may not be used to endorse or promote
 *     products derived from this software without specific prior written
 *     permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE 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.
 *
 *	Header file for v4l or V4L2 drivers and applications
 * with public API.
 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
 * no #if __KERNEL tests are allowed here
 *
 *	See https://linuxtv.org for more info
 *
 *	Author: Bill Dirks <[email protected]>
 *		Justin Schoeman
 *              Hans Verkuil <[email protected]>
 *		et al.
 */
#ifndef _UAPI__LINUX_VIDEODEV2_H
#define _UAPI__LINUX_VIDEODEV2_H

#ifndef __KERNEL__
#include <sys/time.h>
#endif
#include <linux/compiler.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
#include <linux/v4l2-controls.h>

/*
 * Common stuff for both V4L1 and V4L2
 * Moved from videodev.h
 */
#define VIDEO_MAX_FRAME
#define VIDEO_MAX_PLANES

/*
 *	M I S C E L L A N E O U S
 */

/*  Four-character-code (FOURCC) */
#define v4l2_fourcc(a, b, c, d)
#define v4l2_fourcc_be(a, b, c, d)

/*
 *	E N U M S
 */
enum v4l2_field {};
#define V4L2_FIELD_HAS_TOP(field)
#define V4L2_FIELD_HAS_BOTTOM(field)
#define V4L2_FIELD_HAS_BOTH(field)
#define V4L2_FIELD_HAS_T_OR_B(field)
#define V4L2_FIELD_IS_INTERLACED(field)
#define V4L2_FIELD_IS_SEQUENTIAL(field)

enum v4l2_buf_type {};

#define V4L2_TYPE_IS_MULTIPLANAR(type)

#define V4L2_TYPE_IS_OUTPUT(type)

#define V4L2_TYPE_IS_CAPTURE(type)

enum v4l2_tuner_type {};

/* Deprecated, do not use */
#define V4L2_TUNER_ADC

enum v4l2_memory {};

/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
enum v4l2_colorspace {};

/*
 * Determine how COLORSPACE_DEFAULT should map to a proper colorspace.
 * This depends on whether this is a SDTV image (use SMPTE 170M), an
 * HDTV image (use Rec. 709), or something else (use sRGB).
 */
#define V4L2_MAP_COLORSPACE_DEFAULT(is_sdtv, is_hdtv)

enum v4l2_xfer_func {};

/*
 * Determine how XFER_FUNC_DEFAULT should map to a proper transfer function.
 * This depends on the colorspace.
 */
#define V4L2_MAP_XFER_FUNC_DEFAULT(colsp)

enum v4l2_ycbcr_encoding {};

/*
 * enum v4l2_hsv_encoding values should not collide with the ones from
 * enum v4l2_ycbcr_encoding.
 */
enum v4l2_hsv_encoding {};

/*
 * Determine how YCBCR_ENC_DEFAULT should map to a proper Y'CbCr encoding.
 * This depends on the colorspace.
 */
#define V4L2_MAP_YCBCR_ENC_DEFAULT(colsp)

enum v4l2_quantization {};

/*
 * Determine how QUANTIZATION_DEFAULT should map to a proper quantization.
 * This depends on whether the image is RGB or not, the colorspace.
 * The Y'CbCr encoding is not used anymore, but is still there for backwards
 * compatibility.
 */
#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_hsv, colsp, ycbcr_enc)

/*
 * Deprecated names for opRGB colorspace (IEC 61966-2-5)
 *
 * WARNING: Please don't use these deprecated defines in your code, as
 * there is a chance we have to remove them in the future.
 */
#ifndef __KERNEL__
#define V4L2_COLORSPACE_ADOBERGB
#define V4L2_XFER_FUNC_ADOBERGB
#endif

enum v4l2_priority {};

struct v4l2_rect {};

struct v4l2_fract {};

struct v4l2_area {};

/**
  * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
  *
  * @driver:	   name of the driver module (e.g. "bttv")
  * @card:	   name of the card (e.g. "Hauppauge WinTV")
  * @bus_info:	   name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
  * @version:	   KERNEL_VERSION
  * @capabilities: capabilities of the physical device as a whole
  * @device_caps:  capabilities accessed via this particular device (node)
  * @reserved:	   reserved fields for future extensions
  */
struct v4l2_capability {};

/* Values for 'capabilities' field */
#define V4L2_CAP_VIDEO_CAPTURE
#define V4L2_CAP_VIDEO_OUTPUT
#define V4L2_CAP_VIDEO_OVERLAY
#define V4L2_CAP_VBI_CAPTURE
#define V4L2_CAP_VBI_OUTPUT
#define V4L2_CAP_SLICED_VBI_CAPTURE
#define V4L2_CAP_SLICED_VBI_OUTPUT
#define V4L2_CAP_RDS_CAPTURE
#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY
#define V4L2_CAP_HW_FREQ_SEEK
#define V4L2_CAP_RDS_OUTPUT

/* Is a video capture device that supports multiplanar formats */
#define V4L2_CAP_VIDEO_CAPTURE_MPLANE
/* Is a video output device that supports multiplanar formats */
#define V4L2_CAP_VIDEO_OUTPUT_MPLANE
/* Is a video mem-to-mem device that supports multiplanar formats */
#define V4L2_CAP_VIDEO_M2M_MPLANE
/* Is a video mem-to-mem device */
#define V4L2_CAP_VIDEO_M2M

#define V4L2_CAP_TUNER
#define V4L2_CAP_AUDIO
#define V4L2_CAP_RADIO
#define V4L2_CAP_MODULATOR

#define V4L2_CAP_SDR_CAPTURE
#define V4L2_CAP_EXT_PIX_FORMAT
#define V4L2_CAP_SDR_OUTPUT
#define V4L2_CAP_META_CAPTURE

#define V4L2_CAP_READWRITE
#define V4L2_CAP_STREAMING
#define V4L2_CAP_META_OUTPUT

#define V4L2_CAP_TOUCH

#define V4L2_CAP_IO_MC

#define V4L2_CAP_DEVICE_CAPS

/*
 *	V I D E O   I M A G E   F O R M A T
 */
struct v4l2_pix_format {};

/*      Pixel format         FOURCC                          depth  Description  */

/* RGB formats (1 or 2 bytes per pixel) */
#define V4L2_PIX_FMT_RGB332
#define V4L2_PIX_FMT_RGB444
#define V4L2_PIX_FMT_ARGB444
#define V4L2_PIX_FMT_XRGB444
#define V4L2_PIX_FMT_RGBA444
#define V4L2_PIX_FMT_RGBX444
#define V4L2_PIX_FMT_ABGR444
#define V4L2_PIX_FMT_XBGR444
#define V4L2_PIX_FMT_BGRA444
#define V4L2_PIX_FMT_BGRX444
#define V4L2_PIX_FMT_RGB555
#define V4L2_PIX_FMT_ARGB555
#define V4L2_PIX_FMT_XRGB555
#define V4L2_PIX_FMT_RGBA555
#define V4L2_PIX_FMT_RGBX555
#define V4L2_PIX_FMT_ABGR555
#define V4L2_PIX_FMT_XBGR555
#define V4L2_PIX_FMT_BGRA555
#define V4L2_PIX_FMT_BGRX555
#define V4L2_PIX_FMT_RGB565
#define V4L2_PIX_FMT_RGB555X
#define V4L2_PIX_FMT_ARGB555X
#define V4L2_PIX_FMT_XRGB555X
#define V4L2_PIX_FMT_RGB565X

/* RGB formats (3 or 4 bytes per pixel) */
#define V4L2_PIX_FMT_BGR666
#define V4L2_PIX_FMT_BGR24
#define V4L2_PIX_FMT_RGB24
#define V4L2_PIX_FMT_BGR32
#define V4L2_PIX_FMT_ABGR32
#define V4L2_PIX_FMT_XBGR32
#define V4L2_PIX_FMT_BGRA32
#define V4L2_PIX_FMT_BGRX32
#define V4L2_PIX_FMT_RGB32
#define V4L2_PIX_FMT_RGBA32
#define V4L2_PIX_FMT_RGBX32
#define V4L2_PIX_FMT_ARGB32
#define V4L2_PIX_FMT_XRGB32
#define V4L2_PIX_FMT_RGBX1010102
#define V4L2_PIX_FMT_RGBA1010102
#define V4L2_PIX_FMT_ARGB2101010

/* RGB formats (6 or 8 bytes per pixel) */
#define V4L2_PIX_FMT_BGR48_12
#define V4L2_PIX_FMT_BGR48
#define V4L2_PIX_FMT_RGB48
#define V4L2_PIX_FMT_ABGR64_12

/* Grey formats */
#define V4L2_PIX_FMT_GREY
#define V4L2_PIX_FMT_Y4
#define V4L2_PIX_FMT_Y6
#define V4L2_PIX_FMT_Y10
#define V4L2_PIX_FMT_Y12
#define V4L2_PIX_FMT_Y012
#define V4L2_PIX_FMT_Y14
#define V4L2_PIX_FMT_Y16
#define V4L2_PIX_FMT_Y16_BE

/* Grey bit-packed formats */
#define V4L2_PIX_FMT_Y10BPACK
#define V4L2_PIX_FMT_Y10P
#define V4L2_PIX_FMT_IPU3_Y10
#define V4L2_PIX_FMT_Y12P
#define V4L2_PIX_FMT_Y14P

/* Palette formats */
#define V4L2_PIX_FMT_PAL8

/* Chrominance formats */
#define V4L2_PIX_FMT_UV8

/* Luminance+Chrominance formats */
#define V4L2_PIX_FMT_YUYV
#define V4L2_PIX_FMT_YYUV
#define V4L2_PIX_FMT_YVYU
#define V4L2_PIX_FMT_UYVY
#define V4L2_PIX_FMT_VYUY
#define V4L2_PIX_FMT_Y41P
#define V4L2_PIX_FMT_YUV444
#define V4L2_PIX_FMT_YUV555
#define V4L2_PIX_FMT_YUV565
#define V4L2_PIX_FMT_YUV24
#define V4L2_PIX_FMT_YUV32
#define V4L2_PIX_FMT_AYUV32
#define V4L2_PIX_FMT_XYUV32
#define V4L2_PIX_FMT_VUYA32
#define V4L2_PIX_FMT_VUYX32
#define V4L2_PIX_FMT_YUVA32
#define V4L2_PIX_FMT_YUVX32
#define V4L2_PIX_FMT_M420
#define V4L2_PIX_FMT_YUV48_12

/*
 * YCbCr packed format. For each Y2xx format, xx bits of valid data occupy the MSBs
 * of the 16 bit components, and 16-xx bits of zero padding occupy the LSBs.
 */
#define V4L2_PIX_FMT_Y210
#define V4L2_PIX_FMT_Y212
#define V4L2_PIX_FMT_Y216

/* two planes -- one Y, one Cr + Cb interleaved  */
#define V4L2_PIX_FMT_NV12
#define V4L2_PIX_FMT_NV21
#define V4L2_PIX_FMT_NV16
#define V4L2_PIX_FMT_NV61
#define V4L2_PIX_FMT_NV24
#define V4L2_PIX_FMT_NV42
#define V4L2_PIX_FMT_P010
#define V4L2_PIX_FMT_P012

/* two non contiguous planes - one Y, one Cr + Cb interleaved  */
#define V4L2_PIX_FMT_NV12M
#define V4L2_PIX_FMT_NV21M
#define V4L2_PIX_FMT_NV16M
#define V4L2_PIX_FMT_NV61M
#define V4L2_PIX_FMT_P012M

/* three planes - Y Cb, Cr */
#define V4L2_PIX_FMT_YUV410
#define V4L2_PIX_FMT_YVU410
#define V4L2_PIX_FMT_YUV411P
#define V4L2_PIX_FMT_YUV420
#define V4L2_PIX_FMT_YVU420
#define V4L2_PIX_FMT_YUV422P

/* three non contiguous planes - Y, Cb, Cr */
#define V4L2_PIX_FMT_YUV420M
#define V4L2_PIX_FMT_YVU420M
#define V4L2_PIX_FMT_YUV422M
#define V4L2_PIX_FMT_YVU422M
#define V4L2_PIX_FMT_YUV444M
#define V4L2_PIX_FMT_YVU444M

/* Tiled YUV formats */
#define V4L2_PIX_FMT_NV12_4L4
#define V4L2_PIX_FMT_NV12_16L16
#define V4L2_PIX_FMT_NV12_32L32
#define V4L2_PIX_FMT_NV15_4L4
#define V4L2_PIX_FMT_P010_4L4
#define V4L2_PIX_FMT_NV12_8L128
#define V4L2_PIX_FMT_NV12_10BE_8L128

/* Tiled YUV formats, non contiguous planes */
#define V4L2_PIX_FMT_NV12MT
#define V4L2_PIX_FMT_NV12MT_16X16
#define V4L2_PIX_FMT_NV12M_8L128
#define V4L2_PIX_FMT_NV12M_10BE_8L128

/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
#define V4L2_PIX_FMT_SBGGR8
#define V4L2_PIX_FMT_SGBRG8
#define V4L2_PIX_FMT_SGRBG8
#define V4L2_PIX_FMT_SRGGB8
#define V4L2_PIX_FMT_SBGGR10
#define V4L2_PIX_FMT_SGBRG10
#define V4L2_PIX_FMT_SGRBG10
#define V4L2_PIX_FMT_SRGGB10
	/* 10bit raw bayer packed, 5 bytes for every 4 pixels */
#define V4L2_PIX_FMT_SBGGR10P
#define V4L2_PIX_FMT_SGBRG10P
#define V4L2_PIX_FMT_SGRBG10P
#define V4L2_PIX_FMT_SRGGB10P
	/* 10bit raw bayer a-law compressed to 8 bits */
#define V4L2_PIX_FMT_SBGGR10ALAW8
#define V4L2_PIX_FMT_SGBRG10ALAW8
#define V4L2_PIX_FMT_SGRBG10ALAW8
#define V4L2_PIX_FMT_SRGGB10ALAW8
	/* 10bit raw bayer DPCM compressed to 8 bits */
#define V4L2_PIX_FMT_SBGGR10DPCM8
#define V4L2_PIX_FMT_SGBRG10DPCM8
#define V4L2_PIX_FMT_SGRBG10DPCM8
#define V4L2_PIX_FMT_SRGGB10DPCM8
#define V4L2_PIX_FMT_SBGGR12
#define V4L2_PIX_FMT_SGBRG12
#define V4L2_PIX_FMT_SGRBG12
#define V4L2_PIX_FMT_SRGGB12
	/* 12bit raw bayer packed, 6 bytes for every 4 pixels */
#define V4L2_PIX_FMT_SBGGR12P
#define V4L2_PIX_FMT_SGBRG12P
#define V4L2_PIX_FMT_SGRBG12P
#define V4L2_PIX_FMT_SRGGB12P
#define V4L2_PIX_FMT_SBGGR14
#define V4L2_PIX_FMT_SGBRG14
#define V4L2_PIX_FMT_SGRBG14
#define V4L2_PIX_FMT_SRGGB14
	/* 14bit raw bayer packed, 7 bytes for every 4 pixels */
#define V4L2_PIX_FMT_SBGGR14P
#define V4L2_PIX_FMT_SGBRG14P
#define V4L2_PIX_FMT_SGRBG14P
#define V4L2_PIX_FMT_SRGGB14P
#define V4L2_PIX_FMT_SBGGR16
#define V4L2_PIX_FMT_SGBRG16
#define V4L2_PIX_FMT_SGRBG16
#define V4L2_PIX_FMT_SRGGB16

/* HSV formats */
#define V4L2_PIX_FMT_HSV24
#define V4L2_PIX_FMT_HSV32

/* compressed formats */
#define V4L2_PIX_FMT_MJPEG
#define V4L2_PIX_FMT_JPEG
#define V4L2_PIX_FMT_DV
#define V4L2_PIX_FMT_MPEG
#define V4L2_PIX_FMT_H264
#define V4L2_PIX_FMT_H264_NO_SC
#define V4L2_PIX_FMT_H264_MVC
#define V4L2_PIX_FMT_H263
#define V4L2_PIX_FMT_MPEG1
#define V4L2_PIX_FMT_MPEG2
#define V4L2_PIX_FMT_MPEG2_SLICE
#define V4L2_PIX_FMT_MPEG4
#define V4L2_PIX_FMT_XVID
#define V4L2_PIX_FMT_VC1_ANNEX_G
#define V4L2_PIX_FMT_VC1_ANNEX_L
#define V4L2_PIX_FMT_VP8
#define V4L2_PIX_FMT_VP8_FRAME
#define V4L2_PIX_FMT_VP9
#define V4L2_PIX_FMT_VP9_FRAME
#define V4L2_PIX_FMT_HEVC
#define V4L2_PIX_FMT_FWHT
#define V4L2_PIX_FMT_FWHT_STATELESS
#define V4L2_PIX_FMT_H264_SLICE
#define V4L2_PIX_FMT_HEVC_SLICE
#define V4L2_PIX_FMT_AV1_FRAME
#define V4L2_PIX_FMT_SPK
#define V4L2_PIX_FMT_RV30
#define V4L2_PIX_FMT_RV40

/*  Vendor-specific formats   */
#define V4L2_PIX_FMT_CPIA1
#define V4L2_PIX_FMT_WNVA
#define V4L2_PIX_FMT_SN9C10X
#define V4L2_PIX_FMT_SN9C20X_I420
#define V4L2_PIX_FMT_PWC1
#define V4L2_PIX_FMT_PWC2
#define V4L2_PIX_FMT_ET61X251
#define V4L2_PIX_FMT_SPCA501
#define V4L2_PIX_FMT_SPCA505
#define V4L2_PIX_FMT_SPCA508
#define V4L2_PIX_FMT_SPCA561
#define V4L2_PIX_FMT_PAC207
#define V4L2_PIX_FMT_MR97310A
#define V4L2_PIX_FMT_JL2005BCD
#define V4L2_PIX_FMT_SN9C2028
#define V4L2_PIX_FMT_SQ905C
#define V4L2_PIX_FMT_PJPG
#define V4L2_PIX_FMT_OV511
#define V4L2_PIX_FMT_OV518
#define V4L2_PIX_FMT_STV0680
#define V4L2_PIX_FMT_TM6000
#define V4L2_PIX_FMT_CIT_YYVYUY
#define V4L2_PIX_FMT_KONICA420
#define V4L2_PIX_FMT_JPGL
#define V4L2_PIX_FMT_SE401
#define V4L2_PIX_FMT_S5C_UYVY_JPG
#define V4L2_PIX_FMT_Y8I
#define V4L2_PIX_FMT_Y12I
#define V4L2_PIX_FMT_Z16
#define V4L2_PIX_FMT_MT21C
#define V4L2_PIX_FMT_MM21
#define V4L2_PIX_FMT_MT2110T
#define V4L2_PIX_FMT_MT2110R
#define V4L2_PIX_FMT_INZI
#define V4L2_PIX_FMT_CNF4
#define V4L2_PIX_FMT_HI240
#define V4L2_PIX_FMT_QC08C
#define V4L2_PIX_FMT_QC10C
#define V4L2_PIX_FMT_AJPG
#define V4L2_PIX_FMT_HEXTILE

/* 10bit raw packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */
#define V4L2_PIX_FMT_IPU3_SBGGR10
#define V4L2_PIX_FMT_IPU3_SGBRG10
#define V4L2_PIX_FMT_IPU3_SGRBG10
#define V4L2_PIX_FMT_IPU3_SRGGB10

/* Raspberry Pi PiSP compressed formats. */
#define V4L2_PIX_FMT_PISP_COMP1_RGGB
#define V4L2_PIX_FMT_PISP_COMP1_GRBG
#define V4L2_PIX_FMT_PISP_COMP1_GBRG
#define V4L2_PIX_FMT_PISP_COMP1_BGGR
#define V4L2_PIX_FMT_PISP_COMP1_MONO
#define V4L2_PIX_FMT_PISP_COMP2_RGGB
#define V4L2_PIX_FMT_PISP_COMP2_GRBG
#define V4L2_PIX_FMT_PISP_COMP2_GBRG
#define V4L2_PIX_FMT_PISP_COMP2_BGGR
#define V4L2_PIX_FMT_PISP_COMP2_MONO

/* SDR formats - used only for Software Defined Radio devices */
#define V4L2_SDR_FMT_CU8
#define V4L2_SDR_FMT_CU16LE
#define V4L2_SDR_FMT_CS8
#define V4L2_SDR_FMT_CS14LE
#define V4L2_SDR_FMT_RU12LE
#define V4L2_SDR_FMT_PCU16BE
#define V4L2_SDR_FMT_PCU18BE
#define V4L2_SDR_FMT_PCU20BE

/* Touch formats - used for Touch devices */
#define V4L2_TCH_FMT_DELTA_TD16
#define V4L2_TCH_FMT_DELTA_TD08
#define V4L2_TCH_FMT_TU16
#define V4L2_TCH_FMT_TU08

/* Meta-data formats */
#define V4L2_META_FMT_VSP1_HGO
#define V4L2_META_FMT_VSP1_HGT
#define V4L2_META_FMT_UVC
#define V4L2_META_FMT_D4XX
#define V4L2_META_FMT_VIVID

/* Vendor specific - used for RK_ISP1 camera sub-system */
#define V4L2_META_FMT_RK_ISP1_PARAMS
#define V4L2_META_FMT_RK_ISP1_STAT_3A

/* Vendor specific - used for RaspberryPi PiSP */
#define V4L2_META_FMT_RPI_BE_CFG

#ifdef __KERNEL__
/*
 * Line-based metadata formats. Remember to update v4l_fill_fmtdesc() when
 * adding new ones!
 */
#define V4L2_META_FMT_GENERIC_8
#define V4L2_META_FMT_GENERIC_CSI2_10
#define V4L2_META_FMT_GENERIC_CSI2_12
#define V4L2_META_FMT_GENERIC_CSI2_14
#define V4L2_META_FMT_GENERIC_CSI2_16
#define V4L2_META_FMT_GENERIC_CSI2_20
#define V4L2_META_FMT_GENERIC_CSI2_24
#endif

/* priv field value to indicates that subsequent fields are valid. */
#define V4L2_PIX_FMT_PRIV_MAGIC

/* Flags */
#define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA
#define V4L2_PIX_FMT_FLAG_SET_CSC

/*
 *	F O R M A T   E N U M E R A T I O N
 */
struct v4l2_fmtdesc {};

#define V4L2_FMT_FLAG_COMPRESSED
#define V4L2_FMT_FLAG_EMULATED
#define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM
#define V4L2_FMT_FLAG_DYN_RESOLUTION
#define V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL
#define V4L2_FMT_FLAG_CSC_COLORSPACE
#define V4L2_FMT_FLAG_CSC_XFER_FUNC
#define V4L2_FMT_FLAG_CSC_YCBCR_ENC
#define V4L2_FMT_FLAG_CSC_HSV_ENC
#define V4L2_FMT_FLAG_CSC_QUANTIZATION
#define V4L2_FMT_FLAG_META_LINE_BASED

	/* Frame Size and frame rate enumeration */
/*
 *	F R A M E   S I Z E   E N U M E R A T I O N
 */
enum v4l2_frmsizetypes {};

struct v4l2_frmsize_discrete {};

struct v4l2_frmsize_stepwise {};

struct v4l2_frmsizeenum {};

/*
 *	F R A M E   R A T E   E N U M E R A T I O N
 */
enum v4l2_frmivaltypes {};

struct v4l2_frmival_stepwise {};

struct v4l2_frmivalenum {};

/*
 *	T I M E C O D E
 */
struct v4l2_timecode {};

/*  Type  */
#define V4L2_TC_TYPE_24FPS
#define V4L2_TC_TYPE_25FPS
#define V4L2_TC_TYPE_30FPS
#define V4L2_TC_TYPE_50FPS
#define V4L2_TC_TYPE_60FPS

/*  Flags  */
#define V4L2_TC_FLAG_DROPFRAME
#define V4L2_TC_FLAG_COLORFRAME
#define V4L2_TC_USERBITS_field
#define V4L2_TC_USERBITS_USERDEFINED
#define V4L2_TC_USERBITS_8BITCHARS
/* The above is based on SMPTE timecodes */

struct v4l2_jpegcompression {};

/*
 *	M E M O R Y - M A P P I N G   B U F F E R S
 */

#ifdef __KERNEL__
/*
 * This corresponds to the user space version of timeval
 * for 64-bit time_t. sparc64 is different from everyone
 * else, using the microseconds in the wrong half of the
 * second 64-bit word.
 */
struct __kernel_v4l2_timeval {};
#endif

struct v4l2_requestbuffers {};

#define V4L2_MEMORY_FLAG_NON_COHERENT

/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */
#define V4L2_BUF_CAP_SUPPORTS_MMAP
#define V4L2_BUF_CAP_SUPPORTS_USERPTR
#define V4L2_BUF_CAP_SUPPORTS_DMABUF
#define V4L2_BUF_CAP_SUPPORTS_REQUESTS
#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS
#define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF
#define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS
#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS
#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS

/**
 * struct v4l2_plane - plane info for multi-planar buffers
 * @bytesused:		number of bytes occupied by data in the plane (payload)
 * @length:		size of this plane (NOT the payload) in bytes
 * @m.mem_offset:	when memory in the associated struct v4l2_buffer is
 *			V4L2_MEMORY_MMAP, equals the offset from the start of
 *			the device memory for this plane (or is a "cookie" that
 *			should be passed to mmap() called on the video node)
 * @m.userptr:		when memory is V4L2_MEMORY_USERPTR, a userspace pointer
 *			pointing to this plane
 * @m.fd:		when memory is V4L2_MEMORY_DMABUF, a userspace file
 *			descriptor associated with this plane
 * @m:			union of @mem_offset, @userptr and @fd
 * @data_offset:	offset in the plane to the start of data; usually 0,
 *			unless there is a header in front of the data
 * @reserved:		drivers and applications must zero this array
 *
 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
 * with two planes can have one plane for Y, and another for interleaved CbCr
 * components. Each plane can reside in a separate memory buffer, or even in
 * a completely separate memory node (e.g. in embedded devices).
 */
struct v4l2_plane {};

/**
 * struct v4l2_buffer - video buffer info
 * @index:	id number of the buffer
 * @type:	enum v4l2_buf_type; buffer type (type == *_MPLANE for
 *		multiplanar buffers);
 * @bytesused:	number of bytes occupied by data in the buffer (payload);
 *		unused (set to 0) for multiplanar buffers
 * @flags:	buffer informational flags
 * @field:	enum v4l2_field; field order of the image in the buffer
 * @timestamp:	frame timestamp
 * @timecode:	frame timecode
 * @sequence:	sequence count of this frame
 * @memory:	enum v4l2_memory; the method, in which the actual video data is
 *		passed
 * @m.offset:	for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
 *		offset from the start of the device memory for this plane,
 *		(or a "cookie" that should be passed to mmap() as offset)
 * @m.userptr:	for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
 *		a userspace pointer pointing to this buffer
 * @m.fd:		for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;
 *		a userspace file descriptor associated with this buffer
 * @m.planes:	for multiplanar buffers; userspace pointer to the array of plane
 *		info structs for this buffer
 * @m:		union of @offset, @userptr, @planes and @fd
 * @length:	size in bytes of the buffer (NOT its payload) for single-plane
 *		buffers (when type != *_MPLANE); number of elements in the
 *		planes array for multi-plane buffers
 * @reserved2:	drivers and applications must zero this field
 * @request_fd: fd of the request that this buffer should use
 * @reserved:	for backwards compatibility with applications that do not know
 *		about @request_fd
 *
 * Contains data exchanged by application and driver using one of the Streaming
 * I/O methods.
 */
struct v4l2_buffer {};

#ifndef __KERNEL__
/**
 * v4l2_timeval_to_ns - Convert timeval to nanoseconds
 * @tv:		pointer to the timeval variable to be converted
 *
 * Returns the scalar nanosecond representation of the timeval
 * parameter.
 */
static inline __u64 v4l2_timeval_to_ns(const struct timeval *tv)
{
	return (__u64)tv->tv_sec * 1000000000ULL + tv->tv_usec * 1000;
}
#endif

/*  Flags for 'flags' field */
/* Buffer is mapped (flag) */
#define V4L2_BUF_FLAG_MAPPED
/* Buffer is queued for processing */
#define V4L2_BUF_FLAG_QUEUED
/* Buffer is ready */
#define V4L2_BUF_FLAG_DONE
/* Image is a keyframe (I-frame) */
#define V4L2_BUF_FLAG_KEYFRAME
/* Image is a P-frame */
#define V4L2_BUF_FLAG_PFRAME
/* Image is a B-frame */
#define V4L2_BUF_FLAG_BFRAME
/* Buffer is ready, but the data contained within is corrupted. */
#define V4L2_BUF_FLAG_ERROR
/* Buffer is added to an unqueued request */
#define V4L2_BUF_FLAG_IN_REQUEST
/* timecode field is valid */
#define V4L2_BUF_FLAG_TIMECODE
/* Don't return the capture buffer until OUTPUT timestamp changes */
#define V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF
/* Buffer is prepared for queuing */
#define V4L2_BUF_FLAG_PREPARED
/* Cache handling flags */
#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE
#define V4L2_BUF_FLAG_NO_CACHE_CLEAN
/* Timestamp type */
#define V4L2_BUF_FLAG_TIMESTAMP_MASK
#define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN
#define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
#define V4L2_BUF_FLAG_TIMESTAMP_COPY
/* Timestamp sources. */
#define V4L2_BUF_FLAG_TSTAMP_SRC_MASK
#define V4L2_BUF_FLAG_TSTAMP_SRC_EOF
#define V4L2_BUF_FLAG_TSTAMP_SRC_SOE
/* mem2mem encoder/decoder */
#define V4L2_BUF_FLAG_LAST
/* request_fd is valid */
#define V4L2_BUF_FLAG_REQUEST_FD

/**
 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
 *
 * @index:	id number of the buffer
 * @type:	enum v4l2_buf_type; buffer type (type == *_MPLANE for
 *		multiplanar buffers);
 * @plane:	index of the plane to be exported, 0 for single plane queues
 * @flags:	flags for newly created file, currently only O_CLOEXEC is
 *		supported, refer to manual of open syscall for more details
 * @fd:		file descriptor associated with DMABUF (set by driver)
 * @reserved:	drivers and applications must zero this array
 *
 * Contains data used for exporting a video buffer as DMABUF file descriptor.
 * The buffer is identified by a 'cookie' returned by VIDIOC_QUERYBUF
 * (identical to the cookie used to mmap() the buffer to userspace). All
 * reserved fields must be set to zero. The field reserved0 is expected to
 * become a structure 'type' allowing an alternative layout of the structure
 * content. Therefore this field should not be used for any other extensions.
 */
struct v4l2_exportbuffer {};

/*
 *	O V E R L A Y   P R E V I E W
 */
struct v4l2_framebuffer {};
/*  Flags for the 'capability' field. Read only */
#define V4L2_FBUF_CAP_EXTERNOVERLAY
#define V4L2_FBUF_CAP_CHROMAKEY
#ifndef __KERNEL__
#define V4L2_FBUF_CAP_LIST_CLIPPING
#define V4L2_FBUF_CAP_BITMAP_CLIPPING
#endif
#define V4L2_FBUF_CAP_LOCAL_ALPHA
#define V4L2_FBUF_CAP_GLOBAL_ALPHA
#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA
#define V4L2_FBUF_CAP_SRC_CHROMAKEY
/*  Flags for the 'flags' field. */
#define V4L2_FBUF_FLAG_PRIMARY
#define V4L2_FBUF_FLAG_OVERLAY
#define V4L2_FBUF_FLAG_CHROMAKEY
#define V4L2_FBUF_FLAG_LOCAL_ALPHA
#define V4L2_FBUF_FLAG_GLOBAL_ALPHA
#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA
#define V4L2_FBUF_FLAG_SRC_CHROMAKEY

struct v4l2_clip {};

struct v4l2_window {};

/*
 *	C A P T U R E   P A R A M E T E R S
 */
struct v4l2_captureparm {};

/*  Flags for 'capability' and 'capturemode' fields */
#define V4L2_MODE_HIGHQUALITY
#define V4L2_CAP_TIMEPERFRAME

struct v4l2_outputparm {};

/*
 *	I N P U T   I M A G E   C R O P P I N G
 */
struct v4l2_cropcap {};

struct v4l2_crop {};

/**
 * struct v4l2_selection - selection info
 * @type:	buffer type (do not use *_MPLANE types)
 * @target:	Selection target, used to choose one of possible rectangles;
 *		defined in v4l2-common.h; V4L2_SEL_TGT_* .
 * @flags:	constraints flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
 * @r:		coordinates of selection window
 * @reserved:	for future use, rounds structure size to 64 bytes, set to zero
 *
 * Hardware may use multiple helper windows to process a video stream.
 * The structure is used to exchange this selection areas between
 * an application and a driver.
 */
struct v4l2_selection {};


/*
 *      A N A L O G   V I D E O   S T A N D A R D
 */

v4l2_std_id;

/*
 * Attention: Keep the V4L2_STD_* bit definitions in sync with
 * include/dt-bindings/display/sdtv-standards.h SDTV_STD_* bit definitions.
 */
/* one bit for each */
#define V4L2_STD_PAL_B
#define V4L2_STD_PAL_B1
#define V4L2_STD_PAL_G
#define V4L2_STD_PAL_H
#define V4L2_STD_PAL_I
#define V4L2_STD_PAL_D
#define V4L2_STD_PAL_D1
#define V4L2_STD_PAL_K

#define V4L2_STD_PAL_M
#define V4L2_STD_PAL_N
#define V4L2_STD_PAL_Nc
#define V4L2_STD_PAL_60

#define V4L2_STD_NTSC_M
#define V4L2_STD_NTSC_M_JP
#define V4L2_STD_NTSC_443
#define V4L2_STD_NTSC_M_KR

#define V4L2_STD_SECAM_B
#define V4L2_STD_SECAM_D
#define V4L2_STD_SECAM_G
#define V4L2_STD_SECAM_H
#define V4L2_STD_SECAM_K
#define V4L2_STD_SECAM_K1
#define V4L2_STD_SECAM_L
#define V4L2_STD_SECAM_LC

/* ATSC/HDTV */
#define V4L2_STD_ATSC_8_VSB
#define V4L2_STD_ATSC_16_VSB

/* FIXME:
   Although std_id is 64 bits, there is an issue on PPC32 architecture that
   makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
   this value to 32 bits.
   As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
   it should work fine. However, if needed to add more than two standards,
   v4l2-common.c should be fixed.
 */

/*
 * Some macros to merge video standards in order to make live easier for the
 * drivers and V4L2 applications
 */

/*
 * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
 * Missing here.
 */
#define V4L2_STD_NTSC
/* Secam macros */
#define V4L2_STD_SECAM_DK
/* All Secam Standards */
#define V4L2_STD_SECAM
/* PAL macros */
#define V4L2_STD_PAL_BG
#define V4L2_STD_PAL_DK
/*
 * "Common" PAL - This macro is there to be compatible with the old
 * V4L1 concept of "PAL": /BGDKHI.
 * Several PAL standards are missing here: /M, /N and /Nc
 */
#define V4L2_STD_PAL
/* Chroma "agnostic" standards */
#define V4L2_STD_B
#define V4L2_STD_G
#define V4L2_STD_H
#define V4L2_STD_L
#define V4L2_STD_GH
#define V4L2_STD_DK
#define V4L2_STD_BG
#define V4L2_STD_MN

/* Standards where MTS/BTSC stereo could be found */
#define V4L2_STD_MTS

/* Standards for Countries with 60Hz Line frequency */
#define V4L2_STD_525_60
/* Standards for Countries with 50Hz Line frequency */
#define V4L2_STD_625_50

#define V4L2_STD_ATSC
/* Macros with none and all analog standards */
#define V4L2_STD_UNKNOWN
#define V4L2_STD_ALL

struct v4l2_standard {};

/*
 *	D V	B T	T I M I N G S
 */

/** struct v4l2_bt_timings - BT.656/BT.1120 timing data
 * @width:	total width of the active video in pixels
 * @height:	total height of the active video in lines
 * @interlaced:	Interlaced or progressive
 * @polarities:	Positive or negative polarities
 * @pixelclock:	Pixel clock in HZ. Ex. 74.25MHz->74250000
 * @hfrontporch:Horizontal front porch in pixels
 * @hsync:	Horizontal Sync length in pixels
 * @hbackporch:	Horizontal back porch in pixels
 * @vfrontporch:Vertical front porch in lines
 * @vsync:	Vertical Sync length in lines
 * @vbackporch:	Vertical back porch in lines
 * @il_vfrontporch:Vertical front porch for the even field
 *		(aka field 2) of interlaced field formats
 * @il_vsync:	Vertical Sync length for the even field
 *		(aka field 2) of interlaced field formats
 * @il_vbackporch:Vertical back porch for the even field
 *		(aka field 2) of interlaced field formats
 * @standards:	Standards the timing belongs to
 * @flags:	Flags
 * @picture_aspect: The picture aspect ratio (hor/vert).
 * @cea861_vic:	VIC code as per the CEA-861 standard.
 * @hdmi_vic:	VIC code as per the HDMI standard.
 * @reserved:	Reserved fields, must be zeroed.
 *
 * A note regarding vertical interlaced timings: height refers to the total
 * height of the active video frame (= two fields). The blanking timings refer
 * to the blanking of each field. So the height of the total frame is
 * calculated as follows:
 *
 * tot_height = height + vfrontporch + vsync + vbackporch +
 *                       il_vfrontporch + il_vsync + il_vbackporch
 *
 * The active height of each field is height / 2.
 */
struct v4l2_bt_timings {} __attribute__ ((packed));

/* Interlaced or progressive format */
#define V4L2_DV_PROGRESSIVE
#define V4L2_DV_INTERLACED

/* Polarities. If bit is not set, it is assumed to be negative polarity */
#define V4L2_DV_VSYNC_POS_POL
#define V4L2_DV_HSYNC_POS_POL

/* Timings standards */
#define V4L2_DV_BT_STD_CEA861
#define V4L2_DV_BT_STD_DMT
#define V4L2_DV_BT_STD_CVT
#define V4L2_DV_BT_STD_GTF
#define V4L2_DV_BT_STD_SDI

/* Flags */

/*
 * CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary
 * GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
 * intervals are reduced, allowing a higher resolution over the same
 * bandwidth. This is a read-only flag.
 */
#define V4L2_DV_FL_REDUCED_BLANKING
/*
 * CEA-861 specific: set for CEA-861 formats with a framerate of a multiple
 * of six. These formats can be optionally played at 1 / 1.001 speed.
 * This is a read-only flag.
 */
#define V4L2_DV_FL_CAN_REDUCE_FPS
/*
 * CEA-861 specific: only valid for video transmitters, the flag is cleared
 * by receivers.
 * If the framerate of the format is a multiple of six, then the pixelclock
 * used to set up the transmitter is divided by 1.001 to make it compatible
 * with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
 * 29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate
 * such frequencies, then the flag will also be cleared.
 */
#define V4L2_DV_FL_REDUCED_FPS
/*
 * Specific to interlaced formats: if set, then field 1 is really one half-line
 * longer and field 2 is really one half-line shorter, so each field has
 * exactly the same number of half-lines. Whether half-lines can be detected
 * or used depends on the hardware.
 */
#define V4L2_DV_FL_HALF_LINE
/*
 * If set, then this is a Consumer Electronics (CE) video format. Such formats
 * differ from other formats (commonly called IT formats) in that if RGB
 * encoding is used then by default the RGB values use limited range (i.e.
 * use the range 16-235) as opposed to 0-255. All formats defined in CEA-861
 * except for the 640x480 format are CE formats.
 */
#define V4L2_DV_FL_IS_CE_VIDEO
/* Some formats like SMPTE-125M have an interlaced signal with a odd
 * total height. For these formats, if this flag is set, the first
 * field has the extra line. If not, it is the second field.
 */
#define V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE
/*
 * If set, then the picture_aspect field is valid. Otherwise assume that the
 * pixels are square, so the picture aspect ratio is the same as the width to
 * height ratio.
 */
#define V4L2_DV_FL_HAS_PICTURE_ASPECT
/*
 * If set, then the cea861_vic field is valid and contains the Video
 * Identification Code as per the CEA-861 standard.
 */
#define V4L2_DV_FL_HAS_CEA861_VIC
/*
 * If set, then the hdmi_vic field is valid and contains the Video
 * Identification Code as per the HDMI standard (HDMI Vendor Specific
 * InfoFrame).
 */
#define V4L2_DV_FL_HAS_HDMI_VIC
/*
 * CEA-861 specific: only valid for video receivers.
 * If set, then HW can detect the difference between regular FPS and
 * 1000/1001 FPS. Note: This flag is only valid for HDMI VIC codes with
 * the V4L2_DV_FL_CAN_REDUCE_FPS flag set.
 */
#define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS

/* A few useful defines to calculate the total blanking and frame sizes */
#define V4L2_DV_BT_BLANKING_WIDTH(bt)
#define V4L2_DV_BT_FRAME_WIDTH(bt)
#define V4L2_DV_BT_BLANKING_HEIGHT(bt)
#define V4L2_DV_BT_FRAME_HEIGHT(bt)

/** struct v4l2_dv_timings - DV timings
 * @type:	the type of the timings
 * @bt:	BT656/1120 timings
 */
struct v4l2_dv_timings {} __attribute__ ((packed));

/* Values for the type field */
#define V4L2_DV_BT_656_1120


/** struct v4l2_enum_dv_timings - DV timings enumeration
 * @index:	enumeration index
 * @pad:	the pad number for which to enumerate timings (used with
 *		v4l-subdev nodes only)
 * @reserved:	must be zeroed
 * @timings:	the timings for the given index
 */
struct v4l2_enum_dv_timings {};

/** struct v4l2_bt_timings_cap - BT.656/BT.1120 timing capabilities
 * @min_width:		width in pixels
 * @max_width:		width in pixels
 * @min_height:		height in lines
 * @max_height:		height in lines
 * @min_pixelclock:	Pixel clock in HZ. Ex. 74.25MHz->74250000
 * @max_pixelclock:	Pixel clock in HZ. Ex. 74.25MHz->74250000
 * @standards:		Supported standards
 * @capabilities:	Supported capabilities
 * @reserved:		Must be zeroed
 */
struct v4l2_bt_timings_cap {} __attribute__ ((packed));

/* Supports interlaced formats */
#define V4L2_DV_BT_CAP_INTERLACED
/* Supports progressive formats */
#define V4L2_DV_BT_CAP_PROGRESSIVE
/* Supports CVT/GTF reduced blanking */
#define V4L2_DV_BT_CAP_REDUCED_BLANKING
/* Supports custom formats */
#define V4L2_DV_BT_CAP_CUSTOM

/** struct v4l2_dv_timings_cap - DV timings capabilities
 * @type:	the type of the timings (same as in struct v4l2_dv_timings)
 * @pad:	the pad number for which to query capabilities (used with
 *		v4l-subdev nodes only)
 * @bt:		the BT656/1120 timings capabilities
 */
struct v4l2_dv_timings_cap {};


/*
 *	V I D E O   I N P U T S
 */
struct v4l2_input {};

/*  Values for the 'type' field */
#define V4L2_INPUT_TYPE_TUNER
#define V4L2_INPUT_TYPE_CAMERA
#define V4L2_INPUT_TYPE_TOUCH

/* field 'status' - general */
#define V4L2_IN_ST_NO_POWER
#define V4L2_IN_ST_NO_SIGNAL
#define V4L2_IN_ST_NO_COLOR

/* field 'status' - sensor orientation */
/* If sensor is mounted upside down set both bits */
#define V4L2_IN_ST_HFLIP
#define V4L2_IN_ST_VFLIP

/* field 'status' - analog */
#define V4L2_IN_ST_NO_H_LOCK
#define V4L2_IN_ST_COLOR_KILL
#define V4L2_IN_ST_NO_V_LOCK
#define V4L2_IN_ST_NO_STD_LOCK

/* field 'status' - digital */
#define V4L2_IN_ST_NO_SYNC
#define V4L2_IN_ST_NO_EQU
#define V4L2_IN_ST_NO_CARRIER

/* field 'status' - VCR and set-top box */
#define V4L2_IN_ST_MACROVISION
#define V4L2_IN_ST_NO_ACCESS
#define V4L2_IN_ST_VTR

/* capabilities flags */
#define V4L2_IN_CAP_DV_TIMINGS
#define V4L2_IN_CAP_CUSTOM_TIMINGS
#define V4L2_IN_CAP_STD
#define V4L2_IN_CAP_NATIVE_SIZE

/*
 *	V I D E O   O U T P U T S
 */
struct v4l2_output {};
/*  Values for the 'type' field */
#define V4L2_OUTPUT_TYPE_MODULATOR
#define V4L2_OUTPUT_TYPE_ANALOG
#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY

/* capabilities flags */
#define V4L2_OUT_CAP_DV_TIMINGS
#define V4L2_OUT_CAP_CUSTOM_TIMINGS
#define V4L2_OUT_CAP_STD
#define V4L2_OUT_CAP_NATIVE_SIZE

/*
 *	C O N T R O L S
 */
struct v4l2_control {};

struct v4l2_ext_control {} __attribute__ ((packed));

struct v4l2_ext_controls {};

#define V4L2_CTRL_ID_MASK
#ifndef __KERNEL__
#define V4L2_CTRL_ID2CLASS
#endif
#define V4L2_CTRL_ID2WHICH(id)
#define V4L2_CTRL_DRIVER_PRIV(id)
#define V4L2_CTRL_MAX_DIMS
#define V4L2_CTRL_WHICH_CUR_VAL
#define V4L2_CTRL_WHICH_DEF_VAL
#define V4L2_CTRL_WHICH_REQUEST_VAL

enum v4l2_ctrl_type {};

/*  Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
struct v4l2_queryctrl {};

/*  Used in the VIDIOC_QUERY_EXT_CTRL ioctl for querying extended controls */
struct v4l2_query_ext_ctrl {};

/*  Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
struct v4l2_querymenu {} __attribute__ ((packed));

/*  Control flags  */
#define V4L2_CTRL_FLAG_DISABLED
#define V4L2_CTRL_FLAG_GRABBED
#define V4L2_CTRL_FLAG_READ_ONLY
#define V4L2_CTRL_FLAG_UPDATE
#define V4L2_CTRL_FLAG_INACTIVE
#define V4L2_CTRL_FLAG_SLIDER
#define V4L2_CTRL_FLAG_WRITE_ONLY
#define V4L2_CTRL_FLAG_VOLATILE
#define V4L2_CTRL_FLAG_HAS_PAYLOAD
#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE
#define V4L2_CTRL_FLAG_MODIFY_LAYOUT
#define V4L2_CTRL_FLAG_DYNAMIC_ARRAY

/*  Query flags, to be ORed with the control ID */
#define V4L2_CTRL_FLAG_NEXT_CTRL
#define V4L2_CTRL_FLAG_NEXT_COMPOUND

/*  User-class control IDs defined by V4L2 */
#define V4L2_CID_MAX_CTRLS
/*  IDs reserved for driver specific controls */
#define V4L2_CID_PRIVATE_BASE


/*
 *	T U N I N G
 */
struct v4l2_tuner {};

struct v4l2_modulator {};

/*  Flags for the 'capability' field */
#define V4L2_TUNER_CAP_LOW
#define V4L2_TUNER_CAP_NORM
#define V4L2_TUNER_CAP_HWSEEK_BOUNDED
#define V4L2_TUNER_CAP_HWSEEK_WRAP
#define V4L2_TUNER_CAP_STEREO
#define V4L2_TUNER_CAP_LANG2
#define V4L2_TUNER_CAP_SAP
#define V4L2_TUNER_CAP_LANG1
#define V4L2_TUNER_CAP_RDS
#define V4L2_TUNER_CAP_RDS_BLOCK_IO
#define V4L2_TUNER_CAP_RDS_CONTROLS
#define V4L2_TUNER_CAP_FREQ_BANDS
#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM
#define V4L2_TUNER_CAP_1HZ

/*  Flags for the 'rxsubchans' field */
#define V4L2_TUNER_SUB_MONO
#define V4L2_TUNER_SUB_STEREO
#define V4L2_TUNER_SUB_LANG2
#define V4L2_TUNER_SUB_SAP
#define V4L2_TUNER_SUB_LANG1
#define V4L2_TUNER_SUB_RDS

/*  Values for the 'audmode' field */
#define V4L2_TUNER_MODE_MONO
#define V4L2_TUNER_MODE_STEREO
#define V4L2_TUNER_MODE_LANG2
#define V4L2_TUNER_MODE_SAP
#define V4L2_TUNER_MODE_LANG1
#define V4L2_TUNER_MODE_LANG1_LANG2

struct v4l2_frequency {};

#define V4L2_BAND_MODULATION_VSB
#define V4L2_BAND_MODULATION_FM
#define V4L2_BAND_MODULATION_AM

struct v4l2_frequency_band {};

struct v4l2_hw_freq_seek {};

/*
 *	R D S
 */

struct v4l2_rds_data {} __attribute__ ((packed));

#define V4L2_RDS_BLOCK_MSK
#define V4L2_RDS_BLOCK_A
#define V4L2_RDS_BLOCK_B
#define V4L2_RDS_BLOCK_C
#define V4L2_RDS_BLOCK_D
#define V4L2_RDS_BLOCK_C_ALT
#define V4L2_RDS_BLOCK_INVALID

#define V4L2_RDS_BLOCK_CORRECTED
#define V4L2_RDS_BLOCK_ERROR

/*
 *	A U D I O
 */
struct v4l2_audio {};

/*  Flags for the 'capability' field */
#define V4L2_AUDCAP_STEREO
#define V4L2_AUDCAP_AVL

/*  Flags for the 'mode' field */
#define V4L2_AUDMODE_AVL

struct v4l2_audioout {};

/*
 *	M P E G   S E R V I C E S
 */
#if 1
#define V4L2_ENC_IDX_FRAME_I
#define V4L2_ENC_IDX_FRAME_P
#define V4L2_ENC_IDX_FRAME_B
#define V4L2_ENC_IDX_FRAME_MASK

struct v4l2_enc_idx_entry {};

#define V4L2_ENC_IDX_ENTRIES
struct v4l2_enc_idx {};


#define V4L2_ENC_CMD_START
#define V4L2_ENC_CMD_STOP
#define V4L2_ENC_CMD_PAUSE
#define V4L2_ENC_CMD_RESUME

/* Flags for V4L2_ENC_CMD_STOP */
#define V4L2_ENC_CMD_STOP_AT_GOP_END

struct v4l2_encoder_cmd {};

/* Decoder commands */
#define V4L2_DEC_CMD_START
#define V4L2_DEC_CMD_STOP
#define V4L2_DEC_CMD_PAUSE
#define V4L2_DEC_CMD_RESUME
#define V4L2_DEC_CMD_FLUSH

/* Flags for V4L2_DEC_CMD_START */
#define V4L2_DEC_CMD_START_MUTE_AUDIO

/* Flags for V4L2_DEC_CMD_PAUSE */
#define V4L2_DEC_CMD_PAUSE_TO_BLACK

/* Flags for V4L2_DEC_CMD_STOP */
#define V4L2_DEC_CMD_STOP_TO_BLACK
#define V4L2_DEC_CMD_STOP_IMMEDIATELY

/* Play format requirements (returned by the driver): */

/* The decoder has no special format requirements */
#define V4L2_DEC_START_FMT_NONE
/* The decoder requires full GOPs */
#define V4L2_DEC_START_FMT_GOP

/* The structure must be zeroed before use by the application
   This ensures it can be extended safely in the future. */
struct v4l2_decoder_cmd {};
#endif


/*
 *	D A T A   S E R V I C E S   ( V B I )
 *
 *	Data services API by Michael Schimek
 */

/* Raw VBI */
struct v4l2_vbi_format {};

/*  VBI flags  */
#define V4L2_VBI_UNSYNC
#define V4L2_VBI_INTERLACED

/* ITU-R start lines for each field */
#define V4L2_VBI_ITU_525_F1_START
#define V4L2_VBI_ITU_525_F2_START
#define V4L2_VBI_ITU_625_F1_START
#define V4L2_VBI_ITU_625_F2_START

/* Sliced VBI
 *
 *    This implements is a proposal V4L2 API to allow SLICED VBI
 * required for some hardware encoders. It should change without
 * notice in the definitive implementation.
 */

struct v4l2_sliced_vbi_format {};

/* Teletext World System Teletext
   (WST), defined on ITU-R BT.653-2 */
#define V4L2_SLICED_TELETEXT_B
/* Video Program System, defined on ETS 300 231*/
#define V4L2_SLICED_VPS
/* Closed Caption, defined on EIA-608 */
#define V4L2_SLICED_CAPTION_525
/* Wide Screen System, defined on ITU-R BT1119.1 */
#define V4L2_SLICED_WSS_625

#define V4L2_SLICED_VBI_525
#define V4L2_SLICED_VBI_625

struct v4l2_sliced_vbi_cap {};

struct v4l2_sliced_vbi_data {};

/*
 * Sliced VBI data inserted into MPEG Streams
 */

/*
 * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
 *
 * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
 * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
 * data
 *
 * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
 * definitions are not included here.  See the MPEG-2 specifications for details
 * on these headers.
 */

/* Line type IDs */
#define V4L2_MPEG_VBI_IVTV_TELETEXT_B
#define V4L2_MPEG_VBI_IVTV_CAPTION_525
#define V4L2_MPEG_VBI_IVTV_WSS_625
#define V4L2_MPEG_VBI_IVTV_VPS

struct v4l2_mpeg_vbi_itv0_line {} __attribute__ ((packed));

struct v4l2_mpeg_vbi_itv0 {} __attribute__ ((packed));

struct v4l2_mpeg_vbi_ITV0 {} __attribute__ ((packed));

#define V4L2_MPEG_VBI_IVTV_MAGIC0
#define V4L2_MPEG_VBI_IVTV_MAGIC1

struct v4l2_mpeg_vbi_fmt_ivtv {} __attribute__ ((packed));

/*
 *	A G G R E G A T E   S T R U C T U R E S
 */

/**
 * struct v4l2_plane_pix_format - additional, per-plane format definition
 * @sizeimage:		maximum size in bytes required for data, for which
 *			this plane will be used
 * @bytesperline:	distance in bytes between the leftmost pixels in two
 *			adjacent lines
 * @reserved:		drivers and applications must zero this array
 */
struct v4l2_plane_pix_format {} __attribute__ ((packed));

/**
 * struct v4l2_pix_format_mplane - multiplanar format definition
 * @width:		image width in pixels
 * @height:		image height in pixels
 * @pixelformat:	little endian four character code (fourcc)
 * @field:		enum v4l2_field; field order (for interlaced video)
 * @colorspace:		enum v4l2_colorspace; supplemental to pixelformat
 * @plane_fmt:		per-plane information
 * @num_planes:		number of planes for this format
 * @flags:		format flags (V4L2_PIX_FMT_FLAG_*)
 * @ycbcr_enc:		enum v4l2_ycbcr_encoding, Y'CbCr encoding
 * @hsv_enc:		enum v4l2_hsv_encoding, HSV encoding
 * @quantization:	enum v4l2_quantization, colorspace quantization
 * @xfer_func:		enum v4l2_xfer_func, colorspace transfer function
 * @reserved:		drivers and applications must zero this array
 */
struct v4l2_pix_format_mplane {} __attribute__ ((packed));

/**
 * struct v4l2_sdr_format - SDR format definition
 * @pixelformat:	little endian four character code (fourcc)
 * @buffersize:		maximum size in bytes required for data
 * @reserved:		drivers and applications must zero this array
 */
struct v4l2_sdr_format {} __attribute__ ((packed));

/**
 * struct v4l2_meta_format - metadata format definition
 * @dataformat:		little endian four character code (fourcc)
 * @buffersize:		maximum size in bytes required for data
 * @width:		number of data units of data per line (valid for line
 *			based formats only, see format documentation)
 * @height:		number of lines of data per buffer (valid for line based
 *			formats only)
 * @bytesperline:	offset between the beginnings of two adjacent lines in
 *			bytes (valid for line based formats only)
 */
struct v4l2_meta_format {} __attribute__ ((packed));

/**
 * struct v4l2_format - stream data format
 * @type:		enum v4l2_buf_type; type of the data stream
 * @fmt.pix:		definition of an image format
 * @fmt.pix_mp:		definition of a multiplanar image format
 * @fmt.win:		definition of an overlaid image
 * @fmt.vbi:		raw VBI capture or output parameters
 * @fmt.sliced:		sliced VBI capture or output parameters
 * @fmt.raw_data:	placeholder for future extensions and custom formats
 * @fmt:		union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,
 *			@meta and @raw_data
 */
struct v4l2_format {};

/*	Stream type-dependent parameters
 */
struct v4l2_streamparm {};

/*
 *	E V E N T S
 */

#define V4L2_EVENT_ALL
#define V4L2_EVENT_VSYNC
#define V4L2_EVENT_EOS
#define V4L2_EVENT_CTRL
#define V4L2_EVENT_FRAME_SYNC
#define V4L2_EVENT_SOURCE_CHANGE
#define V4L2_EVENT_MOTION_DET
#define V4L2_EVENT_PRIVATE_START

/* Payload for V4L2_EVENT_VSYNC */
struct v4l2_event_vsync {} __attribute__ ((packed));

/* Payload for V4L2_EVENT_CTRL */
#define V4L2_EVENT_CTRL_CH_VALUE
#define V4L2_EVENT_CTRL_CH_FLAGS
#define V4L2_EVENT_CTRL_CH_RANGE
#define V4L2_EVENT_CTRL_CH_DIMENSIONS

struct v4l2_event_ctrl {};

struct v4l2_event_frame_sync {};

#define V4L2_EVENT_SRC_CH_RESOLUTION

struct v4l2_event_src_change {};

#define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ

/**
 * struct v4l2_event_motion_det - motion detection event
 * @flags:             if V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ is set, then the
 *                     frame_sequence field is valid.
 * @frame_sequence:    the frame sequence number associated with this event.
 * @region_mask:       which regions detected motion.
 */
struct v4l2_event_motion_det {};

struct v4l2_event {};

#define V4L2_EVENT_SUB_FL_SEND_INITIAL
#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK

struct v4l2_event_subscription {};

/*
 *	A D V A N C E D   D E B U G G I N G
 *
 *	NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
 *	FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
 */

/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */

#define V4L2_CHIP_MATCH_BRIDGE
#define V4L2_CHIP_MATCH_SUBDEV

/* The following four defines are no longer in use */
#define V4L2_CHIP_MATCH_HOST
#define V4L2_CHIP_MATCH_I2C_DRIVER
#define V4L2_CHIP_MATCH_I2C_ADDR
#define V4L2_CHIP_MATCH_AC97

struct v4l2_dbg_match {} __attribute__ ((packed));

struct v4l2_dbg_register {} __attribute__ ((packed));

#define V4L2_CHIP_FL_READABLE
#define V4L2_CHIP_FL_WRITABLE

/* VIDIOC_DBG_G_CHIP_INFO */
struct v4l2_dbg_chip_info {} __attribute__ ((packed));

/**
 * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
 * @index:	on return, index of the first created buffer
 * @count:	entry: number of requested buffers,
 *		return: number of created buffers
 * @memory:	enum v4l2_memory; buffer memory type
 * @format:	frame format, for which buffers are requested
 * @capabilities: capabilities of this buffer type.
 * @flags:	additional buffer management attributes (ignored unless the
 *		queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability
 *		and configured for MMAP streaming I/O).
 * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set
 *		this field indicate the maximum possible number of buffers
 *		for this queue.
 * @reserved:	future extensions
 */
struct v4l2_create_buffers {};

/**
 * struct v4l2_remove_buffers - VIDIOC_REMOVE_BUFS argument
 * @index:	the first buffer to be removed
 * @count:	number of buffers to removed
 * @type:	enum v4l2_buf_type
 * @reserved:	future extensions
 */
struct v4l2_remove_buffers {};

/*
 *	I O C T L   C O D E S   F O R   V I D E O   D E V I C E S
 *
 */
#define VIDIOC_QUERYCAP
#define VIDIOC_ENUM_FMT
#define VIDIOC_G_FMT
#define VIDIOC_S_FMT
#define VIDIOC_REQBUFS
#define VIDIOC_QUERYBUF
#define VIDIOC_G_FBUF
#define VIDIOC_S_FBUF
#define VIDIOC_OVERLAY
#define VIDIOC_QBUF
#define VIDIOC_EXPBUF
#define VIDIOC_DQBUF
#define VIDIOC_STREAMON
#define VIDIOC_STREAMOFF
#define VIDIOC_G_PARM
#define VIDIOC_S_PARM
#define VIDIOC_G_STD
#define VIDIOC_S_STD
#define VIDIOC_ENUMSTD
#define VIDIOC_ENUMINPUT
#define VIDIOC_G_CTRL
#define VIDIOC_S_CTRL
#define VIDIOC_G_TUNER
#define VIDIOC_S_TUNER
#define VIDIOC_G_AUDIO
#define VIDIOC_S_AUDIO
#define VIDIOC_QUERYCTRL
#define VIDIOC_QUERYMENU
#define VIDIOC_G_INPUT
#define VIDIOC_S_INPUT
#define VIDIOC_G_EDID
#define VIDIOC_S_EDID
#define VIDIOC_G_OUTPUT
#define VIDIOC_S_OUTPUT
#define VIDIOC_ENUMOUTPUT
#define VIDIOC_G_AUDOUT
#define VIDIOC_S_AUDOUT
#define VIDIOC_G_MODULATOR
#define VIDIOC_S_MODULATOR
#define VIDIOC_G_FREQUENCY
#define VIDIOC_S_FREQUENCY
#define VIDIOC_CROPCAP
#define VIDIOC_G_CROP
#define VIDIOC_S_CROP
#define VIDIOC_G_JPEGCOMP
#define VIDIOC_S_JPEGCOMP
#define VIDIOC_QUERYSTD
#define VIDIOC_TRY_FMT
#define VIDIOC_ENUMAUDIO
#define VIDIOC_ENUMAUDOUT
#define VIDIOC_G_PRIORITY
#define VIDIOC_S_PRIORITY
#define VIDIOC_G_SLICED_VBI_CAP
#define VIDIOC_LOG_STATUS
#define VIDIOC_G_EXT_CTRLS
#define VIDIOC_S_EXT_CTRLS
#define VIDIOC_TRY_EXT_CTRLS
#define VIDIOC_ENUM_FRAMESIZES
#define VIDIOC_ENUM_FRAMEINTERVALS
#define VIDIOC_G_ENC_INDEX
#define VIDIOC_ENCODER_CMD
#define VIDIOC_TRY_ENCODER_CMD

/*
 * Experimental, meant for debugging, testing and internal use.
 * Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
 * You must be root to use these ioctls. Never use these in applications!
 */
#define VIDIOC_DBG_S_REGISTER
#define VIDIOC_DBG_G_REGISTER

#define VIDIOC_S_HW_FREQ_SEEK
#define VIDIOC_S_DV_TIMINGS
#define VIDIOC_G_DV_TIMINGS
#define VIDIOC_DQEVENT
#define VIDIOC_SUBSCRIBE_EVENT
#define VIDIOC_UNSUBSCRIBE_EVENT
#define VIDIOC_CREATE_BUFS
#define VIDIOC_PREPARE_BUF
#define VIDIOC_G_SELECTION
#define VIDIOC_S_SELECTION
#define VIDIOC_DECODER_CMD
#define VIDIOC_TRY_DECODER_CMD
#define VIDIOC_ENUM_DV_TIMINGS
#define VIDIOC_QUERY_DV_TIMINGS
#define VIDIOC_DV_TIMINGS_CAP
#define VIDIOC_ENUM_FREQ_BANDS

/*
 * Experimental, meant for debugging, testing and internal use.
 * Never use this in applications!
 */
#define VIDIOC_DBG_G_CHIP_INFO

#define VIDIOC_QUERY_EXT_CTRL
#define VIDIOC_REMOVE_BUFS


/* Reminder: when adding new ioctls please add support for them to
   drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */

#define BASE_VIDIOC_PRIVATE

/* Deprecated definitions kept for backwards compatibility */
#ifndef __KERNEL__
#define V4L2_PIX_FMT_HM12
#define V4L2_PIX_FMT_SUNXI_TILED_NV12
/*
 * This capability was never implemented, anyone using this cap should drop it
 * from their code.
 */
#define V4L2_CAP_ASYNCIO
#endif

#endif /* _UAPI__LINUX_VIDEODEV2_H */