diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-30 00:08:53 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-30 00:08:53 -0700 |
commit | 664a41b8a91bf78a01a751e15175e0008977685a (patch) | |
tree | d9dc15c83400ad2dfb430ff27ae3e7fdc9395856 /Documentation/DocBook/media/v4l/dev-capture.xml | |
parent | 983236b5741e557451f3ed4ec5ebf1f62a5b2c15 (diff) | |
parent | ee2ce3a0b43d14d792d34cf88e7bc2091096744b (diff) | |
download | linux-664a41b8a91bf78a01a751e15175e0008977685a.tar.bz2 |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (430 commits)
[media] ir-mce_kbd-decoder: include module.h for its facilities
[media] ov5642: include module.h for its facilities
[media] em28xx: Fix DVB-C maxsize for em2884
[media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz
[media] v4l: mt9v032: Fix Bayer pattern
[media] V4L: mt9m111: rewrite set_pixfmt
[media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
[media] V4L: initial driver for ov5642 CMOS sensor
[media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
[media] V4L: soc-camera: remove soc-camera bus and devices on it
[media] V4L: soc-camera: un-export the soc-camera bus
[media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier
[media] V4L: add media bus configuration subdev operations
[media] V4L: soc-camera: group struct field initialisations together
[media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
[media] V4L: pxa-camera: switch to using standard PM hooks
[media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param
[media] Don't OOPS if videobuf_dvb_get_frontend return NULL
[media] NetUP Dual DVB-T/C CI RF: load firmware according card revision
[media] omap3isp: Support configurable HS/VS polarities
...
Fix up conflicts:
- arch/arm/mach-omap2/board-rx51-peripherals.c:
cleanup regulator supply definitions in mach-omap2
vs
OMAP3: RX-51: define vdds_csib regulator supply
- drivers/staging/tm6000/tm6000-alsa.c (trivial)
Diffstat (limited to 'Documentation/DocBook/media/v4l/dev-capture.xml')
-rw-r--r-- | Documentation/DocBook/media/v4l/dev-capture.xml | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/Documentation/DocBook/media/v4l/dev-capture.xml b/Documentation/DocBook/media/v4l/dev-capture.xml new file mode 100644 index 000000000000..2237c661f26a --- /dev/null +++ b/Documentation/DocBook/media/v4l/dev-capture.xml @@ -0,0 +1,118 @@ + <title>Video Capture Interface</title> + + <para>Video capture devices sample an analog video signal and store +the digitized images in memory. Today nearly all devices can capture +at full 25 or 30 frames/second. With this interface applications can +control the capture process and move images from the driver into user +space.</para> + + <para>Conventionally V4L2 video capture devices are accessed through +character device special files named <filename>/dev/video</filename> +and <filename>/dev/video0</filename> to +<filename>/dev/video63</filename> with major number 81 and minor +numbers 0 to 63. <filename>/dev/video</filename> is typically a +symbolic link to the preferred video device. Note the same device +files are used for video output devices.</para> + + <section> + <title>Querying Capabilities</title> + + <para>Devices supporting the video capture interface set the +<constant>V4L2_CAP_VIDEO_CAPTURE</constant> or +<constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant> flag in the +<structfield>capabilities</structfield> field of &v4l2-capability; +returned by the &VIDIOC-QUERYCAP; ioctl. As secondary device functions +they may also support the <link linkend="overlay">video overlay</link> +(<constant>V4L2_CAP_VIDEO_OVERLAY</constant>) and the <link +linkend="raw-vbi">raw VBI capture</link> +(<constant>V4L2_CAP_VBI_CAPTURE</constant>) interface. At least one of +the read/write or streaming I/O methods must be supported. Tuners and +audio inputs are optional.</para> + </section> + + <section> + <title>Supplemental Functions</title> + + <para>Video capture devices shall support <link +linkend="audio">audio input</link>, <link +linkend="tuner">tuner</link>, <link linkend="control">controls</link>, +<link linkend="crop">cropping and scaling</link> and <link +linkend="streaming-par">streaming parameter</link> ioctls as needed. +The <link linkend="video">video input</link> and <link +linkend="standard">video standard</link> ioctls must be supported by +all video capture devices.</para> + </section> + + <section> + <title>Image Format Negotiation</title> + + <para>The result of a capture operation is determined by +cropping and image format parameters. The former select an area of the +video picture to capture, the latter how images are stored in memory, +&ie; in RGB or YUV format, the number of bits per pixel or width and +height. Together they also define how images are scaled in the +process.</para> + + <para>As usual these parameters are <emphasis>not</emphasis> reset +at &func-open; time to permit Unix tool chains, programming a device +and then reading from it as if it was a plain file. Well written V4L2 +applications ensure they really get what they want, including cropping +and scaling.</para> + + <para>Cropping initialization at minimum requires to reset the +parameters to defaults. An example is given in <xref +linkend="crop" />.</para> + + <para>To query the current image format applications set the +<structfield>type</structfield> field of a &v4l2-format; to +<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> or +<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant> and call the +&VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill +the &v4l2-pix-format; <structfield>pix</structfield> or the +&v4l2-pix-format-mplane; <structfield>pix_mp</structfield> member of the +<structfield>fmt</structfield> union.</para> + + <para>To request different parameters applications set the +<structfield>type</structfield> field of a &v4l2-format; as above and +initialize all fields of the &v4l2-pix-format; +<structfield>vbi</structfield> member of the +<structfield>fmt</structfield> union, or better just modify the +results of <constant>VIDIOC_G_FMT</constant>, and call the +&VIDIOC-S-FMT; ioctl with a pointer to this structure. Drivers may +adjust the parameters and finally return the actual parameters as +<constant>VIDIOC_G_FMT</constant> does.</para> + + <para>Like <constant>VIDIOC_S_FMT</constant> the +&VIDIOC-TRY-FMT; ioctl can be used to learn about hardware limitations +without disabling I/O or possibly time consuming hardware +preparations.</para> + + <para>The contents of &v4l2-pix-format; and &v4l2-pix-format-mplane; +are discussed in <xref linkend="pixfmt" />. See also the specification of the +<constant>VIDIOC_G_FMT</constant>, <constant>VIDIOC_S_FMT</constant> +and <constant>VIDIOC_TRY_FMT</constant> ioctls for details. Video +capture devices must implement both the +<constant>VIDIOC_G_FMT</constant> and +<constant>VIDIOC_S_FMT</constant> ioctl, even if +<constant>VIDIOC_S_FMT</constant> ignores all requests and always +returns default parameters as <constant>VIDIOC_G_FMT</constant> does. +<constant>VIDIOC_TRY_FMT</constant> is optional.</para> + </section> + + <section> + <title>Reading Images</title> + + <para>A video capture device may support the <link +linkend="rw">read() function</link> and/or streaming (<link +linkend="mmap">memory mapping</link> or <link +linkend="userp">user pointer</link>) I/O. See <xref +linkend="io" /> for details.</para> + </section> + + <!-- +Local Variables: +mode: sgml +sgml-parent-document: "v4l2.sgml" +indent-tabs-mode: nil +End: + --> |