Home | History | Annotate | Download | only in spec
      1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
      2 <HTML
      3 ><HEAD
      4 ><TITLE
      5 >Video Overlay Interface</TITLE
      6 ><META
      7 NAME="GENERATOR"
      8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
      9 REL="HOME"
     10 TITLE="Video for Linux Two API Specification"
     11 HREF="book1.htm"><LINK
     12 REL="UP"
     13 TITLE="Interfaces"
     14 HREF="c6488.htm"><LINK
     15 REL="PREVIOUS"
     16 TITLE="Interfaces"
     17 HREF="c6488.htm"><LINK
     18 REL="NEXT"
     19 TITLE="Video Output Interface"
     20 HREF="x6831.htm"></HEAD
     21 ><BODY
     22 CLASS="SECTION"
     23 BGCOLOR="#FFFFFF"
     24 TEXT="#000000"
     25 LINK="#0000FF"
     26 VLINK="#840084"
     27 ALINK="#0000FF"
     28 ><DIV
     29 CLASS="NAVHEADER"
     30 ><TABLE
     31 SUMMARY="Header navigation table"
     32 WIDTH="100%"
     33 BORDER="0"
     34 CELLPADDING="0"
     35 CELLSPACING="0"
     36 ><TR
     37 ><TH
     38 COLSPAN="3"
     39 ALIGN="center"
     40 >Video for Linux Two API Specification: Revision 0.24</TH
     41 ></TR
     42 ><TR
     43 ><TD
     44 WIDTH="10%"
     45 ALIGN="left"
     46 VALIGN="bottom"
     47 ><A
     48 HREF="c6488.htm"
     49 ACCESSKEY="P"
     50 >Prev</A
     51 ></TD
     52 ><TD
     53 WIDTH="80%"
     54 ALIGN="center"
     55 VALIGN="bottom"
     56 >Chapter 4. Interfaces</TD
     57 ><TD
     58 WIDTH="10%"
     59 ALIGN="right"
     60 VALIGN="bottom"
     61 ><A
     62 HREF="x6831.htm"
     63 ACCESSKEY="N"
     64 >Next</A
     65 ></TD
     66 ></TR
     67 ></TABLE
     68 ><HR
     69 ALIGN="LEFT"
     70 WIDTH="100%"></DIV
     71 ><DIV
     72 CLASS="SECTION"
     73 ><H1
     74 CLASS="SECTION"
     75 ><A
     76 NAME="OVERLAY"
     77 >4.2. Video Overlay Interface</A
     78 ></H1
     79 ><FONT
     80 COLOR="RED"
     81 >Also known as Framebuffer Overlay or Previewing</FONT
     82 ><P
     83 >Video overlay devices have the ability to genlock (TV-)video
     84 into the (VGA-)video signal of a graphics card, or to store captured
     85 images directly in video memory of a graphics card, typically with
     86 clipping. This can be considerable more efficient than capturing
     87 images and displaying them by other means. In the old days when only
     88 nuclear power plants needed cooling towers this used to be the only
     89 way to put live video into a window.</P
     90 ><P
     91 >Video overlay devices are accessed through the same character
     92 special files as <A
     93 HREF="c6488.htm#CAPTURE"
     94 >video capture</A
     95 > devices.
     96 Note the default function of a <TT
     97 CLASS="FILENAME"
     98 >/dev/video</TT
     99 > device
    100 is video capturing. The overlay function is only available after
    101 calling the <A
    102 HREF="r10944.htm"
    103 ><CODE
    104 CLASS="CONSTANT"
    105 >VIDIOC_S_FMT</CODE
    106 ></A
    107 > ioctl.</P
    108 ><P
    109 >The driver may support simultaneous overlay and capturing
    110 using the read/write and streaming I/O methods. If so, operation at
    111 the nominal frame rate of the video standard is not guaranteed. Frames
    112 may be directed away from overlay to capture, or one field may be used
    113 for overlay and the other for capture if the capture parameters permit
    114 this.</P
    115 ><P
    116 >Applications should use different file descriptors for
    117 capturing and overlay. This must be supported by all drivers capable
    118 of simultaneous capturing and overlay. Optionally these drivers may
    119 also permit capturing and overlay with a single file descriptor for
    120 compatibility with V4L and earlier versions of V4L2.<A
    121 NAME="AEN6581"
    122 HREF="x6570.htm#FTN.AEN6581"
    123 ><SPAN
    124 CLASS="footnote"
    125 >[1]</SPAN
    126 ></A
    127 ></P
    128 ><DIV
    129 CLASS="SECTION"
    130 ><H2
    131 CLASS="SECTION"
    132 ><A
    133 NAME="AEN6587"
    134 >4.2.1. Querying Capabilities</A
    135 ></H2
    136 ><P
    137 >Devices supporting the video overlay interface set the
    138 <CODE
    139 CLASS="CONSTANT"
    140 >V4L2_CAP_VIDEO_OVERLAY</CODE
    141 > flag in the
    142 <CODE
    143 CLASS="STRUCTFIELD"
    144 >capabilities</CODE
    145 > field of struct&nbsp;<A
    146 HREF="r13105.htm#V4L2-CAPABILITY"
    147 >v4l2_capability</A
    148 >
    149 returned by the <A
    150 HREF="r13105.htm"
    151 ><CODE
    152 CLASS="CONSTANT"
    153 >VIDIOC_QUERYCAP</CODE
    154 ></A
    155 > ioctl. The overlay I/O method specified
    156 below must be supported. Tuners and audio inputs are optional.</P
    157 ></DIV
    158 ><DIV
    159 CLASS="SECTION"
    160 ><H2
    161 CLASS="SECTION"
    162 ><A
    163 NAME="AEN6595"
    164 >4.2.2. Supplemental Functions</A
    165 ></H2
    166 ><P
    167 >Video overlay devices shall support <A
    168 HREF="x341.htm"
    169 >audio input</A
    170 >, <A
    171 HREF="x394.htm"
    172 >tuner</A
    173 >, <A
    174 HREF="x542.htm"
    175 >controls</A
    176 >,
    177 <A
    178 HREF="x1904.htm"
    179 >cropping and scaling</A
    180 > and <A
    181 HREF="x2009.htm"
    182 >streaming parameter</A
    183 > ioctls as needed.
    184 The <A
    185 HREF="x309.htm"
    186 >video input</A
    187 > and <A
    188 HREF="x448.htm"
    189 >video standard</A
    190 > ioctls must be supported by
    191 all video overlay devices.</P
    192 ></DIV
    193 ><DIV
    194 CLASS="SECTION"
    195 ><H2
    196 CLASS="SECTION"
    197 ><A
    198 NAME="AEN6605"
    199 >4.2.3. Setup</A
    200 ></H2
    201 ><P
    202 >Before overlay can commence applications must program the
    203 driver with frame buffer parameters, namely the address and size of
    204 the frame buffer and the image format, for example RGB 5:6:5. The
    205 <A
    206 HREF="r10595.htm"
    207 ><CODE
    208 CLASS="CONSTANT"
    209 >VIDIOC_G_FBUF</CODE
    210 ></A
    211 > and <A
    212 HREF="r10595.htm"
    213 ><CODE
    214 CLASS="CONSTANT"
    215 >VIDIOC_S_FBUF</CODE
    216 ></A
    217 > ioctls are available to get
    218 and set these parameters, respectively. The
    219 <CODE
    220 CLASS="CONSTANT"
    221 >VIDIOC_S_FBUF</CODE
    222 > ioctl is privileged because it
    223 allows to set up DMA into physical memory, bypassing the memory
    224 protection mechanisms of the kernel. Only the superuser can change the
    225 frame buffer address and size. Users are not supposed to run TV
    226 applications as root or with SUID bit set. A small helper application
    227 with suitable privileges should query the graphics system and program
    228 the V4L2 driver at the appropriate time.</P
    229 ><P
    230 >Some devices add the video overlay to the output signal
    231 of the graphics card. In this case the frame buffer is not modified by
    232 the video device, and the frame buffer address and pixel format are
    233 not needed by the driver. The <CODE
    234 CLASS="CONSTANT"
    235 >VIDIOC_S_FBUF</CODE
    236 > ioctl
    237 is not privileged. An application can check for this type of device by
    238 calling the <CODE
    239 CLASS="CONSTANT"
    240 >VIDIOC_G_FBUF</CODE
    241 > ioctl.</P
    242 ><P
    243 >A driver may support any (or none) of five clipping/blending
    244 methods:<P
    245 ></P
    246 ><OL
    247 TYPE="1"
    248 ><LI
    249 ><P
    250 >Chroma-keying displays the overlaid image only where
    251 pixels in the primary graphics surface assume a certain color.</P
    252 ></LI
    253 ><LI
    254 ><P
    255 >A bitmap can be specified where each bit corresponds
    256 to a pixel in the overlaid image. When the bit is set, the
    257 corresponding video pixel is displayed, otherwise a pixel of the
    258 graphics surface.</P
    259 ></LI
    260 ><LI
    261 ><P
    262 >A list of clipping rectangles can be specified. In
    263 these regions <SPAN
    264 CLASS="emphasis"
    265 ><I
    266 CLASS="EMPHASIS"
    267 >no</I
    268 ></SPAN
    269 > video is displayed, so the
    270 graphics surface can be seen here.</P
    271 ></LI
    272 ><LI
    273 ><P
    274 >The framebuffer has an alpha channel that can be used
    275 to clip or blend the framebuffer with the video.</P
    276 ></LI
    277 ><LI
    278 ><P
    279 >A global alpha value can be specified to blend the
    280 framebuffer contents with video images.</P
    281 ></LI
    282 ></OL
    283 ></P
    284 ><P
    285 >When simultaneous capturing and overlay is supported and
    286 the hardware prohibits different image and frame buffer formats, the
    287 format requested first takes precedence. The attempt to capture
    288 (<A
    289 HREF="r10944.htm"
    290 ><CODE
    291 CLASS="CONSTANT"
    292 >VIDIOC_S_FMT</CODE
    293 ></A
    294 >) or overlay (<A
    295 HREF="r10595.htm"
    296 ><CODE
    297 CLASS="CONSTANT"
    298 >VIDIOC_S_FBUF</CODE
    299 ></A
    300 >) may fail with an
    301 <SPAN
    302 CLASS="ERRORCODE"
    303 >EBUSY</SPAN
    304 > error code or return accordingly modified parameters..</P
    305 ></DIV
    306 ><DIV
    307 CLASS="SECTION"
    308 ><H2
    309 CLASS="SECTION"
    310 ><A
    311 NAME="AEN6635"
    312 >4.2.4. Overlay Window</A
    313 ></H2
    314 ><P
    315 >The overlaid image is determined by cropping and overlay
    316 window parameters. The former select an area of the video picture to
    317 capture, the latter how images are overlaid and clipped. Cropping
    318 initialization at minimum requires to reset the parameters to
    319 defaults. An example is given in <A
    320 HREF="x1904.htm"
    321 >Section 1.11</A
    322 >.</P
    323 ><P
    324 >The overlay window is described by a struct&nbsp;<A
    325 HREF="x6570.htm#V4L2-WINDOW"
    326 >v4l2_window</A
    327 >. It
    328 defines the size of the image, its position over the graphics surface
    329 and the clipping to be applied. To get the current parameters
    330 applications set the <CODE
    331 CLASS="STRUCTFIELD"
    332 >type</CODE
    333 > field of a
    334 struct&nbsp;<A
    335 HREF="r10944.htm#V4L2-FORMAT"
    336 >v4l2_format</A
    337 > to <CODE
    338 CLASS="CONSTANT"
    339 >V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
    340 > and
    341 call the <A
    342 HREF="r10944.htm"
    343 ><CODE
    344 CLASS="CONSTANT"
    345 >VIDIOC_G_FMT</CODE
    346 ></A
    347 > ioctl. The driver fills the
    348 <CODE
    349 CLASS="STRUCTNAME"
    350 >v4l2_window</CODE
    351 > substructure named
    352 <CODE
    353 CLASS="STRUCTFIELD"
    354 >win</CODE
    355 >. It is not possible to retrieve a
    356 previously programmed clipping list or bitmap.</P
    357 ><P
    358 >To program the overlay window applications set the
    359 <CODE
    360 CLASS="STRUCTFIELD"
    361 >type</CODE
    362 > field of a struct&nbsp;<A
    363 HREF="r10944.htm#V4L2-FORMAT"
    364 >v4l2_format</A
    365 > to
    366 <CODE
    367 CLASS="CONSTANT"
    368 >V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
    369 >, initialize the
    370 <CODE
    371 CLASS="STRUCTFIELD"
    372 >win</CODE
    373 > substructure and call the
    374 <A
    375 HREF="r10944.htm"
    376 ><CODE
    377 CLASS="CONSTANT"
    378 >VIDIOC_S_FMT</CODE
    379 ></A
    380 > ioctl. The driver adjusts the parameters against
    381 hardware limits and returns the actual parameters as
    382 <CODE
    383 CLASS="CONSTANT"
    384 >VIDIOC_G_FMT</CODE
    385 > does. Like
    386 <CODE
    387 CLASS="CONSTANT"
    388 >VIDIOC_S_FMT</CODE
    389 >, the <A
    390 HREF="r10944.htm"
    391 ><CODE
    392 CLASS="CONSTANT"
    393 >VIDIOC_TRY_FMT</CODE
    394 ></A
    395 > ioctl can be
    396 used to learn about driver capabilities without actually changing
    397 driver state. Unlike <CODE
    398 CLASS="CONSTANT"
    399 >VIDIOC_S_FMT</CODE
    400 > this also works
    401 after the overlay has been enabled.</P
    402 ><P
    403 >The scaling factor of the overlaid image is implied by the
    404 width and height given in struct&nbsp;<A
    405 HREF="x6570.htm#V4L2-WINDOW"
    406 >v4l2_window</A
    407 > and the size of the cropping
    408 rectangle. For more information see <A
    409 HREF="x1904.htm"
    410 >Section 1.11</A
    411 >.</P
    412 ><P
    413 >When simultaneous capturing and overlay is supported and
    414 the hardware prohibits different image and window sizes, the size
    415 requested first takes precedence. The attempt to capture or overlay as
    416 well (<A
    417 HREF="r10944.htm"
    418 ><CODE
    419 CLASS="CONSTANT"
    420 >VIDIOC_S_FMT</CODE
    421 ></A
    422 >) may fail with an <SPAN
    423 CLASS="ERRORCODE"
    424 >EBUSY</SPAN
    425 > error code or return accordingly
    426 modified parameters.</P
    427 ><DIV
    428 CLASS="TABLE"
    429 ><A
    430 NAME="V4L2-WINDOW"
    431 ></A
    432 ><P
    433 ><B
    434 >Table 4-1. struct <CODE
    435 CLASS="STRUCTNAME"
    436 >v4l2_window</CODE
    437 ></B
    438 ></P
    439 ><TABLE
    440 BORDER="0"
    441 FRAME="void"
    442 WIDTH="100%"
    443 CLASS="CALSTABLE"
    444 ><COL
    445 WIDTH="25%"
    446 TITLE="C1"><COL
    447 WIDTH="25%"
    448 TITLE="C2"><COL
    449 WIDTH="50%"
    450 TITLE="C3"><TBODY
    451 VALIGN="TOP"
    452 ><TR
    453 ><TD
    454 >struct&nbsp;<A
    455 HREF="x6570.htm#V4L2-RECT"
    456 >v4l2_rect</A
    457 ></TD
    458 ><TD
    459 ><CODE
    460 CLASS="STRUCTFIELD"
    461 >w</CODE
    462 ></TD
    463 ><TD
    464 >Size and position of the window relative to the
    465 top, left corner of the frame buffer defined with <A
    466 HREF="r10595.htm"
    467 ><CODE
    468 CLASS="CONSTANT"
    469 >VIDIOC_S_FBUF</CODE
    470 ></A
    471 >. The
    472 window can extend the frame buffer width and height, the
    473 <CODE
    474 CLASS="STRUCTFIELD"
    475 >x</CODE
    476 > and <CODE
    477 CLASS="STRUCTFIELD"
    478 >y</CODE
    479 >
    480 coordinates can be negative, and it can lie completely outside the
    481 frame buffer. The driver clips the window accordingly, or if that is
    482 not possible, modifies its size and/or position.</TD
    483 ></TR
    484 ><TR
    485 ><TD
    486 >enum&nbsp;<A
    487 HREF="x6386.htm#V4L2-FIELD"
    488 >v4l2_field</A
    489 ></TD
    490 ><TD
    491 ><CODE
    492 CLASS="STRUCTFIELD"
    493 >field</CODE
    494 ></TD
    495 ><TD
    496 >Applications set this field to determine which
    497 video field shall be overlaid, typically one of
    498 <CODE
    499 CLASS="CONSTANT"
    500 >V4L2_FIELD_ANY</CODE
    501 > (0),
    502 <CODE
    503 CLASS="CONSTANT"
    504 >V4L2_FIELD_TOP</CODE
    505 >,
    506 <CODE
    507 CLASS="CONSTANT"
    508 >V4L2_FIELD_BOTTOM</CODE
    509 > or
    510 <CODE
    511 CLASS="CONSTANT"
    512 >V4L2_FIELD_INTERLACED</CODE
    513 >. Drivers may have to choose
    514 a different field order and return the actual setting here.</TD
    515 ></TR
    516 ><TR
    517 ><TD
    518 >__u32</TD
    519 ><TD
    520 ><CODE
    521 CLASS="STRUCTFIELD"
    522 >chromakey</CODE
    523 ></TD
    524 ><TD
    525 >When chroma-keying has been negotiated with
    526 <A
    527 HREF="r10595.htm"
    528 ><CODE
    529 CLASS="CONSTANT"
    530 >VIDIOC_S_FBUF</CODE
    531 ></A
    532 > applications set this field to the desired pixel value
    533 for the chroma key. The format is the same as the pixel format of the
    534 framebuffer (struct&nbsp;<A
    535 HREF="r10595.htm#V4L2-FRAMEBUFFER"
    536 >v4l2_framebuffer</A
    537 >
    538 <CODE
    539 CLASS="STRUCTFIELD"
    540 >fmt.pixelformat</CODE
    541 > field), with bytes in host
    542 order. E.&nbsp;g. for <A
    543 HREF="r2492.htm#V4L2-PIX-FMT-BGR32"
    544 ><CODE
    545 CLASS="CONSTANT"
    546 >V4L2_PIX_FMT_BGR24</CODE
    547 ></A
    548 >
    549 the value should be 0xRRGGBB on a little endian, 0xBBGGRR on a big
    550 endian host.</TD
    551 ></TR
    552 ><TR
    553 ><TD
    554 >struct&nbsp;<A
    555 HREF="x6570.htm#V4L2-CLIP"
    556 >v4l2_clip</A
    557 > *</TD
    558 ><TD
    559 ><CODE
    560 CLASS="STRUCTFIELD"
    561 >clips</CODE
    562 ></TD
    563 ><TD
    564 >When chroma-keying has <SPAN
    565 CLASS="emphasis"
    566 ><I
    567 CLASS="EMPHASIS"
    568 >not</I
    569 ></SPAN
    570 >
    571 been negotiated and <A
    572 HREF="r10595.htm"
    573 ><CODE
    574 CLASS="CONSTANT"
    575 >VIDIOC_G_FBUF</CODE
    576 ></A
    577 > indicated this capability,
    578 applications can set this field to point to an array of
    579 clipping rectangles.</TD
    580 ></TR
    581 ><TR
    582 ><TD
    583 COLSPAN="3"
    584 >Like the window coordinates
    585 <CODE
    586 CLASS="STRUCTFIELD"
    587 >w</CODE
    588 >, clipping rectangles are defined relative
    589 to the top, left corner of the frame buffer. However clipping
    590 rectangles must not extend the frame buffer width and height, and they
    591 must not overlap. If possible applications should merge adjacent
    592 rectangles. Whether this must create x-y or y-x bands, or the order of
    593 rectangles, is not defined. When clip lists are not supported the
    594 driver ignores this field. Its contents after calling <A
    595 HREF="r10944.htm"
    596 ><CODE
    597 CLASS="CONSTANT"
    598 >VIDIOC_S_FMT</CODE
    599 ></A
    600 >
    601 are undefined.</TD
    602 ></TR
    603 ><TR
    604 ><TD
    605 >__u32</TD
    606 ><TD
    607 ><CODE
    608 CLASS="STRUCTFIELD"
    609 >clipcount</CODE
    610 ></TD
    611 ><TD
    612 >When the application set the
    613 <CODE
    614 CLASS="STRUCTFIELD"
    615 >clips</CODE
    616 > field, this field must contain the
    617 number of clipping rectangles in the list. When clip lists are not
    618 supported the driver ignores this field, its contents after calling
    619 <CODE
    620 CLASS="CONSTANT"
    621 >VIDIOC_S_FMT</CODE
    622 > are undefined. When clip lists are
    623 supported but no clipping is desired this field must be set to
    624 zero.</TD
    625 ></TR
    626 ><TR
    627 ><TD
    628 >void *</TD
    629 ><TD
    630 ><CODE
    631 CLASS="STRUCTFIELD"
    632 >bitmap</CODE
    633 ></TD
    634 ><TD
    635 >When chroma-keying has
    636 <SPAN
    637 CLASS="emphasis"
    638 ><I
    639 CLASS="EMPHASIS"
    640 >not</I
    641 ></SPAN
    642 > been negotiated and <A
    643 HREF="r10595.htm"
    644 ><CODE
    645 CLASS="CONSTANT"
    646 >VIDIOC_G_FBUF</CODE
    647 ></A
    648 > indicated
    649 this capability, applications can set this field to point to a
    650 clipping bit mask.</TD
    651 ></TR
    652 ><TR
    653 ><TD
    654 COLSPAN="3"
    655 ><P
    656 >It must be of the same size
    657 as the window, <CODE
    658 CLASS="STRUCTFIELD"
    659 >w.width</CODE
    660 > and
    661 <CODE
    662 CLASS="STRUCTFIELD"
    663 >w.height</CODE
    664 >. Each bit corresponds to a pixel
    665 in the overlaid image, which is displayed only when the bit is
    666 <SPAN
    667 CLASS="emphasis"
    668 ><I
    669 CLASS="EMPHASIS"
    670 >set</I
    671 ></SPAN
    672 >. Pixel coordinates translate to bits like:
    673 <PRE
    674 CLASS="PROGRAMLISTING"
    675 >((__u8 *) <CODE
    676 CLASS="STRUCTFIELD"
    677 >bitmap</CODE
    678 >)[<CODE
    679 CLASS="STRUCTFIELD"
    680 >w.width</CODE
    681 > * y + x / 8] &amp; (1 &lt;&lt; (x &amp; 7))</PRE
    682 ></P
    683 ><P
    684 >where <CODE
    685 CLASS="STRUCTFIELD"
    686 >0</CODE
    687 > &le; x &lt;
    688 <CODE
    689 CLASS="STRUCTFIELD"
    690 >w.width</CODE
    691 > and <CODE
    692 CLASS="STRUCTFIELD"
    693 >0</CODE
    694 > &le;
    695 y &lt;<CODE
    696 CLASS="STRUCTFIELD"
    697 >w.height</CODE
    698 >.<SUP
    699 >a</SUP
    700 ></P
    701 ><P
    702 >When a clipping
    703 bit mask is not supported the driver ignores this field, its contents
    704 after calling <A
    705 HREF="r10944.htm"
    706 ><CODE
    707 CLASS="CONSTANT"
    708 >VIDIOC_S_FMT</CODE
    709 ></A
    710 > are undefined. When a bit mask is supported
    711 but no clipping is desired this field must be set to
    712 <CODE
    713 CLASS="CONSTANT"
    714 >NULL</CODE
    715 >.</P
    716 ><P
    717 >Applications need not create a
    718 clip list or bit mask. When they pass both, or despite negotiating
    719 chroma-keying, the results are undefined. Regardless of the chosen
    720 method, the clipping abilities of the hardware may be limited in
    721 quantity or quality. The results when these limits are exceeded are
    722 undefined.<SUP
    723 >b</SUP
    724 ></P
    725 ></TD
    726 ></TR
    727 ><TR
    728 ><TD
    729 >__u8</TD
    730 ><TD
    731 ><CODE
    732 CLASS="STRUCTFIELD"
    733 >global_alpha</CODE
    734 ></TD
    735 ><TD
    736 ><P
    737 >The global alpha value used to blend the
    738 framebuffer with video images, if global alpha blending has been
    739 negotiated (<CODE
    740 CLASS="CONSTANT"
    741 >V4L2_FBUF_FLAG_GLOBAL_ALPHA</CODE
    742 >, see
    743 <A
    744 HREF="r10595.htm"
    745 ><CODE
    746 CLASS="CONSTANT"
    747 >VIDIOC_S_FBUF</CODE
    748 ></A
    749 >, <A
    750 HREF="r10595.htm#FRAMEBUFFER-FLAGS"
    751 >Table 3</A
    752 >).</P
    753 ><P
    754 >Note
    755 this field was added in Linux 2.6.23, extending the structure. However
    756 the <A
    757 HREF="r10944.htm"
    758 >VIDIOC_G/S/TRY_FMT</A
    759 > ioctls,
    760 which take a pointer to a <A
    761 HREF="r10944.htm#V4L2-FORMAT"
    762 >v4l2_format</A
    763 > parent structure with padding
    764 bytes at the end, are not affected.</P
    765 ></TD
    766 ></TR
    767 ></TBODY
    768 ><TR
    769 ><TD
    770 COLSPAN="3"
    771 >Notes:<BR><A
    772 NAME="FTN.AEN6750"
    773 >a. </A
    774 >Should we require
    775               <CODE
    776 CLASS="STRUCTFIELD"
    777 >w.width</CODE
    778 > to be a multiple of
    779               eight?<BR><A
    780 NAME="FTN.AEN6758"
    781 >b. </A
    782 >When the image is written into frame buffer
    783 memory it will be undesirable if the driver clips out less pixels
    784 than expected, because the application and graphics system are not
    785 aware these regions need to be refreshed. The driver should clip out
    786 more pixels or not write the image at all.<BR></TD
    787 ></TR
    788 ></TABLE
    789 ></DIV
    790 ><DIV
    791 CLASS="TABLE"
    792 ><A
    793 NAME="V4L2-CLIP"
    794 ></A
    795 ><P
    796 ><B
    797 >Table 4-2. struct <CODE
    798 CLASS="STRUCTNAME"
    799 >v4l2_clip</CODE
    800 ><A
    801 NAME="AEN6776"
    802 HREF="x6570.htm#FTN.AEN6776"
    803 ><SPAN
    804 CLASS="footnote"
    805 >[2]</SPAN
    806 ></A
    807 ></B
    808 ></P
    809 ><TABLE
    810 BORDER="0"
    811 FRAME="void"
    812 WIDTH="100%"
    813 CLASS="CALSTABLE"
    814 ><COL
    815 WIDTH="25%"
    816 TITLE="C1"><COL
    817 WIDTH="25%"
    818 TITLE="C2"><COL
    819 WIDTH="50%"
    820 TITLE="C3"><TBODY
    821 VALIGN="TOP"
    822 ><TR
    823 ><TD
    824 >struct&nbsp;<A
    825 HREF="x6570.htm#V4L2-RECT"
    826 >v4l2_rect</A
    827 ></TD
    828 ><TD
    829 ><CODE
    830 CLASS="STRUCTFIELD"
    831 >c</CODE
    832 ></TD
    833 ><TD
    834 >Coordinates of the clipping rectangle, relative to
    835 the top, left corner of the frame buffer. Only window pixels
    836 <SPAN
    837 CLASS="emphasis"
    838 ><I
    839 CLASS="EMPHASIS"
    840 >outside</I
    841 ></SPAN
    842 > all clipping rectangles are
    843 displayed.</TD
    844 ></TR
    845 ><TR
    846 ><TD
    847 >struct&nbsp;<A
    848 HREF="x6570.htm#V4L2-CLIP"
    849 >v4l2_clip</A
    850 > *</TD
    851 ><TD
    852 ><CODE
    853 CLASS="STRUCTFIELD"
    854 >next</CODE
    855 ></TD
    856 ><TD
    857 >Pointer to the next clipping rectangle, NULL when
    858 this is the last rectangle. Drivers ignore this field, it cannot be
    859 used to pass a linked list of clipping rectangles.</TD
    860 ></TR
    861 ></TBODY
    862 ></TABLE
    863 ></DIV
    864 ><DIV
    865 CLASS="TABLE"
    866 ><A
    867 NAME="V4L2-RECT"
    868 ></A
    869 ><P
    870 ><B
    871 >Table 4-3. struct <CODE
    872 CLASS="STRUCTNAME"
    873 >v4l2_rect</CODE
    874 ></B
    875 ></P
    876 ><TABLE
    877 BORDER="0"
    878 FRAME="void"
    879 WIDTH="100%"
    880 CLASS="CALSTABLE"
    881 ><COL
    882 WIDTH="25%"
    883 TITLE="C1"><COL
    884 WIDTH="25%"
    885 TITLE="C2"><COL
    886 WIDTH="50%"
    887 TITLE="C3"><TBODY
    888 VALIGN="TOP"
    889 ><TR
    890 ><TD
    891 >__s32</TD
    892 ><TD
    893 ><CODE
    894 CLASS="STRUCTFIELD"
    895 >left</CODE
    896 ></TD
    897 ><TD
    898 >Horizontal offset of the top, left corner of the
    899 rectangle, in pixels.</TD
    900 ></TR
    901 ><TR
    902 ><TD
    903 >__s32</TD
    904 ><TD
    905 ><CODE
    906 CLASS="STRUCTFIELD"
    907 >top</CODE
    908 ></TD
    909 ><TD
    910 >Vertical offset of the top, left corner of the
    911 rectangle, in pixels. Offsets increase to the right and down.</TD
    912 ></TR
    913 ><TR
    914 ><TD
    915 >__s32</TD
    916 ><TD
    917 ><CODE
    918 CLASS="STRUCTFIELD"
    919 >width</CODE
    920 ></TD
    921 ><TD
    922 >Width of the rectangle, in pixels.</TD
    923 ></TR
    924 ><TR
    925 ><TD
    926 >__s32</TD
    927 ><TD
    928 ><CODE
    929 CLASS="STRUCTFIELD"
    930 >height</CODE
    931 ></TD
    932 ><TD
    933 >Height of the rectangle, in pixels. Width and
    934 height cannot be negative, the fields are signed for hysterical
    935 reasons. </TD
    936 ></TR
    937 ></TBODY
    938 ></TABLE
    939 ></DIV
    940 ></DIV
    941 ><DIV
    942 CLASS="SECTION"
    943 ><H2
    944 CLASS="SECTION"
    945 ><A
    946 NAME="AEN6826"
    947 >4.2.5. Enabling Overlay</A
    948 ></H2
    949 ><P
    950 >To start or stop the frame buffer overlay applications call
    951 the <A
    952 HREF="r12816.htm"
    953 ><CODE
    954 CLASS="CONSTANT"
    955 >VIDIOC_OVERLAY</CODE
    956 ></A
    957 > ioctl.</P
    958 ></DIV
    959 ></DIV
    960 ><H3
    961 CLASS="FOOTNOTES"
    962 >Notes</H3
    963 ><TABLE
    964 BORDER="0"
    965 CLASS="FOOTNOTES"
    966 WIDTH="100%"
    967 ><TR
    968 ><TD
    969 ALIGN="LEFT"
    970 VALIGN="TOP"
    971 WIDTH="5%"
    972 ><A
    973 NAME="FTN.AEN6581"
    974 HREF="x6570.htm#AEN6581"
    975 ><SPAN
    976 CLASS="footnote"
    977 >[1]</SPAN
    978 ></A
    979 ></TD
    980 ><TD
    981 ALIGN="LEFT"
    982 VALIGN="TOP"
    983 WIDTH="95%"
    984 ><P
    985 >A common application of two file descriptors is the
    986 XFree86 <A
    987 HREF="x16430.htm#XVIDEO"
    988 >Xv/V4L</A
    989 > interface driver and
    990 a V4L2 application. While the X server controls video overlay, the
    991 application can take advantage of memory mapping and DMA.</P
    992 ><P
    993 >In the opinion of the designers of this API, no driver
    994 writer taking the efforts to support simultaneous capturing and
    995 overlay will restrict this ability by requiring a single file
    996 descriptor, as in V4L and earlier versions of V4L2. Making this
    997 optional means applications depending on two file descriptors need
    998 backup routines to be compatible with all drivers, which is
    999 considerable more work than using two fds in applications which do
   1000 not. Also two fd's fit the general concept of one file descriptor for
   1001 each logical stream. Hence as a complexity trade-off drivers
   1002 <SPAN
   1003 CLASS="emphasis"
   1004 ><I
   1005 CLASS="EMPHASIS"
   1006 >must</I
   1007 ></SPAN
   1008 > support two file descriptors and
   1009 <SPAN
   1010 CLASS="emphasis"
   1011 ><I
   1012 CLASS="EMPHASIS"
   1013 >may</I
   1014 ></SPAN
   1015 > support single fd operation.</P
   1016 ></TD
   1017 ></TR
   1018 ><TR
   1019 ><TD
   1020 ALIGN="LEFT"
   1021 VALIGN="TOP"
   1022 WIDTH="5%"
   1023 ><A
   1024 NAME="FTN.AEN6776"
   1025 HREF="x6570.htm#AEN6776"
   1026 ><SPAN
   1027 CLASS="footnote"
   1028 >[2]</SPAN
   1029 ></A
   1030 ></TD
   1031 ><TD
   1032 ALIGN="LEFT"
   1033 VALIGN="TOP"
   1034 WIDTH="95%"
   1035 ><P
   1036 >The X Window system defines "regions" which are
   1037 vectors of struct BoxRec { short x1, y1, x2, y2; } with width = x2 -
   1038 x1 and height = y2 - y1, so one cannot pass X11 clip lists
   1039 directly.</P
   1040 ></TD
   1041 ></TR
   1042 ></TABLE
   1043 ><DIV
   1044 CLASS="NAVFOOTER"
   1045 ><HR
   1046 ALIGN="LEFT"
   1047 WIDTH="100%"><TABLE
   1048 SUMMARY="Footer navigation table"
   1049 WIDTH="100%"
   1050 BORDER="0"
   1051 CELLPADDING="0"
   1052 CELLSPACING="0"
   1053 ><TR
   1054 ><TD
   1055 WIDTH="33%"
   1056 ALIGN="left"
   1057 VALIGN="top"
   1058 ><A
   1059 HREF="c6488.htm"
   1060 ACCESSKEY="P"
   1061 >Prev</A
   1062 ></TD
   1063 ><TD
   1064 WIDTH="34%"
   1065 ALIGN="center"
   1066 VALIGN="top"
   1067 ><A
   1068 HREF="book1.htm"
   1069 ACCESSKEY="H"
   1070 >Home</A
   1071 ></TD
   1072 ><TD
   1073 WIDTH="33%"
   1074 ALIGN="right"
   1075 VALIGN="top"
   1076 ><A
   1077 HREF="x6831.htm"
   1078 ACCESSKEY="N"
   1079 >Next</A
   1080 ></TD
   1081 ></TR
   1082 ><TR
   1083 ><TD
   1084 WIDTH="33%"
   1085 ALIGN="left"
   1086 VALIGN="top"
   1087 >Interfaces</TD
   1088 ><TD
   1089 WIDTH="34%"
   1090 ALIGN="center"
   1091 VALIGN="top"
   1092 ><A
   1093 HREF="c6488.htm"
   1094 ACCESSKEY="U"
   1095 >Up</A
   1096 ></TD
   1097 ><TD
   1098 WIDTH="33%"
   1099 ALIGN="right"
   1100 VALIGN="top"
   1101 >Video Output Interface</TD
   1102 ></TR
   1103 ></TABLE
   1104 ></DIV
   1105 ></BODY
   1106 ></HTML
   1107 >
   1108