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_QUERYCTRL, VIDIOC_QUERYMENU</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_QUERYCAP"
     17 HREF="r13105.htm"><LINK
     18 REL="NEXT"
     19 TITLE="ioctl VIDIOC_QUERYSTD"
     20 HREF="r13641.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="r13105.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="r13641.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-QUERYCTRL"
     74 ></A
     75 >ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</H1
     76 ><DIV
     77 CLASS="REFNAMEDIV"
     78 ><A
     79 NAME="AEN13321"
     80 ></A
     81 ><H2
     82 >Name</H2
     83 >VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU&nbsp;--&nbsp;Enumerate controls and menu control items</DIV
     84 ><DIV
     85 CLASS="REFSYNOPSISDIV"
     86 ><A
     87 NAME="AEN13325"
     88 ></A
     89 ><H2
     90 >Synopsis</H2
     91 ><DIV
     92 CLASS="FUNCSYNOPSIS"
     93 ><P
     94 ></P
     95 ><A
     96 NAME="AEN13326"
     97 ></A
     98 ><P
     99 ><CODE
    100 ><CODE
    101 CLASS="FUNCDEF"
    102 >int ioctl</CODE
    103 >(int fd, int request, struct v4l2_queryctrl *argp);</CODE
    104 ></P
    105 ><P
    106 ></P
    107 ></DIV
    108 ><DIV
    109 CLASS="FUNCSYNOPSIS"
    110 ><P
    111 ></P
    112 ><A
    113 NAME="AEN13336"
    114 ></A
    115 ><P
    116 ><CODE
    117 ><CODE
    118 CLASS="FUNCDEF"
    119 >int ioctl</CODE
    120 >(int fd, int request, struct v4l2_querymenu *argp);</CODE
    121 ></P
    122 ><P
    123 ></P
    124 ></DIV
    125 ></DIV
    126 ><DIV
    127 CLASS="REFSECT1"
    128 ><A
    129 NAME="AEN13346"
    130 ></A
    131 ><H2
    132 >Arguments</H2
    133 ><P
    134 ></P
    135 ><DIV
    136 CLASS="VARIABLELIST"
    137 ><DL
    138 ><DT
    139 ><CODE
    140 CLASS="PARAMETER"
    141 >fd</CODE
    142 ></DT
    143 ><DD
    144 ><P
    145 >File descriptor returned by <A
    146 HREF="r14090.htm"
    147 ><CODE
    148 CLASS="FUNCTION"
    149 >open()</CODE
    150 ></A
    151 >.</P
    152 ></DD
    153 ><DT
    154 ><CODE
    155 CLASS="PARAMETER"
    156 >request</CODE
    157 ></DT
    158 ><DD
    159 ><P
    160 >VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</P
    161 ></DD
    162 ><DT
    163 ><CODE
    164 CLASS="PARAMETER"
    165 >argp</CODE
    166 ></DT
    167 ><DD
    168 ><P
    169 ></P
    170 ></DD
    171 ></DL
    172 ></DIV
    173 ></DIV
    174 ><DIV
    175 CLASS="REFSECT1"
    176 ><A
    177 NAME="AEN13366"
    178 ></A
    179 ><H2
    180 >Description</H2
    181 ><P
    182 >To query the attributes of a control applications set the
    183 <CODE
    184 CLASS="STRUCTFIELD"
    185 >id</CODE
    186 > field of a struct&nbsp;<A
    187 HREF="r13317.htm#V4L2-QUERYCTRL"
    188 >v4l2_queryctrl</A
    189 > and call the
    190 <CODE
    191 CLASS="CONSTANT"
    192 >VIDIOC_QUERYCTRL</CODE
    193 > ioctl with a pointer to this
    194 structure. The driver fills the rest of the structure or returns an
    195 <SPAN
    196 CLASS="ERRORCODE"
    197 >EINVAL</SPAN
    198 > error code when the <CODE
    199 CLASS="STRUCTFIELD"
    200 >id</CODE
    201 > is invalid.</P
    202 ><P
    203 >It is possible to enumerate controls by calling
    204 <CODE
    205 CLASS="CONSTANT"
    206 >VIDIOC_QUERYCTRL</CODE
    207 > with successive
    208 <CODE
    209 CLASS="STRUCTFIELD"
    210 >id</CODE
    211 > values starting from
    212 <CODE
    213 CLASS="CONSTANT"
    214 >V4L2_CID_BASE</CODE
    215 > up to and exclusive
    216 <CODE
    217 CLASS="CONSTANT"
    218 >V4L2_CID_BASE_LASTP1</CODE
    219 >. Drivers may return
    220 <SPAN
    221 CLASS="ERRORCODE"
    222 >EINVAL</SPAN
    223 > if a control in this range is not
    224 supported. Further applications can enumerate private controls, which
    225 are not defined in this specification, by starting at
    226 <CODE
    227 CLASS="CONSTANT"
    228 >V4L2_CID_PRIVATE_BASE</CODE
    229 > and incrementing
    230 <CODE
    231 CLASS="STRUCTFIELD"
    232 >id</CODE
    233 > until the driver returns
    234 <SPAN
    235 CLASS="ERRORCODE"
    236 >EINVAL</SPAN
    237 >.</P
    238 ><P
    239 >In both cases, when the driver sets the
    240 <CODE
    241 CLASS="CONSTANT"
    242 >V4L2_CTRL_FLAG_DISABLED</CODE
    243 > flag in the
    244 <CODE
    245 CLASS="STRUCTFIELD"
    246 >flags</CODE
    247 > field this control is permanently
    248 disabled and should be ignored by the application.<A
    249 NAME="AEN13386"
    250 HREF="r13317.htm#FTN.AEN13386"
    251 ><SPAN
    252 CLASS="footnote"
    253 >[1]</SPAN
    254 ></A
    255 ></P
    256 ><P
    257 >When the application ORs <CODE
    258 CLASS="STRUCTFIELD"
    259 >id</CODE
    260 > with
    261 <CODE
    262 CLASS="CONSTANT"
    263 >V4L2_CTRL_FLAG_NEXT_CTRL</CODE
    264 > the driver returns the
    265 next supported control, or <SPAN
    266 CLASS="ERRORCODE"
    267 >EINVAL</SPAN
    268 > if there is
    269 none. Drivers which do not support this flag yet always return
    270 <SPAN
    271 CLASS="ERRORCODE"
    272 >EINVAL</SPAN
    273 >.</P
    274 ><P
    275 >Additional information is required for menu controls, the
    276 name of menu items. To query them applications set the
    277 <CODE
    278 CLASS="STRUCTFIELD"
    279 >id</CODE
    280 > and <CODE
    281 CLASS="STRUCTFIELD"
    282 >index</CODE
    283 >
    284 fields of struct&nbsp;<A
    285 HREF="r13317.htm#V4L2-QUERYMENU"
    286 >v4l2_querymenu</A
    287 > and call the
    288 <CODE
    289 CLASS="CONSTANT"
    290 >VIDIOC_QUERYMENU</CODE
    291 > ioctl with a pointer to this
    292 structure. The driver fills the rest of the structure or returns an
    293 <SPAN
    294 CLASS="ERRORCODE"
    295 >EINVAL</SPAN
    296 > error code when the <CODE
    297 CLASS="STRUCTFIELD"
    298 >id</CODE
    299 > or
    300 <CODE
    301 CLASS="STRUCTFIELD"
    302 >index</CODE
    303 > is invalid. Menu items are enumerated
    304 by calling <CODE
    305 CLASS="CONSTANT"
    306 >VIDIOC_QUERYMENU</CODE
    307 > with successive
    308 <CODE
    309 CLASS="STRUCTFIELD"
    310 >index</CODE
    311 > values from struct&nbsp;<A
    312 HREF="r13317.htm#V4L2-QUERYCTRL"
    313 >v4l2_queryctrl</A
    314 >
    315 <CODE
    316 CLASS="STRUCTFIELD"
    317 >minimum</CODE
    318 > (0) to
    319 <CODE
    320 CLASS="STRUCTFIELD"
    321 >maximum</CODE
    322 >, inclusive.</P
    323 ><P
    324 >See also the examples in <A
    325 HREF="x542.htm"
    326 >Section 1.8</A
    327 >.</P
    328 ><DIV
    329 CLASS="TABLE"
    330 ><A
    331 NAME="V4L2-QUERYCTRL"
    332 ></A
    333 ><P
    334 ><B
    335 >Table 1. struct <CODE
    336 CLASS="STRUCTNAME"
    337 >v4l2_queryctrl</CODE
    338 ></B
    339 ></P
    340 ><TABLE
    341 BORDER="0"
    342 FRAME="void"
    343 WIDTH="100%"
    344 CLASS="CALSTABLE"
    345 ><COL
    346 WIDTH="25%"
    347 TITLE="C1"><COL
    348 WIDTH="25%"
    349 TITLE="C2"><COL
    350 WIDTH="50%"
    351 TITLE="C3"><TBODY
    352 VALIGN="TOP"
    353 ><TR
    354 ><TD
    355 >__u32</TD
    356 ><TD
    357 ><CODE
    358 CLASS="STRUCTFIELD"
    359 >id</CODE
    360 ></TD
    361 ><TD
    362 >Identifies the control, set by the application. See
    363 <A
    364 HREF="x542.htm#CONTROL-ID"
    365 >Table 1-1</A
    366 > for predefined IDs. When the ID is ORed
    367 with V4L2_CTRL_FLAG_NEXT_CTRL the driver clears the flag and returns
    368 the first control with a higher ID. Drivers which do not support this
    369 flag yet always return an <SPAN
    370 CLASS="ERRORCODE"
    371 >EINVAL</SPAN
    372 > error code.</TD
    373 ></TR
    374 ><TR
    375 ><TD
    376 >enum&nbsp;<A
    377 HREF="r13317.htm#V4L2-CTRL-TYPE"
    378 >v4l2_ctrl_type</A
    379 ></TD
    380 ><TD
    381 ><CODE
    382 CLASS="STRUCTFIELD"
    383 >type</CODE
    384 ></TD
    385 ><TD
    386 >Type of control, see <A
    387 HREF="r13317.htm#V4L2-CTRL-TYPE"
    388 >Table 3</A
    389 >.</TD
    390 ></TR
    391 ><TR
    392 ><TD
    393 >__u8</TD
    394 ><TD
    395 ><CODE
    396 CLASS="STRUCTFIELD"
    397 >name</CODE
    398 >[32]</TD
    399 ><TD
    400 >Name of the control, a NUL-terminated ASCII
    401 string. This information is intended for the user.</TD
    402 ></TR
    403 ><TR
    404 ><TD
    405 >__s32</TD
    406 ><TD
    407 ><CODE
    408 CLASS="STRUCTFIELD"
    409 >minimum</CODE
    410 ></TD
    411 ><TD
    412 >Minimum value, inclusive. This field gives a lower
    413 bound for <CODE
    414 CLASS="CONSTANT"
    415 >V4L2_CTRL_TYPE_INTEGER</CODE
    416 > controls. It may
    417 not be valid for any other type of control, including
    418 <CODE
    419 CLASS="CONSTANT"
    420 >V4L2_CTRL_TYPE_INTEGER64</CODE
    421 > controls. Note this is a
    422 signed value.</TD
    423 ></TR
    424 ><TR
    425 ><TD
    426 >__s32</TD
    427 ><TD
    428 ><CODE
    429 CLASS="STRUCTFIELD"
    430 >maximum</CODE
    431 ></TD
    432 ><TD
    433 >Maximum value, inclusive. This field gives an upper
    434 bound for <CODE
    435 CLASS="CONSTANT"
    436 >V4L2_CTRL_TYPE_INTEGER</CODE
    437 > controls and the
    438 highest valid index for <CODE
    439 CLASS="CONSTANT"
    440 >V4L2_CTRL_TYPE_MENU</CODE
    441 >
    442 controls. It may not be valid for any other type of control, including
    443 <CODE
    444 CLASS="CONSTANT"
    445 >V4L2_CTRL_TYPE_INTEGER64</CODE
    446 > controls. Note this is a
    447 signed value.</TD
    448 ></TR
    449 ><TR
    450 ><TD
    451 >__s32</TD
    452 ><TD
    453 ><CODE
    454 CLASS="STRUCTFIELD"
    455 >step</CODE
    456 ></TD
    457 ><TD
    458 ><P
    459 >This field gives a step size for
    460 <CODE
    461 CLASS="CONSTANT"
    462 >V4L2_CTRL_TYPE_INTEGER</CODE
    463 > controls. It may not be
    464 valid for any other type of control, including
    465 <CODE
    466 CLASS="CONSTANT"
    467 >V4L2_CTRL_TYPE_INTEGER64</CODE
    468 >
    469 controls.</P
    470 ><P
    471 >Generally drivers should not scale hardware
    472 control values. It may be necessary for example when the
    473 <CODE
    474 CLASS="STRUCTFIELD"
    475 >name</CODE
    476 > or <CODE
    477 CLASS="STRUCTFIELD"
    478 >id</CODE
    479 > imply
    480 a particular unit and the hardware actually accepts only multiples of
    481 said unit. If so, drivers must take care values are properly rounded
    482 when scaling, such that errors will not accumulate on repeated
    483 read-write cycles.</P
    484 ><P
    485 >This field gives the smallest change of
    486 an integer control actually affecting hardware. Often the information
    487 is needed when the user can change controls by keyboard or GUI
    488 buttons, rather than a slider. When for example a hardware register
    489 accepts values 0-511 and the driver reports 0-65535, step should be
    490 128.</P
    491 ><P
    492 >Note although signed, the step value is supposed to
    493 be always positive.</P
    494 ></TD
    495 ></TR
    496 ><TR
    497 ><TD
    498 >__s32</TD
    499 ><TD
    500 ><CODE
    501 CLASS="STRUCTFIELD"
    502 >default_value</CODE
    503 ></TD
    504 ><TD
    505 >The default value of a
    506 <CODE
    507 CLASS="CONSTANT"
    508 >V4L2_CTRL_TYPE_INTEGER</CODE
    509 >,
    510 <CODE
    511 CLASS="CONSTANT"
    512 >_BOOLEAN</CODE
    513 > or <CODE
    514 CLASS="CONSTANT"
    515 >_MENU</CODE
    516 > control.
    517 Not valid for other types of controls. Drivers reset controls only
    518 when the driver is loaded, not later, in particular not when the
    519 func-open; is called.</TD
    520 ></TR
    521 ><TR
    522 ><TD
    523 >__u32</TD
    524 ><TD
    525 ><CODE
    526 CLASS="STRUCTFIELD"
    527 >flags</CODE
    528 ></TD
    529 ><TD
    530 >Control flags, see <A
    531 HREF="r13317.htm#CONTROL-FLAGS"
    532 >Table 4</A
    533 >.</TD
    534 ></TR
    535 ><TR
    536 ><TD
    537 >__u32</TD
    538 ><TD
    539 ><CODE
    540 CLASS="STRUCTFIELD"
    541 >reserved</CODE
    542 >[2]</TD
    543 ><TD
    544 >Reserved for future extensions. Drivers must set
    545 the array to zero.</TD
    546 ></TR
    547 ></TBODY
    548 ></TABLE
    549 ></DIV
    550 ><DIV
    551 CLASS="TABLE"
    552 ><A
    553 NAME="V4L2-QUERYMENU"
    554 ></A
    555 ><P
    556 ><B
    557 >Table 2. struct <CODE
    558 CLASS="STRUCTNAME"
    559 >v4l2_querymenu</CODE
    560 ></B
    561 ></P
    562 ><TABLE
    563 BORDER="0"
    564 FRAME="void"
    565 WIDTH="100%"
    566 CLASS="CALSTABLE"
    567 ><COL
    568 WIDTH="25%"
    569 TITLE="C1"><COL
    570 WIDTH="25%"
    571 TITLE="C2"><COL
    572 WIDTH="50%"
    573 TITLE="C3"><TBODY
    574 VALIGN="TOP"
    575 ><TR
    576 ><TD
    577 >__u32</TD
    578 ><TD
    579 ><CODE
    580 CLASS="STRUCTFIELD"
    581 >id</CODE
    582 ></TD
    583 ><TD
    584 >Identifies the control, set by the application
    585 from the respective struct&nbsp;<A
    586 HREF="r13317.htm#V4L2-QUERYCTRL"
    587 >v4l2_queryctrl</A
    588 >
    589 <CODE
    590 CLASS="STRUCTFIELD"
    591 >id</CODE
    592 >.</TD
    593 ></TR
    594 ><TR
    595 ><TD
    596 >__u32</TD
    597 ><TD
    598 ><CODE
    599 CLASS="STRUCTFIELD"
    600 >index</CODE
    601 ></TD
    602 ><TD
    603 >Index of the menu item, starting at zero, set by
    604             the application.</TD
    605 ></TR
    606 ><TR
    607 ><TD
    608 >__u8</TD
    609 ><TD
    610 ><CODE
    611 CLASS="STRUCTFIELD"
    612 >name</CODE
    613 >[32]</TD
    614 ><TD
    615 >Name of the menu item, a NUL-terminated ASCII
    616 string. This information is intended for the user.</TD
    617 ></TR
    618 ><TR
    619 ><TD
    620 >__u32</TD
    621 ><TD
    622 ><CODE
    623 CLASS="STRUCTFIELD"
    624 >reserved</CODE
    625 ></TD
    626 ><TD
    627 >Reserved for future extensions. Drivers must set
    628 the array to zero.</TD
    629 ></TR
    630 ></TBODY
    631 ></TABLE
    632 ></DIV
    633 ><DIV
    634 CLASS="TABLE"
    635 ><A
    636 NAME="V4L2-CTRL-TYPE"
    637 ></A
    638 ><P
    639 ><B
    640 >Table 3. enum v4l2_ctrl_type</B
    641 ></P
    642 ><TABLE
    643 BORDER="0"
    644 FRAME="void"
    645 WIDTH="100%"
    646 CLASS="CALSTABLE"
    647 ><COL
    648 WIDTH="30%"><COL
    649 WIDTH="5%"
    650 ALIGN="CENTER"><COL
    651 WIDTH="5%"
    652 ALIGN="CENTER"><COL
    653 WIDTH="5%"
    654 ALIGN="CENTER"><COL
    655 WIDTH="55%"><THEAD
    656 ><TR
    657 ><TH
    658 >Type</TH
    659 ><TH
    660 ><CODE
    661 CLASS="STRUCTFIELD"
    662 >minimum</CODE
    663 ></TH
    664 ><TH
    665 ><CODE
    666 CLASS="STRUCTFIELD"
    667 >step</CODE
    668 ></TH
    669 ><TH
    670 ><CODE
    671 CLASS="STRUCTFIELD"
    672 >maximum</CODE
    673 ></TH
    674 ><TH
    675 >Description</TH
    676 ></TR
    677 ></THEAD
    678 ><TBODY
    679 VALIGN="TOP"
    680 ><TR
    681 ><TD
    682 ><CODE
    683 CLASS="CONSTANT"
    684 >V4L2_CTRL_TYPE_INTEGER</CODE
    685 ></TD
    686 ><TD
    687 >any</TD
    688 ><TD
    689 >any</TD
    690 ><TD
    691 >any</TD
    692 ><TD
    693 >An integer-valued control ranging from minimum to
    694 maximum inclusive. The step value indicates the increment between
    695 values which are actually different on the hardware.</TD
    696 ></TR
    697 ><TR
    698 ><TD
    699 ><CODE
    700 CLASS="CONSTANT"
    701 >V4L2_CTRL_TYPE_BOOLEAN</CODE
    702 ></TD
    703 ><TD
    704 >0</TD
    705 ><TD
    706 >1</TD
    707 ><TD
    708 >1</TD
    709 ><TD
    710 >A boolean-valued control. Zero corresponds to
    711 "disabled", and one means "enabled".</TD
    712 ></TR
    713 ><TR
    714 ><TD
    715 ><CODE
    716 CLASS="CONSTANT"
    717 >V4L2_CTRL_TYPE_MENU</CODE
    718 ></TD
    719 ><TD
    720 >0</TD
    721 ><TD
    722 >1</TD
    723 ><TD
    724 >N-1</TD
    725 ><TD
    726 >The control has a menu of N choices. The names of
    727 the menu items can be enumerated with the
    728 <CODE
    729 CLASS="CONSTANT"
    730 >VIDIOC_QUERYMENU</CODE
    731 > ioctl.</TD
    732 ></TR
    733 ><TR
    734 ><TD
    735 ><CODE
    736 CLASS="CONSTANT"
    737 >V4L2_CTRL_TYPE_BUTTON</CODE
    738 ></TD
    739 ><TD
    740 >0</TD
    741 ><TD
    742 >0</TD
    743 ><TD
    744 >0</TD
    745 ><TD
    746 >A control which performs an action when set.
    747 Drivers must ignore the value passed with
    748 <CODE
    749 CLASS="CONSTANT"
    750 >VIDIOC_S_CTRL</CODE
    751 > and return an <SPAN
    752 CLASS="ERRORCODE"
    753 >EINVAL</SPAN
    754 > error code on a
    755 <CODE
    756 CLASS="CONSTANT"
    757 >VIDIOC_G_CTRL</CODE
    758 > attempt.</TD
    759 ></TR
    760 ><TR
    761 ><TD
    762 ><CODE
    763 CLASS="CONSTANT"
    764 >V4L2_CTRL_TYPE_INTEGER64</CODE
    765 ></TD
    766 ><TD
    767 >n/a</TD
    768 ><TD
    769 >n/a</TD
    770 ><TD
    771 >n/a</TD
    772 ><TD
    773 >A 64-bit integer valued control. Minimum, maximum
    774 and step size cannot be queried.</TD
    775 ></TR
    776 ><TR
    777 ><TD
    778 ><CODE
    779 CLASS="CONSTANT"
    780 >V4L2_CTRL_TYPE_CTRL_CLASS</CODE
    781 ></TD
    782 ><TD
    783 >n/a</TD
    784 ><TD
    785 >n/a</TD
    786 ><TD
    787 >n/a</TD
    788 ><TD
    789 >This is not a control. When
    790 <CODE
    791 CLASS="CONSTANT"
    792 >VIDIOC_QUERYCTRL</CODE
    793 > is called with a control ID
    794 equal to a control class code (see <A
    795 HREF="r10386.htm#CTRL-CLASS"
    796 >Table 3</A
    797 >), the
    798 ioctl returns the name of the control class and this control type.
    799 Older drivers which do not support this feature return an
    800 <SPAN
    801 CLASS="ERRORCODE"
    802 >EINVAL</SPAN
    803 > error code.</TD
    804 ></TR
    805 ></TBODY
    806 ></TABLE
    807 ></DIV
    808 ><DIV
    809 CLASS="TABLE"
    810 ><A
    811 NAME="CONTROL-FLAGS"
    812 ></A
    813 ><P
    814 ><B
    815 >Table 4. Control Flags</B
    816 ></P
    817 ><TABLE
    818 BORDER="0"
    819 FRAME="void"
    820 WIDTH="100%"
    821 CLASS="CALSTABLE"
    822 ><COL
    823 WIDTH="38%"
    824 TITLE="C1"><COL
    825 WIDTH="12%"
    826 TITLE="C2"><COL
    827 WIDTH="50%"
    828 TITLE="C3"><TBODY
    829 VALIGN="TOP"
    830 ><TR
    831 ><TD
    832 ><CODE
    833 CLASS="CONSTANT"
    834 >V4L2_CTRL_FLAG_DISABLED</CODE
    835 ></TD
    836 ><TD
    837 >0x0001</TD
    838 ><TD
    839 >This control is permanently disabled and should be
    840 ignored by the application. Any attempt to change the control will
    841 result in an <SPAN
    842 CLASS="ERRORCODE"
    843 >EINVAL</SPAN
    844 > error code.</TD
    845 ></TR
    846 ><TR
    847 ><TD
    848 ><CODE
    849 CLASS="CONSTANT"
    850 >V4L2_CTRL_FLAG_GRABBED</CODE
    851 ></TD
    852 ><TD
    853 >0x0002</TD
    854 ><TD
    855 >This control is temporarily unchangeable, for
    856 example because another application took over control of the
    857 respective resource. Such controls may be displayed specially in a
    858 user interface. Attempts to change the control may result in an
    859 <SPAN
    860 CLASS="ERRORCODE"
    861 >EBUSY</SPAN
    862 > error code.</TD
    863 ></TR
    864 ><TR
    865 ><TD
    866 ><CODE
    867 CLASS="CONSTANT"
    868 >V4L2_CTRL_FLAG_READ_ONLY</CODE
    869 ></TD
    870 ><TD
    871 >0x0004</TD
    872 ><TD
    873 >This control is permanently readable only. Any
    874 attempt to change the control will result in an <SPAN
    875 CLASS="ERRORCODE"
    876 >EINVAL</SPAN
    877 > error code.</TD
    878 ></TR
    879 ><TR
    880 ><TD
    881 ><CODE
    882 CLASS="CONSTANT"
    883 >V4L2_CTRL_FLAG_UPDATE</CODE
    884 ></TD
    885 ><TD
    886 >0x0008</TD
    887 ><TD
    888 >A hint that changing this control may affect the
    889 value of other controls within the same control class. Applications
    890 should update their user interface accordingly.</TD
    891 ></TR
    892 ><TR
    893 ><TD
    894 ><CODE
    895 CLASS="CONSTANT"
    896 >V4L2_CTRL_FLAG_INACTIVE</CODE
    897 ></TD
    898 ><TD
    899 >0x0010</TD
    900 ><TD
    901 >This control is not applicable to the current
    902 configuration and should be displayed accordingly in a user interface.
    903 For example the flag may be set on a MPEG audio level 2 bitrate
    904 control when MPEG audio encoding level 1 was selected with another
    905 control.</TD
    906 ></TR
    907 ><TR
    908 ><TD
    909 ><CODE
    910 CLASS="CONSTANT"
    911 >V4L2_CTRL_FLAG_SLIDER</CODE
    912 ></TD
    913 ><TD
    914 >0x0020</TD
    915 ><TD
    916 >A hint that this control is best represented as a
    917 slider-like element in a user interface.</TD
    918 ></TR
    919 ></TBODY
    920 ></TABLE
    921 ></DIV
    922 ></DIV
    923 ><DIV
    924 CLASS="REFSECT1"
    925 ><A
    926 NAME="AEN13624"
    927 ></A
    928 ><H2
    929 >Return Value</H2
    930 ><P
    931 >On success <SPAN
    932 CLASS="RETURNVALUE"
    933 >0</SPAN
    934 > is returned, on error <SPAN
    935 CLASS="RETURNVALUE"
    936 >-1</SPAN
    937 > and the <CODE
    938 CLASS="VARNAME"
    939 >errno</CODE
    940 > variable is set appropriately:</P
    941 ><P
    942 ></P
    943 ><DIV
    944 CLASS="VARIABLELIST"
    945 ><DL
    946 ><DT
    947 ><SPAN
    948 CLASS="ERRORCODE"
    949 >EINVAL</SPAN
    950 ></DT
    951 ><DD
    952 ><P
    953 >The struct&nbsp;<A
    954 HREF="r13317.htm#V4L2-QUERYCTRL"
    955 >v4l2_queryctrl</A
    956 > <CODE
    957 CLASS="STRUCTFIELD"
    958 >id</CODE
    959 >
    960 is invalid. The struct&nbsp;<A
    961 HREF="r13317.htm#V4L2-QUERYMENU"
    962 >v4l2_querymenu</A
    963 > <CODE
    964 CLASS="STRUCTFIELD"
    965 >id</CODE
    966 > or
    967 <CODE
    968 CLASS="STRUCTFIELD"
    969 >index</CODE
    970 > is invalid.</P
    971 ></DD
    972 ></DL
    973 ></DIV
    974 ></DIV
    975 ><H2
    976 CLASS="FOOTNOTES"
    977 >Notes</H2
    978 ><TABLE
    979 BORDER="0"
    980 CLASS="FOOTNOTES"
    981 WIDTH="100%"
    982 ><TR
    983 ><TD
    984 ALIGN="LEFT"
    985 VALIGN="TOP"
    986 WIDTH="5%"
    987 ><A
    988 NAME="FTN.AEN13386"
    989 HREF="r13317.htm#AEN13386"
    990 ><SPAN
    991 CLASS="footnote"
    992 >[1]</SPAN
    993 ></A
    994 ></TD
    995 ><TD
    996 ALIGN="LEFT"
    997 VALIGN="TOP"
    998 WIDTH="95%"
    999 ><P
   1000 ><CODE
   1001 CLASS="CONSTANT"
   1002 >V4L2_CTRL_FLAG_DISABLED</CODE
   1003 > was
   1004 intended for two purposes: Drivers can skip predefined controls not
   1005 supported by the hardware (although returning EINVAL would do as
   1006 well), or disable predefined and private controls after hardware
   1007 detection without the trouble of reordering control arrays and indices
   1008 (EINVAL cannot be used to skip private controls because it would
   1009 prematurely end the enumeration).</P
   1010 ></TD
   1011 ></TR
   1012 ></TABLE
   1013 ><DIV
   1014 CLASS="NAVFOOTER"
   1015 ><HR
   1016 ALIGN="LEFT"
   1017 WIDTH="100%"><TABLE
   1018 SUMMARY="Footer navigation table"
   1019 WIDTH="100%"
   1020 BORDER="0"
   1021 CELLPADDING="0"
   1022 CELLSPACING="0"
   1023 ><TR
   1024 ><TD
   1025 WIDTH="33%"
   1026 ALIGN="left"
   1027 VALIGN="top"
   1028 ><A
   1029 HREF="r13105.htm"
   1030 ACCESSKEY="P"
   1031 >Prev</A
   1032 ></TD
   1033 ><TD
   1034 WIDTH="34%"
   1035 ALIGN="center"
   1036 VALIGN="top"
   1037 ><A
   1038 HREF="book1.htm"
   1039 ACCESSKEY="H"
   1040 >Home</A
   1041 ></TD
   1042 ><TD
   1043 WIDTH="33%"
   1044 ALIGN="right"
   1045 VALIGN="top"
   1046 ><A
   1047 HREF="r13641.htm"
   1048 ACCESSKEY="N"
   1049 >Next</A
   1050 ></TD
   1051 ></TR
   1052 ><TR
   1053 ><TD
   1054 WIDTH="33%"
   1055 ALIGN="left"
   1056 VALIGN="top"
   1057 >ioctl VIDIOC_QUERYCAP</TD
   1058 ><TD
   1059 WIDTH="34%"
   1060 ALIGN="center"
   1061 VALIGN="top"
   1062 ><A
   1063 HREF="r7624.htm"
   1064 ACCESSKEY="U"
   1065 >Up</A
   1066 ></TD
   1067 ><TD
   1068 WIDTH="33%"
   1069 ALIGN="right"
   1070 VALIGN="top"
   1071 >ioctl VIDIOC_QUERYSTD</TD
   1072 ></TR
   1073 ></TABLE
   1074 ></DIV
   1075 ></BODY
   1076 ></HTML
   1077 >
   1078