LINUX MEDIA INFRASTRUCTURE API

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation. A copy of the license is included in the chapter entitled "GNU Free Documentation License"


Table of Contents

Introduction
I. Video for Linux Two API Specification
1. Common API Elements
Opening and Closing Devices
Device Naming
Related Devices
Multiple Opens
Shared Data Streams
Functions
Querying Capabilities
Application Priority
Video Inputs and Outputs
Audio Inputs and Outputs
Tuners and Modulators
Tuners
Modulators
Radio Frequency
Video Standards
Digital Video (DV) Timings
User Controls
Extended Controls
Introduction
The Extended Control API
Enumerating Extended Controls
Creating Control Panels
MPEG Control Reference
Camera Control Reference
FM Transmitter Control Reference
Flash Control Reference
Image Source Control Reference
Image Process Control Reference
Data Formats
Data Format Negotiation
Image Format Enumeration
Single- and multi-planar APIs
Multi-planar formats
Calls that distinguish between single and multi-planar APIs
Image Cropping, Insertion and Scaling
Cropping Structures
Scaling Adjustments
Examples
Experimental API for cropping, composing and scaling
Introduction
Selection targets
Configuration
Comparison with old cropping API.
Examples
Streaming Parameters
2. Image Formats
Single-planar format structure
Multi-planar format structures
Standard Image Formats
Colorspaces
Indexed Format
RGB Formats
Packed RGB formats — Packed RGB formats
V4L2_PIX_FMT_SBGGR8 ('BA81') — Bayer RGB format
V4L2_PIX_FMT_SGBRG8 ('GBRG') — Bayer RGB format
V4L2_PIX_FMT_SGRBG8 ('GRBG') — Bayer RGB format
V4L2_PIX_FMT_SRGGB8 ('RGGB') — Bayer RGB format
V4L2_PIX_FMT_SBGGR16 ('BYR2') — Bayer RGB format
V4L2_PIX_FMT_SRGGB10 ('RG10'), V4L2_PIX_FMT_SGRBG10 ('BA10'), V4L2_PIX_FMT_SGBRG10 ('GB10'), V4L2_PIX_FMT_SBGGR10 ('BG10'), — 10-bit Bayer formats expanded to 16 bits
V4L2_PIX_FMT_SRGGB10DPCM8 ('bBA8'), V4L2_PIX_FMT_SGBRG10DPCM8 ('bGA8'), V4L2_PIX_FMT_SGRBG10DPCM8 ('BD10'), V4L2_PIX_FMT_SBGGR10DPCM8 ('bRA8'), — 10-bit Bayer formats compressed to 8 bits
V4L2_PIX_FMT_SRGGB12 ('RG12'), V4L2_PIX_FMT_SGRBG12 ('BA12'), V4L2_PIX_FMT_SGBRG12 ('GB12'), V4L2_PIX_FMT_SBGGR12 ('BG12'), — 12-bit Bayer formats expanded to 16 bits
YUV Formats
Packed YUV formats — Packed YUV formats
V4L2_PIX_FMT_GREY ('GREY') — Grey-scale image
V4L2_PIX_FMT_Y10 ('Y10 ') — Grey-scale image
V4L2_PIX_FMT_Y12 ('Y12 ') — Grey-scale image
V4L2_PIX_FMT_Y10BPACK ('Y10B') — Grey-scale image as a bit-packed array
V4L2_PIX_FMT_Y16 ('Y16 ') — Grey-scale image
V4L2_PIX_FMT_YUYV ('YUYV') — Packed format with ½ horizontal chroma resolution, also known as YUV 4:2:2
V4L2_PIX_FMT_UYVY ('UYVY') — Variation of V4L2_PIX_FMT_YUYV with different order of samples in memory
V4L2_PIX_FMT_YVYU ('YVYU') — Variation of V4L2_PIX_FMT_YUYV with different order of samples in memory
V4L2_PIX_FMT_VYUY ('VYUY') — Variation of V4L2_PIX_FMT_YUYV with different order of samples in memory
V4L2_PIX_FMT_Y41P ('Y41P') — Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1
V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12') — Planar formats with ½ horizontal and vertical chroma resolution, also known as YUV 4:2:0
V4L2_PIX_FMT_YUV420M ('YU12M') — Variation of V4L2_PIX_FMT_YUV420 with planes non contiguous in memory.
V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9') — Planar formats with ¼ horizontal and vertical chroma resolution, also known as YUV 4:1:0
V4L2_PIX_FMT_YUV422P ('422P') — Format with ½ horizontal chroma resolution, also known as YUV 4:2:2. Planar layout as opposed to V4L2_PIX_FMT_YUYV
V4L2_PIX_FMT_YUV411P ('411P') — Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1. Planar layout as opposed to V4L2_PIX_FMT_Y41P
V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21') — Formats with ½ horizontal and vertical chroma resolution, also known as YUV 4:2:0. One luminance and one chrominance plane with alternating chroma samples as opposed to V4L2_PIX_FMT_YVU420
V4L2_PIX_FMT_NV12M ('NV12M') — Variation of V4L2_PIX_FMT_NV12 with planes non contiguous in memory.
V4L2_PIX_FMT_NV12MT ('TM12') — Formats with ½ horizontal and vertical chroma resolution. This format has two planes - one for luminance and one for chrominance. Chroma samples are interleaved. The difference to V4L2_PIX_FMT_NV12 is the memory layout. Pixels are grouped in macroblocks of 64x32 size. The order of macroblocks in memory is also not standard.
V4L2_PIX_FMT_NV16 ('NV16'), V4L2_PIX_FMT_NV61 ('NV61') — Formats with ½ horizontal chroma resolution, also known as YUV 4:2:2. One luminance and one chrominance plane with alternating chroma samples as opposed to V4L2_PIX_FMT_YVU420
V4L2_PIX_FMT_NV24 ('NV24'), V4L2_PIX_FMT_NV42 ('NV42') — Formats with full horizontal and vertical chroma resolutions, also known as YUV 4:4:4. One luminance and one chrominance plane with alternating chroma samples as opposed to V4L2_PIX_FMT_YVU420
V4L2_PIX_FMT_M420 ('M420') — Format with ½ horizontal and vertical chroma resolution, also known as YUV 4:2:0. Hybrid plane line-interleaved layout.
Compressed Formats
Reserved Format Identifiers
3. Input/Output
Read/Write
Streaming I/O (Memory Mapping)
Streaming I/O (User Pointers)
Asynchronous I/O
Buffers
Timecodes
Field Order
4. Interfaces
Video Capture Interface
Querying Capabilities
Supplemental Functions
Image Format Negotiation
Reading Images
Video Overlay Interface
Querying Capabilities
Supplemental Functions
Setup
Overlay Window
Enabling Overlay
Video Output Interface
Querying Capabilities
Supplemental Functions
Image Format Negotiation
Writing Images
Video Output Overlay Interface
Querying Capabilities
Framebuffer
Overlay Window and Scaling
Enabling Overlay
Codec Interface
Effect Devices Interface
Raw VBI Data Interface
Querying Capabilities
Supplemental Functions
Raw VBI Format Negotiation
Reading and writing VBI images
Sliced VBI Data Interface
Querying Capabilities
Supplemental Functions
Sliced VBI Format Negotiation
Reading and writing sliced VBI data
Sliced VBI Data in MPEG Streams
Teletext Interface
Radio Interface
Querying Capabilities
Supplemental Functions
Programming
RDS Interface
Querying Capabilities
Reading RDS data
Writing RDS data
RDS datastructures
Event Interface
Sub-device Interface
Controls
Events
Pad-level Formats
Media Bus Formats
5. V4L2 Driver Programming
6. Libv4l Userspace Library
Introduction
libv4lconvert
libv4l1
libv4l2
v4l1compat.so wrapper library
7. Changes
Differences between V4L and V4L2
Opening and Closing Devices
Querying Capabilities
Video Sources
Tuning
Image Properties
Audio
Frame Buffer Overlay
Cropping
Reading Images, Memory Mapping
Reading Raw VBI Data
Miscellaneous
Changes of the V4L2 API
Early Versions
V4L2 Version 0.16 1999-01-31
V4L2 Version 0.18 1999-03-16
V4L2 Version 0.19 1999-06-05
V4L2 Version 0.20 (1999-09-10)
V4L2 Version 0.20 incremental changes
V4L2 Version 0.20 2000-11-23
V4L2 Version 0.20 2002-07-25
V4L2 in Linux 2.5.46, 2002-10
V4L2 2003-06-19
V4L2 2003-11-05
V4L2 in Linux 2.6.6, 2004-05-09
V4L2 in Linux 2.6.8
V4L2 spec erratum 2004-08-01
V4L2 in Linux 2.6.14
V4L2 in Linux 2.6.15
V4L2 spec erratum 2005-11-27
V4L2 spec erratum 2006-01-10
V4L2 spec erratum 2006-02-03
V4L2 spec erratum 2006-02-04
V4L2 in Linux 2.6.17
V4L2 spec erratum 2006-09-23 (Draft 0.15)
V4L2 in Linux 2.6.18
V4L2 in Linux 2.6.19
V4L2 spec erratum 2006-10-12 (Draft 0.17)
V4L2 in Linux 2.6.21
V4L2 in Linux 2.6.22
V4L2 in Linux 2.6.24
V4L2 in Linux 2.6.25
V4L2 in Linux 2.6.26
V4L2 in Linux 2.6.27
V4L2 in Linux 2.6.28
V4L2 in Linux 2.6.29
V4L2 in Linux 2.6.30
V4L2 in Linux 2.6.32
V4L2 in Linux 2.6.33
V4L2 in Linux 2.6.34
V4L2 in Linux 2.6.37
V4L2 in Linux 2.6.39
V4L2 in Linux 3.1
V4L2 in Linux 3.2
V4L2 in Linux 3.3
V4L2 in Linux 3.4
Relation of V4L2 to other Linux multimedia APIs
Experimental API Elements
Obsolete API Elements
A. Function Reference
V4L2 close() — Close a V4L2 device
V4L2 ioctl() — Program a V4L2 device
ioctl VIDIOC_CREATE_BUFS — Create buffers for Memory Mapped or User Pointer I/O
ioctl VIDIOC_CROPCAP — Information about the video cropping and scaling abilities
ioctl VIDIOC_DBG_G_CHIP_IDENT — Identify the chips on a TV card
ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER — Read or write hardware registers
ioctl VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD — Execute an decoder command
ioctl VIDIOC_DQEVENT — Dequeue event
ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD — Execute an encoder command
ioctl VIDIOC_ENUMAUDIO — Enumerate audio inputs
ioctl VIDIOC_ENUMAUDOUT — Enumerate audio outputs
ioctl VIDIOC_ENUM_DV_PRESETS — Enumerate supported Digital Video presets
ioctl VIDIOC_ENUM_FMT — Enumerate image formats
ioctl VIDIOC_ENUM_FRAMESIZES — Enumerate frame sizes
ioctl VIDIOC_ENUM_FRAMEINTERVALS — Enumerate frame intervals
ioctl VIDIOC_ENUMINPUT — Enumerate video inputs
ioctl VIDIOC_ENUMOUTPUT — Enumerate video outputs
ioctl VIDIOC_ENUMSTD — Enumerate supported video standards
ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO — Query or select the current audio input and its attributes
ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT — Query or select the current audio output
ioctl VIDIOC_G_CROP, VIDIOC_S_CROP — Get or set the current cropping rectangle
ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL — Get or set the value of a control
ioctl VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET — Query or select the DV preset of the current input or output
ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS — Get or set custom DV timings for input or output
ioctl VIDIOC_G_ENC_INDEX — Get meta data about a compressed video stream
ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS, VIDIOC_TRY_EXT_CTRLS — Get or set the value of several controls, try control values
ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF — Get or set frame buffer overlay parameters
ioctl VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT — Get or set the data format, try a format
ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY — Get or set tuner or modulator radio frequency
ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT — Query or select the current video input
ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP
ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR — Get or set modulator attributes
ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT — Query or select the current video output
ioctl VIDIOC_G_PARM, VIDIOC_S_PARM — Get or set streaming parameters
ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY — Query or request the access priority associated with a file descriptor
ioctl VIDIOC_G_SELECTION, VIDIOC_S_SELECTION — Get or set one of the selection rectangles
ioctl VIDIOC_G_SLICED_VBI_CAP — Query sliced VBI capabilities
ioctl VIDIOC_G_STD, VIDIOC_S_STD — Query or select the video standard of the current input
ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER — Get or set tuner attributes
ioctl VIDIOC_LOG_STATUS — Log driver status information
ioctl VIDIOC_OVERLAY — Start or stop video overlay
ioctl VIDIOC_QBUF, VIDIOC_DQBUF — Exchange a buffer with the driver
ioctl VIDIOC_QUERYBUF — Query the status of a buffer
ioctl VIDIOC_QUERYCAP — Query device capabilities
ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU — Enumerate controls and menu control items
ioctl VIDIOC_QUERY_DV_PRESET — Sense the DV preset received by the current input
ioctl VIDIOC_QUERYSTD — Sense the video standard received by the current input
ioctl VIDIOC_PREPARE_BUF — Prepare a buffer for I/O
ioctl VIDIOC_REQBUFS — Initiate Memory Mapping or User Pointer I/O
ioctl VIDIOC_S_HW_FREQ_SEEK — Perform a hardware frequency seek
ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF — Start or stop streaming I/O
ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL — Enumerate frame intervals
ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE — Enumerate media bus frame sizes
ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE — Enumerate media bus formats
ioctl VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP — Get or set the crop rectangle on a subdev pad
ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT — Get or set the data format on a subdev pad
ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL — Get or set the frame interval on a subdev pad
ioctl VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION — Get or set selection rectangles on a subdev pad
ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT — Subscribe or unsubscribe event
V4L2 mmap() — Map device memory into application address space
V4L2 munmap() — Unmap device memory
V4L2 open() — Open a V4L2 device
V4L2 poll() — Wait for some event on a file descriptor
V4L2 read() — Read from a V4L2 device
V4L2 select() — Synchronous I/O multiplexing
V4L2 write() — Write to a V4L2 device
B. Video For Linux Two Header File
C. Video Capture Example
D. Video Grabber example using libv4l
List of Types
References
II. LINUX DVB API
8. Introduction
What you need to know
History
Overview
Linux DVB Devices
API include files
9. DVB Frontend API
Frontend Data Types
Frontend type
frontend capabilities
frontend information
diseqc master command
diseqc slave reply
diseqc slave reply
SEC continuous tone
SEC tone burst
frontend status
frontend parameters
frontend events
Frontend Function Calls
open()
close()
FE_READ_STATUS
FE_READ_BER
FE_READ_SNR
FE_READ_SIGNAL_STRENGTH
FE_READ_UNCORRECTED_BLOCKS
FE_SET_FRONTEND
FE_GET_FRONTEND
FE_GET_EVENT
FE_GET_INFO
FE_DISEQC_RESET_OVERLOAD
FE_DISEQC_SEND_MASTER_CMD
FE_DISEQC_RECV_SLAVE_REPLY
FE_DISEQC_SEND_BURST
FE_SET_TONE
FE_SET_VOLTAGE
FE_ENABLE_HIGH_LNB_VOLTAGE
FE_SET_FRONTEND_TUNE_MODE
FE_DISHNETWORK_SEND_LEGACY_CMD
FE_GET_PROPERTY/FE_SET_PROPERTY
DTV property type
DTV properties type
FE_GET_PROPERTY
FE_SET_PROPERTY
Property types
Digital TV property parameters
Properties used on terrestrial delivery systems
Properties used on cable delivery systems
Properties used on satellital delivery systems
10. DVB Demux Device
Demux Data Types
dmx_output_t
dmx_input_t
dmx_pes_type_t
struct dmx_filter
struct dmx_sct_filter_params
struct dmx_pes_filter_params
struct dmx_event
struct dmx_stc
struct dmx_caps
enum dmx_source_t
Demux Function Calls
open()
close()
read()
write()
DMX_START
DMX_STOP
DMX_SET_FILTER
DMX_SET_PES_FILTER
DMX_SET_BUFFER_SIZE
DMX_GET_EVENT
DMX_GET_STC
11. DVB Video Device
Video Data Types
video_format_t
video_displayformat_t
video stream source
video play state
struct video-command
struct video_size-t
struct video_event
struct video_status
struct video_still_picture
video capabilities
video system
struct video_highlight
video SPU
video SPU palette
video NAVI pack
video attributes
Video Function Calls
open()
close()
write()
VIDEO_STOP
VIDEO_PLAY
VIDEO_FREEZE
VIDEO_CONTINUE
VIDEO_SELECT_SOURCE
VIDEO_SET_BLANK
VIDEO_GET_STATUS
VIDEO_GET_EVENT
VIDEO_SET_DISPLAY_FORMAT
VIDEO_STILLPICTURE
VIDEO_FAST_FORWARD
VIDEO_SLOWMOTION
VIDEO_GET_CAPABILITIES
VIDEO_SET_ID
VIDEO_CLEAR_BUFFER
VIDEO_SET_STREAMTYPE
VIDEO_SET_FORMAT
VIDEO_SET_SYSTEM
VIDEO_SET_HIGHLIGHT
VIDEO_SET_SPU
VIDEO_SET_SPU_PALETTE
VIDEO_GET_NAVI
VIDEO_SET_ATTRIBUTES
12. DVB Audio Device
Audio Data Types
audio_stream_source_t
audio_play_state_t
audio_channel_select_t
struct audio_status
struct audio_mixer
audio encodings
struct audio_karaoke
audio attributes
Audio Function Calls
open()
close()
write()
AUDIO_STOP
AUDIO_PLAY
AUDIO_PAUSE
AUDIO_CONTINUE
AUDIO_SELECT_SOURCE
AUDIO_SET_MUTE
AUDIO_SET_AV_SYNC
AUDIO_SET_BYPASS_MODE
AUDIO_CHANNEL_SELECT
AUDIO_GET_STATUS
AUDIO_GET_CAPABILITIES
AUDIO_CLEAR_BUFFER
AUDIO_SET_ID
AUDIO_SET_MIXER
AUDIO_SET_STREAMTYPE
AUDIO_SET_EXT_ID
AUDIO_SET_ATTRIBUTES
AUDIO_SET_KARAOKE
13. DVB CA Device
CA Data Types
ca_slot_info_t
ca_descr_info_t
ca_caps_t
ca_msg_t
ca_descr_t
ca-pid
CA Function Calls
open()
close()
14. DVB Network API
DVB Net Data Types
struct dvb_net_if
DVB net Function Calls
15. Kernel Demux API
Kernel Demux Data Types
dmx_success_t
TS filter types
dmx_ts_pes_t
demux_demux_t
Demux directory
Demux Directory API
dmx_register_demux()
dmx_unregister_demux()
dmx_get_demuxes()
Demux API
open()
close()
write()
allocate_ts_feed()
release_ts_feed()
allocate_section_feed()
release_section_feed()
descramble_mac_address()
descramble_section_payload()
add_frontend()
remove_frontend()
get_frontends()
connect_frontend()
disconnect_frontend()
Demux Callback API
dmx_ts_cb()
dmx_section_cb()
TS Feed API
set()
start_filtering()
stop_filtering()
Section Feed API
set()
allocate_filter()
release_filter()
start_filtering()
stop_filtering()
16. Examples
Tuning
The DVR device
E. DVB Audio Header File
F. DVB Conditional Access Header File
G. DVB Demux Header File
H. DVB Frontend Header File
I. DVB Network Header File
J. DVB Video Header File
III. Remote Controller API
17. Remote Controllers
Introduction
Changing default Remote Controller mappings
LIRC Device Interface
Introduction
LIRC read fop
LIRC write fop
LIRC ioctl fop
IV. Media Controller API
18. Media Controller
Introduction
Media device model
K. Function Reference
media open() — Open a media device
media close() — Close a media device
media ioctl() — Control a media device
ioctl MEDIA_IOC_DEVICE_INFO — Query device information
ioctl MEDIA_IOC_ENUM_ENTITIES — Enumerate entities and their properties
ioctl MEDIA_IOC_ENUM_LINKS — Enumerate all pads and links for a given entity
ioctl MEDIA_IOC_SETUP_LINK — Modify the properties of a link
19. Generic Error Codes
L. GNU Free Documentation License
0. PREAMBLE
1. APPLICABILITY AND DEFINITIONS
2. VERBATIM COPYING
3. COPYING IN QUANTITY
4. MODIFICATIONS
5. COMBINING DOCUMENTS
6. COLLECTIONS OF DOCUMENTS
7. AGGREGATION WITH INDEPENDENT WORKS
8. TRANSLATION
9. TERMINATION
10. FUTURE REVISIONS OF THIS LICENSE
Addendum

