Developer World
Spresense SDK Library v1.4.2-3df2e9d
video.h File Reference
#include <stdint.h>
#include <sys/ioctl.h>
#include <video/video_controls.h>

Go to the source code of this file.

Classes

struct  v4l2_requestbuffers
 parameter of ioctl(VIDIOC_REQBUFS) More...
 
struct  v4l2_timecode
 
struct  v4l2_plane
 
struct  v4l2_buffer
 Parameter of ioctl(VIDIOC_QBUF) and ioctl(VIDIOC_DQBUF).
Currently, support only index, type, bytesused, memory, m.userptr, and length. More...
 
struct  v4l2_fmtdesc
 parameter of ioctl(VIDIOC_ENUM_FMT) More...
 
struct  v4l2_frmsize_discrete
 
struct  v4l2_frmsize_stepwise
 
struct  v4l2_frmsizeenum
 parameter of ioctl(VIDIOC_ENUM_FRAMESIZES) More...
 
struct  v4l2_fract
 
struct  v4l2_frmival_stepwise
 
struct  v4l2_frmivalenum
 parameter of ioctl(VIDIOC_ENUM_FRAMEINTERVALS) More...
 
struct  v4l2_pix_format
 
struct  v4l2_format
 parameter of ioctl(VIDIOC_S_FMT) More...
 
struct  v4l2_captureparm
 
struct  v4l2_streamparm
 parameter of ioctl(VIDIOC_S_PARM) More...
 
struct  v4l2_queryctrl
 parameter of ioctl(VIDIOC_QUERYCTRL) More...
 
struct  v4l2_query_ext_ctrl
 parameter of ioctl(VIDIOC_QUERY_EXT_CTRL) More...
 
struct  v4l2_querymenu
 parameter of ioctl(VIDIOC_QUERYMENU) More...
 
struct  v4l2_control
 parameter of ioctl(VIDIOC_G_CTRL / VIDIOC_S_CTRL) More...
 
struct  v4l2_ext_control
 
struct  v4l2_ext_controls
 parameter of ioctl(VIDIOC_G_EXT_CTRLS / VIDIOC_S_EXT_CTRLS) More...
 

Macros

#define _VIDIOCBASE   (0x1000)
 
#define _VIDIOC(nr)   _IOC(_VIDIOCBASE,nr)
 
#define VIDIOC_ENUM_FMT   _VIDIOC(0x0001)
 
#define VIDIOC_ENUM_FRAMESIZES   _VIDIOC(0x0002)
 
#define VIDIOC_ENUM_FRAMEINTERVALS   _VIDIOC(0x0003)
 
#define VIDIOC_TRY_FMT   _VIDIOC(0x0004)
 
#define VIDIOC_S_FMT   _VIDIOC(0x0005)
 
#define VIDIOC_S_PARM   _VIDIOC(0x0006)
 
#define VIDIOC_REQBUFS   _VIDIOC(0x0007)
 
#define VIDIOC_QBUF   _VIDIOC(0x0008)
 
#define VIDIOC_DQBUF   _VIDIOC(0x0009)
 
#define VIDIOC_STREAMON   _VIDIOC(0x000A)
 
#define VIDIOC_STREAMOFF   _VIDIOC(0x000B)
 
#define VIDIOC_DO_HALFPUSH   _VIDIOC(0x000C)
 
#define VIDIOC_TAKEPICT_START   _VIDIOC(0x000D)
 
#define VIDIOC_TAKEPICT_STOP   _VIDIOC(0x000E)
 
#define VIDIOC_QUERYCTRL   _VIDIOC(0x000F)
 
#define VIDIOC_QUERY_EXT_CTRL   _VIDIOC(0x0010)
 
#define VIDIOC_QUERYMENU   _VIDIOC(0x0011)
 
#define VIDIOC_G_CTRL   _VIDIOC(0x0012)
 
#define VIDIOC_S_CTRL   _VIDIOC(0x0013)
 
#define VIDIOC_G_EXT_CTRLS   _VIDIOC(0x0014)
 
#define VIDIOC_S_EXT_CTRLS   _VIDIOC(0x0015)
 
#define VIDIOC_CANCEL_DQBUF   _VIDIOC(0x0016)
 
#define VIDEO_HSIZE_QVGA   (320)
 
#define VIDEO_VSIZE_QVGA   (240)
 
#define VIDEO_HSIZE_VGA   (640)
 
#define VIDEO_VSIZE_VGA   (480)
 
#define VIDEO_HSIZE_QUADVGA   (1280)
 
#define VIDEO_VSIZE_QUADVGA   (960)
 
#define VIDEO_HSIZE_HD   (1280)
 
#define VIDEO_VSIZE_HD   (720)
 
#define VIDEO_HSIZE_FULLHD   (1920)
 
#define VIDEO_VSIZE_FULLHD   (1080)
 
#define VIDEO_HSIZE_5M   (2560)
 
#define VIDEO_VSIZE_5M   (1920)
 
#define VIDEO_HSIZE_3M   (2048)
 
#define VIDEO_VSIZE_3M   (1536)
 
#define v4l2_fourcc(a, b, c, d)
 
#define v4l2_fourcc_be(a, b, c, d)   (v4l2_fourcc(a, b, c, d) | (1 << 31))
 
#define V4L2_PIX_FMT_UYVY   v4l2_fourcc('U', 'Y', 'V', 'Y')
 
