• 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_INPUT, VIDIOC_S_INPUT</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_FREQUENCY, VIDIOC_S_FREQUENCY"
17HREF="r11094.htm"><LINK
18REL="NEXT"
19TITLE="ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP"
20HREF="r11285.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="r11094.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="r11285.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-INPUT"
74></A
75>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</H1
76><DIV
77CLASS="REFNAMEDIV"
78><A
79NAME="AEN11221"
80></A
81><H2
82>Name</H2
83>VIDIOC_G_INPUT, VIDIOC_S_INPUT&nbsp;--&nbsp;Query or select the current video input</DIV
84><DIV
85CLASS="REFSYNOPSISDIV"
86><A
87NAME="AEN11225"
88></A
89><H2
90>Synopsis</H2
91><DIV
92CLASS="FUNCSYNOPSIS"
93><P
94></P
95><A
96NAME="AEN11226"
97></A
98><P
99><CODE
100><CODE
101CLASS="FUNCDEF"
102>int ioctl</CODE
103>(int fd, int request, int *argp);</CODE
104></P
105><P
106></P
107></DIV
108></DIV
109><DIV
110CLASS="REFSECT1"
111><A
112NAME="AEN11236"
113></A
114><H2
115>Arguments</H2
116><P
117></P
118><DIV
119CLASS="VARIABLELIST"
120><DL
121><DT
122><CODE
123CLASS="PARAMETER"
124>fd</CODE
125></DT
126><DD
127><P
128>File descriptor returned by <A
129HREF="r14090.htm"
130><CODE
131CLASS="FUNCTION"
132>open()</CODE
133></A
134>.</P
135></DD
136><DT
137><CODE
138CLASS="PARAMETER"
139>request</CODE
140></DT
141><DD
142><P
143>VIDIOC_G_INPUT, VIDIOC_S_INPUT</P
144></DD
145><DT
146><CODE
147CLASS="PARAMETER"
148>argp</CODE
149></DT
150><DD
151><P
152></P
153></DD
154></DL
155></DIV
156></DIV
157><DIV
158CLASS="REFSECT1"
159><A
160NAME="AEN11256"
161></A
162><H2
163>Description</H2
164><P
165>To query the current video input applications call the
166<CODE
167CLASS="CONSTANT"
168>VIDIOC_G_INPUT</CODE
169> ioctl with a pointer to an integer
170where the driver stores the number of the input, as in the
171struct&nbsp;<A
172HREF="r8936.htm#V4L2-INPUT"
173>v4l2_input</A
174> <CODE
175CLASS="STRUCTFIELD"
176>index</CODE
177> field. This ioctl will
178fail only when there are no video inputs, returning
179<SPAN
180CLASS="ERRORCODE"
181>EINVAL</SPAN
182>.</P
183><P
184>To select a video input applications store the number of the
185desired input in an integer and call the
186<CODE
187CLASS="CONSTANT"
188>VIDIOC_S_INPUT</CODE
189> ioctl with a pointer to this
190integer. Side effects are possible. For example inputs may support
191different video standards, so the driver may implicitly switch the
192current standard. It is good practice to select an input before
193querying or negotiating any other parameters.</P
194><P
195>Information about video inputs is available using the
196<A
197HREF="r8936.htm"
198><CODE
199CLASS="CONSTANT"
200>VIDIOC_ENUMINPUT</CODE
201></A
202> ioctl.</P
203></DIV
204><DIV
205CLASS="REFSECT1"
206><A
207NAME="AEN11268"
208></A
209><H2
210>Return Value</H2
211><P
212>On success <SPAN
213CLASS="RETURNVALUE"
214>0</SPAN
215> is returned, on error <SPAN
216CLASS="RETURNVALUE"
217>-1</SPAN
218> and the <CODE
219CLASS="VARNAME"
220>errno</CODE
221> variable is set appropriately:</P
222><P
223></P
224><DIV
225CLASS="VARIABLELIST"
226><DL
227><DT
228><SPAN
229CLASS="ERRORCODE"
230>EINVAL</SPAN
231></DT
232><DD
233><P
234>The number of the video input is out of bounds, or
235there are no video inputs at all and this ioctl is not
236supported.</P
237></DD
238><DT
239><SPAN
240CLASS="ERRORCODE"
241>EBUSY</SPAN
242></DT
243><DD
244><P
245>I/O is in progress, the input cannot be
246switched.</P
247></DD
248></DL
249></DIV
250></DIV
251><DIV
252CLASS="NAVFOOTER"
253><HR
254ALIGN="LEFT"
255WIDTH="100%"><TABLE
256SUMMARY="Footer navigation table"
257WIDTH="100%"
258BORDER="0"
259CELLPADDING="0"
260CELLSPACING="0"
261><TR
262><TD
263WIDTH="33%"
264ALIGN="left"
265VALIGN="top"
266><A
267HREF="r11094.htm"
268ACCESSKEY="P"
269>Prev</A
270></TD
271><TD
272WIDTH="34%"
273ALIGN="center"
274VALIGN="top"
275><A
276HREF="book1.htm"
277ACCESSKEY="H"
278>Home</A
279></TD
280><TD
281WIDTH="33%"
282ALIGN="right"
283VALIGN="top"
284><A
285HREF="r11285.htm"
286ACCESSKEY="N"
287>Next</A
288></TD
289></TR
290><TR
291><TD
292WIDTH="33%"
293ALIGN="left"
294VALIGN="top"
295>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</TD
296><TD
297WIDTH="34%"
298ALIGN="center"
299VALIGN="top"
300><A
301HREF="r7624.htm"
302ACCESSKEY="U"
303>Up</A
304></TD
305><TD
306WIDTH="33%"
307ALIGN="right"
308VALIGN="top"
309>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</TD
310></TR
311></TABLE
312></DIV
313></BODY
314></HTML
315>
316