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_ENUM_FRAMEINTERVALS</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_ENUM_FRAMESIZES"
17HREF="r8494.htm"><LINK
18REL="NEXT"
19TITLE="ioctl VIDIOC_ENUMINPUT"
20HREF="r8936.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="r8494.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="r8936.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-ENUM-FRAMEINTERVALS"
74></A
75>ioctl VIDIOC_ENUM_FRAMEINTERVALS</H1
76><DIV
77CLASS="REFNAMEDIV"
78><A
79NAME="AEN8728"
80></A
81><H2
82>Name</H2
83>VIDIOC_ENUM_FRAMEINTERVALS&nbsp;--&nbsp;Enumerate frame intervals</DIV
84><DIV
85CLASS="REFSYNOPSISDIV"
86><A
87NAME="AEN8731"
88></A
89><H2
90>Synopsis</H2
91><DIV
92CLASS="FUNCSYNOPSIS"
93><P
94></P
95><A
96NAME="AEN8732"
97></A
98><P
99><CODE
100><CODE
101CLASS="FUNCDEF"
102>int ioctl</CODE
103>(int fd, int request, struct v4l2_frmivalenum *argp);</CODE
104></P
105><P
106></P
107></DIV
108></DIV
109><DIV
110CLASS="REFSECT1"
111><A
112NAME="AEN8742"
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_ENUM_FRAMEINTERVALS</P
144></DD
145><DT
146><CODE
147CLASS="PARAMETER"
148>argp</CODE
149></DT
150><DD
151><P
152>Pointer to a struct&nbsp;<A
153HREF="r8724.htm#V4L2-FRMIVALENUM"
154>v4l2_frmivalenum</A
155> structure that
156contains a pixel format and size and receives a frame interval.</P
157></DD
158></DL
159></DIV
160></DIV
161><DIV
162CLASS="REFSECT1"
163><A
164NAME="AEN8763"
165></A
166><H2
167>Description</H2
168><P
169>This ioctl allows applications to enumerate all frame
170intervals that the device supports for the given pixel format and
171frame size.</P
172><P
173>The supported pixel formats and frame sizes can be obtained
174by using the <A
175HREF="r8367.htm"
176><CODE
177CLASS="CONSTANT"
178>VIDIOC_ENUM_FMT</CODE
179></A
180> and <A
181HREF="r8494.htm"
182><CODE
183CLASS="CONSTANT"
184>VIDIOC_ENUM_FRAMESIZES</CODE
185></A
186>
187functions.</P
188><P
189>The return value and the content of the
190<CODE
191CLASS="STRUCTFIELD"
192>v4l2_frmivalenum.type</CODE
193> field depend on the
194type of frame intervals the device supports. Here are the semantics of
195the function for the different cases:</P
196><P
197></P
198><UL
199><LI
200><P
201><SPAN
202CLASS="bold"
203><B
204CLASS="EMPHASIS"
205>Discrete:</B
206></SPAN
207> The function
208returns success if the given index value (zero-based) is valid. The
209application should increase the index by one for each call until
210<CODE
211CLASS="CONSTANT"
212>EINVAL</CODE
213> is returned. The `v4l2_frmivalenum.type`
214field is set to `V4L2_FRMIVAL_TYPE_DISCRETE` by the driver. Of the
215union only the `discrete` member is valid.</P
216></LI
217><LI
218><P
219><SPAN
220CLASS="bold"
221><B
222CLASS="EMPHASIS"
223>Step-wise:</B
224></SPAN
225> The function
226returns success if the given index value is zero and
227<CODE
228CLASS="CONSTANT"
229>EINVAL</CODE
230> for any other index value. The
231<CODE
232CLASS="STRUCTFIELD"
233>v4l2_frmivalenum.type</CODE
234> field is set to
235<CODE
236CLASS="CONSTANT"
237>V4L2_FRMIVAL_TYPE_STEPWISE</CODE
238> by the driver. Of the
239union only the <CODE
240CLASS="STRUCTFIELD"
241>stepwise</CODE
242> member is
243valid.</P
244></LI
245><LI
246><P
247><SPAN
248CLASS="bold"
249><B
250CLASS="EMPHASIS"
251>Continuous:</B
252></SPAN
253> This is a
254special case of the step-wise type above. The function returns success
255if the given index value is zero and <CODE
256CLASS="CONSTANT"
257>EINVAL</CODE
258> for
259any other index value. The
260<CODE
261CLASS="STRUCTFIELD"
262>v4l2_frmivalenum.type</CODE
263> field is set to
264<CODE
265CLASS="CONSTANT"
266>V4L2_FRMIVAL_TYPE_CONTINUOUS</CODE
267> by the driver. Of
268the union only the <CODE
269CLASS="STRUCTFIELD"
270>stepwise</CODE
271> member is valid
272and the <CODE
273CLASS="STRUCTFIELD"
274>step</CODE
275> value is set to 1.</P
276></LI
277></UL
278><P
279>When the application calls the function with index zero, it
280must check the <CODE
281CLASS="STRUCTFIELD"
282>type</CODE
283> field to determine the
284type of frame interval enumeration the device supports. Only for the
285<CODE
286CLASS="CONSTANT"
287>V4L2_FRMIVAL_TYPE_DISCRETE</CODE
288> type does it make
289sense to increase the index value to receive more frame
290intervals.</P
291><P
292>Note that the order in which the frame intervals are
293returned has no special meaning. In particular does it not say
294anything about potential default frame intervals.</P
295><P
296>Applications can assume that the enumeration data does not
297change without any interaction from the application itself. This means
298that the enumeration data is consistent if the application does not
299perform any other ioctl calls while it runs the frame interval
300enumeration.</P
301></DIV
302><DIV
303CLASS="REFSECT1"
304><A
305NAME="AEN8798"
306></A
307><H2
308>Notes</H2
309><P
310></P
311><UL
312><LI
313><P
314><SPAN
315CLASS="bold"
316><B
317CLASS="EMPHASIS"
318>Frame intervals and frame
319rates:</B
320></SPAN
321> The V4L2 API uses frame intervals instead of frame
322rates. Given the frame interval the frame rate can be computed as
323follows:<PRE
324CLASS="SCREEN"
325>frame_rate = 1 / frame_interval</PRE
326></P
327></LI
328></UL
329></DIV
330><DIV
331CLASS="REFSECT1"
332><A
333NAME="AEN8805"
334></A
335><H2
336>Structs</H2
337><P
338>In the structs below, <SPAN
339CLASS="emphasis"
340><I
341CLASS="EMPHASIS"
342>IN</I
343></SPAN
344> denotes a
345value that has to be filled in by the application,
346<SPAN
347CLASS="emphasis"
348><I
349CLASS="EMPHASIS"
350>OUT</I
351></SPAN
352> denotes values that the driver fills in. The
353application should zero out all members except for the
354<SPAN
355CLASS="emphasis"
356><I
357CLASS="EMPHASIS"
358>IN</I
359></SPAN
360> fields.</P
361><DIV
362CLASS="TABLE"
363><A
364NAME="V4L2-FRMIVAL-STEPWISE"
365></A
366><P
367><B
368>Table 1. struct <CODE
369CLASS="STRUCTNAME"
370>v4l2_frmival_stepwise</CODE
371></B
372></P
373><TABLE
374BORDER="0"
375FRAME="void"
376WIDTH="100%"
377CLASS="CALSTABLE"
378><COL
379WIDTH="25%"
380TITLE="C1"><COL
381WIDTH="25%"
382TITLE="C2"><COL
383WIDTH="50%"
384TITLE="C3"><TBODY
385VALIGN="TOP"
386><TR
387><TD
388>struct&nbsp;<A
389HREF="r9288.htm#V4L2-FRACT"
390>v4l2_fract</A
391></TD
392><TD
393><CODE
394CLASS="STRUCTFIELD"
395>min</CODE
396></TD
397><TD
398>Minimum frame interval [s].</TD
399></TR
400><TR
401><TD
402>struct&nbsp;<A
403HREF="r9288.htm#V4L2-FRACT"
404>v4l2_fract</A
405></TD
406><TD
407><CODE
408CLASS="STRUCTFIELD"
409>max</CODE
410></TD
411><TD
412>Maximum frame interval [s].</TD
413></TR
414><TR
415><TD
416>struct&nbsp;<A
417HREF="r9288.htm#V4L2-FRACT"
418>v4l2_fract</A
419></TD
420><TD
421><CODE
422CLASS="STRUCTFIELD"
423>step</CODE
424></TD
425><TD
426>Frame interval step size [s].</TD
427></TR
428></TBODY
429></TABLE
430></DIV
431><DIV
432CLASS="TABLE"
433><A
434NAME="V4L2-FRMIVALENUM"
435></A
436><P
437><B
438>Table 2. struct <CODE
439CLASS="STRUCTNAME"
440>v4l2_frmivalenum</CODE
441></B
442></P
443><TABLE
444BORDER="0"
445FRAME="void"
446WIDTH="100%"
447CLASS="CALSTABLE"
448><COL
449WIDTH="25%"
450TITLE="C1"><COL
451WIDTH="25%"
452TITLE="C2"><COL
453WIDTH="25%"
454TITLE="C3"><COL
455WIDTH="25%"
456TITLE="C4"><TBODY
457VALIGN="TOP"
458><TR
459><TD
460>__u32</TD
461><TD
462><CODE
463CLASS="STRUCTFIELD"
464>index</CODE
465></TD
466><TD
467>&nbsp;</TD
468><TD
469>IN: Index of the given frame interval in the
470enumeration.</TD
471></TR
472><TR
473><TD
474>__u32</TD
475><TD
476><CODE
477CLASS="STRUCTFIELD"
478>pixel_format</CODE
479></TD
480><TD
481>&nbsp;</TD
482><TD
483>IN: Pixel format for which the frame intervals are
484enumerated.</TD
485></TR
486><TR
487><TD
488>__u32</TD
489><TD
490><CODE
491CLASS="STRUCTFIELD"
492>width</CODE
493></TD
494><TD
495>&nbsp;</TD
496><TD
497>IN: Frame width for which the frame intervals are
498enumerated.</TD
499></TR
500><TR
501><TD
502>__u32</TD
503><TD
504><CODE
505CLASS="STRUCTFIELD"
506>height</CODE
507></TD
508><TD
509>&nbsp;</TD
510><TD
511>IN: Frame height for which the frame intervals are
512enumerated.</TD
513></TR
514><TR
515><TD
516>__u32</TD
517><TD
518><CODE
519CLASS="STRUCTFIELD"
520>type</CODE
521></TD
522><TD
523>&nbsp;</TD
524><TD
525>OUT: Frame interval type the device supports.</TD
526></TR
527><TR
528><TD
529>union</TD
530><TD
531>&nbsp;</TD
532><TD
533>&nbsp;</TD
534><TD
535>OUT: Frame interval with the given index.</TD
536></TR
537><TR
538><TD
539>&nbsp;</TD
540><TD
541>struct&nbsp;<A
542HREF="r9288.htm#V4L2-FRACT"
543>v4l2_fract</A
544></TD
545><TD
546><CODE
547CLASS="STRUCTFIELD"
548>discrete</CODE
549></TD
550><TD
551>Frame interval [s].</TD
552></TR
553><TR
554><TD
555>&nbsp;</TD
556><TD
557>struct&nbsp;<A
558HREF="r8724.htm#V4L2-FRMIVAL-STEPWISE"
559>v4l2_frmival_stepwise</A
560></TD
561><TD
562><CODE
563CLASS="STRUCTFIELD"
564>stepwise</CODE
565></TD
566><TD
567>&nbsp;</TD
568></TR
569><TR
570><TD
571>__u32</TD
572><TD
573><CODE
574CLASS="STRUCTFIELD"
575>reserved[2]</CODE
576></TD
577><TD
578>&nbsp;</TD
579><TD
580>Reserved space for future use.</TD
581></TR
582></TBODY
583></TABLE
584></DIV
585></DIV
586><DIV
587CLASS="REFSECT1"
588><A
589NAME="AEN8902"
590></A
591><H2
592>Enums</H2
593><DIV
594CLASS="TABLE"
595><A
596NAME="V4L2-FRMIVALTYPES"
597></A
598><P
599><B
600>Table 3. enum <CODE
601CLASS="STRUCTNAME"
602>v4l2_frmivaltypes</CODE
603></B
604></P
605><TABLE
606BORDER="0"
607FRAME="void"
608WIDTH="100%"
609CLASS="CALSTABLE"
610><COL
611WIDTH="38%"
612TITLE="C1"><COL
613WIDTH="12%"
614TITLE="C2"><COL
615WIDTH="50%"
616TITLE="C3"><TBODY
617VALIGN="TOP"
618><TR
619><TD
620><CODE
621CLASS="CONSTANT"
622>V4L2_FRMIVAL_TYPE_DISCRETE</CODE
623></TD
624><TD
625>1</TD
626><TD
627>Discrete frame interval.</TD
628></TR
629><TR
630><TD
631><CODE
632CLASS="CONSTANT"
633>V4L2_FRMIVAL_TYPE_CONTINUOUS</CODE
634></TD
635><TD
636>2</TD
637><TD
638>Continuous frame interval.</TD
639></TR
640><TR
641><TD
642><CODE
643CLASS="CONSTANT"
644>V4L2_FRMIVAL_TYPE_STEPWISE</CODE
645></TD
646><TD
647>3</TD
648><TD
649>Step-wise defined frame interval.</TD
650></TR
651></TBODY
652></TABLE
653></DIV
654></DIV
655><DIV
656CLASS="REFSECT1"
657><A
658NAME="AEN8928"
659></A
660><H2
661>Return Value</H2
662><P
663>On success <SPAN
664CLASS="RETURNVALUE"
665>0</SPAN
666> is returned, on error <SPAN
667CLASS="RETURNVALUE"
668>-1</SPAN
669> and the <CODE
670CLASS="VARNAME"
671>errno</CODE
672> variable is set appropriately:</P
673><P
674>See the description section above for a list of return
675values that <CODE
676CLASS="VARNAME"
677>errno</CODE
678> can have.</P
679></DIV
680><DIV
681CLASS="NAVFOOTER"
682><HR
683ALIGN="LEFT"
684WIDTH="100%"><TABLE
685SUMMARY="Footer navigation table"
686WIDTH="100%"
687BORDER="0"
688CELLPADDING="0"
689CELLSPACING="0"
690><TR
691><TD
692WIDTH="33%"
693ALIGN="left"
694VALIGN="top"
695><A
696HREF="r8494.htm"
697ACCESSKEY="P"
698>Prev</A
699></TD
700><TD
701WIDTH="34%"
702ALIGN="center"
703VALIGN="top"
704><A
705HREF="book1.htm"
706ACCESSKEY="H"
707>Home</A
708></TD
709><TD
710WIDTH="33%"
711ALIGN="right"
712VALIGN="top"
713><A
714HREF="r8936.htm"
715ACCESSKEY="N"
716>Next</A
717></TD
718></TR
719><TR
720><TD
721WIDTH="33%"
722ALIGN="left"
723VALIGN="top"
724>ioctl VIDIOC_ENUM_FRAMESIZES</TD
725><TD
726WIDTH="34%"
727ALIGN="center"
728VALIGN="top"
729><A
730HREF="r7624.htm"
731ACCESSKEY="U"
732>Up</A
733></TD
734><TD
735WIDTH="33%"
736ALIGN="right"
737VALIGN="top"
738>ioctl VIDIOC_ENUMINPUT</TD
739></TR
740></TABLE
741></DIV
742></BODY
743></HTML
744>
745