List of Figures

1.1. Image Cropping, Insertion and Scaling
1.2. Cropping and composing targets
2.1. V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
2.2. Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks
3.1. Field Order, Top Field First Transmitted
3.2. Field Order, Bottom Field First Transmitted
4.1. Line synchronization
4.2. ITU-R 525 line numbering (M/NTSC and M/PAL)
4.3. ITU-R 625 line numbering
4.4. Image Format Negotiation on Pipelines
4.5. Image processing in subdevs: simple crop example
4.6. Image processing in subdevs: scaling with multiple sources
4.7. Image processing in subdevs: scaling and composition with multiple sinks and sources
4.8. Bayer Patterns
A.1. Size adjustments with constraint flags.
8.1. Components of a DVB card/STB

List of Tables

1.1. Control IDs
1.2. MPEG Control IDs
1.3. MFC 5.1 Control IDs
1.4. CX2341x Control IDs
1.5. Camera Control IDs
1.6. FM_TX Control IDs
1.7. Flash Control IDs
1.8. Image Source Control IDs
1.9. Image Source Control IDs
2.1. struct v4l2_pix_format
2.2. struct v4l2_plane_pix_format
2.3. struct v4l2_pix_format_mplane
2.4. enum v4l2_colorspace
2.5. Indexed Image Format
2.6. Packed RGB Image Formats
2.7. Packed RGB Image Formats (corrected)
2.8. Packed YUV Image Formats
2.9. Compressed Image Formats
2.10. Reserved Image Formats
3.1. struct v4l2_buffer
3.2. struct v4l2_plane
3.3. enum v4l2_buf_type
3.4. Buffer Flags
3.5. enum v4l2_memory
3.6. struct v4l2_timecode
3.7. Timecode Types
3.8. Timecode Flags
3.9. enum v4l2_field
4.1. struct v4l2_window
4.2. struct v4l2_clip
4.3. struct v4l2_rect
4.4. struct v4l2_vbi_format
4.5. Raw VBI Format Flags
4.6. struct v4l2_sliced_vbi_format
4.7. Sliced VBI services
4.8. struct v4l2_sliced_vbi_data
4.9. struct v4l2_mpeg_vbi_fmt_ivtv
4.10. Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic field
4.11. struct v4l2_mpeg_vbi_itv0
4.12. struct v4l2_mpeg_vbi_ITV0
4.13. struct v4l2_mpeg_vbi_itv0_line
4.14. Line Identifiers for struct v4l2_mpeg_vbi_itv0_line id field
4.15. struct v4l2_rds_data
4.16. Block description
4.17. Block defines
4.18. Sample Pipeline Configuration
4.19. V4L2 subdev selection targets
4.20. V4L2 subdev selection flags
4.21. struct v4l2_subdev_selection
4.22. struct v4l2_mbus_framefmt
4.23. RGB formats
4.24. Bayer Formats
4.25. YUV Formats
4.26. JPEG Formats
7.1. V4L Device Types, Names and Numbers
A.1. struct v4l2_create_buffers
A.2. struct v4l2_cropcap
A.3. struct v4l2_rect
A.4. struct v4l2_dbg_match
A.5. struct v4l2_dbg_chip_ident
A.6. Chip Match Types
A.7. Chip Identifiers
A.8. struct v4l2_dbg_match
A.9. struct v4l2_dbg_register
A.10. Chip Match Types
A.11. struct v4l2_decoder_cmd
A.12. Decoder Commands
A.13. struct v4l2_event
A.14. struct v4l2_event_vsync
A.15. struct v4l2_event_ctrl
A.16. struct v4l2_event_frame_sync
A.17. Changes
A.18. struct v4l2_encoder_cmd
A.19. Encoder Commands
A.20. Encoder Command Flags
A.21. struct v4l2_dv_enum_presets
A.22. struct DV Presets
A.23. struct v4l2_fmtdesc
A.24. Image Format Description Flags
A.25. struct v4l2_frmsize_discrete
A.26. struct v4l2_frmsize_stepwise
A.27. struct v4l2_frmsizeenum
A.28. enum v4l2_frmsizetypes
A.29. struct v4l2_frmival_stepwise
A.30. struct v4l2_frmivalenum
A.31. enum v4l2_frmivaltypes
A.32. struct v4l2_input
A.33. Input Types
A.34. Input Status Flags
A.35. Input capabilities
A.36. struct v4l2_output
A.37. Output Type
A.38. Output capabilities
A.39. struct v4l2_standard
A.40. struct v4l2_fract
A.41. typedef v4l2_std_id
A.42. Video Standards (based on [[ITU BT.470]])
A.43. struct v4l2_audio
A.44. Audio Capability Flags
A.45. Audio Mode Flags
A.46. struct v4l2_audioout
A.47. struct v4l2_crop
A.48. struct v4l2_control
A.49. struct v4l2_dv_preset
A.50. struct v4l2_bt_timings
A.51. struct v4l2_dv_timings
A.52. DV Timing types
A.53. struct v4l2_enc_idx
A.54. struct v4l2_enc_idx_entry
A.55. Index Entry Flags
A.56. struct v4l2_ext_control
A.57. struct v4l2_ext_controls
A.58. Control classes
A.59. struct v4l2_framebuffer
A.60. Frame Buffer Capability Flags
A.61. Frame Buffer Flags
A.62. struct v4l2_format
A.63. struct v4l2_frequency
A.64. struct v4l2_jpegcompression
A.65. JPEG Markers Flags
A.66. struct v4l2_modulator
A.67. Modulator Audio Transmission Flags
A.68. struct v4l2_streamparm
A.69. struct v4l2_captureparm
A.70. struct v4l2_outputparm
A.71. Streaming Parameters Capabilites
A.72. Capture Parameters Flags
A.73. enum v4l2_priority
A.74. Selection targets.
A.75. Selection constraint flags
A.76. struct v4l2_selection
A.77. struct v4l2_sliced_vbi_cap
A.78. Sliced VBI services
A.79. struct v4l2_tuner
A.80. enum v4l2_tuner_type
A.81. Tuner and Modulator Capability Flags
A.82. Tuner Audio Reception Flags
A.83. Tuner Audio Modes
A.84. Tuner Audio Matrix
A.85. struct v4l2_capability
A.86. Device Capabilities Flags
A.87. struct v4l2_queryctrl
A.88. struct v4l2_querymenu
A.89. enum v4l2_ctrl_type
A.90. Control Flags
A.91. struct v4l2_requestbuffers
A.92. struct v4l2_hw_freq_seek
A.93. struct v4l2_subdev_frame_interval_enum
A.94. struct v4l2_subdev_frame_size_enum
A.95. struct v4l2_subdev_mbus_code_enum
A.96. struct v4l2_subdev_crop
A.97. struct v4l2_subdev_format
A.98. enum v4l2_subdev_format_whence
A.99. struct v4l2_subdev_frame_interval
A.100. V4L2 subdev selection targets
A.101. V4L2 subdev selection flags
A.102. struct v4l2_subdev_selection
A.103. struct v4l2_event_subscription
A.104. Event Types
A.105. Event Flags
9.1. Frontend types
17.1. IR default keymapping
17.2. Notes
K.1. struct media_device_info
K.2. struct media_entity_desc
K.3. Media entity types
K.4. Media entity flags
K.5. struct media_links_enum
K.6. struct media_pad_desc
K.7. Media pad flags
K.8. struct media_link_desc
K.9. Media link flags
19.1. Generic error codes

