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_G_FREQUENCY, VIDIOC_S_FREQUENCY</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_G_FMT, VIDIOC_S_FMT,
     17 VIDIOC_TRY_FMT"
     18 HREF="r10944.htm"><LINK
     19 REL="NEXT"
     20 TITLE="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"
     21 HREF="r11217.htm"></HEAD
     22 ><BODY
     23 CLASS="REFENTRY"
     24 BGCOLOR="#FFFFFF"
     25 TEXT="#000000"
     26 LINK="#0000FF"
     27 VLINK="#840084"
     28 ALINK="#0000FF"
     29 ><DIV
     30 CLASS="NAVHEADER"
     31 ><TABLE
     32 SUMMARY="Header navigation table"
     33 WIDTH="100%"
     34 BORDER="0"
     35 CELLPADDING="0"
     36 CELLSPACING="0"
     37 ><TR
     38 ><TH
     39 COLSPAN="3"
     40 ALIGN="center"
     41 >Video for Linux Two API Specification: Revision 0.24</TH
     42 ></TR
     43 ><TR
     44 ><TD
     45 WIDTH="10%"
     46 ALIGN="left"
     47 VALIGN="bottom"
     48 ><A
     49 HREF="r10944.htm"
     50 ACCESSKEY="P"
     51 >Prev</A
     52 ></TD
     53 ><TD
     54 WIDTH="80%"
     55 ALIGN="center"
     56 VALIGN="bottom"
     57 ></TD
     58 ><TD
     59 WIDTH="10%"
     60 ALIGN="right"
     61 VALIGN="bottom"
     62 ><A
     63 HREF="r11217.htm"
     64 ACCESSKEY="N"
     65 >Next</A
     66 ></TD
     67 ></TR
     68 ></TABLE
     69 ><HR
     70 ALIGN="LEFT"
     71 WIDTH="100%"></DIV
     72 ><H1
     73 ><A
     74 NAME="VIDIOC-G-FREQUENCY"
     75 ></A
     76 >ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</H1
     77 ><DIV
     78 CLASS="REFNAMEDIV"
     79 ><A
     80 NAME="AEN11098"
     81 ></A
     82 ><H2
     83 >Name</H2
     84 >VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY&nbsp;--&nbsp;Get or set tuner or modulator radio
     85 frequency</DIV
     86 ><DIV
     87 CLASS="REFSYNOPSISDIV"
     88 ><A
     89 NAME="AEN11102"
     90 ></A
     91 ><H2
     92 >Synopsis</H2
     93 ><DIV
     94 CLASS="FUNCSYNOPSIS"
     95 ><P
     96 ></P
     97 ><A
     98 NAME="AEN11103"
     99 ></A
    100 ><P
    101 ><CODE
    102 ><CODE
    103 CLASS="FUNCDEF"
    104 >int ioctl</CODE
    105 >(int fd, int request, struct v4l2_frequency
    106 *argp);</CODE
    107 ></P
    108 ><P
    109 ></P
    110 ></DIV
    111 ><DIV
    112 CLASS="FUNCSYNOPSIS"
    113 ><P
    114 ></P
    115 ><A
    116 NAME="AEN11113"
    117 ></A
    118 ><P
    119 ><CODE
    120 ><CODE
    121 CLASS="FUNCDEF"
    122 >int ioctl</CODE
    123 >(int fd, int request, const struct v4l2_frequency
    124 *argp);</CODE
    125 ></P
    126 ><P
    127 ></P
    128 ></DIV
    129 ></DIV
    130 ><DIV
    131 CLASS="REFSECT1"
    132 ><A
    133 NAME="AEN11123"
    134 ></A
    135 ><H2
    136 >Arguments</H2
    137 ><P
    138 ></P
    139 ><DIV
    140 CLASS="VARIABLELIST"
    141 ><DL
    142 ><DT
    143 ><CODE
    144 CLASS="PARAMETER"
    145 >fd</CODE
    146 ></DT
    147 ><DD
    148 ><P
    149 >File descriptor returned by <A
    150 HREF="r14090.htm"
    151 ><CODE
    152 CLASS="FUNCTION"
    153 >open()</CODE
    154 ></A
    155 >.</P
    156 ></DD
    157 ><DT
    158 ><CODE
    159 CLASS="PARAMETER"
    160 >request</CODE
    161 ></DT
    162 ><DD
    163 ><P
    164 >VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</P
    165 ></DD
    166 ><DT
    167 ><CODE
    168 CLASS="PARAMETER"
    169 >argp</CODE
    170 ></DT
    171 ><DD
    172 ><P
    173 ></P
    174 ></DD
    175 ></DL
    176 ></DIV
    177 ></DIV
    178 ><DIV
    179 CLASS="REFSECT1"
    180 ><A
    181 NAME="AEN11143"
    182 ></A
    183 ><H2
    184 >Description</H2
    185 ><P
    186 >To get the current tuner or modulator radio frequency
    187 applications set the <CODE
    188 CLASS="STRUCTFIELD"
    189 >tuner</CODE
    190 > field of a
    191 struct&nbsp;<A
    192 HREF="r11094.htm#V4L2-FREQUENCY"
    193 >v4l2_frequency</A
    194 > to the respective tuner or modulator number (only
    195 input devices have tuners, only output devices have modulators), zero
    196 out the <CODE
    197 CLASS="STRUCTFIELD"
    198 >reserved</CODE
    199 > array and
    200 call the <CODE
    201 CLASS="CONSTANT"
    202 >VIDIOC_G_FREQUENCY</CODE
    203 > ioctl with a pointer
    204 to this structure. The driver stores the current frequency in the
    205 <CODE
    206 CLASS="STRUCTFIELD"
    207 >frequency</CODE
    208 > field.</P
    209 ><P
    210 >To change the current tuner or modulator radio frequency
    211 applications initialize the <CODE
    212 CLASS="STRUCTFIELD"
    213 >tuner</CODE
    214 >,
    215 <CODE
    216 CLASS="STRUCTFIELD"
    217 >type</CODE
    218 > and
    219 <CODE
    220 CLASS="STRUCTFIELD"
    221 >frequency</CODE
    222 > fields, and the
    223 <CODE
    224 CLASS="STRUCTFIELD"
    225 >reserved</CODE
    226 > array of a struct&nbsp;<A
    227 HREF="r11094.htm#V4L2-FREQUENCY"
    228 >v4l2_frequency</A
    229 > and
    230 call the <CODE
    231 CLASS="CONSTANT"
    232 >VIDIOC_S_FREQUENCY</CODE
    233 > ioctl with a pointer
    234 to this structure. When the requested frequency is not possible the
    235 driver assumes the closest possible value. However
    236 <CODE
    237 CLASS="CONSTANT"
    238 >VIDIOC_S_FREQUENCY</CODE
    239 > is a write-only ioctl, it does
    240 not return the actual new frequency.</P
    241 ><DIV
    242 CLASS="TABLE"
    243 ><A
    244 NAME="V4L2-FREQUENCY"
    245 ></A
    246 ><P
    247 ><B
    248 >Table 1. struct <CODE
    249 CLASS="STRUCTNAME"
    250 >v4l2_frequency</CODE
    251 ></B
    252 ></P
    253 ><TABLE
    254 BORDER="0"
    255 FRAME="void"
    256 WIDTH="100%"
    257 CLASS="CALSTABLE"
    258 ><COL
    259 WIDTH="25%"
    260 TITLE="C1"><COL
    261 WIDTH="25%"
    262 TITLE="C2"><COL
    263 WIDTH="50%"
    264 TITLE="C3"><TBODY
    265 VALIGN="TOP"
    266 ><TR
    267 ><TD
    268 >__u32</TD
    269 ><TD
    270 ><CODE
    271 CLASS="STRUCTFIELD"
    272 >tuner</CODE
    273 ></TD
    274 ><TD
    275 >The tuner or modulator index number. This is the
    276 same value as in the struct&nbsp;<A
    277 HREF="r8936.htm#V4L2-INPUT"
    278 >v4l2_input</A
    279 > <CODE
    280 CLASS="STRUCTFIELD"
    281 >tuner</CODE
    282 >
    283 field and the struct&nbsp;<A
    284 HREF="r12342.htm#V4L2-TUNER"
    285 >v4l2_tuner</A
    286 > <CODE
    287 CLASS="STRUCTFIELD"
    288 >index</CODE
    289 > field, or
    290 the struct&nbsp;<A
    291 HREF="r9149.htm#V4L2-OUTPUT"
    292 >v4l2_output</A
    293 > <CODE
    294 CLASS="STRUCTFIELD"
    295 >modulator</CODE
    296 > field and the
    297 struct&nbsp;<A
    298 HREF="r11430.htm#V4L2-MODULATOR"
    299 >v4l2_modulator</A
    300 > <CODE
    301 CLASS="STRUCTFIELD"
    302 >index</CODE
    303 > field.</TD
    304 ></TR
    305 ><TR
    306 ><TD
    307 >enum&nbsp;<A
    308 HREF="r12342.htm#V4L2-TUNER-TYPE"
    309 >v4l2_tuner_type</A
    310 ></TD
    311 ><TD
    312 ><CODE
    313 CLASS="STRUCTFIELD"
    314 >type</CODE
    315 ></TD
    316 ><TD
    317 >The tuner type. This is the same value as in the
    318 struct&nbsp;<A
    319 HREF="r12342.htm#V4L2-TUNER"
    320 >v4l2_tuner</A
    321 > <CODE
    322 CLASS="STRUCTFIELD"
    323 >type</CODE
    324 > field. The field is not
    325 applicable to modulators, i.&nbsp;e. ignored by drivers.</TD
    326 ></TR
    327 ><TR
    328 ><TD
    329 >__u32</TD
    330 ><TD
    331 ><CODE
    332 CLASS="STRUCTFIELD"
    333 >frequency</CODE
    334 ></TD
    335 ><TD
    336 >Tuning frequency in units of 62.5 kHz, or if the
    337 struct&nbsp;<A
    338 HREF="r12342.htm#V4L2-TUNER"
    339 >v4l2_tuner</A
    340 > or struct&nbsp;<A
    341 HREF="r11430.htm#V4L2-MODULATOR"
    342 >v4l2_modulator</A
    343 > <CODE
    344 CLASS="STRUCTFIELD"
    345 >capabilities</CODE
    346 > flag
    347 <CODE
    348 CLASS="CONSTANT"
    349 >V4L2_TUNER_CAP_LOW</CODE
    350 > is set, in units of 62.5
    351 Hz.</TD
    352 ></TR
    353 ><TR
    354 ><TD
    355 >__u32</TD
    356 ><TD
    357 ><CODE
    358 CLASS="STRUCTFIELD"
    359 >reserved</CODE
    360 >[8];</TD
    361 ><TD
    362 >Reserved for future extensions. Drivers and
    363             applications must set the array to zero.</TD
    364 ></TR
    365 ></TBODY
    366 ></TABLE
    367 ></DIV
    368 ></DIV
    369 ><DIV
    370 CLASS="REFSECT1"
    371 ><A
    372 NAME="AEN11203"
    373 ></A
    374 ><H2
    375 >Return Value</H2
    376 ><P
    377 >On success <SPAN
    378 CLASS="RETURNVALUE"
    379 >0</SPAN
    380 > is returned, on error <SPAN
    381 CLASS="RETURNVALUE"
    382 >-1</SPAN
    383 > and the <CODE
    384 CLASS="VARNAME"
    385 >errno</CODE
    386 > variable is set appropriately:</P
    387 ><P
    388 ></P
    389 ><DIV
    390 CLASS="VARIABLELIST"
    391 ><DL
    392 ><DT
    393 ><SPAN
    394 CLASS="ERRORCODE"
    395 >EINVAL</SPAN
    396 ></DT
    397 ><DD
    398 ><P
    399 >The <CODE
    400 CLASS="STRUCTFIELD"
    401 >tuner</CODE
    402 > index is out of
    403 bounds or the value in the <CODE
    404 CLASS="STRUCTFIELD"
    405 >type</CODE
    406 > field is
    407 wrong.</P
    408 ></DD
    409 ></DL
    410 ></DIV
    411 ></DIV
    412 ><DIV
    413 CLASS="NAVFOOTER"
    414 ><HR
    415 ALIGN="LEFT"
    416 WIDTH="100%"><TABLE
    417 SUMMARY="Footer navigation table"
    418 WIDTH="100%"
    419 BORDER="0"
    420 CELLPADDING="0"
    421 CELLSPACING="0"
    422 ><TR
    423 ><TD
    424 WIDTH="33%"
    425 ALIGN="left"
    426 VALIGN="top"
    427 ><A
    428 HREF="r10944.htm"
    429 ACCESSKEY="P"
    430 >Prev</A
    431 ></TD
    432 ><TD
    433 WIDTH="34%"
    434 ALIGN="center"
    435 VALIGN="top"
    436 ><A
    437 HREF="book1.htm"
    438 ACCESSKEY="H"
    439 >Home</A
    440 ></TD
    441 ><TD
    442 WIDTH="33%"
    443 ALIGN="right"
    444 VALIGN="top"
    445 ><A
    446 HREF="r11217.htm"
    447 ACCESSKEY="N"
    448 >Next</A
    449 ></TD
    450 ></TR
    451 ><TR
    452 ><TD
    453 WIDTH="33%"
    454 ALIGN="left"
    455 VALIGN="top"
    456 >ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
    457 VIDIOC_TRY_FMT</TD
    458 ><TD
    459 WIDTH="34%"
    460 ALIGN="center"
    461 VALIGN="top"
    462 ><A
    463 HREF="r7624.htm"
    464 ACCESSKEY="U"
    465 >Up</A
    466 ></TD
    467 ><TD
    468 WIDTH="33%"
    469 ALIGN="right"
    470 VALIGN="top"
    471 >ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</TD
    472 ></TR
    473 ></TABLE
    474 ></DIV
    475 ></BODY
    476 ></HTML
    477 >
    478