diff options
Diffstat (limited to 'v4l2-spec')
-rw-r--r-- | v4l2-spec/Makefile | 5 | ||||
-rw-r--r-- | v4l2-spec/README | 3 | ||||
-rw-r--r-- | v4l2-spec/V4L1_API.html | 401 | ||||
-rw-r--r-- | v4l2-spec/biblio.sgml | 65 | ||||
-rw-r--r-- | v4l2-spec/common.sgml | 2 | ||||
-rw-r--r-- | v4l2-spec/compat.sgml | 17 | ||||
-rw-r--r-- | v4l2-spec/dev-radio.sgml | 14 | ||||
-rw-r--r-- | v4l2-spec/dev-rds.sgml | 182 | ||||
-rw-r--r-- | v4l2-spec/dev-sliced-vbi.sgml | 315 | ||||
-rw-r--r-- | v4l2-spec/pixfmt-sgrbg8.sgml | 75 | ||||
-rw-r--r-- | v4l2-spec/pixfmt.sgml | 21 | ||||
-rw-r--r-- | v4l2-spec/v4l2.sgml | 27 | ||||
-rw-r--r-- | v4l2-spec/vidioc-enuminput.sgml | 19 | ||||
-rw-r--r-- | v4l2-spec/vidioc-g-modulator.sgml | 18 | ||||
-rw-r--r-- | v4l2-spec/vidioc-g-tuner.sgml | 21 | ||||
-rw-r--r-- | v4l2-spec/vidioc-querycap.sgml | 16 |
16 files changed, 1093 insertions, 108 deletions
diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile index d0dde12f4..8f40e8614 100644 --- a/v4l2-spec/Makefile +++ b/v4l2-spec/Makefile @@ -1,5 +1,6 @@ # Also update in v4l2.sgml! -VERSION = 0.25 +VERSION = 0.26 +SHELL=/bin/bash SGMLS = \ biblio.sgml \ @@ -40,6 +41,7 @@ SGMLS = \ pixfmt-sbggr16.sgml \ pixfmt-sbggr8.sgml \ pixfmt-sgbrg8.sgml \ + pixfmt-sgrbg8.sgml \ pixfmt-uyvy.sgml \ pixfmt-vyuy.sgml \ pixfmt-y16.sgml \ @@ -274,6 +276,7 @@ STRUCTS = \ v4l2_input \ v4l2_jpegcompression \ v4l2_modulator \ + v4l2_mpeg_vbi_fmt_ivtv \ v4l2_output \ v4l2_outputparm \ v4l2_pix_format \ diff --git a/v4l2-spec/README b/v4l2-spec/README index 6b0a3d0f1..9fe129642 100644 --- a/v4l2-spec/README +++ b/v4l2-spec/README @@ -15,3 +15,6 @@ html-single A single HTML file (default) html Tree of HTML files pdf A PDF file coffeebreak All of the above + +Note: the V4L1_API.html is here just for reference. The V4L2 API replaces +V4L1. diff --git a/v4l2-spec/V4L1_API.html b/v4l2-spec/V4L1_API.html new file mode 100644 index 000000000..9f717fd50 --- /dev/null +++ b/v4l2-spec/V4L1_API.html @@ -0,0 +1,401 @@ +<HTML><HEAD> +<TITLE>Video4Linux Kernel API Reference v0.1:19990430 - OBSOLETE - USE V4L2 API INSTEAD.</TITLE> +</HEAD> +<! Revision History: > +<! 4/30/1999 - Fred Gleason (fredg@wava.com)> +<! Documented extensions for the Radio Data System (RDS) extensions > +<BODY bgcolor="#ffffff"> +<H1>Obsoleted by V4L2 API</H1> + +<H3>Devices</H3> +Video4Linux provides the following sets of device files. These live on the +character device formerly known as "/dev/bttv". /dev/bttv should be a +symlink to /dev/video0 for most people. +<P> +<TABLE> +<TR><TH>Device Name</TH><TH>Minor Range</TH><TH>Function</TH> +<TR><TD>/dev/video</TD><TD>0-63</TD><TD>Video Capture Interface</TD> +<TR><TD>/dev/radio</TD><TD>64-127</TD><TD>AM/FM Radio Devices</TD> +<TR><TD>/dev/vtx</TD><TD>192-223</TD><TD>Teletext Interface Chips</TD> +<TR><TD>/dev/vbi</TD><TD>224-239</TD><TD>Raw VBI Data (Intercast/teletext)</TD> +</TABLE> +<P> +Video4Linux programs open and scan the devices to find what they are looking +for. Capability queries define what each interface supports. The +described API is only defined for video capture cards. The relevant subset +applies to radio cards. Teletext interfaces talk the existing VTX API. +<P> +<H3>Capability Query Ioctl</H3> +The <B>VIDIOCGCAP</B> ioctl call is used to obtain the capability +information for a video device. The <b>struct video_capability</b> object +passed to the ioctl is completed and returned. It contains the following +information +<P> +<TABLE> +<TR><TD><b>name[32]</b><TD>Canonical name for this interface</TD> +<TR><TD><b>type</b><TD>Type of interface</TD> +<TR><TD><b>channels</b><TD>Number of radio/tv channels if appropriate</TD> +<TR><TD><b>audios</b><TD>Number of audio devices if appropriate</TD> +<TR><TD><b>maxwidth</b><TD>Maximum capture width in pixels</TD> +<TR><TD><b>maxheight</b><TD>Maximum capture height in pixels</TD> +<TR><TD><b>minwidth</b><TD>Minimum capture width in pixels</TD> +<TR><TD><b>minheight</b><TD>Minimum capture height in pixels</TD> +</TABLE> +<P> +The type field lists the capability flags for the device. These are +as follows +<P> +<TABLE> +<TR><TH>Name</TH><TH>Description</TH> +<TR><TD><b>VID_TYPE_CAPTURE</b><TD>Can capture to memory</TD> +<TR><TD><b>VID_TYPE_TUNER</b><TD>Has a tuner of some form</TD> +<TR><TD><b>VID_TYPE_TELETEXT</b><TD>Has teletext capability</TD> +<TR><TD><b>VID_TYPE_OVERLAY</b><TD>Can overlay its image onto the frame buffer</TD> +<TR><TD><b>VID_TYPE_CHROMAKEY</b><TD>Overlay is Chromakeyed</TD> +<TR><TD><b>VID_TYPE_CLIPPING</b><TD>Overlay clipping is supported</TD> +<TR><TD><b>VID_TYPE_FRAMERAM</b><TD>Overlay overwrites frame buffer memory</TD> +<TR><TD><b>VID_TYPE_SCALES</b><TD>The hardware supports image scaling</TD> +<TR><TD><b>VID_TYPE_MONOCHROME</b><TD>Image capture is grey scale only</TD> +<TR><TD><b>VID_TYPE_SUBCAPTURE</b><TD>Capture can be of only part of the image</TD> +</TABLE> +<P> +The minimum and maximum sizes listed for a capture device do not imply all +that all height/width ratios or sizes within the range are possible. A +request to set a size will be honoured by the largest available capture +size whose capture is no large than the requested rectangle in either +direction. For example the quickcam has 3 fixed settings. +<P> +<H3>Frame Buffer</H3> +Capture cards that drop data directly onto the frame buffer must be told the +base address of the frame buffer, its size and organisation. This is a +privileged ioctl and one that eventually X itself should set. +<P> +The <b>VIDIOCSFBUF</b> ioctl sets the frame buffer parameters for a capture +card. If the card does not do direct writes to the frame buffer then this +ioctl will be unsupported. The <b>VIDIOCGFBUF</b> ioctl returns the +currently used parameters. The structure used in both cases is a +<b>struct video_buffer</b>. +<P> +<TABLE> +<TR><TD><b>void *base</b></TD><TD>Base physical address of the buffer</TD> +<TR><TD><b>int height</b></TD><TD>Height of the frame buffer</TD> +<TR><TD><b>int width</b></TD><TD>Width of the frame buffer</TD> +<TR><TD><b>int depth</b></TD><TD>Depth of the frame buffer</TD> +<TR><TD><b>int bytesperline</b></TD><TD>Number of bytes of memory between the start of two adjacent lines</TD> +</TABLE> +<P> +Note that these values reflect the physical layout of the frame buffer. +The visible area may be smaller. In fact under XFree86 this is commonly the +case. XFree86 DGA can provide the parameters required to set up this ioctl. +Setting the base address to NULL indicates there is no physical frame buffer +access. +<P> +<H3>Capture Windows</H3> +The capture area is described by a <b>struct video_window</b>. This defines +a capture area and the clipping information if relevant. The +<b>VIDIOCGWIN</b> ioctl recovers the current settings and the +<b>VIDIOCSWIN</b> sets new values. A successful call to <b>VIDIOCSWIN</b> +indicates that a suitable set of parameters have been chosen. They do not +indicate that exactly what was requested was granted. The program should +call <b>VIDIOCGWIN</b> to check if the nearest match was suitable. The +<b>struct video_window</b> contains the following fields. +<P> +<TABLE> +<TR><TD><b>x</b><TD>The X co-ordinate specified in X windows format.</TD> +<TR><TD><b>y</b><TD>The Y co-ordinate specified in X windows format.</TD> +<TR><TD><b>width</b><TD>The width of the image capture.</TD> +<TR><TD><b>height</b><TD>The height of the image capture.</TD> +<TR><TD><b>chromakey</b><TD>A host order RGB32 value for the chroma key.</TD> +<TR><TD><b>flags</b><TD>Additional capture flags.</TD> +<TR><TD><b>clips</b><TD>A list of clipping rectangles. <em>(Set only)</em></TD> +<TR><TD><b>clipcount</b><TD>The number of clipping rectangles. <em>(Set only)</em></TD> +</TABLE> +<P> +Clipping rectangles are passed as an array. Each clip consists of the following +fields available to the user. +<P> +<TABLE> +<TR><TD><b>x</b></TD><TD>X co-ordinate of rectangle to skip</TD> +<TR><TD><b>y</b></TD><TD>Y co-ordinate of rectangle to skip</TD> +<TR><TD><b>width</b></TD><TD>Width of rectangle to skip</TD> +<TR><TD><b>height</b></TD><TD>Height of rectangle to skip</TD> +</TABLE> +<P> +Merely setting the window does not enable capturing. Overlay capturing +(i.e. PCI-PCI transfer to the frame buffer of the video card) +is activated by passing the <b>VIDIOCCAPTURE</b> ioctl a value of 1, and +disabled by passing it a value of 0. +<P> +Some capture devices can capture a subfield of the image they actually see. +This is indicated when VIDEO_TYPE_SUBCAPTURE is defined. +The video_capture describes the time and special subfields to capture. +The video_capture structure contains the following fields. +<P> +<TABLE> +<TR><TD><b>x</b></TD><TD>X co-ordinate of source rectangle to grab</TD> +<TR><TD><b>y</b></TD><TD>Y co-ordinate of source rectangle to grab</TD> +<TR><TD><b>width</b></TD><TD>Width of source rectangle to grab</TD> +<TR><TD><b>height</b></TD><TD>Height of source rectangle to grab</TD> +<TR><TD><b>decimation</b></TD><TD>Decimation to apply</TD> +<TR><TD><b>flags</b></TD><TD>Flag settings for grabbing</TD> +</TABLE> +The available flags are +<P> +<TABLE> +<TR><TH>Name</TH><TH>Description</TH> +<TR><TD><b>VIDEO_CAPTURE_ODD</b><TD>Capture only odd frames</TD> +<TR><TD><b>VIDEO_CAPTURE_EVEN</b><TD>Capture only even frames</TD> +</TABLE> +<P> +<H3>Video Sources</H3> +Each video4linux video or audio device captures from one or more +source <b>channels</b>. Each channel can be queries with the +<b>VDIOCGCHAN</b> ioctl call. Before invoking this function the caller +must set the channel field to the channel that is being queried. On return +the <b>struct video_channel</b> is filled in with information about the +nature of the channel itself. +<P> +The <b>VIDIOCSCHAN</b> ioctl takes an integer argument and switches the +capture to this input. It is not defined whether parameters such as colour +settings or tuning are maintained across a channel switch. The caller should +maintain settings as desired for each channel. (This is reasonable as +different video inputs may have different properties). +<P> +The <b>struct video_channel</b> consists of the following +<P> +<TABLE> +<TR><TD><b>channel</b></TD><TD>The channel number</TD> +<TR><TD><b>name</b></TD><TD>The input name - preferably reflecting the label +on the card input itself</TD> +<TR><TD><b>tuners</b></TD><TD>Number of tuners for this input</TD> +<TR><TD><b>flags</b></TD><TD>Properties the tuner has</TD> +<TR><TD><b>type</b></TD><TD>Input type (if known)</TD> +<TR><TD><b>norm</b><TD>The norm for this channel</TD> +</TABLE> +<P> +The flags defined are +<P> +<TABLE> +<TR><TD><b>VIDEO_VC_TUNER</b><TD>Channel has tuners.</TD> +<TR><TD><b>VIDEO_VC_AUDIO</b><TD>Channel has audio.</TD> +<TR><TD><b>VIDEO_VC_NORM</b><TD>Channel has norm setting.</TD> +</TABLE> +<P> +The types defined are +<P> +<TABLE> +<TR><TD><b>VIDEO_TYPE_TV</b><TD>The input is a TV input.</TD> +<TR><TD><b>VIDEO_TYPE_CAMERA</b><TD>The input is a camera.</TD> +</TABLE> +<P> +<H3>Image Properties</H3> +The image properties of the picture can be queried with the <b>VIDIOCGPICT</b> +ioctl which fills in a <b>struct video_picture</b>. The <b>VIDIOCSPICT</b> +ioctl allows values to be changed. All values except for the palette type +are scaled between 0-65535. +<P> +The <b>struct video_picture</b> consists of the following fields +<P> +<TABLE> +<TR><TD><b>brightness</b><TD>Picture brightness</TD> +<TR><TD><b>hue</b><TD>Picture hue (colour only)</TD> +<TR><TD><b>colour</b><TD>Picture colour (colour only)</TD> +<TR><TD><b>contrast</b><TD>Picture contrast</TD> +<TR><TD><b>whiteness</b><TD>The whiteness (greyscale only)</TD> +<TR><TD><b>depth</b><TD>The capture depth (may need to match the frame buffer depth)</TD> +<TR><TD><b>palette</b><TD>Reports the palette that should be used for this image</TD> +</TABLE> +<P> +The following palettes are defined +<P> +<TABLE> +<TR><TD><b>VIDEO_PALETTE_GREY</b><TD>Linear intensity grey scale (255 is brightest).</TD> +<TR><TD><b>VIDEO_PALETTE_HI240</b><TD>The BT848 8bit colour cube.</TD> +<TR><TD><b>VIDEO_PALETTE_RGB565</b><TD>RGB565 packed into 16 bit words.</TD> +<TR><TD><b>VIDEO_PALETTE_RGB555</b><TD>RGV555 packed into 16 bit words, top bit undefined.</TD> +<TR><TD><b>VIDEO_PALETTE_RGB24</b><TD>RGB888 packed into 24bit words.</TD> +<TR><TD><b>VIDEO_PALETTE_RGB32</b><TD>RGB888 packed into the low 3 bytes of 32bit words. The top 8bits are undefined.</TD> +<TR><TD><b>VIDEO_PALETTE_YUV422</b><TD>Video style YUV422 - 8bits packed 4bits Y 2bits U 2bits V</TD> +<TR><TD><b>VIDEO_PALETTE_YUYV</b><TD>Describe me</TD> +<TR><TD><b>VIDEO_PALETTE_UYVY</b><TD>Describe me</TD> +<TR><TD><b>VIDEO_PALETTE_YUV420</b><TD>YUV420 capture</TD> +<TR><TD><b>VIDEO_PALETTE_YUV411</b><TD>YUV411 capture</TD> +<TR><TD><b>VIDEO_PALETTE_RAW</b><TD>RAW capture (BT848)</TD> +<TR><TD><b>VIDEO_PALETTE_YUV422P</b><TD>YUV 4:2:2 Planar</TD> +<TR><TD><b>VIDEO_PALETTE_YUV411P</b><TD>YUV 4:1:1 Planar</TD> +</TABLE> +<P> +<H3>Tuning</H3> +Each video input channel can have one or more tuners associated with it. Many +devices will not have tuners. TV cards and radio cards will have one or more +tuners attached. +<P> +Tuners are described by a <b>struct video_tuner</b> which can be obtained by +the <b>VIDIOCGTUNER</b> ioctl. Fill in the tuner number in the structure +then pass the structure to the ioctl to have the data filled in. The +tuner can be switched using <b>VIDIOCSTUNER</b> which takes an integer argument +giving the tuner to use. A struct tuner has the following fields +<P> +<TABLE> +<TR><TD><b>tuner</b><TD>Number of the tuner</TD> +<TR><TD><b>name</b><TD>Canonical name for this tuner (eg FM/AM/TV)</TD> +<TR><TD><b>rangelow</b><TD>Lowest tunable frequency</TD> +<TR><TD><b>rangehigh</b><TD>Highest tunable frequency</TD> +<TR><TD><b>flags</b><TD>Flags describing the tuner</TD> +<TR><TD><b>mode</b><TD>The video signal mode if relevant</TD> +<TR><TD><b>signal</b><TD>Signal strength if known - between 0-65535</TD> +</TABLE> +<P> +The following flags exist +<P> +<TABLE> +<TR><TD><b>VIDEO_TUNER_PAL</b><TD>PAL tuning is supported</TD> +<TR><TD><b>VIDEO_TUNER_NTSC</b><TD>NTSC tuning is supported</TD> +<TR><TD><b>VIDEO_TUNER_SECAM</b><TD>SECAM tuning is supported</TD> +<TR><TD><b>VIDEO_TUNER_LOW</b><TD>Frequency is in a lower range</TD> +<TR><TD><b>VIDEO_TUNER_NORM</b><TD>The norm for this tuner is settable</TD> +<TR><TD><b>VIDEO_TUNER_STEREO_ON</b><TD>The tuner is seeing stereo audio</TD> +<TR><TD><b>VIDEO_TUNER_RDS_ON</b><TD>The tuner is seeing a RDS datastream</TD> +<TR><TD><b>VIDEO_TUNER_MBS_ON</b><TD>The tuner is seeing a MBS datastream</TD> +</TABLE> +<P> +The following modes are defined +<P> +<TABLE> +<TR><TD><b>VIDEO_MODE_PAL</b><TD>The tuner is in PAL mode</TD> +<TR><TD><b>VIDEO_MODE_NTSC</b><TD>The tuner is in NTSC mode</TD> +<TR><TD><b>VIDEO_MODE_SECAM</b><TD>The tuner is in SECAM mode</TD> +<TR><TD><b>VIDEO_MODE_AUTO</b><TD>The tuner auto switches, or mode does not apply</TD> +</TABLE> +<P> +Tuning frequencies are an unsigned 32bit value in 1/16th MHz or if the +<b>VIDEO_TUNER_LOW</b> flag is set they are in 1/16th KHz. The current +frequency is obtained as an unsigned long via the <b>VIDIOCGFREQ</b> ioctl and +set by the <b>VIDIOCSFREQ</b> ioctl. +<P> +<H3>Audio</H3> +TV and Radio devices have one or more audio inputs that may be selected. +The audio properties are queried by passing a <b>struct video_audio</b> to <b>VIDIOCGAUDIO</b> ioctl. The +<b>VIDIOCSAUDIO</b> ioctl sets audio properties. +<P> +The structure contains the following fields +<P> +<TABLE> +<TR><TD><b>audio</b><TD>The channel number</TD> +<TR><TD><b>volume</b><TD>The volume level</TD> +<TR><TD><b>bass</b><TD>The bass level</TD> +<TR><TD><b>treble</b><TD>The treble level</TD> +<TR><TD><b>flags</b><TD>Flags describing the audio channel</TD> +<TR><TD><b>name</b><TD>Canonical name for the audio input</TD> +<TR><TD><b>mode</b><TD>The mode the audio input is in</TD> +<TR><TD><b>balance</b><TD>The left/right balance</TD> +<TR><TD><b>step</b><TD>Actual step used by the hardware</TD> +</TABLE> +<P> +The following flags are defined +<P> +<TABLE> +<TR><TD><b>VIDEO_AUDIO_MUTE</b><TD>The audio is muted</TD> +<TR><TD><b>VIDEO_AUDIO_MUTABLE</b><TD>Audio muting is supported</TD> +<TR><TD><b>VIDEO_AUDIO_VOLUME</b><TD>The volume is controllable</TD> +<TR><TD><b>VIDEO_AUDIO_BASS</b><TD>The bass is controllable</TD> +<TR><TD><b>VIDEO_AUDIO_TREBLE</b><TD>The treble is controllable</TD> +<TR><TD><b>VIDEO_AUDIO_BALANCE</b><TD>The balance is controllable</TD> +</TABLE> +<P> +The following decoding modes are defined +<P> +<TABLE> +<TR><TD><b>VIDEO_SOUND_MONO</b><TD>Mono signal</TD> +<TR><TD><b>VIDEO_SOUND_STEREO</b><TD>Stereo signal (NICAM for TV)</TD> +<TR><TD><b>VIDEO_SOUND_LANG1</b><TD>European TV alternate language 1</TD> +<TR><TD><b>VIDEO_SOUND_LANG2</b><TD>European TV alternate language 2</TD> +</TABLE> +<P> +<H3>Reading Images</H3> +Each call to the <b>read</b> syscall returns the next available image +from the device. It is up to the caller to set format and size (using +the VIDIOCSPICT and VIDIOCSWIN ioctls) and then to pass a suitable +size buffer and length to the function. Not all devices will support +read operations. +<P> +A second way to handle image capture is via the mmap interface if supported. +To use the mmap interface a user first sets the desired image size and depth +properties. Next the VIDIOCGMBUF ioctl is issued. This reports the size +of buffer to mmap and the offset within the buffer for each frame. The +number of frames supported is device dependent and may only be one. +<P> +The video_mbuf structure contains the following fields +<P> +<TABLE> +<TR><TD><b>size</b><TD>The number of bytes to map</TD> +<TR><TD><b>frames</b><TD>The number of frames</TD> +<TR><TD><b>offsets</b><TD>The offset of each frame</TD> +</TABLE> +<P> +Once the mmap has been made the VIDIOCMCAPTURE ioctl starts the +capture to a frame using the format and image size specified in the +video_mmap (which should match or be below the initial query size). +When the VIDIOCMCAPTURE ioctl returns the frame is <em>not</em> +captured yet, the driver just instructed the hardware to start the +capture. The application has to use the VIDIOCSYNC ioctl to wait +until the capture of a frame is finished. VIDIOCSYNC takes the frame +number you want to wait for as argument. +<p> +It is allowed to call VIDIOCMCAPTURE multiple times (with different +frame numbers in video_mmap->frame of course) and thus have multiple +outstanding capture requests. A simple way do to double-buffering +using this feature looks like this: +<pre> +/* setup everything */ +VIDIOCMCAPTURE(0) +while (whatever) { + VIDIOCMCAPTURE(1) + VIDIOCSYNC(0) + /* process frame 0 while the hardware captures frame 1 */ + VIDIOCMCAPTURE(0) + VIDIOCSYNC(1) + /* process frame 1 while the hardware captures frame 0 */ +} +</pre> +Note that you are <em>not</em> limited to only two frames. The API +allows up to 32 frames, the VIDIOCGMBUF ioctl returns the number of +frames the driver granted. Thus it is possible to build deeper queues +to avoid loosing frames on load peaks. +<p> +While capturing to memory the driver will make a "best effort" attempt +to capture to screen as well if requested. This normally means all +frames that "miss" memory mapped capture will go to the display. +<P> +A final ioctl exists to allow a device to obtain related devices if a +driver has multiple components (for example video0 may not be associated +with vbi0 which would cause an intercast display program to make a bad +mistake). The VIDIOCGUNIT ioctl reports the unit numbers of the associated +devices if any exist. The video_unit structure has the following fields. +<P> +<TABLE> +<TR><TD><b>video</b><TD>Video capture device</TD> +<TR><TD><b>vbi</b><TD>VBI capture device</TD> +<TR><TD><b>radio</b><TD>Radio device</TD> +<TR><TD><b>audio</b><TD>Audio mixer</TD> +<TR><TD><b>teletext</b><TD>Teletext device</TD> +</TABLE> +<P> +<H3>RDS Datastreams</H3> +For radio devices that support it, it is possible to receive Radio Data +System (RDS) data by means of a read() on the device. The data is packed in +groups of three, as follows: +<TABLE> +<TR><TD>First Octet</TD><TD>Least Significant Byte of RDS Block</TD></TR> +<TR><TD>Second Octet</TD><TD>Most Significant Byte of RDS Block +<TR><TD>Third Octet</TD><TD>Bit 7:</TD><TD>Error bit. Indicates that +an uncorrectable error occurred during reception of this block.</TD></TR> +<TR><TD> </TD><TD>Bit 6:</TD><TD>Corrected bit. Indicates that +an error was corrected for this data block.</TD></TR> +<TR><TD> </TD><TD>Bits 5-3:</TD><TD>Received Offset. Indicates the +offset received by the sync system.</TD></TR> +<TR><TD> </TD><TD>Bits 2-0:</TD><TD>Offset Name. Indicates the +offset applied to this data.</TD></TR> +</TABLE> +</BODY> +</HTML> diff --git a/v4l2-spec/biblio.sgml b/v4l2-spec/biblio.sgml index b013ece1d..afc8a0dd2 100644 --- a/v4l2-spec/biblio.sgml +++ b/v4l2-spec/biblio.sgml @@ -158,54 +158,23 @@ Signal - NTSC for Studio Applications"</title> 1125-Line High-Definition Production"</title> </biblioentry> - <biblioentry id="v4l"> - <abbrev>V4L</abbrev> - <authorgroup> - <author> - <firstname>Alan</firstname> - <surname>Cox</surname> - <affiliation> - <orgname>Red Hat, Inc.</orgname> - <address> - <email>alan@redhat.com</email> - </address> - </affiliation> - </author> - </authorgroup> - <title>Video4Linux API Specification</title> - <abstract> - <para>This file is part of the Linux kernel sources under -<filename>Documentation/video4linux</filename>.</para> - </abstract> - </biblioentry> - - <biblioentry id="v4lprog"> - <abbrev>V4LPROG</abbrev> - <authorgroup> - <author> - <firstname>Alan</firstname> - <surname>Cox</surname> - <affiliation> - <orgname>Red Hat, Inc.</orgname> - <address> - <email>alan@redhat.com</email> - </address> - </affiliation> - </author> - </authorgroup> - <title>Video4Linux Programming (a.k.a. The Video4Linux -Book)</title> - <abstract> - <para>About V4L <emphasis>driver</emphasis> programming. This -book is part of the Linux kernel DocBook documentation, for example at -<ulink url="http://kernelnewbies.org/documents/"> -http://kernelnewbies.org/documents/</ulink>. SGML sources are included -in the kernel sources.</para> - </abstract> - <copyright> - <year>2000</year> - <holder>Alan Cox</holder> - </copyright> + <biblioentry id="en50067"> + <abbrev>EN 50067</abbrev> + <authorgroup> + <corpauthor>European Committee for Electrotechnical Standardization +(<ulink url="http://www.cenelec.eu">http://www.cenelec.eu</ulink>)</corpauthor> + </authorgroup> + <title>Specification of the radio data system (RDS) for VHF/FM sound broadcasting +in the frequency range from 87,5 to 108,0 MHz</title> + </biblioentry> + + <biblioentry id="nrsc4"> + <abbrev>NRSC-4</abbrev> + <authorgroup> + <corpauthor>National Radio Systems Committee +(<ulink url="http://www.nrscstandards.org">http://www.nrscstandards.org</ulink>)</corpauthor> + </authorgroup> + <title>NTSC-4: United States RBDS Standard</title> </biblioentry> </bibliography> diff --git a/v4l2-spec/common.sgml b/v4l2-spec/common.sgml index ff595960b..75c7141e3 100644 --- a/v4l2-spec/common.sgml +++ b/v4l2-spec/common.sgml @@ -491,7 +491,7 @@ the &VIDIOC-G-MODULATOR; and &VIDIOC-S-MODULATOR; ioctl. Note that <constant>VIDIOC_S_MODULATOR</constant> does not switch the current modulator, when there is more than one at all. The modulator is solely determined by the current video output. Drivers must support both -ioctls and set the <constant>V4L2_CAP_TUNER</constant> (sic) flag in +ioctls and set the <constant>V4L2_CAP_MODULATOR</constant> flag in the &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl when the device has one or more modulators.</para> </section> diff --git a/v4l2-spec/compat.sgml b/v4l2-spec/compat.sgml index 94713023d..bcc372c18 100644 --- a/v4l2-spec/compat.sgml +++ b/v4l2-spec/compat.sgml @@ -1273,9 +1273,8 @@ also the size of the structure changed, which is encoded in the ioctl request code, thus older V4L2 devices will respond with an &EINVAL; to the new &VIDIOC-QUERYCAP; ioctl.</para> - <para>There are new fields to identify the driver, a new (as -of yet unspecified) device function -<constant>V4L2_CAP_RDS_CAPTURE</constant>, the + <para>There are new fields to identify the driver, a new RDS +device function <constant>V4L2_CAP_RDS_CAPTURE</constant>, the <constant>V4L2_CAP_AUDIO</constant> flag indicates if the device has any audio connectors, another I/O capability <constant>V4L2_CAP_ASYNCIO</constant> can be flagged. In response to @@ -2294,6 +2293,18 @@ was renamed to <structname id=v4l2-chip-ident-old>v4l2_chip_ident_old</structnam </listitem> </orderedlist> </section> + <section> + <title>V4L2 in Linux 2.6.32</title> + <orderedlist> + <listitem> + <para>Finalized the RDS capture API. See <xref linkend="rds"> for +more information.</para> + </listitem> + <listitem> + <para>Added new capabilities for modulators and RDS encoders.</para> + </listitem> + </orderedlist> + </section> </section> <section id="other"> diff --git a/v4l2-spec/dev-radio.sgml b/v4l2-spec/dev-radio.sgml index ae8367219..4d521d2a8 100644 --- a/v4l2-spec/dev-radio.sgml +++ b/v4l2-spec/dev-radio.sgml @@ -1,7 +1,7 @@ <title>Radio Interface</title> <para>This interface is intended for AM and FM (analog) radio -receivers.</para> +receivers and transmitters.</para> <para>Conventionally V4L2 radio devices are accessed through character device special files named <filename>/dev/radio</filename> @@ -14,7 +14,8 @@ numbers 64 to 127.</para> <para>Devices supporting the radio interface set the <constant>V4L2_CAP_RADIO</constant> and -<constant>V4L2_CAP_TUNER</constant> flag in the +<constant>V4L2_CAP_TUNER</constant> or +<constant>V4L2_CAP_MODULATOR</constant> flag in the <structfield>capabilities</structfield> field of &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl. Other combinations of capability flags are reserved for future extensions.</para> @@ -25,7 +26,7 @@ capability flags are reserved for future extensions.</para> <para>Radio devices can support <link linkend="control">controls</link>, and must support the <link -linkend="tuner">tuner</link> ioctls.</para> +linkend="tuner">tuner or modulator</link> ioctls.</para> <para>They do not support the video input or output, audio input or output, video standard, cropping and scaling, compression and @@ -38,11 +39,12 @@ methods are reserved for future extensions.</para> <para>Radio devices may have a couple audio controls (as discussed in <xref linkend="control">) such as a volume control, possibly custom -controls. Further all radio devices have one tuner (these are +controls. Further all radio devices have one tuner or modulator (these are discussed in <xref linkend="tuner">) with index number zero to select the radio frequency and to determine if a monaural or FM stereo -program is received. Drivers switch automatically between AM and FM -depending on the selected frequency. The &VIDIOC-G-TUNER; ioctl +program is received/emitted. Drivers switch automatically between AM and FM +depending on the selected frequency. The &VIDIOC-G-TUNER; or +&VIDIOC-G-MODULATOR; ioctl reports the supported frequency range.</para> </section> diff --git a/v4l2-spec/dev-rds.sgml b/v4l2-spec/dev-rds.sgml index 07bfd4c65..9d59d0cb0 100644 --- a/v4l2-spec/dev-rds.sgml +++ b/v4l2-spec/dev-rds.sgml @@ -2,38 +2,162 @@ <para>The Radio Data System transmits supplementary information in binary format, for example the station name or travel -information, on a inaudible audio subcarrier of a radio program. This -interface aims at devices capable of receiving and decoding RDS +information, on an inaudible audio subcarrier of a radio program. This +interface is aimed at devices capable of receiving and decoding RDS information.</para> - <para>The V4L API defines its RDS API as follows.</para> - - <para>From radio devices supporting it, RDS data can be read -with the &func-read; function. The data is packed in groups of three, -as follows:<orderedlist> - <listitem> - <para>First Octet Least Significant Byte of RDS Block</para> - </listitem> - <listitem> - <para>Second Octet Most Significant Byte of RDS Block</para> - </listitem> - <listitem> - <para>Third Octet Bit 7: Error bit. Indicates that an -uncorrectable error occurred during reception of this block. Bit 6: -Corrected bit. Indicates that an error was corrected for this data -block. Bits 5-3: Received Offset. Indicates the offset received by the -sync system. Bits 2-0: Offset Name. Indicates the offset applied to -this data.</para> - </listitem> - </orderedlist></para> - - <para>It was argued <!-- video4linux-list@redhat.com -on 12 Nov 2002, subject "RDS/RBDS" --> the RDS API should be -extended before integration into V4L2, no new API has been devised yet. -Please write to the linux-media mailing list for discussion: &v4l-ml;. -Meanwhile no V4L2 driver should set the -<constant>V4L2_CAP_RDS_CAPTURE</constant> capability flag.</para> + <para>For more information see the core RDS standard <xref linkend="en50067"> +and the RBDS standard <xref linkend="nrsc4">.</para> + <para>Note that the RBDS standard as is used in the USA is almost identical +to the RDS standard. Any RDS decoder can also handle RBDS. Only some of the fields +have slightly different meanings. See the RBDS standard for more information.</para> + + <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search). +This is a proprietary format which seems to be discontinued. The RDS interface does not +support this format. Should support for MMBS (or the so-called 'E blocks' in general) +be needed, then please contact the linux-media mailing list: &v4l-ml;.</para> + + <section> + <title>Querying Capabilities</title> + + <para>Devices supporting the RDS capturing API +set the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in +the <structfield>capabilities</structfield> field of &v4l2-capability; +returned by the &VIDIOC-QUERYCAP; ioctl. +Any tuner that supports RDS will set the +<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> +field of &v4l2-tuner;. +Whether an RDS signal is present can be detected by looking at +the <structfield>rxsubchans</structfield> field of &v4l2-tuner;: the +<constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data was detected.</para> + + <para>Devices supporting the RDS output API +set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in +the <structfield>capabilities</structfield> field of &v4l2-capability; +returned by the &VIDIOC-QUERYCAP; ioctl. +Any modulator that supports RDS will set the +<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> +field of &v4l2-modulator;. +In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant> +bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.</para> + + </section> + + <section> + <title>Reading RDS data</title> + + <para>RDS data can be read from the radio device +with the &func-read; function. The data is packed in groups of three bytes, +as follows:</para> + <table frame="none" pgwide="1" id="v4l2-rds-data"> + <title>struct +<structname>v4l2_rds_data</structname></title> + <tgroup cols="3"> + <colspec colname="c1" colwidth="1*"> + <colspec colname="c2" colwidth="1*"> + <colspec colname="c3" colwidth="5*"> + <tbody valign="top"> + <row> + <entry>__u8</entry> + <entry><structfield>lsb</structfield></entry> + <entry>Least Significant Byte of RDS Block</entry> + </row> + <row> + <entry>__u8</entry> + <entry><structfield>msb</structfield></entry> + <entry>Most Significant Byte of RDS Block</entry> + </row> + <row> + <entry>__u8</entry> + <entry><structfield>block</structfield></entry> + <entry>Block description</entry> + </row> + </tbody> + </tgroup> + </table> + <table frame="none" pgwide="1" id="v4l2-rds-block"> + <title>Block description</title> + <tgroup cols="2"> + <colspec colname="c1" colwidth="1*"> + <colspec colname="c2" colwidth="5*"> + <tbody valign="top"> + <row> + <entry>Bits 0-2</entry> + <entry>Block (aka offset) of the received data.</entry> + </row> + <row> + <entry>Bits 3-5</entry> + <entry>Deprecated. Currently identical to bits 0-2. Do not use these bits.</entry> + </row> + <row> + <entry>Bit 6</entry> + <entry>Corrected bit. Indicates that an error was corrected for this data block.</entry> + </row> + <row> + <entry>Bit 7</entry> + <entry>Error bit. Indicates that an uncorrectable error occurred during reception of this block.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table frame="none" pgwide="1" id="v4l2-rds-block-codes"> + <title>Block defines</title> + <tgroup cols="3"> + <colspec colname="c1" colwidth="1*"> + <colspec colname="c2" colwidth="1*"> + <colspec colname="c3" colwidth="5*"> + <tbody valign="top"> + <row> + <entry>V4L2_RDS_BLOCK_MSK</entry> + <entry>7</entry> + <entry>Mask for bits 0-2 to get the block ID.</entry> + </row> + <row> + <entry>V4L2_RDS_BLOCK_A</entry> + <entry>0</entry> + <entry>Block A.</entry> + </row> + <row> + <entry>V4L2_RDS_BLOCK_B</entry> + <entry>1</entry> + <entry>Block B.</entry> + </row> + <row> + <entry>V4L2_RDS_BLOCK_C</entry> + <entry>2</entry> + <entry>Block C.</entry> + </row> + <row> + <entry>V4L2_RDS_BLOCK_D</entry> + <entry>3</entry> + <entry>Block D.</entry> + </row> + <row> + <entry>V4L2_RDS_BLOCK_C_ALT</entry> + <entry>4</entry> + <entry>Block C'.</entry> + </row> + <row> + <entry>V4L2_RDS_BLOCK_INVALID</entry> + <entry>7</entry> + <entry>An invalid block.</entry> + </row> + <row> + <entry>V4L2_RDS_BLOCK_CORRECTED</entry> + <entry>0x40</entry> + <entry>A bit error was detected but corrected.</entry> + </row> + <row> + <entry>V4L2_RDS_BLOCK_ERROR</entry> + <entry>0x80</entry> + <entry>An incorrectable error occurred.</entry> + </row> + </tbody> + </tgroup> + </table> + </section> <!-- Local Variables: diff --git a/v4l2-spec/dev-sliced-vbi.sgml b/v4l2-spec/dev-sliced-vbi.sgml index 5560650a6..3c260e3e3 100644 --- a/v4l2-spec/dev-sliced-vbi.sgml +++ b/v4l2-spec/dev-sliced-vbi.sgml @@ -48,7 +48,7 @@ vital to program a sliced VBI device, therefore must be supported.</para> </section> - <section> + <section id="sliced-vbi-format-negotitation"> <title>Sliced VBI Format Negotiation</title> <para>To find out which data services are supported by the @@ -386,6 +386,319 @@ video and VBI data by using buffer timestamps.</para> </section> + <section> + <title>Sliced VBI Data in MPEG Streams</title> + + <para>If a device can produce an MPEG output stream, it may be +capable of providing <link +linkend="sliced-vbi-format-negotitation">negotiated sliced VBI +services</link> as data embedded in the MPEG stream. Users or +applications control this sliced VBI data insertion with the <link +linkend="v4l2-mpeg-stream-vbi-fmt">V4L2_CID_MPEG_STREAM_VBI_FMT</link> +control.</para> + + <para>If the driver does not provide the <link +linkend="v4l2-mpeg-stream-vbi-fmt">V4L2_CID_MPEG_STREAM_VBI_FMT</link> +control, or only allows that control to be set to <link +linkend="v4l2-mpeg-stream-vbi-fmt"><constant> +V4L2_MPEG_STREAM_VBI_FMT_NONE</constant></link>, then the device +cannot embed sliced VBI data in the MPEG stream.</para> + + <para>The <link linkend="v4l2-mpeg-stream-vbi-fmt"> +V4L2_CID_MPEG_STREAM_VBI_FMT</link> control does not implicitly set +the device driver to capture nor cease capturing sliced VBI data. The +control only indicates to embed sliced VBI data in the MPEG stream, if +an application has negotiated sliced VBI service be captured.</para> + + <para>It may also be the case that a device can embed sliced VBI +data in only certain types of MPEG streams: for example in an MPEG-2 +PS but not an MPEG-2 TS. In this situation, if sliced VBI data +insertion is requested, the sliced VBI data will be embedded in MPEG +stream types when supported, and silently omitted from MPEG stream +types where sliced VBI data insertion is not supported by the device. +</para> + + <para>The following subsections specify the format of the +embedded sliced VBI data.</para> + + <section> + <title>MPEG Stream Embedded, Sliced VBI Data Format: NONE</title> + <para>The <link linkend="v4l2-mpeg-stream-vbi-fmt"><constant> +V4L2_MPEG_STREAM_VBI_FMT_NONE</constant></link> embedded sliced VBI +format shall be interpreted by drivers as a control to cease +embedding sliced VBI data in MPEG streams. Neither the device nor +driver shall insert "empty" embedded sliced VBI data packets in the +MPEG stream when this format is set. No MPEG stream data structures +are specified for this format.</para> + </section> + + <section> + <title>MPEG Stream Embedded, Sliced VBI Data Format: IVTV</title> + <para>The <link linkend="v4l2-mpeg-stream-vbi-fmt"><constant> +V4L2_MPEG_STREAM_VBI_FMT_IVTV</constant></link> embedded sliced VBI +format, when supported, indicates to the driver to embed up to 36 +lines of sliced VBI data per frame in an MPEG-2 <emphasis>Private +Stream 1 PES</emphasis> packet encapsulated in an MPEG-2 <emphasis> +Program Pack</emphasis> in the MPEG stream.</para> + + <para><emphasis>Historical context</emphasis>: This format +specification originates from a custom, embedded, sliced VBI data +format used by the <filename>ivtv</filename> driver. This format +has already been informally specified in the kernel sources in the +file <filename>Documentation/video4linux/cx2341x/README.vbi</filename> +. The maximum size of the payload and other aspects of this format +are driven by the CX23415 MPEG decoder's capabilities and limitations +with respect to extracting, decoding, and displaying sliced VBI data +embedded within an MPEG stream.</para> + + <para>This format's use is <emphasis>not</emphasis> exclusive to +the <filename>ivtv</filename> driver <emphasis>nor</emphasis> +exclusive to CX2341x devices, as the sliced VBI data packet insertion +into the MPEG stream is implemented in driver software. At least the +<filename>cx18</filename> driver provides sliced VBI data insertion +into an MPEG-2 PS in this format as well.</para> + + <para>The following definitions specify the payload of the +MPEG-2 <emphasis>Private Stream 1 PES</emphasis> packets that contain +sliced VBI data when <link linkend="v4l2-mpeg-stream-vbi-fmt"> +<constant>V4L2_MPEG_STREAM_VBI_FMT_IVTV</constant></link> is set. +(The MPEG-2 <emphasis>Private Stream 1 PES</emphasis> packet header +and encapsulating MPEG-2 <emphasis>Program Pack</emphasis> header are +not detailed here. Please refer to the MPEG-2 specifications for +details on those packet headers.)</para> + + <para>The payload of the MPEG-2 <emphasis>Private Stream 1 PES +</emphasis> packets that contain sliced VBI data is specified by +&v4l2-mpeg-vbi-fmt-ivtv;. The payload is variable +length, depending on the actual number of lines of sliced VBI data +present in a video frame. The payload may be padded at the end with +unspecified fill bytes to align the end of the payload to a 4-byte +boundary. The payload shall never exceed 1552 bytes (2 fields with +18 lines/field with 43 bytes of data/line and a 4 byte magic number). +</para> + + <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-fmt-ivtv"> + <title>struct <structname>v4l2_mpeg_vbi_fmt_ivtv</structname> + </title> + <tgroup cols="4"> + &cs-ustr; + <tbody valign="top"> + <row> + <entry>__u8</entry> + <entry><structfield>magic</structfield>[4]</entry> + <entry></entry> + <entry>A "magic" constant from <xref + linkend="v4l2-mpeg-vbi-fmt-ivtv-magic"> that indicates +this is a valid sliced VBI data payload and also indicates which +member of the anonymous union, <structfield>itv0</structfield> or +<structfield>ITV0</structfield>, to use for the payload data.</entry> + </row> + <row> + <entry>union</entry> + <entry>(anonymous)</entry> + </row> + <row> + <entry></entry> + <entry>struct <link linkend="v4l2-mpeg-vbi-itv0"> + <structname>v4l2_mpeg_vbi_itv0</structname></link> + </entry> + <entry><structfield>itv0</structfield></entry> + <entry>The primary form of the sliced VBI data payload +that contains anywhere from 1 to 35 lines of sliced VBI data. +Line masks are provided in this form of the payload indicating +which VBI lines are provided.</entry> + </row> + <row> + <entry></entry> + <entry>struct <link linkend="v4l2-mpeg-vbi-ITV0-1"> + <structname>v4l2_mpeg_vbi_ITV0</structname></link> + </entry> + <entry><structfield>ITV0</structfield></entry> + <entry>An alternate form of the sliced VBI data payload +used when 36 lines of sliced VBI data are present. No line masks are +provided in this form of the payload; all valid line mask bits are +implcitly set.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-fmt-ivtv-magic"> + <title>Magic Constants for &v4l2-mpeg-vbi-fmt-ivtv; + <structfield>magic</structfield> field</title> + <tgroup cols="3"> + &cs-def; + <thead> + <row> + <entry align="left">Defined Symbol</entry> + <entry align="left">Value</entry> + <entry align="left">Description</entry> + </row> + </thead> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VBI_IVTV_MAGIC0</constant> + </entry> + <entry>"itv0"</entry> + <entry>Indicates the <structfield>itv0</structfield> +member of the union in &v4l2-mpeg-vbi-fmt-ivtv; is valid.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VBI_IVTV_MAGIC1</constant> + </entry> + <entry>"ITV0"</entry> + <entry>Indicates the <structfield>ITV0</structfield> +member of the union in &v4l2-mpeg-vbi-fmt-ivtv; is valid and +that 36 lines of sliced VBI data are present.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-itv0"> + <title>struct <structname>v4l2_mpeg_vbi_itv0</structname> + </title> + <tgroup cols="3"> + &cs-str; + <tbody valign="top"> + <row> + <entry>__le32</entry> + <entry><structfield>linemask</structfield>[2]</entry> + <entry><para>Bitmasks indicating the VBI service lines +present. These <structfield>linemask</structfield> values are stored +in little endian byte order in the MPEG stream. Some reference +<structfield>linemask</structfield> bit positions with their +corresponding VBI line number and video field are given below. +b<subscript>0</subscript> indicates the least significant bit of a +<structfield>linemask</structfield> value:<screen> +<structfield>linemask</structfield>[0] b<subscript>0</subscript>: line 6 first field +<structfield>linemask</structfield>[0] b<subscript>17</subscript>: line 23 first field +<structfield>linemask</structfield>[0] b<subscript>18</subscript>: line 6 second field +<structfield>linemask</structfield>[0] b<subscript>31</subscript>: line 19 second field +<structfield>linemask</structfield>[1] b<subscript>0</subscript>: line 20 second field +<structfield>linemask</structfield>[1] b<subscript>3</subscript>: line 23 second field +<structfield>linemask</structfield>[1] b<subscript>4</subscript>-b<subscript>31</subscript>: unused and set to 0</screen></para></entry> + </row> + <row> + <entry>struct <link linkend="v4l2-mpeg-vbi-itv0-line"> + <structname>v4l2_mpeg_vbi_itv0_line</structname></link> + </entry> + <entry><structfield>line</structfield>[35]</entry> + <entry>This is a variable length array that holds from 1 +to 35 lines of sliced VBI data. The sliced VBI data lines present +correspond to the bits set in the <structfield>linemask</structfield> +array, starting from b<subscript>0</subscript> of <structfield> +linemask</structfield>[0] up through b<subscript>31</subscript> of +<structfield>linemask</structfield>[0], and from b<subscript>0 +</subscript> of <structfield>linemask</structfield>[1] up through b +<subscript>3</subscript> of <structfield>linemask</structfield>[1]. +<structfield>line</structfield>[0] corresponds to the first bit +found set in the <structfield>linemask</structfield> array, +<structfield>line</structfield>[1] corresponds to the second bit +found set in the <structfield>linemask</structfield> array, etc. +If no <structfield>linemask</structfield> array bits are set, then +<structfield>line</structfield>[0] may contain one line of +unspecified data that should be ignored by applications.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-ITV0-1"> + <title>struct <structname>v4l2_mpeg_vbi_ITV0</structname> + </title> + <tgroup cols="3"> + &cs-str; + <tbody valign="top"> + <row> + <entry>struct <link linkend="v4l2-mpeg-vbi-itv0-line"> + <structname>v4l2_mpeg_vbi_itv0_line</structname></link> + </entry> + <entry><structfield>line</structfield>[36]</entry> + <entry>A fixed length array of 36 lines of sliced VBI +data. <structfield>line</structfield>[0] through <structfield>line +</structfield>[17] correspond to lines 6 through 23 of the +first field. <structfield>line</structfield>[18] through +<structfield>line</structfield>[35] corresponds to lines 6 +through 23 of the second field.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table frame="none" pgwide="1" id="v4l2-mpeg-vbi-itv0-line"> + <title>struct <structname>v4l2_mpeg_vbi_itv0_line</structname> + </title> + <tgroup cols="3"> + &cs-str; + <tbody valign="top"> + <row> + <entry>__u8</entry> + <entry><structfield>id</structfield></entry> + <entry>A line identifier value from +<xref linkend="ITV0-Line-Identifier-Constants"> that indicates +the type of sliced VBI data stored on this line.</entry> + </row> + <row> + <entry>__u8</entry> + <entry><structfield>data</structfield>[42]</entry> + <entry>The sliced VBI data for the line.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table frame="none" pgwide="1" id="ITV0-Line-Identifier-Constants"> + <title>Line Identifiers for struct <link + linkend="v4l2-mpeg-vbi-itv0-line"><structname> +v4l2_mpeg_vbi_itv0_line</structname></link> <structfield>id +</structfield> field</title> + <tgroup cols="3"> + &cs-def; + <thead> + <row> + <entry align="left">Defined Symbol</entry> + <entry align="left">Value</entry> + <entry align="left">Description</entry> + </row> + </thead> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VBI_IVTV_TELETEXT_B</constant> + </entry> + <entry>1</entry> + <entry>Refer to <link linkend="vbi-services2"> +Sliced VBI services</link> for a description of the line payload.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VBI_IVTV_CAPTION_525</constant> + </entry> + <entry>4</entry> + <entry>Refer to <link linkend="vbi-services2"> +Sliced VBI services</link> for a description of the line payload.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VBI_IVTV_WSS_625</constant> + </entry> + <entry>5</entry> + <entry>Refer to <link linkend="vbi-services2"> +Sliced VBI services</link> for a description of the line payload.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VBI_IVTV_VPS</constant> + </entry> + <entry>7</entry> + <entry>Refer to <link linkend="vbi-services2"> +Sliced VBI services</link> for a description of the line payload.</entry> + </row> + </tbody> + </tgroup> + </table> + + </section> + </section> + + <!-- Local Variables: mode: sgml diff --git a/v4l2-spec/pixfmt-sgrbg8.sgml b/v4l2-spec/pixfmt-sgrbg8.sgml new file mode 100644 index 000000000..553c5264a --- /dev/null +++ b/v4l2-spec/pixfmt-sgrbg8.sgml @@ -0,0 +1,75 @@ + <refentry id="V4L2-PIX-FMT-SGRBG8"> + <refmeta> + <refentrytitle>V4L2_PIX_FMT_SGRBG8 ('GRBG')</refentrytitle> + &manvol; + </refmeta> + <refnamediv> + <refname><constant>V4L2_PIX_FMT_SGRBG8</constant></refname> + <refpurpose>Bayer RGB format</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + + <para>This is commonly the native format of digital cameras, +reflecting the arrangement of sensors on the CCD device. Only one red, +green or blue value is given for each pixel. Missing components must +be interpolated from neighbouring pixels. From left to right the first +row consists of a green and blue value, the second row of a red and +green value. This scheme repeats to the right and down for every two +columns and rows.</para> + + <example> + <title><constant>V4L2_PIX_FMT_SGRBG8</constant> 4 × +4 pixel image</title> + + <formalpara> + <title>Byte Order.</title> + <para>Each cell is one byte. + <informaltable frame="none"> + <tgroup cols="5" align="center"> + <colspec align="left" colwidth="2*"> + <tbody valign="top"> + <row> + <entry>start + 0:</entry> + <entry>G<subscript>00</subscript></entry> + <entry>R<subscript>01</subscript></entry> + <entry>G<subscript>02</subscript></entry> + <entry>R<subscript>03</subscript></entry> + </row> + <row> + <entry>start + 4:</entry> + <entry>R<subscript>10</subscript></entry> + <entry>B<subscript>11</subscript></entry> + <entry>R<subscript>12</subscript></entry> + <entry>B<subscript>13</subscript></entry> + </row> + <row> + <entry>start + 8:</entry> + <entry>G<subscript>20</subscript></entry> + <entry>R<subscript>21</subscript></entry> + <entry>G<subscript>22</subscript></entry> + <entry>R<subscript>23</subscript></entry> + </row> + <row> + <entry>start + 12:</entry> + <entry>R<subscript>30</subscript></entry> + <entry>B<subscript>31</subscript></entry> + <entry>R<subscript>32</subscript></entry> + <entry>B<subscript>33</subscript></entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </formalpara> + </example> + </refsect1> + </refentry> + + <!-- +Local Variables: +mode: sgml +sgml-parent-document: "pixfmt.sgml" +indent-tabs-mode: nil +End: + --> diff --git a/v4l2-spec/pixfmt.sgml b/v4l2-spec/pixfmt.sgml index f1a36d396..9e6bebeb4 100644 --- a/v4l2-spec/pixfmt.sgml +++ b/v4l2-spec/pixfmt.sgml @@ -565,6 +565,7 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.< &sub-packed-rgb; &sub-sbggr8; &sub-sgbrg8; + &sub-sgrbg8 &sub-sbggr16; </section> @@ -724,11 +725,26 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm <entry>'M310'</entry> <entry>Compressed BGGR Bayer format used by the gspca driver.</entry> </row> + <row id="V4L2-PIX-FMT-OV511"> + <entry><constant>V4L2_PIX_FMT_OV511</constant></entry> + <entry>'O511'</entry> + <entry>OV511 JPEG format used by the gspca driver.</entry> + </row> + <row id="V4L2-PIX-FMT-OV518"> + <entry><constant>V4L2_PIX_FMT_OV518</constant></entry> + <entry>'O518'</entry> + <entry>OV518 JPEG format used by the gspca driver.</entry> + </row> <row id="V4L2-PIX-FMT-PJPG"> <entry><constant>V4L2_PIX_FMT_PJPG</constant></entry> <entry>'PJPG'</entry> <entry>Pixart 73xx JPEG format used by the gspca driver.</entry> </row> + <row id="V4L2-PIX-FMT-SQ905C"> + <entry><constant>V4L2_PIX_FMT_SQ905C</constant></entry> + <entry>'905C'</entry> + <entry>Compressed RGGB bayer format used by the gspca driver.</entry> + </row> <row id="V4L2-PIX-FMT-MJPEG"> <entry><constant>V4L2_PIX_FMT_MJPEG</constant></entry> <entry>'MJPG'</entry> @@ -749,6 +765,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm <entry>'S910'</entry> <entry>Compressed format of the SN9C102 driver.</entry> </row> + <row id="V4L2-PIX-FMT-SN9C20X-I420"> + <entry><constant>V4L2_PIX_FMT_SN9C20X_I420</constant></entry> + <entry>'S920'</entry> + <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> + </row> <row id="V4L2-PIX-FMT-WNVA"> <entry><constant>V4L2_PIX_FMT_WNVA</constant></entry> <entry>'WNVA'</entry> diff --git a/v4l2-spec/v4l2.sgml b/v4l2-spec/v4l2.sgml index 9f43b6d1e..bae7eb441 100644 --- a/v4l2-spec/v4l2.sgml +++ b/v4l2-spec/v4l2.sgml @@ -25,7 +25,7 @@ <book id="v4l2spec"> <bookinfo> <title>Video for Linux Two API Specification</title> - <subtitle>Revision 0.25</subtitle> + <subtitle>Revision 0.26</subtitle> <authorgroup> <author> @@ -77,6 +77,19 @@ API.</contrib> <contrib>Designed and documented the VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS ioctls.</contrib> </author> + + <author> + <firstname>Andy</firstname> + <surname>Walls</surname> + <contrib>Documented the fielded V4L2_MPEG_STREAM_VBI_FMT_IVTV +MPEG stream embedded, sliced VBI data format in this specification. +</contrib> + <affiliation> + <address> + <email>awalls@radix.net</email> + </address> + </affiliation> + </author> </authorgroup> <copyright> @@ -92,12 +105,12 @@ and VIDIOC_ENUM_FRAMEINTERVALS ioctls.</contrib> <year>2008</year> <year>2009</year> <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin -Rubli</holder> +Rubli, Andy Walls</holder> </copyright> <legalnotice> <para>This document is copyrighted © 1999-2009 by Bill -Dirks, Michael H. Schimek, Hans Verkuil and Martin Rubli.</para> +Dirks, Michael H. Schimek, Hans Verkuil, Martin Rubli, and Andy Walls.</para> <para>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -118,6 +131,14 @@ structs, ioctls) must be noted in more detail in the history chapter applications. --> <revision> + <revnumber>0.26</revnumber> + <date>2009-06-15</date> + <authorinitials>hv</authorinitials> + <revremark>Finalized the RDS capture API. Added modulator and RDS encoder +capabilities.</revremark> + </revision> + + <revision> <revnumber>0.25</revnumber> <date>2009-01-18</date> <authorinitials>hv</authorinitials> diff --git a/v4l2-spec/vidioc-enuminput.sgml b/v4l2-spec/vidioc-enuminput.sgml index 1c1486b43..824b47e5f 100644 --- a/v4l2-spec/vidioc-enuminput.sgml +++ b/v4l2-spec/vidioc-enuminput.sgml @@ -119,7 +119,7 @@ linkend="standard">.</entry> <entry><structfield>status</structfield></entry> <entry>This field provides status information about the input. See <xref linkend="input-status"> for flags. -<structfield>status</structfield> is only valid when this is the +With the exception of the sensor orientation bits <structfield>status</structfield> is only valid when this is the current input.</entry> </row> <row> @@ -188,6 +188,23 @@ is OK." --> detect color modulation in the signal.</entry> </row> <row> + <entry spanname="hspan">Sensor Orientation</entry> + </row> + <row> + <entry><constant>V4L2_IN_ST_HFLIP</constant></entry> + <entry>0x00000010</entry> + <entry>The input is connected to a device that produces a signal +that is flipped horizontally and does not correct this before passing the +signal to userspace.</entry> + </row> + <row> + <entry><constant>V4L2_IN_ST_VFLIP</constant></entry> + <entry>0x00000020</entry> + <entry>The input is connected to a device that produces a signal +that is flipped vertically and does not correct this before passing the +signal to userspace. Note that a 180 degree rotation is the same as HFLIP | VFLIP</entry> + </row> + <row> <entry spanname="hspan">Analog Video</entry> </row> <row> diff --git a/v4l2-spec/vidioc-g-modulator.sgml b/v4l2-spec/vidioc-g-modulator.sgml index e5d4a3f24..945147f90 100644 --- a/v4l2-spec/vidioc-g-modulator.sgml +++ b/v4l2-spec/vidioc-g-modulator.sgml @@ -166,7 +166,7 @@ combine with <constant>V4L2_TUNER_SUB_STEREO</constant> or channel of a stereo audio signal. When the input has only one channel or two channels and <constant>V4L2_TUNER_SUB_SAP</constant> is also set, channel 1 is encoded as left and right channel. This flag does -not combine with <constant>V4L2_TUNER_SUB_MONO </constant> or +not combine with <constant>V4L2_TUNER_SUB_MONO</constant> or <constant>V4L2_TUNER_SUB_LANG1</constant>. When the driver does not support stereo audio it shall fall back to mono.</entry> </row> @@ -177,8 +177,9 @@ support stereo audio it shall fall back to mono.</entry> language of a bilingual audio signal. When the input has only one channel it is used for both languages. It is not possible to encode the primary or secondary language only. This flag does not combine -with <constant>V4L2_TUNER_SUB_MONO </constant> or -<constant>V4L2_TUNER_SUB_STEREO</constant>. If the hardware does not +with <constant>V4L2_TUNER_SUB_MONO</constant>, +<constant>V4L2_TUNER_SUB_STEREO</constant> or +<constant>V4L2_TUNER_SUB_SAP</constant>. If the hardware does not support the respective audio matrix, or the current video standard does not permit bilingual audio the <constant>VIDIOC_S_MODULATOR</constant> ioctl shall return an &EINVAL; @@ -188,7 +189,7 @@ and the driver shall fall back to mono or stereo mode.</entry> <entry><constant>V4L2_TUNER_SUB_LANG2</constant></entry> <entry>0x0004</entry> <entry>Same effect as -<constant>V4L2_TUNER_SUB_LANG1</constant>.</entry> +<constant>V4L2_TUNER_SUB_SAP</constant>.</entry> </row> <row> <entry><constant>V4L2_TUNER_SUB_SAP</constant></entry> @@ -198,7 +199,7 @@ and the driver shall fall back to mono or stereo mode.</entry> channel as Second Audio Program. When the input has only one channel it is used for both audio tracks. When the input has three channels the mono track is a down-mix of channel 1 and 2. When combined with -<constant>V4L2_TUNER_SUB_STEREO </constant> channel 1 and 2 are +<constant>V4L2_TUNER_SUB_STEREO</constant> channel 1 and 2 are encoded as left and right stereo audio, channel 3 as Second Audio Program. When the input has only two channels, the first is encoded as left and right channel and the second as SAP. When the input has only @@ -207,10 +208,15 @@ encode a Second Audio Program only. This flag must combine with <constant>V4L2_TUNER_SUB_MONO</constant> or <constant>V4L2_TUNER_SUB_STEREO</constant>. If the hardware does not support the respective audio matrix, or the current video standard -does not permit SAP the <constant> VIDIOC_S_MODULATOR</constant> ioctl +does not permit SAP the <constant>VIDIOC_S_MODULATOR</constant> ioctl shall return an &EINVAL; and driver shall fall back to mono or stereo mode.</entry> </row> + <row> + <entry><constant>V4L2_TUNER_SUB_RDS</constant></entry> + <entry>0x0010</entry> + <entry>Enable the RDS encoder for a radio FM transmitter.</entry> + </row> </tbody> </tgroup> </table> diff --git a/v4l2-spec/vidioc-g-tuner.sgml b/v4l2-spec/vidioc-g-tuner.sgml index 6285c18de..eb0b89e9a 100644 --- a/v4l2-spec/vidioc-g-tuner.sgml +++ b/v4l2-spec/vidioc-g-tuner.sgml @@ -120,9 +120,9 @@ field is not quite clear.--></para></entry> to decode audio subprograms. They will <emphasis>not</emphasis> change, for example with the current video standard.</para><para>When the structure refers to a radio tuner only the -<constant>V4L2_TUNER_CAP_LOW</constant> and -<constant>V4L2_TUNER_CAP_STEREO</constant> flags can be -set.</para></entry> +<constant>V4L2_TUNER_CAP_LOW</constant>, +<constant>V4L2_TUNER_CAP_STEREO</constant> and +<constant>V4L2_TUNER_CAP_RDS</constant> flags can be set.</para></entry> </row> <row> <entry>__u32</entry> @@ -312,6 +312,12 @@ carrier for a monaural secondary language. Only supports the <constant>V4L2_STD_NTSC_M</constant> video standard.</para><!-- FIXME what if PAL+NTSC and Bi but not SAP? --></entry> </row> + <row> + <entry><constant>V4L2_TUNER_CAP_RDS</constant></entry> + <entry>0x0080</entry> + <entry>RDS capture is supported. This capability is only valid for +radio tuners.</entry> + </row> </tbody> </tgroup> </table> @@ -353,6 +359,11 @@ bilingual audio signal (or a second audio program).</entry> <constant>V4L2_TUNER_SUB_SAP</constant> flag applies when the current video standard is <constant>V4L2_STD_NTSC_M</constant>.</entry> </row> + <row> + <entry><constant>V4L2_TUNER_SUB_RDS</constant></entry> + <entry>0x0010</entry> + <entry>The tuner receives an RDS channel.</entry> + </row> </tbody> </tgroup> </table> @@ -375,8 +386,8 @@ language.</entry> <entry>1</entry> <entry><para>Play stereo audio. When the tuner receives bilingual audio it may play different languages on the left and right -channel or the primary language on both channels. behave as in mono -mode.</para><para>Playing different languages in this mode is +channel or the primary language is played on both channels.</para><para>Playing +different languages in this mode is deprecated. New drivers should do this only in <constant>MODE_LANG1_LANG2</constant>.</para><para>When the tuner receives no stereo signal or does not support stereo reception the diff --git a/v4l2-spec/vidioc-querycap.sgml b/v4l2-spec/vidioc-querycap.sgml index 2715289d8..fa12ae738 100644 --- a/v4l2-spec/vidioc-querycap.sgml +++ b/v4l2-spec/vidioc-querycap.sgml @@ -184,7 +184,7 @@ data.</entry> <row> <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry> <entry>0x00000100</entry> - <entry>[to be defined]</entry> + <entry>The device supports the <link linkend="rds">RDS</link> interface.</entry> </row> <row> <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry> @@ -208,9 +208,9 @@ hardware frequency seeking.</entry> <row> <entry><constant>V4L2_CAP_TUNER</constant></entry> <entry>0x00010000</entry> - <entry>The device has some sort of tuner or modulator to -receive or emit RF-modulated video signals. For more information about -tuner and modulator programming see + <entry>The device has some sort of tuner to +receive RF-modulated video signals. For more information about +tuner programming see <xref linkend="tuner">.</entry> </row> <row> @@ -228,6 +228,14 @@ interface. For more information on audio inputs and outputs see <xref <entry>This is a radio receiver.</entry> </row> <row> + <entry><constant>V4L2_CAP_MODULATOR</constant></entry> + <entry>0x00080000</entry> + <entry>The device has some sort of modulator to +emit RF-modulated video/audio signals. For more information about +modulator programming see +<xref linkend="tuner">.</entry> + </row> + <row> <entry><constant>V4L2_CAP_READWRITE</constant></entry> <entry>0x01000000</entry> <entry>The device supports the <link |