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