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 >ioctl VIDIOC_QUERYCAP</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="Function Reference"
     14 HREF="r7624.htm"><LINK
     15 REL="PREVIOUS"
     16 TITLE="ioctl VIDIOC_QUERYBUF"
     17 HREF="r13022.htm"><LINK
     18 REL="NEXT"
     19 TITLE="ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU"
     20 HREF="r13317.htm"></HEAD
     21 ><BODY
     22 CLASS="REFENTRY"
     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="r13022.htm"
     49 ACCESSKEY="P"
     50 >Prev</A
     51 ></TD
     52 ><TD
     53 WIDTH="80%"
     54 ALIGN="center"
     55 VALIGN="bottom"
     56 ></TD
     57 ><TD
     58 WIDTH="10%"
     59 ALIGN="right"
     60 VALIGN="bottom"
     61 ><A
     62 HREF="r13317.htm"
     63 ACCESSKEY="N"
     64 >Next</A
     65 ></TD
     66 ></TR
     67 ></TABLE
     68 ><HR
     69 ALIGN="LEFT"
     70 WIDTH="100%"></DIV
     71 ><H1
     72 ><A
     73 NAME="VIDIOC-QUERYCAP"
     74 ></A
     75 >ioctl VIDIOC_QUERYCAP</H1
     76 ><DIV
     77 CLASS="REFNAMEDIV"
     78 ><A
     79 NAME="AEN13109"
     80 ></A
     81 ><H2
     82 >Name</H2
     83 >VIDIOC_QUERYCAP&nbsp;--&nbsp;Query device capabilities</DIV
     84 ><DIV
     85 CLASS="REFSYNOPSISDIV"
     86 ><A
     87 NAME="AEN13112"
     88 ></A
     89 ><H2
     90 >Synopsis</H2
     91 ><DIV
     92 CLASS="FUNCSYNOPSIS"
     93 ><P
     94 ></P
     95 ><A
     96 NAME="AEN13113"
     97 ></A
     98 ><P
     99 ><CODE
    100 ><CODE
    101 CLASS="FUNCDEF"
    102 >int ioctl</CODE
    103 >(int fd, int request, struct v4l2_capability *argp);</CODE
    104 ></P
    105 ><P
    106 ></P
    107 ></DIV
    108 ></DIV
    109 ><DIV
    110 CLASS="REFSECT1"
    111 ><A
    112 NAME="AEN13123"
    113 ></A
    114 ><H2
    115 >Arguments</H2
    116 ><P
    117 ></P
    118 ><DIV
    119 CLASS="VARIABLELIST"
    120 ><DL
    121 ><DT
    122 ><CODE
    123 CLASS="PARAMETER"
    124 >fd</CODE
    125 ></DT
    126 ><DD
    127 ><P
    128 >File descriptor returned by <A
    129 HREF="r14090.htm"
    130 ><CODE
    131 CLASS="FUNCTION"
    132 >open()</CODE
    133 ></A
    134 >.</P
    135 ></DD
    136 ><DT
    137 ><CODE
    138 CLASS="PARAMETER"
    139 >request</CODE
    140 ></DT
    141 ><DD
    142 ><P
    143 >VIDIOC_QUERYCAP</P
    144 ></DD
    145 ><DT
    146 ><CODE
    147 CLASS="PARAMETER"
    148 >argp</CODE
    149 ></DT
    150 ><DD
    151 ><P
    152 ></P
    153 ></DD
    154 ></DL
    155 ></DIV
    156 ></DIV
    157 ><DIV
    158 CLASS="REFSECT1"
    159 ><A
    160 NAME="AEN13143"
    161 ></A
    162 ><H2
    163 >Description</H2
    164 ><P
    165 >All V4L2 devices support the
    166 <CODE
    167 CLASS="CONSTANT"
    168 >VIDIOC_QUERYCAP</CODE
    169 > ioctl. It is used to identify
    170 kernel devices compatible with this specification and to obtain
    171 information about driver and hardware capabilities. The ioctl takes a
    172 pointer to a struct&nbsp;<A
    173 HREF="r13105.htm#V4L2-CAPABILITY"
    174 >v4l2_capability</A
    175 > which is filled by the driver. When the
    176 driver is not compatible with this specification the ioctl returns an
    177 <SPAN
    178 CLASS="ERRORCODE"
    179 >EINVAL</SPAN
    180 > error code.</P
    181 ><DIV
    182 CLASS="TABLE"
    183 ><A
    184 NAME="V4L2-CAPABILITY"
    185 ></A
    186 ><P
    187 ><B
    188 >Table 1. struct <CODE
    189 CLASS="STRUCTNAME"
    190 >v4l2_capability</CODE
    191 ></B
    192 ></P
    193 ><TABLE
    194 BORDER="0"
    195 FRAME="void"
    196 WIDTH="100%"
    197 CLASS="CALSTABLE"
    198 ><COL
    199 WIDTH="25%"
    200 TITLE="C1"><COL
    201 WIDTH="25%"
    202 TITLE="C2"><COL
    203 WIDTH="50%"
    204 TITLE="C3"><TBODY
    205 VALIGN="TOP"
    206 ><TR
    207 ><TD
    208 >__u8</TD
    209 ><TD
    210 ><CODE
    211 CLASS="STRUCTFIELD"
    212 >driver</CODE
    213 >[16]</TD
    214 ><TD
    215 ><P
    216 >Name of the driver, a unique NUL-terminated
    217 ASCII string. For example: "bttv". Driver specific applications can
    218 use this information to verify the driver identity. It is also useful
    219 to work around known bugs, or to identify drivers in error reports.
    220 The driver version is stored in the <CODE
    221 CLASS="STRUCTFIELD"
    222 >version</CODE
    223 >
    224 field.</P
    225 ><P
    226 >Storing strings in fixed sized arrays is bad
    227 practice but unavoidable here. Drivers and applications should take
    228 precautions to never read or write beyond the end of the array and to
    229 make sure the strings are properly NUL-terminated.</P
    230 ></TD
    231 ></TR
    232 ><TR
    233 ><TD
    234 >__u8</TD
    235 ><TD
    236 ><CODE
    237 CLASS="STRUCTFIELD"
    238 >card</CODE
    239 >[32]</TD
    240 ><TD
    241 >Name of the device, a NUL-terminated ASCII string.
    242 For example: "Yoyodyne TV/FM". One driver may support different brands
    243 or models of video hardware. This information is intended for users,
    244 for example in a menu of available devices. Since multiple TV cards of
    245 the same brand may be installed which are supported by the same
    246 driver, this name should be combined with the character device file
    247 name (e.&nbsp;g. <TT
    248 CLASS="FILENAME"
    249 >/dev/video2</TT
    250 >) or the
    251 <CODE
    252 CLASS="STRUCTFIELD"
    253 >bus_info</CODE
    254 > string to avoid
    255 ambiguities.</TD
    256 ></TR
    257 ><TR
    258 ><TD
    259 >__u8</TD
    260 ><TD
    261 ><CODE
    262 CLASS="STRUCTFIELD"
    263 >bus_info</CODE
    264 >[32]</TD
    265 ><TD
    266 >Location of the device in the system, a
    267 NUL-terminated ASCII string. For example: "PCI Slot 4". This
    268 information is intended for users, to distinguish multiple
    269 identical devices. If no such information is available the field may
    270 simply count the devices controlled by the driver, or contain the
    271 empty string (<CODE
    272 CLASS="STRUCTFIELD"
    273 >bus_info</CODE
    274 >[0] = 0).</TD
    275 ></TR
    276 ><TR
    277 ><TD
    278 >__u32</TD
    279 ><TD
    280 ><CODE
    281 CLASS="STRUCTFIELD"
    282 >version</CODE
    283 ></TD
    284 ><TD
    285 ><P
    286 >Version number of the driver. Together with
    287 the <CODE
    288 CLASS="STRUCTFIELD"
    289 >driver</CODE
    290 > field this identifies a
    291 particular driver. The version number is formatted using the
    292 <CODE
    293 CLASS="CONSTANT"
    294 >KERNEL_VERSION()</CODE
    295 > macro:</P
    296 ></TD
    297 ></TR
    298 ><TR
    299 ><TD
    300 COLSPAN="3"
    301 ><P
    302 ><PRE
    303 CLASS="PROGRAMLISTING"
    304 >#define KERNEL_VERSION(a,b,c) (((a) &lt;&lt; 16) + ((b) &lt;&lt; 8) + (c))
    305 
    306 __u32 version = KERNEL_VERSION(0, 8, 1);
    307 
    308 printf ("Version: %u.%u.%u\n",
    309         (version &gt;&gt; 16) &amp; 0xFF,
    310         (version &gt;&gt; 8) &amp; 0xFF,
    311          version &amp; 0xFF);</PRE
    312 ></P
    313 ></TD
    314 ></TR
    315 ><TR
    316 ><TD
    317 >__u32</TD
    318 ><TD
    319 ><CODE
    320 CLASS="STRUCTFIELD"
    321 >capabilities</CODE
    322 ></TD
    323 ><TD
    324 >Device capabilities, see <A
    325 HREF="r13105.htm#DEVICE-CAPABILITIES"
    326 >Table 2</A
    327 >.</TD
    328 ></TR
    329 ><TR
    330 ><TD
    331 >__u32</TD
    332 ><TD
    333 ><CODE
    334 CLASS="STRUCTFIELD"
    335 >reserved</CODE
    336 >[4]</TD
    337 ><TD
    338 >Reserved for future extensions. Drivers must set
    339 this array to zero.</TD
    340 ></TR
    341 ></TBODY
    342 ></TABLE
    343 ></DIV
    344 ><DIV
    345 CLASS="TABLE"
    346 ><A
    347 NAME="DEVICE-CAPABILITIES"
    348 ></A
    349 ><P
    350 ><B
    351 >Table 2. Device Capabilities Flags</B
    352 ></P
    353 ><TABLE
    354 BORDER="0"
    355 FRAME="void"
    356 WIDTH="100%"
    357 CLASS="CALSTABLE"
    358 ><COL
    359 WIDTH="38%"
    360 TITLE="C1"><COL
    361 WIDTH="12%"
    362 TITLE="C2"><COL
    363 WIDTH="50%"
    364 TITLE="C3"><TBODY
    365 VALIGN="TOP"
    366 ><TR
    367 ><TD
    368 ><CODE
    369 CLASS="CONSTANT"
    370 >V4L2_CAP_VIDEO_CAPTURE</CODE
    371 ></TD
    372 ><TD
    373 >0x00000001</TD
    374 ><TD
    375 >The device supports the <A
    376 HREF="c6488.htm#CAPTURE"
    377 >Video Capture</A
    378 > interface.</TD
    379 ></TR
    380 ><TR
    381 ><TD
    382 ><CODE
    383 CLASS="CONSTANT"
    384 >V4L2_CAP_VIDEO_OUTPUT</CODE
    385 ></TD
    386 ><TD
    387 >0x00000002</TD
    388 ><TD
    389 >The device supports the <A
    390 HREF="x6831.htm"
    391 >Video Output</A
    392 > interface.</TD
    393 ></TR
    394 ><TR
    395 ><TD
    396 ><CODE
    397 CLASS="CONSTANT"
    398 >V4L2_CAP_VIDEO_OVERLAY</CODE
    399 ></TD
    400 ><TD
    401 >0x00000004</TD
    402 ><TD
    403 >The device supports the <A
    404 HREF="x6570.htm"
    405 >Video Overlay</A
    406 > interface. A video overlay device
    407 typically stores captured images directly in the video memory of a
    408 graphics card, with hardware clipping and scaling.</TD
    409 ></TR
    410 ><TR
    411 ><TD
    412 ><CODE
    413 CLASS="CONSTANT"
    414 >V4L2_CAP_VBI_CAPTURE</CODE
    415 ></TD
    416 ><TD
    417 >0x00000010</TD
    418 ><TD
    419 >The device supports the <A
    420 HREF="x7013.htm"
    421 >Raw
    422 VBI Capture</A
    423 > interface, providing Teletext and Closed Caption
    424 data.</TD
    425 ></TR
    426 ><TR
    427 ><TD
    428 ><CODE
    429 CLASS="CONSTANT"
    430 >V4L2_CAP_VBI_OUTPUT</CODE
    431 ></TD
    432 ><TD
    433 >0x00000020</TD
    434 ><TD
    435 >The device supports the <A
    436 HREF="x7013.htm"
    437 >Raw VBI Output</A
    438 > interface.</TD
    439 ></TR
    440 ><TR
    441 ><TD
    442 ><CODE
    443 CLASS="CONSTANT"
    444 >V4L2_CAP_SLICED_VBI_CAPTURE</CODE
    445 ></TD
    446 ><TD
    447 >0x00000040</TD
    448 ><TD
    449 >The device supports the <A
    450 HREF="x7236.htm"
    451 >Sliced VBI Capture</A
    452 > interface.</TD
    453 ></TR
    454 ><TR
    455 ><TD
    456 ><CODE
    457 CLASS="CONSTANT"
    458 >V4L2_CAP_SLICED_VBI_OUTPUT</CODE
    459 ></TD
    460 ><TD
    461 >0x00000080</TD
    462 ><TD
    463 >The device supports the <A
    464 HREF="x7236.htm"
    465 >Sliced VBI Output</A
    466 > interface.</TD
    467 ></TR
    468 ><TR
    469 ><TD
    470 ><CODE
    471 CLASS="CONSTANT"
    472 >V4L2_CAP_RDS_CAPTURE</CODE
    473 ></TD
    474 ><TD
    475 >0x00000100</TD
    476 ><TD
    477 >[to be defined]</TD
    478 ></TR
    479 ><TR
    480 ><TD
    481 ><CODE
    482 CLASS="CONSTANT"
    483 >V4L2_CAP_VIDEO_OUTPUT_OVERLAY</CODE
    484 ></TD
    485 ><TD
    486 >0x00000200</TD
    487 ><TD
    488 >The device supports the <A
    489 HREF="x6909.htm"
    490 >Video
    491 Output Overlay</A
    492 > (OSD) interface. Unlike the <I
    493 CLASS="WORDASWORD"
    494 >Video
    495 Overlay</I
    496 > interface, this is a secondary function of video
    497 output devices and overlays an image onto an outgoing video signal.
    498 When the driver sets this flag, it must clear the
    499 <CODE
    500 CLASS="CONSTANT"
    501 >V4L2_CAP_VIDEO_OVERLAY</CODE
    502 > flag and vice
    503 versa.<A
    504 NAME="AEN13265"
    505 HREF="r13105.htm#FTN.AEN13265"
    506 ><SPAN
    507 CLASS="footnote"
    508 >[a]</SPAN
    509 ></A
    510 ></TD
    511 ></TR
    512 ><TR
    513 ><TD
    514 ><CODE
    515 CLASS="CONSTANT"
    516 >V4L2_CAP_TUNER</CODE
    517 ></TD
    518 ><TD
    519 >0x00010000</TD
    520 ><TD
    521 >The device has some sort of tuner or modulator to
    522 receive or emit RF-modulated video signals. For more information about
    523 tuner and modulator programming see
    524 <A
    525 HREF="x394.htm"
    526 >Section 1.6</A
    527 >.</TD
    528 ></TR
    529 ><TR
    530 ><TD
    531 ><CODE
    532 CLASS="CONSTANT"
    533 >V4L2_CAP_AUDIO</CODE
    534 ></TD
    535 ><TD
    536 >0x00020000</TD
    537 ><TD
    538 >The device has audio inputs or outputs. It may or
    539 may not support audio recording or playback, in PCM or compressed
    540 formats. PCM audio support must be implemented as ALSA or OSS
    541 interface. For more information on audio inputs and outputs see <A
    542 HREF="x341.htm"
    543 >Section 1.5</A
    544 >.</TD
    545 ></TR
    546 ><TR
    547 ><TD
    548 ><CODE
    549 CLASS="CONSTANT"
    550 >V4L2_CAP_RADIO</CODE
    551 ></TD
    552 ><TD
    553 >0x00040000</TD
    554 ><TD
    555 >This is a radio receiver.</TD
    556 ></TR
    557 ><TR
    558 ><TD
    559 ><CODE
    560 CLASS="CONSTANT"
    561 >V4L2_CAP_READWRITE</CODE
    562 ></TD
    563 ><TD
    564 >0x01000000</TD
    565 ><TD
    566 >The device supports the <A
    567 HREF="c5742.htm#RW"
    568 >read()</A
    569 > and/or <A
    570 HREF="c5742.htm#RW"
    571 >write()</A
    572 >
    573 I/O methods.</TD
    574 ></TR
    575 ><TR
    576 ><TD
    577 ><CODE
    578 CLASS="CONSTANT"
    579 >V4L2_CAP_ASYNCIO</CODE
    580 ></TD
    581 ><TD
    582 >0x02000000</TD
    583 ><TD
    584 >The device supports the <A
    585 HREF="x5950.htm"
    586 >asynchronous</A
    587 > I/O methods.</TD
    588 ></TR
    589 ><TR
    590 ><TD
    591 ><CODE
    592 CLASS="CONSTANT"
    593 >V4L2_CAP_STREAMING</CODE
    594 ></TD
    595 ><TD
    596 >0x04000000</TD
    597 ><TD
    598 >The device supports the <A
    599 HREF="x5791.htm"
    600 >streaming</A
    601 > I/O method.</TD
    602 ></TR
    603 ></TBODY
    604 ><TR
    605 ><TD
    606 COLSPAN="3"
    607 >Notes:<BR><A
    608 NAME="FTN.AEN13265"
    609 >a. </A
    610 >The struct&nbsp;<A
    611 HREF="r10595.htm#V4L2-FRAMEBUFFER"
    612 >v4l2_framebuffer</A
    613 > lacks an
    614 enum&nbsp;<A
    615 HREF="x5953.htm#V4L2-BUF-TYPE"
    616 >v4l2_buf_type</A
    617 > field, therefore the type of overlay is implied by the
    618 driver capabilities.<BR></TD
    619 ></TR
    620 ></TABLE
    621 ></DIV
    622 ></DIV
    623 ><DIV
    624 CLASS="REFSECT1"
    625 ><A
    626 NAME="AEN13305"
    627 ></A
    628 ><H2
    629 >Return Value</H2
    630 ><P
    631 >On success <SPAN
    632 CLASS="RETURNVALUE"
    633 >0</SPAN
    634 > is returned, on error <SPAN
    635 CLASS="RETURNVALUE"
    636 >-1</SPAN
    637 > and the <CODE
    638 CLASS="VARNAME"
    639 >errno</CODE
    640 > variable is set appropriately:</P
    641 ><P
    642 ></P
    643 ><DIV
    644 CLASS="VARIABLELIST"
    645 ><DL
    646 ><DT
    647 ><SPAN
    648 CLASS="ERRORCODE"
    649 >EINVAL</SPAN
    650 ></DT
    651 ><DD
    652 ><P
    653 >The device is not compatible with this
    654 specification.</P
    655 ></DD
    656 ></DL
    657 ></DIV
    658 ></DIV
    659 ><DIV
    660 CLASS="NAVFOOTER"
    661 ><HR
    662 ALIGN="LEFT"
    663 WIDTH="100%"><TABLE
    664 SUMMARY="Footer navigation table"
    665 WIDTH="100%"
    666 BORDER="0"
    667 CELLPADDING="0"
    668 CELLSPACING="0"
    669 ><TR
    670 ><TD
    671 WIDTH="33%"
    672 ALIGN="left"
    673 VALIGN="top"
    674 ><A
    675 HREF="r13022.htm"
    676 ACCESSKEY="P"
    677 >Prev</A
    678 ></TD
    679 ><TD
    680 WIDTH="34%"
    681 ALIGN="center"
    682 VALIGN="top"
    683 ><A
    684 HREF="book1.htm"
    685 ACCESSKEY="H"
    686 >Home</A
    687 ></TD
    688 ><TD
    689 WIDTH="33%"
    690 ALIGN="right"
    691 VALIGN="top"
    692 ><A
    693 HREF="r13317.htm"
    694 ACCESSKEY="N"
    695 >Next</A
    696 ></TD
    697 ></TR
    698 ><TR
    699 ><TD
    700 WIDTH="33%"
    701 ALIGN="left"
    702 VALIGN="top"
    703 >ioctl VIDIOC_QUERYBUF</TD
    704 ><TD
    705 WIDTH="34%"
    706 ALIGN="center"
    707 VALIGN="top"
    708 ><A
    709 HREF="r7624.htm"
    710 ACCESSKEY="U"
    711 >Up</A
    712 ></TD
    713 ><TD
    714 WIDTH="33%"
    715 ALIGN="right"
    716 VALIGN="top"
    717 >ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</TD
    718 ></TR
    719 ></TABLE
    720 ></DIV
    721 ></BODY
    722 ></HTML
    723 >
    724