List of Examples

1.1. Information about the current video input
1.2. Switching to the first video input
1.3. Information about the current audio input
1.4. Switching to the first audio input
1.5. Information about the current video standard
1.6. Listing the video standards supported by the current input
1.7. Selecting a new video standard
1.8. Enumerating all controls
1.9. Changing controls
1.10. Resetting the cropping parameters
1.11. Simple downscaling
1.12. Selecting an output area
1.13. Current scaling factor and pixel aspect
1.14. Resetting the cropping parameters
1.15. Simple downscaling
1.16. Querying for scaling factors
2.1. ITU-R Rec. BT.601 color conversion
2.2. V4L2_PIX_FMT_BGR24 4 × 4 pixel image
2.3. V4L2_PIX_FMT_SBGGR8 4 × 4 pixel image
2.4. V4L2_PIX_FMT_SGBRG8 4 × 4 pixel image
2.5. V4L2_PIX_FMT_SGRBG8 4 × 4 pixel image
2.6. V4L2_PIX_FMT_SRGGB8 4 × 4 pixel image
2.7. V4L2_PIX_FMT_SBGGR16 4 × 4 pixel image
2.8. V4L2_PIX_FMT_SBGGR10 4 × 4 pixel image
2.9. V4L2_PIX_FMT_SBGGR12 4 × 4 pixel image
2.10. V4L2_PIX_FMT_GREY 4 × 4 pixel image
2.11. V4L2_PIX_FMT_Y10 4 × 4 pixel image
2.12. V4L2_PIX_FMT_Y12 4 × 4 pixel image
2.13. V4L2_PIX_FMT_Y10BPACK 4 pixel data stream taking 5 bytes
2.14. V4L2_PIX_FMT_Y16 4 × 4 pixel image
2.15. V4L2_PIX_FMT_YUYV 4 × 4 pixel image
2.16. V4L2_PIX_FMT_UYVY 4 × 4 pixel image
2.17. V4L2_PIX_FMT_YVYU 4 × 4 pixel image
2.18. V4L2_PIX_FMT_VYUY 4 × 4 pixel image
2.19. V4L2_PIX_FMT_Y41P 8 × 4 pixel image
2.20. V4L2_PIX_FMT_YVU420 4 × 4 pixel image
2.21. V4L2_PIX_FMT_YVU420M 4 × 4 pixel image
2.22. V4L2_PIX_FMT_YVU410 4 × 4 pixel image
2.23. V4L2_PIX_FMT_YUV422P 4 × 4 pixel image
2.24. V4L2_PIX_FMT_YUV411P 4 × 4 pixel image
2.25. V4L2_PIX_FMT_NV12 4 × 4 pixel image
2.26. V4L2_PIX_FMT_NV12M 4 × 4 pixel image
2.27. Memory layout of macroblocks in V4L2_PIX_FMT_NV12 format pixel image - extreme case
2.28. V4L2_PIX_FMT_NV16 4 × 4 pixel image
2.29. V4L2_PIX_FMT_NV24 4 × 4 pixel image
2.30. V4L2_PIX_FMT_M420 4 × 4 pixel image
3.1. Mapping buffers in the single-planar API
3.2. Mapping buffers in the multi-planar API
3.3. Initiating streaming I/O with user pointers
4.1. Finding a framebuffer device for OSD