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