没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Video for Linux Two API Specification
Revision 2.6.32
Michael H Schimek
<mschimek@gmx.at>
Bill Dirks
Original author of the V4L2 API and documentation.
Hans Verkuil
Designed and documented the VIDIOC_LOG_STATUS ioctl, the extended control ioctls and major parts of the sliced VBI API.
<hverkuil@xs4all.nl>
Martin Rubli
Designed and documented the VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS ioctls.
Andy Walls
Documented the fielded V4L2_MPEG_STREAM_VBI_FMT_IVTV MPEG stream embedded, sliced VBI data format in this specification.
<awalls@radix.net>
Mauro Carvalho Chehab
Documented libv4l, designed and added v4l2grab example, Remote Controller chapter
<mchehab@redhat.com>
Copyright © 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin Rubli, Andy Walls, Mauro
Carvalho Chehab
This document is copyrighted © 1999-2009 by Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin Rubli, Andy Walls and Mauro Carvalho Chehab.
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; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in
the appendix entitled "GNU Free Documentation License".
Programming examples can be used and distributed without restrictions.
Revision History
Revision 2.6.32 2009-08-31 mcc
Now, revisions will match the kernel version where the V4L2 API changes will be used by the Linux Kernel. Also added Remote Controller chapter.
Revision 0.29 2009-08-26 ev
Added documentation for string controls and for FM Transmitter controls.
Revision 0.28 2009-08-26 gl
Added V4L2_CID_BAND_STOP_FILTER documentation.
Revision 0.27 2009-08-15 mcc
Added libv4l and Remote Controller documentation; added v4l2grab and keytable application examples.
Revision 0.26 2009-07-23 hv
Finalized the RDS capture API. Added modulator and RDS encoder capabilities. Added support for string controls.
Revision 0.25 2009-01-18 hv
Added pixel formats VYUY, NV16 and NV61, and changed the debug ioctls VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT. Added camera
controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE, V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.
Revision 0.24 2008-03-04 mhs
Added pixel formats Y16 and SBGGR16, new controls and a camera controls class. Removed VIDIOC_G/S_MPEGCOMP.
Revision 0.23 2007-08-30 mhs
Fixed a typo in VIDIOC_DBG_G/S_REGISTER. Clarified the byte order of packed pixel formats.
Revision 0.22 2007-08-29 mhs
Added the Video Output Overlay interface, new MPEG controls, V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT,
VIDIOC_DBG_G/S_REGISTER, VIDIOC_(TRY_)ENCODER_CMD, VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats. Clarifications in
the cropping chapter, about RGB pixel formats, the mmap(), poll(), select(), read() and write() functions. Typographical fixes.
Revision 0.21 2006-12-19 mhs
Fixed a link in the VIDIOC_G_EXT_CTRLS section.
Revision 0.20 2006-11-24 mhs
Clarified the purpose of the audioset field in struct v4l2_input and v4l2_output.
Revision 0.19 2006-10-19 mhs
第
1
页
/
共
114
页
Table of Contents
Introduction
1. Common API Elements
1.1. Opening and Closing Devices
1.1.1. Device Naming
1.1.2. Related Devices
1.1.3. Multiple Opens
1.1.4. Shared Data Streams
1.1.5. Functions
1.2. Querying Capabilities
1.3. Application Priority
1.4. Video Inputs and Outputs
1.5. Audio Inputs and Outputs
1.6. Tuners and Modulators
1.6.1. Tuners
1.6.2. Modulators
1.6.3. Radio Frequency
1.6.4. Satellite Receivers
1.7. Video Standards
1.8. User Controls
1.9. Extended Controls
1.9.1. Introduction
1.9.2. The Extended Control API
1.9.3. Enumerating Extended Controls
1.9.4. Creating Control Panels
1.9.5. MPEG Control Reference
1.9.5.1. Generic MPEG Controls
1.9.5.2. CX2341x MPEG Controls
1.9.6. Camera Control Reference
1.9.7. FM Transmitter Control Reference
1.10. Data Formats
1.10.1. Data Format Negotiation
1.10.2. Image Format Enumeration
1.11. Image Cropping, Insertion and Scaling
1.11.1. Cropping Structures
1.11.2. Scaling Adjustments
1.11.3. Examples
Documented V4L2_PIX_FMT_RGB444.
Revision 0.18 2006-10-18 mhs
Added the description of extended controls by Hans Verkuil. Linked V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.
Revision 0.17 2006-10-12 mhs
Corrected V4L2_PIX_FMT_HM12 description.
Revision 0.16 2006-10-08 mhs
VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS are now part of the API.
Revision 0.15 2006-09-23 mhs
Cleaned up the bibliography, added BT.653 and BT.1119. capture.c/start_capturing() for user pointer I/O did not initialize the buffer index. Documented the V4L
MPEG and MJPEG VID_TYPEs and V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel formats. See the history chapter for API changes.
Revision 0.14 2006-09-14 mr
Added VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS proposal for frame format enumeration of digital devices.
Revision 0.13 2006-04-07 mhs
Corrected the description of struct v4l2_window clips. New V4L2_STD_ and V4L2_TUNER_MODE_LANG1_LANG2 defines.
Revision 0.12 2006-02-03 mhs
Corrected the description of struct v4l2_captureparm and v4l2_outputparm.
Revision 0.11 2006-01-27 mhs
Improved the description of struct v4l2_tuner.
Revision 0.10 2006-01-10 mhs
VIDIOC_G_INPUT and VIDIOC_S_PARM clarifications.
Revision 0.9 2005-11-27 mhs
Improved the 525 line numbering diagram. Hans Verkuil and I rewrote the sliced VBI section. He also contributed a VIDIOC_LOG_STATUS page. Fixed
VIDIOC_S_STD call in the video standard selection example. Various updates.
Revision 0.8 2004-10-04 mhs
Somehow a piece of junk slipped into the capture example, removed.
Revision 0.7 2004-09-19 mhs
Fixed video standard selection, control enumeration, downscaling and aspect example. Added read and user pointer i/o to video capture example.
Revision 0.6 2004-08-01 mhs
v4l2_buffer changes, added video capture example, various corrections.
Revision 0.5 2003-11-05 mhs
Pixel format erratum.
Revision 0.4 2003-09-17 mhs
Corrected source and Makefile to generate a PDF. SGML fixes. Added latest API changes. Closed gaps in the history chapter.
Revision 0.3 2003-02-05 mhs
Another draft, more corrections.
Revision 0.2 2003-01-15 mhs
Second draft, with corrections pointed out by Gerd Knorr.
Revision 0.1 2002-12-01 mhs
First draft, based on documentation by Bill Dirks and discussions on the V4L mailing list.
第
2
页
/
共
114
页
1.12. Streaming Parameters
2. Image Formats
2.1. Standard Image Formats
2.2. Colorspaces
2.3. Indexed Format
2.4. RGB Formats
2.5. YUV Formats
2.6. Compressed Formats
2.7. Reserved Format Identifiers
3. Input/Output
3.1. Read/Write
3.2. Streaming I/O (Memory Mapping)
3.3. Streaming I/O (User Pointers)
3.4. Asynchronous I/O
3.5. Buffers
3.5.1. Timecodes
3.6. Field Order
4. Interfaces
4.1. Video Capture Interface
4.1.1. Querying Capabilities
4.1.2. Supplemental Functions
4.1.3. Image Format Negotiation
4.1.4. Reading Images
4.2. Video Overlay Interface
4.2.1. Querying Capabilities
4.2.2. Supplemental Functions
4.2.3. Setup
4.2.4. Overlay Window
4.2.5. Enabling Overlay
4.3. Video Output Interface
4.3.1. Querying Capabilities
4.3.2. Supplemental Functions
4.3.3. Image Format Negotiation
4.3.4. Writing Images
4.4. Video Output Overlay Interface
4.4.1. Querying Capabilities
4.4.2. Framebuffer
4.4.3. Overlay Window and Scaling
4.4.4. Enabling Overlay
4.5. Codec Interface
4.6. Effect Devices Interface
4.7. Raw VBI Data Interface
4.7.1. Querying Capabilities
4.7.2. Supplemental Functions
4.7.3. Raw VBI Format Negotiation
4.7.4. Reading and writing VBI images
4.8. Sliced VBI Data Interface
4.8.1. Querying Capabilities
4.8.2. Supplemental Functions
4.8.3. Sliced VBI Format Negotiation
4.8.4. Reading and writing sliced VBI data
4.8.5. Sliced VBI Data in MPEG Streams
4.8.5.1. MPEG Stream Embedded, Sliced VBI Data Format: NONE
4.8.5.2. MPEG Stream Embedded, Sliced VBI Data Format: IVTV
4.9. Teletext Interface
4.10. Radio Interface
4.10.1. Querying Capabilities
4.10.2. Supplemental Functions
4.10.3. Programming
4.11. RDS Interface
4.11.1. Querying Capabilities
4.11.2. Reading RDS data
I. Function Reference
V4L2 close() — Close a V4L2 device
V4L2 ioctl() — Program a V4L2 device
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_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_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_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
第
3
页
/
共
114
页
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_QUERYSTD — Sense the video standard received by the current input
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
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
5. V4L2 Driver Programming
6. Libv4l Userspace Library
6.1. Introduction
6.1.1. libv4lconvert
6.1.2. libv4l1
6.1.3. libv4l2
6.1.3.1. Libv4l device control functions
6.1.4. v4l1compat.so wrapper library
7. Remote Controllers
7.1. Introduction
7.2. Changing default Remote Controller mappings
8. Changes
8.1. Differences between V4L and V4L2
8.1.1. Opening and Closing Devices
8.1.2. Querying Capabilities
8.1.3. Video Sources
8.1.4. Tuning
8.1.5. Image Properties
8.1.6. Audio
8.1.7. Frame Buffer Overlay
8.1.8. Cropping
8.1.9. Reading Images, Memory Mapping
8.1.9.1. Capturing using the read method
8.1.9.2. Capturing using memory mapping
8.1.10. Reading Raw VBI Data
8.1.11. Miscellaneous
8.2. Changes of the V4L2 API
8.2.1. Early Versions
8.2.2. V4L2 Version 0.16 1999-01-31
8.2.3. V4L2 Version 0.18 1999-03-16
8.2.4. V4L2 Version 0.19 1999-06-05
8.2.5. V4L2 Version 0.20 (1999-09-10)
8.2.6. V4L2 Version 0.20 incremental changes
8.2.7. V4L2 Version 0.20 2000-11-23
8.2.8. V4L2 Version 0.20 2002-07-25
8.2.9. V4L2 in Linux 2.5.46, 2002-10
8.2.10. V4L2 2003-06-19
8.2.11. V4L2 2003-11-05
8.2.12. V4L2 in Linux 2.6.6, 2004-05-09
8.2.13. V4L2 in Linux 2.6.8
8.2.14. V4L2 spec erratum 2004-08-01
8.2.15. V4L2 in Linux 2.6.14
8.2.16. V4L2 in Linux 2.6.15
8.2.17. V4L2 spec erratum 2005-11-27
8.2.18. V4L2 spec erratum 2006-01-10
8.2.19. V4L2 spec erratum 2006-02-03
8.2.20. V4L2 spec erratum 2006-02-04
8.2.21. V4L2 in Linux 2.6.17
8.2.22. V4L2 spec erratum 2006-09-23 (Draft 0.15)
8.2.23. V4L2 in Linux 2.6.18
8.2.24. V4L2 in Linux 2.6.19
8.2.25. V4L2 spec erratum 2006-10-12 (Draft 0.17)
8.2.26. V4L2 in Linux 2.6.21
8.2.27. V4L2 in Linux 2.6.22
8.2.28. V4L2 in Linux 2.6.24
8.2.29. V4L2 in Linux 2.6.25
8.2.30. V4L2 in Linux 2.6.26
8.2.31. V4L2 in Linux 2.6.27
8.2.32. V4L2 in Linux 2.6.28
8.2.33. V4L2 in Linux 2.6.29
8.2.34. V4L2 in Linux 2.6.30
8.2.35. V4L2 in Linux 2.6.32
8.3. Relation of V4L2 to other Linux multimedia APIs
8.3.1. X Video Extension
8.3.2. Digital Video
8.3.3. Audio Interfaces
8.4. Experimental API Elements
8.5. Obsolete API Elements
A. Video For Linux Two Header File
B. Video Capture Example
C. Video Grabber example using libv4l
D. GNU Free Documentation License
第
4
页
/
共
114
页
D.1. 0. PREAMBLE
D.2. 1. APPLICABILITY AND DEFINITIONS
D.3. 2. VERBATIM COPYING
D.4. 3. COPYING IN QUANTITY
D.5. 4. MODIFICATIONS
D.6. 5. COMBINING DOCUMENTS
D.7. 6. COLLECTIONS OF DOCUMENTS
D.8. 7. AGGREGATION WITH INDEPENDENT WORKS
D.9. 8. TRANSLATION
D.10. 9. TERMINATION
D.11. 10. FUTURE REVISIONS OF THIS LICENSE
D.12. Addendum
List of Types
References
List of Figures
1.1. Image Cropping, Insertion and Scaling
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
List of Tables
1.1. Control IDs
1.2. MPEG Control IDs
1.3. CX2341x Control IDs
1.4. Camera Control IDs
1.5. FM_TX Control IDs
2.1. struct v4l2_pix_format
2.2. enum v4l2_colorspace
2.3. Indexed Image Format
2.4. Packed RGB Image Formats
2.5. Packed RGB Image Formats (corrected)
2.6. Packed YUV Image Formats
2.7. Compressed Image Formats
2.8. Reserved Image Formats
3.1. struct v4l2_buffer
3.2. enum v4l2_buf_type
3.3. Buffer Flags
3.4. enum v4l2_memory
3.5. struct v4l2_timecode
3.6. Timecode Types
3.7. Timecode Flags
3.8. 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
39. struct v4l2_cropcap
40. struct v4l2_rect
41. struct v4l2_dbg_match
42. struct v4l2_dbg_chip_ident
43. Chip Match Types
44. Chip Identifiers
45. struct v4l2_dbg_match
46. struct v4l2_dbg_register
47. Chip Match Types
48. struct v4l2_encoder_cmd
49. Encoder Commands
50. Encoder Command Flags
51. struct v4l2_fmtdesc
52. Image Format Description Flags
53. struct v4l2_frmsize_discrete
54. struct v4l2_frmsize_stepwise
55. struct v4l2_frmsizeenum
56. enum v4l2_frmsizetypes
57. struct v4l2_frmival_stepwise
58. struct v4l2_frmivalenum
59. enum v4l2_frmivaltypes
60. struct v4l2_input
61. Input Types
62. Input Status Flags
63. struct v4l2_output
64. Output Type
65.
struct
v4l2_standard
第
5
页
/
共
114
页
剩余113页未读,继续阅读
zhao973
- 粉丝: 5
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页