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