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_ENUMINPUT</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_FRAMEINTERVALS" 17HREF="r8724.htm"><LINK 18REL="NEXT" 19TITLE="ioctl VIDIOC_ENUMOUTPUT" 20HREF="r9149.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="r8724.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="r9149.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-ENUMINPUT" 74></A 75>ioctl VIDIOC_ENUMINPUT</H1 76><DIV 77CLASS="REFNAMEDIV" 78><A 79NAME="AEN8940" 80></A 81><H2 82>Name</H2 83>VIDIOC_ENUMINPUT -- Enumerate video inputs</DIV 84><DIV 85CLASS="REFSYNOPSISDIV" 86><A 87NAME="AEN8943" 88></A 89><H2 90>Synopsis</H2 91><DIV 92CLASS="FUNCSYNOPSIS" 93><P 94></P 95><A 96NAME="AEN8944" 97></A 98><P 99><CODE 100><CODE 101CLASS="FUNCDEF" 102>int ioctl</CODE 103>(int fd, int request, struct v4l2_input 104*argp);</CODE 105></P 106><P 107></P 108></DIV 109></DIV 110><DIV 111CLASS="REFSECT1" 112><A 113NAME="AEN8954" 114></A 115><H2 116>Arguments</H2 117><P 118></P 119><DIV 120CLASS="VARIABLELIST" 121><DL 122><DT 123><CODE 124CLASS="PARAMETER" 125>fd</CODE 126></DT 127><DD 128><P 129>File descriptor returned by <A 130HREF="r14090.htm" 131><CODE 132CLASS="FUNCTION" 133>open()</CODE 134></A 135>.</P 136></DD 137><DT 138><CODE 139CLASS="PARAMETER" 140>request</CODE 141></DT 142><DD 143><P 144>VIDIOC_ENUMINPUT</P 145></DD 146><DT 147><CODE 148CLASS="PARAMETER" 149>argp</CODE 150></DT 151><DD 152><P 153></P 154></DD 155></DL 156></DIV 157></DIV 158><DIV 159CLASS="REFSECT1" 160><A 161NAME="AEN8974" 162></A 163><H2 164>Description</H2 165><P 166>To query the attributes of a video input applications 167initialize the <CODE 168CLASS="STRUCTFIELD" 169>index</CODE 170> field of struct <A 171HREF="r8936.htm#V4L2-INPUT" 172>v4l2_input</A 173> 174and call the <CODE 175CLASS="CONSTANT" 176>VIDIOC_ENUMINPUT</CODE 177> ioctl with a 178pointer to this structure. Drivers fill the rest of the structure or 179return an <SPAN 180CLASS="ERRORCODE" 181>EINVAL</SPAN 182> error code when the index is out of bounds. To enumerate all 183inputs applications shall begin at index zero, incrementing by one 184until the driver returns <SPAN 185CLASS="ERRORCODE" 186>EINVAL</SPAN 187>.</P 188><DIV 189CLASS="TABLE" 190><A 191NAME="V4L2-INPUT" 192></A 193><P 194><B 195>Table 1. struct <CODE 196CLASS="STRUCTNAME" 197>v4l2_input</CODE 198></B 199></P 200><TABLE 201BORDER="0" 202FRAME="void" 203WIDTH="100%" 204CLASS="CALSTABLE" 205><COL 206WIDTH="25%" 207TITLE="C1"><COL 208WIDTH="25%" 209TITLE="C2"><COL 210WIDTH="50%" 211TITLE="C3"><TBODY 212VALIGN="TOP" 213><TR 214><TD 215>__u32</TD 216><TD 217><CODE 218CLASS="STRUCTFIELD" 219>index</CODE 220></TD 221><TD 222>Identifies the input, set by the 223application.</TD 224></TR 225><TR 226><TD 227>__u8</TD 228><TD 229><CODE 230CLASS="STRUCTFIELD" 231>name</CODE 232>[32]</TD 233><TD 234>Name of the video input, a NUL-terminated ASCII 235string, for example: "Vin (Composite 2)". This information is intended 236for the user, preferably the connector label on the device itself.</TD 237></TR 238><TR 239><TD 240>__u32</TD 241><TD 242><CODE 243CLASS="STRUCTFIELD" 244>type</CODE 245></TD 246><TD 247>Type of the input, see <A 248HREF="r8936.htm#INPUT-TYPE" 249>Table 2</A 250>.</TD 251></TR 252><TR 253><TD 254>__u32</TD 255><TD 256><CODE 257CLASS="STRUCTFIELD" 258>audioset</CODE 259></TD 260><TD 261><P 262>Drivers can enumerate up to 32 video and 263audio inputs. This field shows which audio inputs were selectable as 264audio source if this was the currently selected video input. It is a 265bit mask. The LSB corresponds to audio input 0, the MSB to input 31. 266Any number of bits can be set, or none.</P 267><P 268>When the driver 269does not enumerate audio inputs no bits must be set. Applications 270shall not interpret this as lack of audio support. Some drivers 271automatically select audio sources and do not enumerate them since 272there is no choice anyway.</P 273><P 274>For details on audio inputs and 275how to select the current input see <A 276HREF="x341.htm" 277>Section 1.5</A 278>.</P 279></TD 280></TR 281><TR 282><TD 283>__u32</TD 284><TD 285><CODE 286CLASS="STRUCTFIELD" 287>tuner</CODE 288></TD 289><TD 290>Capture devices can have zero or more tuners (RF 291demodulators). When the <CODE 292CLASS="STRUCTFIELD" 293>type</CODE 294> is set to 295<CODE 296CLASS="CONSTANT" 297>V4L2_INPUT_TYPE_TUNER</CODE 298> this is an RF connector and 299this field identifies the tuner. It corresponds to 300struct <A 301HREF="r12342.htm#V4L2-TUNER" 302>v4l2_tuner</A 303> field <CODE 304CLASS="STRUCTFIELD" 305>index</CODE 306>. For details on 307tuners see <A 308HREF="x394.htm" 309>Section 1.6</A 310>.</TD 311></TR 312><TR 313><TD 314><A 315HREF="r9288.htm#V4L2-STD-ID" 316>v4l2_std_id</A 317></TD 318><TD 319><CODE 320CLASS="STRUCTFIELD" 321>std</CODE 322></TD 323><TD 324>Every video input supports one or more different 325video standards. This field is a set of all supported standards. For 326details on video standards and how to switch see <A 327HREF="x448.htm" 328>Section 1.7</A 329>.</TD 330></TR 331><TR 332><TD 333>__u32</TD 334><TD 335><CODE 336CLASS="STRUCTFIELD" 337>status</CODE 338></TD 339><TD 340>This field provides status information about the 341input. See <A 342HREF="r8936.htm#INPUT-STATUS" 343>Table 3</A 344> for flags. 345<CODE 346CLASS="STRUCTFIELD" 347>status</CODE 348> is only valid when this is the 349current input.</TD 350></TR 351><TR 352><TD 353>__u32</TD 354><TD 355><CODE 356CLASS="STRUCTFIELD" 357>reserved</CODE 358>[4]</TD 359><TD 360>Reserved for future extensions. Drivers must set 361the array to zero.</TD 362></TR 363></TBODY 364></TABLE 365></DIV 366><DIV 367CLASS="TABLE" 368><A 369NAME="INPUT-TYPE" 370></A 371><P 372><B 373>Table 2. Input Types</B 374></P 375><TABLE 376BORDER="0" 377FRAME="void" 378WIDTH="100%" 379CLASS="CALSTABLE" 380><COL 381WIDTH="38%" 382TITLE="C1"><COL 383WIDTH="12%" 384TITLE="C2"><COL 385WIDTH="50%" 386TITLE="C3"><TBODY 387VALIGN="TOP" 388><TR 389><TD 390><CODE 391CLASS="CONSTANT" 392>V4L2_INPUT_TYPE_TUNER</CODE 393></TD 394><TD 395>1</TD 396><TD 397>This input uses a tuner (RF demodulator).</TD 398></TR 399><TR 400><TD 401><CODE 402CLASS="CONSTANT" 403>V4L2_INPUT_TYPE_CAMERA</CODE 404></TD 405><TD 406>2</TD 407><TD 408>Analog baseband input, for example CVBS / 409Composite Video, S-Video, RGB.</TD 410></TR 411></TBODY 412></TABLE 413></DIV 414><DIV 415CLASS="TABLE" 416><A 417NAME="INPUT-STATUS" 418></A 419><P 420><B 421>Table 3. Input Status Flags</B 422></P 423><TABLE 424BORDER="0" 425FRAME="void" 426WIDTH="100%" 427CLASS="CALSTABLE" 428><COL 429WIDTH="33%" 430TITLE="C1"><COL 431WIDTH="33%" 432ALIGN="CENTER" 433TITLE="C2"><COL 434WIDTH="33%" 435TITLE="C3"><TBODY 436VALIGN="TOP" 437><TR 438><TD 439COLSPAN="3" 440ALIGN="LEFT" 441>General</TD 442></TR 443><TR 444><TD 445><CODE 446CLASS="CONSTANT" 447>V4L2_IN_ST_NO_POWER</CODE 448></TD 449><TD 450>0x00000001</TD 451><TD 452>Attached device is off.</TD 453></TR 454><TR 455><TD 456><CODE 457CLASS="CONSTANT" 458>V4L2_IN_ST_NO_SIGNAL</CODE 459></TD 460><TD 461>0x00000002</TD 462><TD 463> </TD 464></TR 465><TR 466><TD 467><CODE 468CLASS="CONSTANT" 469>V4L2_IN_ST_NO_COLOR</CODE 470></TD 471><TD 472>0x00000004</TD 473><TD 474>The hardware supports color decoding, but does not 475detect color modulation in the signal.</TD 476></TR 477><TR 478><TD 479COLSPAN="3" 480ALIGN="LEFT" 481>Analog Video</TD 482></TR 483><TR 484><TD 485><CODE 486CLASS="CONSTANT" 487>V4L2_IN_ST_NO_H_LOCK</CODE 488></TD 489><TD 490>0x00000100</TD 491><TD 492>No horizontal sync lock.</TD 493></TR 494><TR 495><TD 496><CODE 497CLASS="CONSTANT" 498>V4L2_IN_ST_COLOR_KILL</CODE 499></TD 500><TD 501>0x00000200</TD 502><TD 503>A color killer circuit automatically disables color 504decoding when it detects no color modulation. When this flag is set 505the color killer is enabled <SPAN 506CLASS="emphasis" 507><I 508CLASS="EMPHASIS" 509>and</I 510></SPAN 511> has shut off 512color decoding.</TD 513></TR 514><TR 515><TD 516COLSPAN="3" 517ALIGN="LEFT" 518>Digital Video</TD 519></TR 520><TR 521><TD 522><CODE 523CLASS="CONSTANT" 524>V4L2_IN_ST_NO_SYNC</CODE 525></TD 526><TD 527>0x00010000</TD 528><TD 529>No synchronization lock.</TD 530></TR 531><TR 532><TD 533><CODE 534CLASS="CONSTANT" 535>V4L2_IN_ST_NO_EQU</CODE 536></TD 537><TD 538>0x00020000</TD 539><TD 540>No equalizer lock.</TD 541></TR 542><TR 543><TD 544><CODE 545CLASS="CONSTANT" 546>V4L2_IN_ST_NO_CARRIER</CODE 547></TD 548><TD 549>0x00040000</TD 550><TD 551>Carrier recovery failed.</TD 552></TR 553><TR 554><TD 555COLSPAN="3" 556ALIGN="LEFT" 557>VCR and Set-Top Box</TD 558></TR 559><TR 560><TD 561><CODE 562CLASS="CONSTANT" 563>V4L2_IN_ST_MACROVISION</CODE 564></TD 565><TD 566>0x01000000</TD 567><TD 568>Macrovision is an analog copy prevention system 569mangling the video signal to confuse video recorders. When this 570flag is set Macrovision has been detected.</TD 571></TR 572><TR 573><TD 574><CODE 575CLASS="CONSTANT" 576>V4L2_IN_ST_NO_ACCESS</CODE 577></TD 578><TD 579>0x02000000</TD 580><TD 581>Conditional access denied.</TD 582></TR 583><TR 584><TD 585><CODE 586CLASS="CONSTANT" 587>V4L2_IN_ST_VTR</CODE 588></TD 589><TD 590>0x04000000</TD 591><TD 592>VTR time constant. [?]</TD 593></TR 594></TBODY 595></TABLE 596></DIV 597></DIV 598><DIV 599CLASS="REFSECT1" 600><A 601NAME="AEN9135" 602></A 603><H2 604>Return Value</H2 605><P 606>On success <SPAN 607CLASS="RETURNVALUE" 608>0</SPAN 609> is returned, on error <SPAN 610CLASS="RETURNVALUE" 611>-1</SPAN 612> and the <CODE 613CLASS="VARNAME" 614>errno</CODE 615> variable is set appropriately:</P 616><P 617></P 618><DIV 619CLASS="VARIABLELIST" 620><DL 621><DT 622><SPAN 623CLASS="ERRORCODE" 624>EINVAL</SPAN 625></DT 626><DD 627><P 628>The struct <A 629HREF="r8936.htm#V4L2-INPUT" 630>v4l2_input</A 631> <CODE 632CLASS="STRUCTFIELD" 633>index</CODE 634> is 635out of bounds.</P 636></DD 637></DL 638></DIV 639></DIV 640><DIV 641CLASS="NAVFOOTER" 642><HR 643ALIGN="LEFT" 644WIDTH="100%"><TABLE 645SUMMARY="Footer navigation table" 646WIDTH="100%" 647BORDER="0" 648CELLPADDING="0" 649CELLSPACING="0" 650><TR 651><TD 652WIDTH="33%" 653ALIGN="left" 654VALIGN="top" 655><A 656HREF="r8724.htm" 657ACCESSKEY="P" 658>Prev</A 659></TD 660><TD 661WIDTH="34%" 662ALIGN="center" 663VALIGN="top" 664><A 665HREF="book1.htm" 666ACCESSKEY="H" 667>Home</A 668></TD 669><TD 670WIDTH="33%" 671ALIGN="right" 672VALIGN="top" 673><A 674HREF="r9149.htm" 675ACCESSKEY="N" 676>Next</A 677></TD 678></TR 679><TR 680><TD 681WIDTH="33%" 682ALIGN="left" 683VALIGN="top" 684>ioctl VIDIOC_ENUM_FRAMEINTERVALS</TD 685><TD 686WIDTH="34%" 687ALIGN="center" 688VALIGN="top" 689><A 690HREF="r7624.htm" 691ACCESSKEY="U" 692>Up</A 693></TD 694><TD 695WIDTH="33%" 696ALIGN="right" 697VALIGN="top" 698>ioctl VIDIOC_ENUMOUTPUT</TD 699></TR 700></TABLE 701></DIV 702></BODY 703></HTML 704> 705