#define V4L2_PIX_FMT_RGB565   v4l2_fourcc('R', 'G', 'B', 'P')
 
#define V4L2_PIX_FMT_JPEG   v4l2_fourcc('J', 'P', 'E', 'G')
 
#define V4L2_PIX_FMT_JPEG_WITH_SUBIMG   v4l2_fourcc('J', 'S', 'U', 'B')
 
#define V4L2_FMT_DSC_MAX   (32)
 
#define V4L2_CTRL_MAX_DIMS   (4)
 
#define V4L2_REQBUFS_COUNT_MAX   (256)
 
#define V4L2_BUF_FLAG_ERROR   (0x0001)
 

Typedefs

typedef struct v4l2_requestbuffers v4l2_requestbuffers_t
 
typedef struct v4l2_timecode v4l2_timecode_t
 
typedef struct v4l2_plane v4l2_plane_t
 
typedef struct v4l2_buffer v4l2_buffer_t
 
typedef struct v4l2_pix_format v4l2_pix_format_t
 
typedef struct v4l2_format v4l2_format_t
 

Enumerations

enum  v4l2_buf_type {
  V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, V4L2_BUF_TYPE_VBI_CAPTURE = 4,
  V4L2_BUF_TYPE_VBI_OUTPUT = 5, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
  V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, V4L2_BUF_TYPE_SDR_CAPTURE = 11, V4L2_BUF_TYPE_SDR_OUTPUT = 12,
  V4L2_BUF_TYPE_META_CAPTURE = 13, V4L2_BUF_TYPE_PRIVATE = 0x80, V4L2_BUF_TYPE_STILL_CAPTURE = 0x81
}
 
enum  v4l2_memory { V4L2_MEMORY_MMAP = 1, V4L2_MEMORY_USERPTR = 2, V4L2_MEMORY_OVERLAY = 3, V4L2_MEMORY_DMABUF = 4 }
 
enum  v4l2_field {
  V4L2_FIELD_ANY = 0, V4L2_FIELD_NONE = 1, V4L2_FIELD_TOP = 2, V4L2_FIELD_BOTTOM = 3,
  V4L2_FIELD_INTERLACED = 4, V4L2_FIELD_SEQ_TB = 5, V4L2_FIELD_SEQ_BT = 6, V4L2_FIELD_ALTERNATE = 7,
  V4L2_FIELD_INTERLACED_TB = 8, V4L2_FIELD_INTERLACED_BT = 9
}
 
enum  v4l2_buf_mode { V4L2_BUF_MODE_RING = 0, V4L2_BUF_MODE_FIFO = 1 }
 
enum  v4l2_frmsizetypes { V4L2_FRMSIZE_TYPE_DISCRETE = 1, V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, V4L2_FRMSIZE_TYPE_STEPWISE = 3 }
 
enum  v4l2_frmivaltypes { V4L2_FRMIVAL_TYPE_DISCRETE = 1, V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, V4L2_FRMIVAL_TYPE_STEPWISE = 3 }
 
enum  v4l2_ctrl_type {
  V4L2_CTRL_TYPE_INTEGER = 1, V4L2_CTRL_TYPE_BOOLEAN = 2, V4L2_CTRL_TYPE_MENU = 3, V4L2_CTRL_TYPE_BUTTON = 4,
  V4L2_CTRL_TYPE_INTEGER64 = 5, V4L2_CTRL_TYPE_CTRL_CLASS = 6, V4L2_CTRL_TYPE_STRING = 7, V4L2_CTRL_TYPE_BITMASK = 8,
  V4L2_CTRL_TYPE_INTEGER_MENU = 9, V4L2_CTRL_TYPE_U8FIXEDPOINT_Q7 = 10, V4L2_CTRL_TYPE_U16FIXEDPOINT_Q8 = 11, V4L2_CTRL_TYPE_INTEGER_TIMES_3 = 12,
  V4L2_CTRL_COMPOUND_TYPES = 0x0100, V4L2_CTRL_TYPE_U8 = 0x0100, V4L2_CTRL_TYPE_U16 = 0x0101, V4L2_CTRL_TYPE_U32 = 0x0102
}
 

Functions

struct v4l2_querymenu __attribute__ ((packed))
 
int video_initialize (FAR const char *devpath)
 
int video_uninitialize (void)
 

Variables

uint16_t ctrl_class
 
uint16_t id
 
uint32_t index
 
union {
   char   name [32]
 
   int64_t   value
 
}; 
 
struct v4l2_control __attribute__
 
uint16_t size
 
union {
   int32_t   value
 
   int64_t   value64
 
   char *   string
 
   uint8_t *   p_u8
 
   uint16_t *   p_u16
 
   uint32_t *   p_u32
 
   void *   ptr
 
}; 
 

Variable Documentation

◆ ctrl_class

uint16_t ctrl_class

camera control class

◆ id

uint16_t id

camera control id

◆ index

uint32_t index

index of menu.

◆ name

char name[32]

name of menu

◆ value

int32_t value

value of menu

QUERY_EXT_CTRL type = INTEGER, xxx

◆ size

uint16_t size

size of value(not use)

◆ value64

int64_t value64

QUERY_EXT_CTRL type = INTEGER64, MENU

◆ p_u8

uint8_t* p_u8

QUERY_EXT_CTRL type = U8

◆ p_u16

uint16_t* p_u16

QUERY_EXT_CTRL type = U16

◆ p_u32

uint32_t* p_u32

QUERY_EXT_CTRL type = U32