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_MODULATOR, VIDIOC_S_MODULATOR</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_JPEGCOMP, VIDIOC_S_JPEGCOMP"
     17 HREF="r11285.htm"><LINK
     18 REL="NEXT"
     19 TITLE="ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT"
     20 HREF="r11612.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="r11285.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="r11612.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-G-MODULATOR"
     74 ></A
     75 >ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</H1
     76 ><DIV
     77 CLASS="REFNAMEDIV"
     78 ><A
     79 NAME="AEN11434"
     80 ></A
     81 ><H2
     82 >Name</H2
     83 >VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR&nbsp;--&nbsp;Get or set modulator attributes</DIV
     84 ><DIV
     85 CLASS="REFSYNOPSISDIV"
     86 ><A
     87 NAME="AEN11438"
     88 ></A
     89 ><H2
     90 >Synopsis</H2
     91 ><DIV
     92 CLASS="FUNCSYNOPSIS"
     93 ><P
     94 ></P
     95 ><A
     96 NAME="AEN11439"
     97 ></A
     98 ><P
     99 ><CODE
    100 ><CODE
    101 CLASS="FUNCDEF"
    102 >int ioctl</CODE
    103 >(int fd, int request, struct v4l2_modulator
    104 *argp);</CODE
    105 ></P
    106 ><P
    107 ></P
    108 ></DIV
    109 ><DIV
    110 CLASS="FUNCSYNOPSIS"
    111 ><P
    112 ></P
    113 ><A
    114 NAME="AEN11449"
    115 ></A
    116 ><P
    117 ><CODE
    118 ><CODE
    119 CLASS="FUNCDEF"
    120 >int ioctl</CODE
    121 >(int fd, int request, const struct v4l2_modulator
    122 *argp);</CODE
    123 ></P
    124 ><P
    125 ></P
    126 ></DIV
    127 ></DIV
    128 ><DIV
    129 CLASS="REFSECT1"
    130 ><A
    131 NAME="AEN11459"
    132 ></A
    133 ><H2
    134 >Arguments</H2
    135 ><P
    136 ></P
    137 ><DIV
    138 CLASS="VARIABLELIST"
    139 ><DL
    140 ><DT
    141 ><CODE
    142 CLASS="PARAMETER"
    143 >fd</CODE
    144 ></DT
    145 ><DD
    146 ><P
    147 >File descriptor returned by <A
    148 HREF="r14090.htm"
    149 ><CODE
    150 CLASS="FUNCTION"
    151 >open()</CODE
    152 ></A
    153 >.</P
    154 ></DD
    155 ><DT
    156 ><CODE
    157 CLASS="PARAMETER"
    158 >request</CODE
    159 ></DT
    160 ><DD
    161 ><P
    162 >VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</P
    163 ></DD
    164 ><DT
    165 ><CODE
    166 CLASS="PARAMETER"
    167 >argp</CODE
    168 ></DT
    169 ><DD
    170 ><P
    171 ></P
    172 ></DD
    173 ></DL
    174 ></DIV
    175 ></DIV
    176 ><DIV
    177 CLASS="REFSECT1"
    178 ><A
    179 NAME="AEN11479"
    180 ></A
    181 ><H2
    182 >Description</H2
    183 ><P
    184 >To query the attributes of a modulator applications initialize
    185 the <CODE
    186 CLASS="STRUCTFIELD"
    187 >index</CODE
    188 > field and zero out the
    189 <CODE
    190 CLASS="STRUCTFIELD"
    191 >reserved</CODE
    192 > array of a struct&nbsp;<A
    193 HREF="r11430.htm#V4L2-MODULATOR"
    194 >v4l2_modulator</A
    195 > and
    196 call the <CODE
    197 CLASS="CONSTANT"
    198 >VIDIOC_G_MODULATOR</CODE
    199 > ioctl with a pointer
    200 to this structure. Drivers fill the rest of the structure or return an
    201 <SPAN
    202 CLASS="ERRORCODE"
    203 >EINVAL</SPAN
    204 > error code when the index is out of bounds. To enumerate all modulators
    205 applications shall begin at index zero, incrementing by one until the
    206 driver returns <SPAN
    207 CLASS="ERRORCODE"
    208 >EINVAL</SPAN
    209 >.</P
    210 ><P
    211 >Modulators have two writable properties, an audio
    212 modulation set and the radio frequency. To change the modulated audio
    213 subprograms, applications initialize the <CODE
    214 CLASS="STRUCTFIELD"
    215 >index</CODE
    216 > and <CODE
    217 CLASS="STRUCTFIELD"
    218 >txsubchans</CODE
    219 > fields and the
    220 <CODE
    221 CLASS="STRUCTFIELD"
    222 >reserved</CODE
    223 > array and call the
    224 <CODE
    225 CLASS="CONSTANT"
    226 >VIDIOC_S_MODULATOR</CODE
    227 > ioctl. Drivers may choose a
    228 different audio modulation if the request cannot be satisfied. However
    229 this is a write-only ioctl, it does not return the actual audio
    230 modulation selected.</P
    231 ><P
    232 >To change the radio frequency the <A
    233 HREF="r11094.htm"
    234 ><CODE
    235 CLASS="CONSTANT"
    236 >VIDIOC_S_FREQUENCY</CODE
    237 ></A
    238 > ioctl
    239 is available.</P
    240 ><DIV
    241 CLASS="TABLE"
    242 ><A
    243 NAME="V4L2-MODULATOR"
    244 ></A
    245 ><P
    246 ><B
    247 >Table 1. struct <CODE
    248 CLASS="STRUCTNAME"
    249 >v4l2_modulator</CODE
    250 ></B
    251 ></P
    252 ><TABLE
    253 BORDER="0"
    254 FRAME="void"
    255 WIDTH="100%"
    256 CLASS="CALSTABLE"
    257 ><COL
    258 WIDTH="25%"
    259 TITLE="C1"><COL
    260 WIDTH="25%"
    261 TITLE="C2"><COL
    262 WIDTH="50%"
    263 TITLE="C3"><TBODY
    264 VALIGN="TOP"
    265 ><TR
    266 ><TD
    267 >__u32</TD
    268 ><TD
    269 ><CODE
    270 CLASS="STRUCTFIELD"
    271 >index</CODE
    272 ></TD
    273 ><TD
    274 >Identifies the modulator, set by the
    275 application.</TD
    276 ></TR
    277 ><TR
    278 ><TD
    279 >__u8</TD
    280 ><TD
    281 ><CODE
    282 CLASS="STRUCTFIELD"
    283 >name</CODE
    284 >[32]</TD
    285 ><TD
    286 >Name of the modulator, a NUL-terminated ASCII
    287 string. This information is intended for the user.</TD
    288 ></TR
    289 ><TR
    290 ><TD
    291 >__u32</TD
    292 ><TD
    293 ><CODE
    294 CLASS="STRUCTFIELD"
    295 >capability</CODE
    296 ></TD
    297 ><TD
    298 >Modulator capability flags. No flags are defined
    299 for this field, the tuner flags in struct&nbsp;<A
    300 HREF="r12342.htm#V4L2-TUNER"
    301 >v4l2_tuner</A
    302 >
    303 are used accordingly. The audio flags indicate the ability
    304 to encode audio subprograms. They will <SPAN
    305 CLASS="emphasis"
    306 ><I
    307 CLASS="EMPHASIS"
    308 >not</I
    309 ></SPAN
    310 >
    311 change for example with the current video standard.</TD
    312 ></TR
    313 ><TR
    314 ><TD
    315 >__u32</TD
    316 ><TD
    317 ><CODE
    318 CLASS="STRUCTFIELD"
    319 >rangelow</CODE
    320 ></TD
    321 ><TD
    322 >The lowest tunable frequency in units of 62.5
    323 KHz, or if the <CODE
    324 CLASS="STRUCTFIELD"
    325 >capability</CODE
    326 > flag
    327 <CODE
    328 CLASS="CONSTANT"
    329 >V4L2_TUNER_CAP_LOW</CODE
    330 > is set, in units of 62.5
    331 Hz.</TD
    332 ></TR
    333 ><TR
    334 ><TD
    335 >__u32</TD
    336 ><TD
    337 ><CODE
    338 CLASS="STRUCTFIELD"
    339 >rangehigh</CODE
    340 ></TD
    341 ><TD
    342 >The highest tunable frequency in units of 62.5
    343 KHz, or if the <CODE
    344 CLASS="STRUCTFIELD"
    345 >capability</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 >txsubchans</CODE
    360 ></TD
    361 ><TD
    362 >With this field applications can determine how
    363 audio sub-carriers shall be modulated. It contains a set of flags as
    364 defined in <A
    365 HREF="r11430.htm#MODULATOR-TXSUBCHANS"
    366 >Table 2</A
    367 >. Note the tuner
    368 <CODE
    369 CLASS="STRUCTFIELD"
    370 >rxsubchans</CODE
    371 > flags are reused, but the
    372 semantics are different. Video output devices are assumed to have an
    373 analog or PCM audio input with 1-3 channels. The
    374 <CODE
    375 CLASS="STRUCTFIELD"
    376 >txsubchans</CODE
    377 > flags select one or more
    378 channels for modulation, together with some audio subprogram
    379 indicator, for example a stereo pilot tone.</TD
    380 ></TR
    381 ><TR
    382 ><TD
    383 >__u32</TD
    384 ><TD
    385 ><CODE
    386 CLASS="STRUCTFIELD"
    387 >reserved</CODE
    388 >[4]</TD
    389 ><TD
    390 >Reserved for future extensions. Drivers and
    391 applications must set the array to zero.</TD
    392 ></TR
    393 ></TBODY
    394 ></TABLE
    395 ></DIV
    396 ><DIV
    397 CLASS="TABLE"
    398 ><A
    399 NAME="MODULATOR-TXSUBCHANS"
    400 ></A
    401 ><P
    402 ><B
    403 >Table 2. Modulator Audio Transmission Flags</B
    404 ></P
    405 ><TABLE
    406 BORDER="0"
    407 FRAME="void"
    408 WIDTH="100%"
    409 CLASS="CALSTABLE"
    410 ><COL
    411 WIDTH="38%"
    412 TITLE="C1"><COL
    413 WIDTH="12%"
    414 TITLE="C2"><COL
    415 WIDTH="50%"
    416 TITLE="C3"><TBODY
    417 VALIGN="TOP"
    418 ><TR
    419 ><TD
    420 ><CODE
    421 CLASS="CONSTANT"
    422 >V4L2_TUNER_SUB_MONO</CODE
    423 ></TD
    424 ><TD
    425 >0x0001</TD
    426 ><TD
    427 >Modulate channel 1 as mono audio, when the input
    428 has more channels, a down-mix of channel 1 and 2. This flag does not
    429 combine with <CODE
    430 CLASS="CONSTANT"
    431 >V4L2_TUNER_SUB_STEREO</CODE
    432 > or
    433 <CODE
    434 CLASS="CONSTANT"
    435 >V4L2_TUNER_SUB_LANG1</CODE
    436 >.</TD
    437 ></TR
    438 ><TR
    439 ><TD
    440 ><CODE
    441 CLASS="CONSTANT"
    442 >V4L2_TUNER_SUB_STEREO</CODE
    443 ></TD
    444 ><TD
    445 >0x0002</TD
    446 ><TD
    447 >Modulate channel 1 and 2 as left and right
    448 channel of a stereo audio signal. When the input has only one channel
    449 or two channels and <CODE
    450 CLASS="CONSTANT"
    451 >V4L2_TUNER_SUB_SAP</CODE
    452 > is also
    453 set, channel 1 is encoded as left and right channel. This flag does
    454 not combine with <CODE
    455 CLASS="CONSTANT"
    456 >V4L2_TUNER_SUB_MONO </CODE
    457 > or
    458 <CODE
    459 CLASS="CONSTANT"
    460 >V4L2_TUNER_SUB_LANG1</CODE
    461 >. When the driver does not
    462 support stereo audio it shall fall back to mono.</TD
    463 ></TR
    464 ><TR
    465 ><TD
    466 ><CODE
    467 CLASS="CONSTANT"
    468 >V4L2_TUNER_SUB_LANG1</CODE
    469 ></TD
    470 ><TD
    471 >0x0008</TD
    472 ><TD
    473 >Modulate channel 1 and 2 as primary and secondary
    474 language of a bilingual audio signal. When the input has only one
    475 channel it is used for both languages. It is not possible to encode
    476 the primary or secondary language only. This flag does not combine
    477 with <CODE
    478 CLASS="CONSTANT"
    479 >V4L2_TUNER_SUB_MONO </CODE
    480 > or
    481 <CODE
    482 CLASS="CONSTANT"
    483 >V4L2_TUNER_SUB_STEREO</CODE
    484 >. If the hardware does not
    485 support the respective audio matrix, or the current video standard
    486 does not permit bilingual audio the
    487 <CODE
    488 CLASS="CONSTANT"
    489 >VIDIOC_S_MODULATOR</CODE
    490 > ioctl shall return an <SPAN
    491 CLASS="ERRORCODE"
    492 >EINVAL</SPAN
    493 > error code
    494 and the driver shall fall back to mono or stereo mode.</TD
    495 ></TR
    496 ><TR
    497 ><TD
    498 ><CODE
    499 CLASS="CONSTANT"
    500 >V4L2_TUNER_SUB_LANG2</CODE
    501 ></TD
    502 ><TD
    503 >0x0004</TD
    504 ><TD
    505 >Same effect as
    506 <CODE
    507 CLASS="CONSTANT"
    508 >V4L2_TUNER_SUB_LANG1</CODE
    509 >.</TD
    510 ></TR
    511 ><TR
    512 ><TD
    513 ><CODE
    514 CLASS="CONSTANT"
    515 >V4L2_TUNER_SUB_SAP</CODE
    516 ></TD
    517 ><TD
    518 >0x0004</TD
    519 ><TD
    520 >When combined with <CODE
    521 CLASS="CONSTANT"
    522 >V4L2_TUNER_SUB_MONO</CODE
    523 > the first channel is encoded as mono audio, the last
    524 channel as Second Audio Program. When the input has only one channel
    525 it is used for both audio tracks. When the input has three channels
    526 the mono track is a down-mix of channel 1 and 2. When combined with
    527 <CODE
    528 CLASS="CONSTANT"
    529 >V4L2_TUNER_SUB_STEREO </CODE
    530 > channel 1 and 2 are
    531 encoded as left and right stereo audio, channel 3 as Second Audio
    532 Program. When the input has only two channels, the first is encoded as
    533 left and right channel and the second as SAP. When the input has only
    534 one channel it is used for all audio tracks. It is not possible to
    535 encode a Second Audio Program only. This flag must combine with
    536 <CODE
    537 CLASS="CONSTANT"
    538 >V4L2_TUNER_SUB_MONO</CODE
    539 > or
    540 <CODE
    541 CLASS="CONSTANT"
    542 >V4L2_TUNER_SUB_STEREO</CODE
    543 >. If the hardware does not
    544 support the respective audio matrix, or the current video standard
    545 does not permit SAP the <CODE
    546 CLASS="CONSTANT"
    547 > VIDIOC_S_MODULATOR</CODE
    548 > ioctl
    549 shall return an <SPAN
    550 CLASS="ERRORCODE"
    551 >EINVAL</SPAN
    552 > error code and driver shall fall back to mono or stereo
    553 mode.</TD
    554 ></TR
    555 ></TBODY
    556 ></TABLE
    557 ></DIV
    558 ></DIV
    559 ><DIV
    560 CLASS="REFSECT1"
    561 ><A
    562 NAME="AEN11598"
    563 ></A
    564 ><H2
    565 >Return Value</H2
    566 ><P
    567 >On success <SPAN
    568 CLASS="RETURNVALUE"
    569 >0</SPAN
    570 > is returned, on error <SPAN
    571 CLASS="RETURNVALUE"
    572 >-1</SPAN
    573 > and the <CODE
    574 CLASS="VARNAME"
    575 >errno</CODE
    576 > variable is set appropriately:</P
    577 ><P
    578 ></P
    579 ><DIV
    580 CLASS="VARIABLELIST"
    581 ><DL
    582 ><DT
    583 ><SPAN
    584 CLASS="ERRORCODE"
    585 >EINVAL</SPAN
    586 ></DT
    587 ><DD
    588 ><P
    589 >The struct&nbsp;<A
    590 HREF="r11430.htm#V4L2-MODULATOR"
    591 >v4l2_modulator</A
    592 >
    593 <CODE
    594 CLASS="STRUCTFIELD"
    595 >index</CODE
    596 > is out of bounds.</P
    597 ></DD
    598 ></DL
    599 ></DIV
    600 ></DIV
    601 ><DIV
    602 CLASS="NAVFOOTER"
    603 ><HR
    604 ALIGN="LEFT"
    605 WIDTH="100%"><TABLE
    606 SUMMARY="Footer navigation table"
    607 WIDTH="100%"
    608 BORDER="0"
    609 CELLPADDING="0"
    610 CELLSPACING="0"
    611 ><TR
    612 ><TD
    613 WIDTH="33%"
    614 ALIGN="left"
    615 VALIGN="top"
    616 ><A
    617 HREF="r11285.htm"
    618 ACCESSKEY="P"
    619 >Prev</A
    620 ></TD
    621 ><TD
    622 WIDTH="34%"
    623 ALIGN="center"
    624 VALIGN="top"
    625 ><A
    626 HREF="book1.htm"
    627 ACCESSKEY="H"
    628 >Home</A
    629 ></TD
    630 ><TD
    631 WIDTH="33%"
    632 ALIGN="right"
    633 VALIGN="top"
    634 ><A
    635 HREF="r11612.htm"
    636 ACCESSKEY="N"
    637 >Next</A
    638 ></TD
    639 ></TR
    640 ><TR
    641 ><TD
    642 WIDTH="33%"
    643 ALIGN="left"
    644 VALIGN="top"
    645 >ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</TD
    646 ><TD
    647 WIDTH="34%"
    648 ALIGN="center"
    649 VALIGN="top"
    650 ><A
    651 HREF="r7624.htm"
    652 ACCESSKEY="U"
    653 >Up</A
    654 ></TD
    655 ><TD
    656 WIDTH="33%"
    657 ALIGN="right"
    658 VALIGN="top"
    659 >ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</TD
    660 ></TR
    661 ></TABLE
    662 ></DIV
    663 ></BODY
    664 ></HTML
    665 >
    666