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>Changes</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="PREVIOUS" 13TITLE="V4L2 Driver Programming" 14HREF="c14592.htm"><LINK 15REL="NEXT" 16TITLE="Changes of the V4L2 API" 17HREF="x15446.htm"></HEAD 18><BODY 19CLASS="CHAPTER" 20BGCOLOR="#FFFFFF" 21TEXT="#000000" 22LINK="#0000FF" 23VLINK="#840084" 24ALINK="#0000FF" 25><DIV 26CLASS="NAVHEADER" 27><TABLE 28SUMMARY="Header navigation table" 29WIDTH="100%" 30BORDER="0" 31CELLPADDING="0" 32CELLSPACING="0" 33><TR 34><TH 35COLSPAN="3" 36ALIGN="center" 37>Video for Linux Two API Specification: Revision 0.24</TH 38></TR 39><TR 40><TD 41WIDTH="10%" 42ALIGN="left" 43VALIGN="bottom" 44><A 45HREF="c14592.htm" 46ACCESSKEY="P" 47>Prev</A 48></TD 49><TD 50WIDTH="80%" 51ALIGN="center" 52VALIGN="bottom" 53></TD 54><TD 55WIDTH="10%" 56ALIGN="right" 57VALIGN="bottom" 58><A 59HREF="x15446.htm" 60ACCESSKEY="N" 61>Next</A 62></TD 63></TR 64></TABLE 65><HR 66ALIGN="LEFT" 67WIDTH="100%"></DIV 68><DIV 69CLASS="CHAPTER" 70><H1 71><A 72NAME="COMPAT" 73></A 74>Chapter 6. Changes</H1 75><DIV 76CLASS="TOC" 77><DL 78><DT 79><B 80>Table of Contents</B 81></DT 82><DT 83>6.1. <A 84HREF="c14595.htm#DIFF-V4L" 85>Differences between V4L and V4L2</A 86></DT 87><DT 88>6.2. <A 89HREF="x15446.htm" 90>Changes of the V4L2 API</A 91></DT 92><DT 93>6.3. <A 94HREF="x16430.htm" 95>Relation of V4L2 to other Linux multimedia APIs</A 96></DT 97><DT 98>6.4. <A 99HREF="x16453.htm" 100>Experimental API Elements</A 101></DT 102><DT 103>6.5. <A 104HREF="x16497.htm" 105>Obsolete API Elements</A 106></DT 107></DL 108></DIV 109><P 110>The following chapters document the evolution of the V4L2 API, 111errata or extensions. They are also intended to help application and 112driver writers to port or update their code.</P 113><DIV 114CLASS="SECTION" 115><H1 116CLASS="SECTION" 117><A 118NAME="DIFF-V4L" 119>6.1. Differences between V4L and V4L2</A 120></H1 121><P 122>The Video For Linux API was first introduced in Linux 2.1 to 123unify and replace various TV and radio device related interfaces, 124developed independently by driver writers in prior years. Starting 125with Linux 2.5 the much improved V4L2 API replaces the V4L API, 126although existing drivers will continue to support V4L applications in 127the future, either directly or through the V4L2 compatibility layer in 128the <TT 129CLASS="FILENAME" 130>videodev</TT 131> kernel module translating ioctls on 132the fly. For a transition period not all drivers will support the V4L2 133API.</P 134><DIV 135CLASS="SECTION" 136><H2 137CLASS="SECTION" 138><A 139NAME="AEN14602" 140>6.1.1. Opening and Closing Devices</A 141></H2 142><P 143>For compatibility reasons the character device file names 144recommended for V4L2 video capture, overlay, radio, teletext and raw 145vbi capture devices did not change from those used by V4L. They are 146listed in <A 147HREF="c6488.htm" 148>Chapter 4</A 149> and below in <A 150HREF="c14595.htm#V4L-DEV" 151>Table 6-1</A 152>.</P 153><P 154>The V4L <TT 155CLASS="FILENAME" 156>videodev</TT 157> module automatically 158assigns minor numbers to drivers in load order, depending on the 159registered device type. We recommend that V4L2 drivers by default 160register devices with the same numbers, but the system administrator 161can assign arbitrary minor numbers using driver module options. The 162major device number remains 81.</P 163><DIV 164CLASS="TABLE" 165><A 166NAME="V4L-DEV" 167></A 168><P 169><B 170>Table 6-1. V4L Device Types, Names and Numbers</B 171></P 172><TABLE 173BORDER="1" 174CLASS="CALSTABLE" 175><COL><COL><COL><THEAD 176><TR 177><TH 178>Device Type</TH 179><TH 180>File Name</TH 181><TH 182>Minor Numbers</TH 183></TR 184></THEAD 185><TBODY 186VALIGN="TOP" 187><TR 188><TD 189>Video capture and overlay</TD 190><TD 191><P 192><TT 193CLASS="FILENAME" 194>/dev/video</TT 195> and 196<TT 197CLASS="FILENAME" 198>/dev/bttv0</TT 199><SUP 200>a</SUP 201>, 202<TT 203CLASS="FILENAME" 204>/dev/video0</TT 205> to 206<TT 207CLASS="FILENAME" 208>/dev/video63</TT 209></P 210></TD 211><TD 212>0-63</TD 213></TR 214><TR 215><TD 216>Radio receiver</TD 217><TD 218><P 219><TT 220CLASS="FILENAME" 221>/dev/radio</TT 222><SUP 223>b</SUP 224>, <TT 225CLASS="FILENAME" 226>/dev/radio0</TT 227> to 228<TT 229CLASS="FILENAME" 230>/dev/radio63</TT 231></P 232></TD 233><TD 234>64-127</TD 235></TR 236><TR 237><TD 238>Teletext decoder</TD 239><TD 240><P 241><TT 242CLASS="FILENAME" 243>/dev/vtx</TT 244>, 245<TT 246CLASS="FILENAME" 247>/dev/vtx0</TT 248> to 249<TT 250CLASS="FILENAME" 251>/dev/vtx31</TT 252></P 253></TD 254><TD 255>192-223</TD 256></TR 257><TR 258><TD 259>Raw VBI capture</TD 260><TD 261><P 262><TT 263CLASS="FILENAME" 264>/dev/vbi</TT 265>, 266<TT 267CLASS="FILENAME" 268>/dev/vbi0</TT 269> to 270<TT 271CLASS="FILENAME" 272>/dev/vbi31</TT 273></P 274></TD 275><TD 276>224-255</TD 277></TR 278></TBODY 279><TR 280><TD 281COLSPAN="3" 282>Notes:<BR><A 283NAME="FTN.AEN14624" 284>a. </A 285>According to 286Documentation/devices.txt these should be symbolic links to 287<TT 288CLASS="FILENAME" 289>/dev/video0</TT 290>. Note the original bttv interface is 291not compatible with V4L or V4L2.<BR><A 292NAME="FTN.AEN14635" 293>b. </A 294>According to 295<TT 296CLASS="FILENAME" 297>Documentation/devices.txt</TT 298> a symbolic link to 299<TT 300CLASS="FILENAME" 301>/dev/radio0</TT 302>.<BR></TD 303></TR 304></TABLE 305></DIV 306><P 307>V4L prohibits (or used to prohibit) multiple opens of a 308device file. V4L2 drivers <SPAN 309CLASS="emphasis" 310><I 311CLASS="EMPHASIS" 312>may</I 313></SPAN 314> support multiple 315opens, see <A 316HREF="c174.htm#OPEN" 317>Section 1.1</A 318> for details and consequences.</P 319><P 320>V4L drivers respond to V4L2 ioctls with an <SPAN 321CLASS="ERRORCODE" 322>EINVAL</SPAN 323> error code. The 324compatibility layer in the V4L2 <TT 325CLASS="FILENAME" 326>videodev</TT 327> module 328can translate V4L ioctl requests to their V4L2 counterpart, however a 329V4L2 driver usually needs more preparation to become fully V4L 330compatible. This is covered in more detail in <A 331HREF="c14592.htm" 332>Chapter 5</A 333>.</P 334></DIV 335><DIV 336CLASS="SECTION" 337><H2 338CLASS="SECTION" 339><A 340NAME="AEN14665" 341>6.1.2. Querying Capabilities</A 342></H2 343><P 344>The V4L <CODE 345CLASS="CONSTANT" 346>VIDIOCGCAP</CODE 347> ioctl is 348equivalent to V4L2's <A 349HREF="r13105.htm" 350><CODE 351CLASS="CONSTANT" 352>VIDIOC_QUERYCAP</CODE 353></A 354>.</P 355><P 356>The <CODE 357CLASS="STRUCTFIELD" 358>name</CODE 359> field in struct 360<CODE 361CLASS="STRUCTNAME" 362>video_capability</CODE 363> became 364<CODE 365CLASS="STRUCTFIELD" 366>card</CODE 367> in struct <A 368HREF="r13105.htm#V4L2-CAPABILITY" 369>v4l2_capability</A 370>, 371<CODE 372CLASS="STRUCTFIELD" 373>type</CODE 374> was replaced by 375<CODE 376CLASS="STRUCTFIELD" 377>capabilities</CODE 378>. Note V4L2 does not 379distinguish between device types like this, better think of basic 380video input, video output and radio devices supporting a set of 381related functions like video capturing, video overlay and VBI 382capturing. See <A 383HREF="c174.htm#OPEN" 384>Section 1.1</A 385> for an 386introduction.<DIV 387CLASS="INFORMALTABLE" 388><P 389></P 390><A 391NAME="AEN14679" 392></A 393><TABLE 394BORDER="1" 395CLASS="CALSTABLE" 396><COL><COL><COL><THEAD 397><TR 398><TH 399>struct 400<CODE 401CLASS="STRUCTNAME" 402>video_capability</CODE 403> 404<CODE 405CLASS="STRUCTFIELD" 406>type</CODE 407></TH 408><TH 409>struct <A 410HREF="r13105.htm#V4L2-CAPABILITY" 411>v4l2_capability</A 412> 413<CODE 414CLASS="STRUCTFIELD" 415>capabilities</CODE 416> flags</TH 417><TH 418>Purpose</TH 419></TR 420></THEAD 421><TBODY 422VALIGN="TOP" 423><TR 424><TD 425><CODE 426CLASS="CONSTANT" 427>VID_TYPE_CAPTURE</CODE 428></TD 429><TD 430><CODE 431CLASS="CONSTANT" 432>V4L2_CAP_VIDEO_CAPTURE</CODE 433></TD 434><TD 435>The <A 436HREF="c6488.htm#CAPTURE" 437>video 438capture</A 439> interface is supported.</TD 440></TR 441><TR 442><TD 443><CODE 444CLASS="CONSTANT" 445>VID_TYPE_TUNER</CODE 446></TD 447><TD 448><CODE 449CLASS="CONSTANT" 450>V4L2_CAP_TUNER</CODE 451></TD 452><TD 453>The device has a <A 454HREF="x394.htm" 455>tuner or 456modulator</A 457>.</TD 458></TR 459><TR 460><TD 461><CODE 462CLASS="CONSTANT" 463>VID_TYPE_TELETEXT</CODE 464></TD 465><TD 466><CODE 467CLASS="CONSTANT" 468>V4L2_CAP_VBI_CAPTURE</CODE 469></TD 470><TD 471>The <A 472HREF="x7013.htm" 473>raw VBI 474capture</A 475> interface is supported.</TD 476></TR 477><TR 478><TD 479><CODE 480CLASS="CONSTANT" 481>VID_TYPE_OVERLAY</CODE 482></TD 483><TD 484><CODE 485CLASS="CONSTANT" 486>V4L2_CAP_VIDEO_OVERLAY</CODE 487></TD 488><TD 489>The <A 490HREF="x6570.htm" 491>video 492overlay</A 493> interface is supported.</TD 494></TR 495><TR 496><TD 497><CODE 498CLASS="CONSTANT" 499>VID_TYPE_CHROMAKEY</CODE 500></TD 501><TD 502><CODE 503CLASS="CONSTANT" 504>V4L2_FBUF_CAP_CHROMAKEY</CODE 505> in 506field <CODE 507CLASS="STRUCTFIELD" 508>capability</CODE 509> of 510struct <A 511HREF="r10595.htm#V4L2-FRAMEBUFFER" 512>v4l2_framebuffer</A 513></TD 514><TD 515>Whether chromakey overlay is supported. For 516more information on overlay see 517<A 518HREF="x6570.htm" 519>Section 4.2</A 520>.</TD 521></TR 522><TR 523><TD 524><CODE 525CLASS="CONSTANT" 526>VID_TYPE_CLIPPING</CODE 527></TD 528><TD 529><CODE 530CLASS="CONSTANT" 531>V4L2_FBUF_CAP_LIST_CLIPPING</CODE 532> 533and <CODE 534CLASS="CONSTANT" 535>V4L2_FBUF_CAP_BITMAP_CLIPPING</CODE 536> in field 537<CODE 538CLASS="STRUCTFIELD" 539>capability</CODE 540> of struct <A 541HREF="r10595.htm#V4L2-FRAMEBUFFER" 542>v4l2_framebuffer</A 543></TD 544><TD 545>Whether clipping the overlaid image is 546supported, see <A 547HREF="x6570.htm" 548>Section 4.2</A 549>.</TD 550></TR 551><TR 552><TD 553><CODE 554CLASS="CONSTANT" 555>VID_TYPE_FRAMERAM</CODE 556></TD 557><TD 558><CODE 559CLASS="CONSTANT" 560>V4L2_FBUF_CAP_EXTERNOVERLAY</CODE 561> 562<SPAN 563CLASS="emphasis" 564><I 565CLASS="EMPHASIS" 566>not set</I 567></SPAN 568> in field 569<CODE 570CLASS="STRUCTFIELD" 571>capability</CODE 572> of struct <A 573HREF="r10595.htm#V4L2-FRAMEBUFFER" 574>v4l2_framebuffer</A 575></TD 576><TD 577>Whether overlay overwrites frame buffer memory, 578see <A 579HREF="x6570.htm" 580>Section 4.2</A 581>.</TD 582></TR 583><TR 584><TD 585><CODE 586CLASS="CONSTANT" 587>VID_TYPE_SCALES</CODE 588></TD 589><TD 590><CODE 591CLASS="CONSTANT" 592>-</CODE 593></TD 594><TD 595>This flag indicates if the hardware can scale 596images. The V4L2 API implies the scale factor by setting the cropping 597dimensions and image size with the <A 598HREF="r9994.htm" 599><CODE 600CLASS="CONSTANT" 601>VIDIOC_S_CROP</CODE 602></A 603> and <A 604HREF="r10944.htm" 605><CODE 606CLASS="CONSTANT" 607>VIDIOC_S_FMT</CODE 608></A 609> 610ioctl, respectively. The driver returns the closest sizes possible. 611For more information on cropping and scaling see <A 612HREF="x1904.htm" 613>Section 1.11</A 614>.</TD 615></TR 616><TR 617><TD 618><CODE 619CLASS="CONSTANT" 620>VID_TYPE_MONOCHROME</CODE 621></TD 622><TD 623><CODE 624CLASS="CONSTANT" 625>-</CODE 626></TD 627><TD 628>Applications can enumerate the supported image 629formats with the <A 630HREF="r8367.htm" 631><CODE 632CLASS="CONSTANT" 633>VIDIOC_ENUM_FMT</CODE 634></A 635> ioctl to determine if the device 636supports grey scale capturing only. For more information on image 637formats see <A 638HREF="c2030.htm" 639>Chapter 2</A 640>.</TD 641></TR 642><TR 643><TD 644><CODE 645CLASS="CONSTANT" 646>VID_TYPE_SUBCAPTURE</CODE 647></TD 648><TD 649><CODE 650CLASS="CONSTANT" 651>-</CODE 652></TD 653><TD 654>Applications can call the <A 655HREF="r9994.htm" 656><CODE 657CLASS="CONSTANT" 658>VIDIOC_G_CROP</CODE 659></A 660> ioctl 661to determine if the device supports capturing a subsection of the full 662picture ("cropping" in V4L2). If not, the ioctl returns the <SPAN 663CLASS="ERRORCODE" 664>EINVAL</SPAN 665> error code. 666For more information on cropping and scaling see <A 667HREF="x1904.htm" 668>Section 1.11</A 669>.</TD 670></TR 671><TR 672><TD 673><CODE 674CLASS="CONSTANT" 675>VID_TYPE_MPEG_DECODER</CODE 676></TD 677><TD 678><CODE 679CLASS="CONSTANT" 680>-</CODE 681></TD 682><TD 683>Applications can enumerate the supported image 684formats with the <A 685HREF="r8367.htm" 686><CODE 687CLASS="CONSTANT" 688>VIDIOC_ENUM_FMT</CODE 689></A 690> ioctl to determine if the device 691supports MPEG streams.</TD 692></TR 693><TR 694><TD 695><CODE 696CLASS="CONSTANT" 697>VID_TYPE_MPEG_ENCODER</CODE 698></TD 699><TD 700><CODE 701CLASS="CONSTANT" 702>-</CODE 703></TD 704><TD 705>See above.</TD 706></TR 707><TR 708><TD 709><CODE 710CLASS="CONSTANT" 711>VID_TYPE_MJPEG_DECODER</CODE 712></TD 713><TD 714><CODE 715CLASS="CONSTANT" 716>-</CODE 717></TD 718><TD 719>See above.</TD 720></TR 721><TR 722><TD 723><CODE 724CLASS="CONSTANT" 725>VID_TYPE_MJPEG_ENCODER</CODE 726></TD 727><TD 728><CODE 729CLASS="CONSTANT" 730>-</CODE 731></TD 732><TD 733>See above.</TD 734></TR 735></TBODY 736></TABLE 737><P 738></P 739></DIV 740></P 741><P 742>The <CODE 743CLASS="STRUCTFIELD" 744>audios</CODE 745> field was replaced 746by <CODE 747CLASS="STRUCTFIELD" 748>capabilities</CODE 749> flag 750<CODE 751CLASS="CONSTANT" 752>V4L2_CAP_AUDIO</CODE 753>, indicating 754<SPAN 755CLASS="emphasis" 756><I 757CLASS="EMPHASIS" 758>if</I 759></SPAN 760> the device has any audio inputs or outputs. To 761determine their number applications can enumerate audio inputs with 762the <A 763HREF="r9539.htm" 764><CODE 765CLASS="CONSTANT" 766>VIDIOC_G_AUDIO</CODE 767></A 768> ioctl. The audio ioctls are described in <A 769HREF="x341.htm" 770>Section 1.5</A 771>.</P 772><P 773>The <CODE 774CLASS="STRUCTFIELD" 775>maxwidth</CODE 776>, 777<CODE 778CLASS="STRUCTFIELD" 779>maxheight</CODE 780>, 781<CODE 782CLASS="STRUCTFIELD" 783>minwidth</CODE 784> and 785<CODE 786CLASS="STRUCTFIELD" 787>minheight</CODE 788> fields were removed. Calling the 789<A 790HREF="r10944.htm" 791><CODE 792CLASS="CONSTANT" 793>VIDIOC_S_FMT</CODE 794></A 795> or <A 796HREF="r10944.htm" 797><CODE 798CLASS="CONSTANT" 799>VIDIOC_TRY_FMT</CODE 800></A 801> ioctl with the desired dimensions 802returns the closest size possible, taking into account the current 803video standard, cropping and scaling limitations.</P 804></DIV 805><DIV 806CLASS="SECTION" 807><H2 808CLASS="SECTION" 809><A 810NAME="AEN14821" 811>6.1.3. Video Sources</A 812></H2 813><P 814>V4L provides the <CODE 815CLASS="CONSTANT" 816>VIDIOCGCHAN</CODE 817> and 818<CODE 819CLASS="CONSTANT" 820>VIDIOCSCHAN</CODE 821> ioctl using struct 822<CODE 823CLASS="STRUCTNAME" 824>video_channel</CODE 825> to enumerate 826the video inputs of a V4L device. The equivalent V4L2 ioctls 827are <A 828HREF="r8936.htm" 829><CODE 830CLASS="CONSTANT" 831>VIDIOC_ENUMINPUT</CODE 832></A 833>, <A 834HREF="r11217.htm" 835><CODE 836CLASS="CONSTANT" 837>VIDIOC_G_INPUT</CODE 838></A 839> and <A 840HREF="r11217.htm" 841><CODE 842CLASS="CONSTANT" 843>VIDIOC_S_INPUT</CODE 844></A 845> 846using struct <A 847HREF="r8936.htm#V4L2-INPUT" 848>v4l2_input</A 849> as discussed in <A 850HREF="x309.htm" 851>Section 1.4</A 852>.</P 853><P 854>The <CODE 855CLASS="STRUCTFIELD" 856>channel</CODE 857> field counting 858inputs was renamed to <CODE 859CLASS="STRUCTFIELD" 860>index</CODE 861>, the video 862input types were renamed as follows: <DIV 863CLASS="INFORMALTABLE" 864><P 865></P 866><A 867NAME="AEN14838" 868></A 869><TABLE 870BORDER="1" 871CLASS="CALSTABLE" 872><COL><COL><THEAD 873><TR 874><TH 875>struct <CODE 876CLASS="STRUCTNAME" 877>video_channel</CODE 878> 879<CODE 880CLASS="STRUCTFIELD" 881>type</CODE 882></TH 883><TH 884>struct <A 885HREF="r8936.htm#V4L2-INPUT" 886>v4l2_input</A 887> 888<CODE 889CLASS="STRUCTFIELD" 890>type</CODE 891></TH 892></TR 893></THEAD 894><TBODY 895VALIGN="TOP" 896><TR 897><TD 898><CODE 899CLASS="CONSTANT" 900>VIDEO_TYPE_TV</CODE 901></TD 902><TD 903><CODE 904CLASS="CONSTANT" 905>V4L2_INPUT_TYPE_TUNER</CODE 906></TD 907></TR 908><TR 909><TD 910><CODE 911CLASS="CONSTANT" 912>VIDEO_TYPE_CAMERA</CODE 913></TD 914><TD 915><CODE 916CLASS="CONSTANT" 917>V4L2_INPUT_TYPE_CAMERA</CODE 918></TD 919></TR 920></TBODY 921></TABLE 922><P 923></P 924></DIV 925></P 926><P 927>Unlike the <CODE 928CLASS="STRUCTFIELD" 929>tuners</CODE 930> field 931expressing the number of tuners of this input, V4L2 assumes each video 932input is connected to at most one tuner. However a tuner can have more 933than one input, i. e. RF connectors, and a device can have multiple 934tuners. The index number of the tuner associated with the input, if 935any, is stored in field <CODE 936CLASS="STRUCTFIELD" 937>tuner</CODE 938> of 939struct <A 940HREF="r8936.htm#V4L2-INPUT" 941>v4l2_input</A 942>. Enumeration of tuners is discussed in <A 943HREF="x394.htm" 944>Section 1.6</A 945>.</P 946><P 947>The redundant <CODE 948CLASS="CONSTANT" 949>VIDEO_VC_TUNER</CODE 950> flag was 951dropped. Video inputs associated with a tuner are of type 952<CODE 953CLASS="CONSTANT" 954>V4L2_INPUT_TYPE_TUNER</CODE 955>. The 956<CODE 957CLASS="CONSTANT" 958>VIDEO_VC_AUDIO</CODE 959> flag was replaced by the 960<CODE 961CLASS="STRUCTFIELD" 962>audioset</CODE 963> field. V4L2 considers devices with 964up to 32 audio inputs. Each set bit in the 965<CODE 966CLASS="STRUCTFIELD" 967>audioset</CODE 968> field represents one audio input 969this video input combines with. For information about audio inputs and 970how to switch between them see <A 971HREF="x341.htm" 972>Section 1.5</A 973>.</P 974><P 975>The <CODE 976CLASS="STRUCTFIELD" 977>norm</CODE 978> field describing the 979supported video standards was replaced by 980<CODE 981CLASS="STRUCTFIELD" 982>std</CODE 983>. The V4L specification mentions a flag 984<CODE 985CLASS="CONSTANT" 986>VIDEO_VC_NORM</CODE 987> indicating whether the standard can 988be changed. This flag was a later addition together with the 989<CODE 990CLASS="STRUCTFIELD" 991>norm</CODE 992> field and has been removed in the 993meantime. V4L2 has a similar, albeit more comprehensive approach 994to video standards, see <A 995HREF="x448.htm" 996>Section 1.7</A 997> for more 998information.</P 999></DIV 1000><DIV 1001CLASS="SECTION" 1002><H2 1003CLASS="SECTION" 1004><A 1005NAME="AEN14877" 1006>6.1.4. Tuning</A 1007></H2 1008><P 1009>The V4L <CODE 1010CLASS="CONSTANT" 1011>VIDIOCGTUNER</CODE 1012> and 1013<CODE 1014CLASS="CONSTANT" 1015>VIDIOCSTUNER</CODE 1016> ioctl and struct 1017<CODE 1018CLASS="STRUCTNAME" 1019>video_tuner</CODE 1020> can be used to enumerate the 1021tuners of a V4L TV or radio device. The equivalent V4L2 ioctls are 1022<A 1023HREF="r12342.htm" 1024><CODE 1025CLASS="CONSTANT" 1026>VIDIOC_G_TUNER</CODE 1027></A 1028> and <A 1029HREF="r12342.htm" 1030><CODE 1031CLASS="CONSTANT" 1032>VIDIOC_S_TUNER</CODE 1033></A 1034> using struct <A 1035HREF="r12342.htm#V4L2-TUNER" 1036>v4l2_tuner</A 1037>. Tuners are 1038covered in <A 1039HREF="x394.htm" 1040>Section 1.6</A 1041>.</P 1042><P 1043>The <CODE 1044CLASS="STRUCTFIELD" 1045>tuner</CODE 1046> field counting tuners 1047was renamed to <CODE 1048CLASS="STRUCTFIELD" 1049>index</CODE 1050>. The fields 1051<CODE 1052CLASS="STRUCTFIELD" 1053>name</CODE 1054>, <CODE 1055CLASS="STRUCTFIELD" 1056>rangelow</CODE 1057> 1058and <CODE 1059CLASS="STRUCTFIELD" 1060>rangehigh</CODE 1061> remained unchanged.</P 1062><P 1063>The <CODE 1064CLASS="CONSTANT" 1065>VIDEO_TUNER_PAL</CODE 1066>, 1067<CODE 1068CLASS="CONSTANT" 1069>VIDEO_TUNER_NTSC</CODE 1070> and 1071<CODE 1072CLASS="CONSTANT" 1073>VIDEO_TUNER_SECAM</CODE 1074> flags indicating the supported 1075video standards were dropped. This information is now contained in the 1076associated struct <A 1077HREF="r8936.htm#V4L2-INPUT" 1078>v4l2_input</A 1079>. No replacement exists for the 1080<CODE 1081CLASS="CONSTANT" 1082>VIDEO_TUNER_NORM</CODE 1083> flag indicating whether the 1084video standard can be switched. The <CODE 1085CLASS="STRUCTFIELD" 1086>mode</CODE 1087> 1088field to select a different video standard was replaced by a whole new 1089set of ioctls and structures described in <A 1090HREF="x448.htm" 1091>Section 1.7</A 1092>. 1093Due to its ubiquity it should be mentioned the BTTV driver supports 1094several standards in addition to the regular 1095<CODE 1096CLASS="CONSTANT" 1097>VIDEO_MODE_PAL</CODE 1098> (0), 1099<CODE 1100CLASS="CONSTANT" 1101>VIDEO_MODE_NTSC</CODE 1102>, 1103<CODE 1104CLASS="CONSTANT" 1105>VIDEO_MODE_SECAM</CODE 1106> and 1107<CODE 1108CLASS="CONSTANT" 1109>VIDEO_MODE_AUTO</CODE 1110> (3). Namely N/PAL Argentina, 1111M/PAL, N/PAL, and NTSC Japan with numbers 3-6 (sic).</P 1112><P 1113>The <CODE 1114CLASS="CONSTANT" 1115>VIDEO_TUNER_STEREO_ON</CODE 1116> flag 1117indicating stereo reception became 1118<CODE 1119CLASS="CONSTANT" 1120>V4L2_TUNER_SUB_STEREO</CODE 1121> in field 1122<CODE 1123CLASS="STRUCTFIELD" 1124>rxsubchans</CODE 1125>. This field also permits the 1126detection of monaural and bilingual audio, see the definition of 1127struct <A 1128HREF="r12342.htm#V4L2-TUNER" 1129>v4l2_tuner</A 1130> for details. Presently no replacement exists for the 1131<CODE 1132CLASS="CONSTANT" 1133>VIDEO_TUNER_RDS_ON</CODE 1134> and 1135<CODE 1136CLASS="CONSTANT" 1137>VIDEO_TUNER_MBS_ON</CODE 1138> flags.</P 1139><P 1140> The <CODE 1141CLASS="CONSTANT" 1142>VIDEO_TUNER_LOW</CODE 1143> flag was renamed 1144to <CODE 1145CLASS="CONSTANT" 1146>V4L2_TUNER_CAP_LOW</CODE 1147> in the struct <A 1148HREF="r12342.htm#V4L2-TUNER" 1149>v4l2_tuner</A 1150> 1151<CODE 1152CLASS="STRUCTFIELD" 1153>capability</CODE 1154> field.</P 1155><P 1156>The <CODE 1157CLASS="CONSTANT" 1158>VIDIOCGFREQ</CODE 1159> and 1160<CODE 1161CLASS="CONSTANT" 1162>VIDIOCSFREQ</CODE 1163> ioctl to change the tuner frequency 1164where renamed to <A 1165HREF="r11094.htm" 1166><CODE 1167CLASS="CONSTANT" 1168>VIDIOC_G_FREQUENCY</CODE 1169></A 1170> and <A 1171HREF="r11094.htm" 1172><CODE 1173CLASS="CONSTANT" 1174>VIDIOC_S_FREQUENCY</CODE 1175></A 1176>. They 1177take a pointer to a struct <A 1178HREF="r11094.htm#V4L2-FREQUENCY" 1179>v4l2_frequency</A 1180> instead of an unsigned long 1181integer.</P 1182></DIV 1183><DIV 1184CLASS="SECTION" 1185><H2 1186CLASS="SECTION" 1187><A 1188NAME="V4L-IMAGE-PROPERTIES" 1189>6.1.5. Image Properties</A 1190></H2 1191><P 1192>V4L2 has no equivalent of the 1193<CODE 1194CLASS="CONSTANT" 1195>VIDIOCGPICT</CODE 1196> and <CODE 1197CLASS="CONSTANT" 1198>VIDIOCSPICT</CODE 1199> 1200ioctl and struct <CODE 1201CLASS="STRUCTNAME" 1202>video_picture</CODE 1203>. The following 1204fields where replaced by V4L2 controls accessible with the 1205<A 1206HREF="r13317.htm" 1207><CODE 1208CLASS="CONSTANT" 1209>VIDIOC_QUERYCTRL</CODE 1210></A 1211>, <A 1212HREF="r10104.htm" 1213><CODE 1214CLASS="CONSTANT" 1215>VIDIOC_G_CTRL</CODE 1216></A 1217> and <A 1218HREF="r10104.htm" 1219><CODE 1220CLASS="CONSTANT" 1221>VIDIOC_S_CTRL</CODE 1222></A 1223> ioctls:<DIV 1224CLASS="INFORMALTABLE" 1225><P 1226></P 1227><A 1228NAME="AEN14939" 1229></A 1230><TABLE 1231BORDER="1" 1232CLASS="CALSTABLE" 1233><COL><COL><THEAD 1234><TR 1235><TH 1236>struct <CODE 1237CLASS="STRUCTNAME" 1238>video_picture</CODE 1239></TH 1240><TH 1241>V4L2 Control ID</TH 1242></TR 1243></THEAD 1244><TBODY 1245VALIGN="TOP" 1246><TR 1247><TD 1248><CODE 1249CLASS="STRUCTFIELD" 1250>brightness</CODE 1251></TD 1252><TD 1253><CODE 1254CLASS="CONSTANT" 1255>V4L2_CID_BRIGHTNESS</CODE 1256></TD 1257></TR 1258><TR 1259><TD 1260><CODE 1261CLASS="STRUCTFIELD" 1262>hue</CODE 1263></TD 1264><TD 1265><CODE 1266CLASS="CONSTANT" 1267>V4L2_CID_HUE</CODE 1268></TD 1269></TR 1270><TR 1271><TD 1272><CODE 1273CLASS="STRUCTFIELD" 1274>colour</CODE 1275></TD 1276><TD 1277><CODE 1278CLASS="CONSTANT" 1279>V4L2_CID_SATURATION</CODE 1280></TD 1281></TR 1282><TR 1283><TD 1284><CODE 1285CLASS="STRUCTFIELD" 1286>contrast</CODE 1287></TD 1288><TD 1289><CODE 1290CLASS="CONSTANT" 1291>V4L2_CID_CONTRAST</CODE 1292></TD 1293></TR 1294><TR 1295><TD 1296><CODE 1297CLASS="STRUCTFIELD" 1298>whiteness</CODE 1299></TD 1300><TD 1301><CODE 1302CLASS="CONSTANT" 1303>V4L2_CID_WHITENESS</CODE 1304></TD 1305></TR 1306></TBODY 1307></TABLE 1308><P 1309></P 1310></DIV 1311></P 1312><P 1313>The V4L picture controls are assumed to range from 0 to 131465535 with no particular reset value. The V4L2 API permits arbitrary 1315limits and defaults which can be queried with the <A 1316HREF="r13317.htm" 1317><CODE 1318CLASS="CONSTANT" 1319>VIDIOC_QUERYCTRL</CODE 1320></A 1321> 1322ioctl. For general information about controls see <A 1323HREF="x542.htm" 1324>Section 1.8</A 1325>.</P 1326><P 1327>The <CODE 1328CLASS="STRUCTFIELD" 1329>depth</CODE 1330> (average number of 1331bits per pixel) of a video image is implied by the selected image 1332format. V4L2 does not explicitely provide such information assuming 1333applications recognizing the format are aware of the image depth and 1334others need not know. The <CODE 1335CLASS="STRUCTFIELD" 1336>palette</CODE 1337> field 1338moved into the struct <A 1339HREF="c2030.htm#V4L2-PIX-FORMAT" 1340>v4l2_pix_format</A 1341>:<DIV 1342CLASS="INFORMALTABLE" 1343><P 1344></P 1345><A 1346NAME="AEN14980" 1347></A 1348><TABLE 1349BORDER="1" 1350CLASS="CALSTABLE" 1351><COL><COL><THEAD 1352><TR 1353><TH 1354>struct <CODE 1355CLASS="STRUCTNAME" 1356>video_picture</CODE 1357> 1358<CODE 1359CLASS="STRUCTFIELD" 1360>palette</CODE 1361></TH 1362><TH 1363>struct <A 1364HREF="c2030.htm#V4L2-PIX-FORMAT" 1365>v4l2_pix_format</A 1366> 1367<CODE 1368CLASS="STRUCTFIELD" 1369>pixfmt</CODE 1370></TH 1371></TR 1372></THEAD 1373><TBODY 1374VALIGN="TOP" 1375><TR 1376><TD 1377><CODE 1378CLASS="CONSTANT" 1379>VIDEO_PALETTE_GREY</CODE 1380></TD 1381><TD 1382><P 1383><A 1384HREF="r4185.htm" 1385><CODE 1386CLASS="CONSTANT" 1387>V4L2_PIX_FMT_GREY</CODE 1388></A 1389></P 1390></TD 1391></TR 1392><TR 1393><TD 1394><CODE 1395CLASS="CONSTANT" 1396>VIDEO_PALETTE_HI240</CODE 1397></TD 1398><TD 1399><P 1400><A 1401HREF="x5665.htm" 1402><CODE 1403CLASS="CONSTANT" 1404>V4L2_PIX_FMT_HI240</CODE 1405></A 1406><SUP 1407>a</SUP 1408></P 1409></TD 1410></TR 1411><TR 1412><TD 1413><CODE 1414CLASS="CONSTANT" 1415>VIDEO_PALETTE_RGB565</CODE 1416></TD 1417><TD 1418><P 1419><A 1420HREF="x2490.htm" 1421><CODE 1422CLASS="CONSTANT" 1423>V4L2_PIX_FMT_RGB565</CODE 1424></A 1425></P 1426></TD 1427></TR 1428><TR 1429><TD 1430><CODE 1431CLASS="CONSTANT" 1432>VIDEO_PALETTE_RGB555</CODE 1433></TD 1434><TD 1435><P 1436><A 1437HREF="x2490.htm" 1438><CODE 1439CLASS="CONSTANT" 1440>V4L2_PIX_FMT_RGB555</CODE 1441></A 1442></P 1443></TD 1444></TR 1445><TR 1446><TD 1447><CODE 1448CLASS="CONSTANT" 1449>VIDEO_PALETTE_RGB24</CODE 1450></TD 1451><TD 1452><P 1453><A 1454HREF="x2490.htm" 1455><CODE 1456CLASS="CONSTANT" 1457>V4L2_PIX_FMT_BGR24</CODE 1458></A 1459></P 1460></TD 1461></TR 1462><TR 1463><TD 1464><CODE 1465CLASS="CONSTANT" 1466>VIDEO_PALETTE_RGB32</CODE 1467></TD 1468><TD 1469><P 1470><A 1471HREF="x2490.htm" 1472><CODE 1473CLASS="CONSTANT" 1474>V4L2_PIX_FMT_BGR32</CODE 1475></A 1476><SUP 1477>b</SUP 1478></P 1479></TD 1480></TR 1481><TR 1482><TD 1483><CODE 1484CLASS="CONSTANT" 1485>VIDEO_PALETTE_YUV422</CODE 1486></TD 1487><TD 1488><P 1489><A 1490HREF="r4339.htm" 1491><CODE 1492CLASS="CONSTANT" 1493>V4L2_PIX_FMT_YUYV</CODE 1494></A 1495></P 1496></TD 1497></TR 1498><TR 1499><TD 1500><P 1501><CODE 1502CLASS="CONSTANT" 1503>VIDEO_PALETTE_YUYV</CODE 1504><SUP 1505>c</SUP 1506></P 1507></TD 1508><TD 1509><P 1510><A 1511HREF="r4339.htm" 1512><CODE 1513CLASS="CONSTANT" 1514>V4L2_PIX_FMT_YUYV</CODE 1515></A 1516></P 1517></TD 1518></TR 1519><TR 1520><TD 1521><CODE 1522CLASS="CONSTANT" 1523>VIDEO_PALETTE_UYVY</CODE 1524></TD 1525><TD 1526><P 1527><A 1528HREF="r4484.htm" 1529><CODE 1530CLASS="CONSTANT" 1531>V4L2_PIX_FMT_UYVY</CODE 1532></A 1533></P 1534></TD 1535></TR 1536><TR 1537><TD 1538><CODE 1539CLASS="CONSTANT" 1540>VIDEO_PALETTE_YUV420</CODE 1541></TD 1542><TD 1543>None</TD 1544></TR 1545><TR 1546><TD 1547><CODE 1548CLASS="CONSTANT" 1549>VIDEO_PALETTE_YUV411</CODE 1550></TD 1551><TD 1552><P 1553><A 1554HREF="r4629.htm" 1555><CODE 1556CLASS="CONSTANT" 1557>V4L2_PIX_FMT_Y41P</CODE 1558></A 1559><SUP 1560>d</SUP 1561></P 1562></TD 1563></TR 1564><TR 1565><TD 1566><CODE 1567CLASS="CONSTANT" 1568>VIDEO_PALETTE_RAW</CODE 1569></TD 1570><TD 1571><P 1572>None<SUP 1573>e</SUP 1574></P 1575></TD 1576></TR 1577><TR 1578><TD 1579><CODE 1580CLASS="CONSTANT" 1581>VIDEO_PALETTE_YUV422P</CODE 1582></TD 1583><TD 1584><P 1585><A 1586HREF="r5154.htm" 1587><CODE 1588CLASS="CONSTANT" 1589>V4L2_PIX_FMT_YUV422P</CODE 1590></A 1591></P 1592></TD 1593></TR 1594><TR 1595><TD 1596><CODE 1597CLASS="CONSTANT" 1598>VIDEO_PALETTE_YUV411P</CODE 1599></TD 1600><TD 1601><P 1602><A 1603HREF="r5319.htm" 1604><CODE 1605CLASS="CONSTANT" 1606>V4L2_PIX_FMT_YUV411P</CODE 1607></A 1608><SUP 1609>f</SUP 1610></P 1611></TD 1612></TR 1613><TR 1614><TD 1615><CODE 1616CLASS="CONSTANT" 1617>VIDEO_PALETTE_YUV420P</CODE 1618></TD 1619><TD 1620><P 1621><A 1622HREF="r4850.htm#V4L2-PIX-FMT-YVU420" 1623><CODE 1624CLASS="CONSTANT" 1625>V4L2_PIX_FMT_YVU420</CODE 1626></A 1627></P 1628></TD 1629></TR 1630><TR 1631><TD 1632><CODE 1633CLASS="CONSTANT" 1634>VIDEO_PALETTE_YUV410P</CODE 1635></TD 1636><TD 1637><P 1638><A 1639HREF="r5016.htm#V4L2-PIX-FMT-YVU410" 1640><CODE 1641CLASS="CONSTANT" 1642>V4L2_PIX_FMT_YVU410</CODE 1643></A 1644></P 1645></TD 1646></TR 1647></TBODY 1648><TR 1649><TD 1650COLSPAN="2" 1651>Notes:<BR><A 1652NAME="FTN.AEN15005" 1653>a. </A 1654>This is a custom format used by the BTTV 1655driver, not one of the V4L2 standard formats.<BR><A 1656NAME="FTN.AEN15035" 1657>b. </A 1658>Presumably all V4L RGB formats are 1659little-endian, although some drivers might interpret them according to machine endianess. V4L2 defines little-endian, big-endian and red/blue 1660swapped variants. For details see <A 1661HREF="x2490.htm" 1662>Section 2.4</A 1663>.<BR><A 1664NAME="FTN.AEN15049" 1665>c. </A 1666><CODE 1667CLASS="CONSTANT" 1668>VIDEO_PALETTE_YUV422</CODE 1669> 1670and <CODE 1671CLASS="CONSTANT" 1672>VIDEO_PALETTE_YUYV</CODE 1673> are the same formats. Some 1674V4L drivers respond to one, some to the other.<BR><A 1675NAME="FTN.AEN15075" 1676>d. </A 1677>Not to be confused with 1678<CODE 1679CLASS="CONSTANT" 1680>V4L2_PIX_FMT_YUV411P</CODE 1681>, which is a planar 1682format.<BR><A 1683NAME="FTN.AEN15083" 1684>e. </A 1685>V4L explains this 1686as: "RAW capture (BT848)"<BR><A 1687NAME="FTN.AEN15099" 1688>f. </A 1689>Not to be confused with 1690<CODE 1691CLASS="CONSTANT" 1692>V4L2_PIX_FMT_Y41P</CODE 1693>, which is a packed 1694format.<BR></TD 1695></TR 1696></TABLE 1697><P 1698></P 1699></DIV 1700></P 1701><P 1702>V4L2 image formats are defined in <A 1703HREF="c2030.htm" 1704>Chapter 2</A 1705>. The image format can be selected with the 1706<A 1707HREF="r10944.htm" 1708><CODE 1709CLASS="CONSTANT" 1710>VIDIOC_S_FMT</CODE 1711></A 1712> ioctl.</P 1713></DIV 1714><DIV 1715CLASS="SECTION" 1716><H2 1717CLASS="SECTION" 1718><A 1719NAME="AEN15120" 1720>6.1.6. Audio</A 1721></H2 1722><P 1723>The <CODE 1724CLASS="CONSTANT" 1725>VIDIOCGAUDIO</CODE 1726> and 1727<CODE 1728CLASS="CONSTANT" 1729>VIDIOCSAUDIO</CODE 1730> ioctl and struct 1731<CODE 1732CLASS="STRUCTNAME" 1733>video_audio</CODE 1734> are used to enumerate the 1735audio inputs of a V4L device. The equivalent V4L2 ioctls are 1736<A 1737HREF="r9539.htm" 1738><CODE 1739CLASS="CONSTANT" 1740>VIDIOC_G_AUDIO</CODE 1741></A 1742> and <A 1743HREF="r9539.htm" 1744><CODE 1745CLASS="CONSTANT" 1746>VIDIOC_S_AUDIO</CODE 1747></A 1748> using struct <A 1749HREF="r9539.htm#V4L2-AUDIO" 1750>v4l2_audio</A 1751> as 1752discussed in <A 1753HREF="x341.htm" 1754>Section 1.5</A 1755>.</P 1756><P 1757>The <CODE 1758CLASS="STRUCTFIELD" 1759>audio</CODE 1760> "channel number" 1761field counting audio inputs was renamed to 1762<CODE 1763CLASS="STRUCTFIELD" 1764>index</CODE 1765>.</P 1766><P 1767>On <CODE 1768CLASS="CONSTANT" 1769>VIDIOCSAUDIO</CODE 1770> the 1771<CODE 1772CLASS="STRUCTFIELD" 1773>mode</CODE 1774> field selects <SPAN 1775CLASS="emphasis" 1776><I 1777CLASS="EMPHASIS" 1778>one</I 1779></SPAN 1780> 1781of the <CODE 1782CLASS="CONSTANT" 1783>VIDEO_SOUND_MONO</CODE 1784>, 1785<CODE 1786CLASS="CONSTANT" 1787>VIDEO_SOUND_STEREO</CODE 1788>, 1789<CODE 1790CLASS="CONSTANT" 1791>VIDEO_SOUND_LANG1</CODE 1792> or 1793<CODE 1794CLASS="CONSTANT" 1795>VIDEO_SOUND_LANG2</CODE 1796> audio demodulation modes. When 1797the current audio standard is BTSC 1798<CODE 1799CLASS="CONSTANT" 1800>VIDEO_SOUND_LANG2</CODE 1801> refers to SAP and 1802<CODE 1803CLASS="CONSTANT" 1804>VIDEO_SOUND_LANG1</CODE 1805> is meaningless. Also 1806undocumented in the V4L specification, there is no way to query the 1807selected mode. On <CODE 1808CLASS="CONSTANT" 1809>VIDIOCGAUDIO</CODE 1810> the driver returns 1811the <SPAN 1812CLASS="emphasis" 1813><I 1814CLASS="EMPHASIS" 1815>actually received</I 1816></SPAN 1817> audio programmes in this 1818field. In the V4L2 API this information is stored in the struct <A 1819HREF="r12342.htm#V4L2-TUNER" 1820>v4l2_tuner</A 1821> 1822<CODE 1823CLASS="STRUCTFIELD" 1824>rxsubchans</CODE 1825> and 1826<CODE 1827CLASS="STRUCTFIELD" 1828>audmode</CODE 1829> fields, respectively. See <A 1830HREF="x394.htm" 1831>Section 1.6</A 1832> for more information on tuners. Related to audio 1833modes struct <A 1834HREF="r9539.htm#V4L2-AUDIO" 1835>v4l2_audio</A 1836> also reports if this is a mono or stereo 1837input, regardless if the source is a tuner.</P 1838><P 1839>The following fields where replaced by V4L2 controls 1840accessible with the <A 1841HREF="r13317.htm" 1842><CODE 1843CLASS="CONSTANT" 1844>VIDIOC_QUERYCTRL</CODE 1845></A 1846>, <A 1847HREF="r10104.htm" 1848><CODE 1849CLASS="CONSTANT" 1850>VIDIOC_G_CTRL</CODE 1851></A 1852> and 1853<A 1854HREF="r10104.htm" 1855><CODE 1856CLASS="CONSTANT" 1857>VIDIOC_S_CTRL</CODE 1858></A 1859> ioctls:<DIV 1860CLASS="INFORMALTABLE" 1861><P 1862></P 1863><A 1864NAME="AEN15159" 1865></A 1866><TABLE 1867BORDER="1" 1868CLASS="CALSTABLE" 1869><COL><COL><THEAD 1870><TR 1871><TH 1872>struct 1873<CODE 1874CLASS="STRUCTNAME" 1875>video_audio</CODE 1876></TH 1877><TH 1878>V4L2 Control ID</TH 1879></TR 1880></THEAD 1881><TBODY 1882VALIGN="TOP" 1883><TR 1884><TD 1885><CODE 1886CLASS="STRUCTFIELD" 1887>volume</CODE 1888></TD 1889><TD 1890><CODE 1891CLASS="CONSTANT" 1892>V4L2_CID_AUDIO_VOLUME</CODE 1893></TD 1894></TR 1895><TR 1896><TD 1897><CODE 1898CLASS="STRUCTFIELD" 1899>bass</CODE 1900></TD 1901><TD 1902><CODE 1903CLASS="CONSTANT" 1904>V4L2_CID_AUDIO_BASS</CODE 1905></TD 1906></TR 1907><TR 1908><TD 1909><CODE 1910CLASS="STRUCTFIELD" 1911>treble</CODE 1912></TD 1913><TD 1914><CODE 1915CLASS="CONSTANT" 1916>V4L2_CID_AUDIO_TREBLE</CODE 1917></TD 1918></TR 1919><TR 1920><TD 1921><CODE 1922CLASS="STRUCTFIELD" 1923>balance</CODE 1924></TD 1925><TD 1926><CODE 1927CLASS="CONSTANT" 1928>V4L2_CID_AUDIO_BALANCE</CODE 1929></TD 1930></TR 1931></TBODY 1932></TABLE 1933><P 1934></P 1935></DIV 1936></P 1937><P 1938>To determine which of these controls are supported by a 1939driver V4L provides the <CODE 1940CLASS="STRUCTFIELD" 1941>flags</CODE 1942> 1943<CODE 1944CLASS="CONSTANT" 1945>VIDEO_AUDIO_VOLUME</CODE 1946>, 1947<CODE 1948CLASS="CONSTANT" 1949>VIDEO_AUDIO_BASS</CODE 1950>, 1951<CODE 1952CLASS="CONSTANT" 1953>VIDEO_AUDIO_TREBLE</CODE 1954> and 1955<CODE 1956CLASS="CONSTANT" 1957>VIDEO_AUDIO_BALANCE</CODE 1958>. In the V4L2 API the 1959<A 1960HREF="r13317.htm" 1961><CODE 1962CLASS="CONSTANT" 1963>VIDIOC_QUERYCTRL</CODE 1964></A 1965> ioctl reports if the respective control is 1966supported. Accordingly the <CODE 1967CLASS="CONSTANT" 1968>VIDEO_AUDIO_MUTABLE</CODE 1969> 1970and <CODE 1971CLASS="CONSTANT" 1972>VIDEO_AUDIO_MUTE</CODE 1973> flags where replaced by the 1974boolean <CODE 1975CLASS="CONSTANT" 1976>V4L2_CID_AUDIO_MUTE</CODE 1977> control.</P 1978><P 1979>All V4L2 controls have a <CODE 1980CLASS="STRUCTFIELD" 1981>step</CODE 1982> 1983attribute replacing the struct <CODE 1984CLASS="STRUCTNAME" 1985>video_audio</CODE 1986> 1987<CODE 1988CLASS="STRUCTFIELD" 1989>step</CODE 1990> field. The V4L audio controls are 1991assumed to range from 0 to 65535 with no particular reset value. The 1992V4L2 API permits arbitrary limits and defaults which can be queried 1993with the <A 1994HREF="r13317.htm" 1995><CODE 1996CLASS="CONSTANT" 1997>VIDIOC_QUERYCTRL</CODE 1998></A 1999> ioctl. For general information about 2000controls see <A 2001HREF="x542.htm" 2002>Section 1.8</A 2003>.</P 2004></DIV 2005><DIV 2006CLASS="SECTION" 2007><H2 2008CLASS="SECTION" 2009><A 2010NAME="AEN15205" 2011>6.1.7. Frame Buffer Overlay</A 2012></H2 2013><P 2014>The V4L2 ioctls equivalent to 2015<CODE 2016CLASS="CONSTANT" 2017>VIDIOCGFBUF</CODE 2018> and <CODE 2019CLASS="CONSTANT" 2020>VIDIOCSFBUF</CODE 2021> 2022are <A 2023HREF="r10595.htm" 2024><CODE 2025CLASS="CONSTANT" 2026>VIDIOC_G_FBUF</CODE 2027></A 2028> and <A 2029HREF="r10595.htm" 2030><CODE 2031CLASS="CONSTANT" 2032>VIDIOC_S_FBUF</CODE 2033></A 2034>. The 2035<CODE 2036CLASS="STRUCTFIELD" 2037>base</CODE 2038> field of struct 2039<CODE 2040CLASS="STRUCTNAME" 2041>video_buffer</CODE 2042> remained unchanged, except V4L2 2043defines a flag to indicate non-destructive overlays instead of a 2044<CODE 2045CLASS="CONSTANT" 2046>NULL</CODE 2047> pointer. All other fields moved into the 2048struct <A 2049HREF="c2030.htm#V4L2-PIX-FORMAT" 2050>v4l2_pix_format</A 2051> <CODE 2052CLASS="STRUCTFIELD" 2053>fmt</CODE 2054> substructure of 2055struct <A 2056HREF="r10595.htm#V4L2-FRAMEBUFFER" 2057>v4l2_framebuffer</A 2058>. The <CODE 2059CLASS="STRUCTFIELD" 2060>depth</CODE 2061> field was 2062replaced by <CODE 2063CLASS="STRUCTFIELD" 2064>pixelformat</CODE 2065>. See <A 2066HREF="x2490.htm" 2067>Section 2.4</A 2068> for a list of RGB formats and their 2069respective color depths.</P 2070><P 2071>Instead of the special ioctls 2072<CODE 2073CLASS="CONSTANT" 2074>VIDIOCGWIN</CODE 2075> and <CODE 2076CLASS="CONSTANT" 2077>VIDIOCSWIN</CODE 2078> 2079V4L2 uses the general-purpose data format negotiation ioctls 2080<A 2081HREF="r10944.htm" 2082><CODE 2083CLASS="CONSTANT" 2084>VIDIOC_G_FMT</CODE 2085></A 2086> and <A 2087HREF="r10944.htm" 2088><CODE 2089CLASS="CONSTANT" 2090>VIDIOC_S_FMT</CODE 2091></A 2092>. They take a pointer to a 2093struct <A 2094HREF="r10944.htm#V4L2-FORMAT" 2095>v4l2_format</A 2096> as argument. Here the <CODE 2097CLASS="STRUCTFIELD" 2098>win</CODE 2099> 2100member of the <CODE 2101CLASS="STRUCTFIELD" 2102>fmt</CODE 2103> union is used, a 2104struct <A 2105HREF="x6570.htm#V4L2-WINDOW" 2106>v4l2_window</A 2107>.</P 2108><P 2109>The <CODE 2110CLASS="STRUCTFIELD" 2111>x</CODE 2112>, 2113<CODE 2114CLASS="STRUCTFIELD" 2115>y</CODE 2116>, <CODE 2117CLASS="STRUCTFIELD" 2118>width</CODE 2119> and 2120<CODE 2121CLASS="STRUCTFIELD" 2122>height</CODE 2123> fields of struct 2124<CODE 2125CLASS="STRUCTNAME" 2126>video_window</CODE 2127> moved into struct <A 2128HREF="x6570.htm#V4L2-RECT" 2129>v4l2_rect</A 2130> 2131substructure <CODE 2132CLASS="STRUCTFIELD" 2133>w</CODE 2134> of struct 2135<CODE 2136CLASS="STRUCTNAME" 2137>v4l2_window</CODE 2138>. The 2139<CODE 2140CLASS="STRUCTFIELD" 2141>chromakey</CODE 2142>, 2143<CODE 2144CLASS="STRUCTFIELD" 2145>clips</CODE 2146>, and 2147<CODE 2148CLASS="STRUCTFIELD" 2149>clipcount</CODE 2150> fields remained unchanged. Struct 2151<CODE 2152CLASS="STRUCTNAME" 2153>video_clip</CODE 2154> was renamed to struct <A 2155HREF="x6570.htm#V4L2-CLIP" 2156>v4l2_clip</A 2157>, also 2158containing a struct <CODE 2159CLASS="STRUCTNAME" 2160>v4l2_rect</CODE 2161>, but the 2162semantics are still the same.</P 2163><P 2164>The <CODE 2165CLASS="CONSTANT" 2166>VIDEO_WINDOW_INTERLACE</CODE 2167> flag was 2168dropped. Instead applications must set the 2169<CODE 2170CLASS="STRUCTFIELD" 2171>field</CODE 2172> field to 2173<CODE 2174CLASS="CONSTANT" 2175>V4L2_FIELD_ANY</CODE 2176> or 2177<CODE 2178CLASS="CONSTANT" 2179>V4L2_FIELD_INTERLACED</CODE 2180>. The 2181<CODE 2182CLASS="CONSTANT" 2183>VIDEO_WINDOW_CHROMAKEY</CODE 2184> flag moved into 2185struct <A 2186HREF="r10595.htm#V4L2-FRAMEBUFFER" 2187>v4l2_framebuffer</A 2188>, under the new name 2189<CODE 2190CLASS="CONSTANT" 2191>V4L2_FBUF_FLAG_CHROMAKEY</CODE 2192>.</P 2193><P 2194>In V4L, storing a bitmap pointer in 2195<CODE 2196CLASS="STRUCTFIELD" 2197>clips</CODE 2198> and setting 2199<CODE 2200CLASS="STRUCTFIELD" 2201>clipcount</CODE 2202> to 2203<CODE 2204CLASS="CONSTANT" 2205>VIDEO_CLIP_BITMAP</CODE 2206> (-1) requests bitmap 2207clipping, using a fixed size bitmap of 1024 × 625 bits. Struct 2208<CODE 2209CLASS="STRUCTNAME" 2210>v4l2_window</CODE 2211> has a separate 2212<CODE 2213CLASS="STRUCTFIELD" 2214>bitmap</CODE 2215> pointer field for this purpose and 2216the bitmap size is determined by <CODE 2217CLASS="STRUCTFIELD" 2218>w.width</CODE 2219> and 2220<CODE 2221CLASS="STRUCTFIELD" 2222>w.height</CODE 2223>.</P 2224><P 2225>The <CODE 2226CLASS="CONSTANT" 2227>VIDIOCCAPTURE</CODE 2228> ioctl to enable or 2229disable overlay was renamed to <A 2230HREF="r12816.htm" 2231><CODE 2232CLASS="CONSTANT" 2233>VIDIOC_OVERLAY</CODE 2234></A 2235>.</P 2236></DIV 2237><DIV 2238CLASS="SECTION" 2239><H2 2240CLASS="SECTION" 2241><A 2242NAME="AEN15269" 2243>6.1.8. Cropping</A 2244></H2 2245><P 2246>To capture only a subsection of the full picture V4L 2247defines the <CODE 2248CLASS="CONSTANT" 2249>VIDIOCGCAPTURE</CODE 2250> and 2251<CODE 2252CLASS="CONSTANT" 2253>VIDIOCSCAPTURE</CODE 2254> ioctls using struct 2255<CODE 2256CLASS="STRUCTNAME" 2257>video_capture</CODE 2258>. The equivalent V4L2 ioctls are 2259<A 2260HREF="r9994.htm" 2261><CODE 2262CLASS="CONSTANT" 2263>VIDIOC_G_CROP</CODE 2264></A 2265> and <A 2266HREF="r9994.htm" 2267><CODE 2268CLASS="CONSTANT" 2269>VIDIOC_S_CROP</CODE 2270></A 2271> using struct <A 2272HREF="r9994.htm#V4L2-CROP" 2273>v4l2_crop</A 2274>, and the related 2275<A 2276HREF="r7771.htm" 2277><CODE 2278CLASS="CONSTANT" 2279>VIDIOC_CROPCAP</CODE 2280></A 2281> ioctl. This is a rather complex matter, see 2282<A 2283HREF="x1904.htm" 2284>Section 1.11</A 2285> for details.</P 2286><P 2287>The <CODE 2288CLASS="STRUCTFIELD" 2289>x</CODE 2290>, 2291<CODE 2292CLASS="STRUCTFIELD" 2293>y</CODE 2294>, <CODE 2295CLASS="STRUCTFIELD" 2296>width</CODE 2297> and 2298<CODE 2299CLASS="STRUCTFIELD" 2300>height</CODE 2301> fields moved into struct <A 2302HREF="x6570.htm#V4L2-RECT" 2303>v4l2_rect</A 2304> 2305substructure <CODE 2306CLASS="STRUCTFIELD" 2307>c</CODE 2308> of struct 2309<CODE 2310CLASS="STRUCTNAME" 2311>v4l2_crop</CODE 2312>. The 2313<CODE 2314CLASS="STRUCTFIELD" 2315>decimation</CODE 2316> field was dropped. In the V4L2 2317API the scaling factor is implied by the size of the cropping 2318rectangle and the size of the captured or overlaid image.</P 2319><P 2320>The <CODE 2321CLASS="CONSTANT" 2322>VIDEO_CAPTURE_ODD</CODE 2323> 2324and <CODE 2325CLASS="CONSTANT" 2326>VIDEO_CAPTURE_EVEN</CODE 2327> flags to capture only the 2328odd or even field, respectively, were replaced by 2329<CODE 2330CLASS="CONSTANT" 2331>V4L2_FIELD_TOP</CODE 2332> and 2333<CODE 2334CLASS="CONSTANT" 2335>V4L2_FIELD_BOTTOM</CODE 2336> in the field named 2337<CODE 2338CLASS="STRUCTFIELD" 2339>field</CODE 2340> of struct <A 2341HREF="c2030.htm#V4L2-PIX-FORMAT" 2342>v4l2_pix_format</A 2343> and 2344struct <A 2345HREF="x6570.htm#V4L2-WINDOW" 2346>v4l2_window</A 2347>. These structures are used to select a capture or 2348overlay format with the <A 2349HREF="r10944.htm" 2350><CODE 2351CLASS="CONSTANT" 2352>VIDIOC_S_FMT</CODE 2353></A 2354> ioctl.</P 2355></DIV 2356><DIV 2357CLASS="SECTION" 2358><H2 2359CLASS="SECTION" 2360><A 2361NAME="AEN15302" 2362>6.1.9. Reading Images, Memory Mapping</A 2363></H2 2364><DIV 2365CLASS="SECTION" 2366><H3 2367CLASS="SECTION" 2368><A 2369NAME="AEN15304" 2370>6.1.9.1. Capturing using the read method</A 2371></H3 2372><P 2373>There is no essential difference between reading images 2374from a V4L or V4L2 device using the <A 2375HREF="r14264.htm" 2376><CODE 2377CLASS="FUNCTION" 2378>read()</CODE 2379></A 2380> function, however V4L2 2381drivers are not required to support this I/O method. Applications can 2382determine if the function is available with the <A 2383HREF="r13105.htm" 2384><CODE 2385CLASS="CONSTANT" 2386>VIDIOC_QUERYCAP</CODE 2387></A 2388> 2389ioctl. All V4L2 devices exchanging data with applications must support 2390the <A 2391HREF="r14390.htm" 2392><CODE 2393CLASS="FUNCTION" 2394>select()</CODE 2395></A 2396> and <A 2397HREF="r14169.htm" 2398><CODE 2399CLASS="FUNCTION" 2400>poll()</CODE 2401></A 2402> functions.</P 2403><P 2404>To select an image format and size, V4L provides the 2405<CODE 2406CLASS="CONSTANT" 2407>VIDIOCSPICT</CODE 2408> and <CODE 2409CLASS="CONSTANT" 2410>VIDIOCSWIN</CODE 2411> 2412ioctls. V4L2 uses the general-purpose data format negotiation ioctls 2413<A 2414HREF="r10944.htm" 2415><CODE 2416CLASS="CONSTANT" 2417>VIDIOC_G_FMT</CODE 2418></A 2419> and <A 2420HREF="r10944.htm" 2421><CODE 2422CLASS="CONSTANT" 2423>VIDIOC_S_FMT</CODE 2424></A 2425>. They take a pointer to a 2426struct <A 2427HREF="r10944.htm#V4L2-FORMAT" 2428>v4l2_format</A 2429> as argument, here the struct <A 2430HREF="c2030.htm#V4L2-PIX-FORMAT" 2431>v4l2_pix_format</A 2432> named 2433<CODE 2434CLASS="STRUCTFIELD" 2435>pix</CODE 2436> of its <CODE 2437CLASS="STRUCTFIELD" 2438>fmt</CODE 2439> 2440union is used.</P 2441><P 2442>For more information about the V4L2 read interface see 2443<A 2444HREF="c5742.htm#RW" 2445>Section 3.1</A 2446>.</P 2447></DIV 2448><DIV 2449CLASS="SECTION" 2450><H3 2451CLASS="SECTION" 2452><A 2453NAME="AEN15328" 2454>6.1.9.2. Capturing using memory mapping</A 2455></H3 2456><P 2457>Applications can read from V4L devices by mapping 2458buffers in device memory, or more often just buffers allocated in 2459DMA-able system memory, into their address space. This avoids the data 2460copying overhead of the read method. V4L2 supports memory mapping as 2461well, with a few differences.</P 2462><DIV 2463CLASS="INFORMALTABLE" 2464><P 2465></P 2466><A 2467NAME="AEN15331" 2468></A 2469><TABLE 2470BORDER="1" 2471CLASS="CALSTABLE" 2472><COL><COL><THEAD 2473><TR 2474><TH 2475>V4L</TH 2476><TH 2477>V4L2</TH 2478></TR 2479></THEAD 2480><TBODY 2481VALIGN="TOP" 2482><TR 2483><TD 2484> </TD 2485><TD 2486>The image format must be selected before 2487buffers are allocated, with the <A 2488HREF="r10944.htm" 2489><CODE 2490CLASS="CONSTANT" 2491>VIDIOC_S_FMT</CODE 2492></A 2493> ioctl. When no format 2494is selected the driver may use the last, possibly by another 2495application requested format.</TD 2496></TR 2497><TR 2498><TD 2499><P 2500>Applications cannot change the number of 2501buffers. The it is built into the driver, unless it has a module 2502option to change the number when the driver module is 2503loaded.</P 2504></TD 2505><TD 2506><P 2507>The <A 2508HREF="r13696.htm" 2509><CODE 2510CLASS="CONSTANT" 2511>VIDIOC_REQBUFS</CODE 2512></A 2513> ioctl allocates the 2514desired number of buffers, this is a required step in the initialization 2515sequence.</P 2516></TD 2517></TR 2518><TR 2519><TD 2520><P 2521>Drivers map all buffers as one contiguous 2522range of memory. The <CODE 2523CLASS="CONSTANT" 2524>VIDIOCGMBUF</CODE 2525> ioctl is 2526available to query the number of buffers, the offset of each buffer 2527from the start of the virtual file, and the overall amount of memory 2528used, which can be used as arguments for the <A 2529HREF="r13889.htm" 2530><CODE 2531CLASS="FUNCTION" 2532>mmap()</CODE 2533></A 2534> 2535function.</P 2536></TD 2537><TD 2538><P 2539>Buffers are individually mapped. The 2540offset and size of each buffer can be determined with the 2541<A 2542HREF="r13022.htm" 2543><CODE 2544CLASS="CONSTANT" 2545>VIDIOC_QUERYBUF</CODE 2546></A 2547> ioctl.</P 2548></TD 2549></TR 2550><TR 2551><TD 2552><P 2553>The <CODE 2554CLASS="CONSTANT" 2555>VIDIOCMCAPTURE</CODE 2556> 2557ioctl prepares a buffer for capturing. It also determines the image 2558format for this buffer. The ioctl returns immediately, eventually with 2559an <SPAN 2560CLASS="ERRORCODE" 2561>EAGAIN</SPAN 2562> error code if no video signal had been detected. When the driver 2563supports more than one buffer applications can call the ioctl multiple 2564times and thus have multiple outstanding capture 2565requests.</P 2566><P 2567>The <CODE 2568CLASS="CONSTANT" 2569>VIDIOCSYNC</CODE 2570> ioctl 2571suspends execution until a particular buffer has been 2572filled.</P 2573></TD 2574><TD 2575><P 2576>Drivers maintain an incoming and outgoing 2577queue. <A 2578HREF="r12878.htm" 2579><CODE 2580CLASS="CONSTANT" 2581>VIDIOC_QBUF</CODE 2582></A 2583> enqueues any empty buffer into the incoming 2584queue. Filled buffers are dequeued from the outgoing queue with the 2585<A 2586HREF="r12878.htm" 2587><CODE 2588CLASS="CONSTANT" 2589>VIDIOC_DQBUF</CODE 2590></A 2591> ioctl. To wait until filled buffers become available this 2592function, <A 2593HREF="r14390.htm" 2594><CODE 2595CLASS="FUNCTION" 2596>select()</CODE 2597></A 2598> or <A 2599HREF="r14169.htm" 2600><CODE 2601CLASS="FUNCTION" 2602>poll()</CODE 2603></A 2604> can be used. The 2605<A 2606HREF="r13817.htm" 2607><CODE 2608CLASS="CONSTANT" 2609>VIDIOC_STREAMON</CODE 2610></A 2611> ioctl must be called once after enqueuing one or 2612more buffers to start capturing. Its counterpart 2613<A 2614HREF="r13817.htm" 2615><CODE 2616CLASS="CONSTANT" 2617>VIDIOC_STREAMOFF</CODE 2618></A 2619> stops capturing and dequeues all buffers from both 2620queues. Applications can query the signal status, if known, with the 2621<A 2622HREF="r8936.htm" 2623><CODE 2624CLASS="CONSTANT" 2625>VIDIOC_ENUMINPUT</CODE 2626></A 2627> ioctl.</P 2628></TD 2629></TR 2630></TBODY 2631></TABLE 2632><P 2633></P 2634></DIV 2635><P 2636>For a more in-depth discussion of memory mapping and 2637examples, see <A 2638HREF="x5791.htm" 2639>Section 3.2</A 2640>.</P 2641></DIV 2642></DIV 2643><DIV 2644CLASS="SECTION" 2645><H2 2646CLASS="SECTION" 2647><A 2648NAME="AEN15385" 2649>6.1.10. Reading Raw VBI Data</A 2650></H2 2651><P 2652>Originally the V4L API did not specify a raw VBI capture 2653interface, only the device file <TT 2654CLASS="FILENAME" 2655>/dev/vbi</TT 2656> was 2657reserved for this purpose. The only driver supporting this interface 2658was the BTTV driver, de-facto defining the V4L VBI interface. Reading 2659from the device yields a raw VBI image with the following 2660parameters:<DIV 2661CLASS="INFORMALTABLE" 2662><P 2663></P 2664><A 2665NAME="AEN15389" 2666></A 2667><TABLE 2668BORDER="1" 2669CLASS="CALSTABLE" 2670><COL><COL><THEAD 2671><TR 2672><TH 2673>struct <A 2674HREF="x7013.htm#V4L2-VBI-FORMAT" 2675>v4l2_vbi_format</A 2676></TH 2677><TH 2678>V4L, BTTV driver</TH 2679></TR 2680></THEAD 2681><TBODY 2682VALIGN="TOP" 2683><TR 2684><TD 2685>sampling_rate</TD 2686><TD 2687>28636363 Hz NTSC (or any other 525-line 2688standard); 35468950 Hz PAL and SECAM (625-line standards)</TD 2689></TR 2690><TR 2691><TD 2692>offset</TD 2693><TD 2694>?</TD 2695></TR 2696><TR 2697><TD 2698>samples_per_line</TD 2699><TD 2700>2048</TD 2701></TR 2702><TR 2703><TD 2704>sample_format</TD 2705><TD 2706>V4L2_PIX_FMT_GREY. The last four bytes (a 2707machine endianess integer) contain a frame counter.</TD 2708></TR 2709><TR 2710><TD 2711>start[]</TD 2712><TD 2713>10, 273 NTSC; 22, 335 PAL and SECAM</TD 2714></TR 2715><TR 2716><TD 2717>count[]</TD 2718><TD 2719><P 2720>16, 16<SUP 2721>a</SUP 2722></P 2723></TD 2724></TR 2725><TR 2726><TD 2727>flags</TD 2728><TD 2729>0</TD 2730></TR 2731></TBODY 2732><TR 2733><TD 2734COLSPAN="2" 2735>Notes:<BR><A 2736NAME="FTN.AEN15416" 2737>a. </A 2738>Old driver 2739versions used different values, eventually the custom 2740<CODE 2741CLASS="CONSTANT" 2742>BTTV_VBISIZE</CODE 2743> ioctl was added to query the 2744correct values.<BR></TD 2745></TR 2746></TABLE 2747><P 2748></P 2749></DIV 2750></P 2751><P 2752>Undocumented in the V4L specification, in Linux 2.3 the 2753<CODE 2754CLASS="CONSTANT" 2755>VIDIOCGVBIFMT</CODE 2756> and 2757<CODE 2758CLASS="CONSTANT" 2759>VIDIOCSVBIFMT</CODE 2760> ioctls using struct 2761<CODE 2762CLASS="STRUCTNAME" 2763>vbi_format</CODE 2764> were added to determine the VBI 2765image parameters. These ioctls are only partially compatible with the 2766V4L2 VBI interface specified in <A 2767HREF="x7013.htm" 2768>Section 4.7</A 2769>.</P 2770><P 2771>An <CODE 2772CLASS="STRUCTFIELD" 2773>offset</CODE 2774> field does not 2775exist, <CODE 2776CLASS="STRUCTFIELD" 2777>sample_format</CODE 2778> is supposed to be 2779<CODE 2780CLASS="CONSTANT" 2781>VIDEO_PALETTE_RAW</CODE 2782>, equivalent to 2783<CODE 2784CLASS="CONSTANT" 2785>V4L2_PIX_FMT_GREY</CODE 2786>. The remaining fields are 2787probably equivalent to struct <A 2788HREF="x7013.htm#V4L2-VBI-FORMAT" 2789>v4l2_vbi_format</A 2790>.</P 2791><P 2792>Apparently only the Zoran (ZR 36120) driver implements 2793these ioctls. The semantics differ from those specified for V4L2 in two 2794ways. The parameters are reset on <A 2795HREF="r14090.htm" 2796><CODE 2797CLASS="FUNCTION" 2798>open()</CODE 2799></A 2800> and 2801<CODE 2802CLASS="CONSTANT" 2803>VIDIOCSVBIFMT</CODE 2804> always returns an <SPAN 2805CLASS="ERRORCODE" 2806>EINVAL</SPAN 2807> error code if the 2808parameters are invalid.</P 2809></DIV 2810><DIV 2811CLASS="SECTION" 2812><H2 2813CLASS="SECTION" 2814><A 2815NAME="AEN15438" 2816>6.1.11. Miscellaneous</A 2817></H2 2818><P 2819>V4L2 has no equivalent of the 2820<CODE 2821CLASS="CONSTANT" 2822>VIDIOCGUNIT</CODE 2823> ioctl. Applications can find the VBI 2824device associated with a video capture device (or vice versa) by 2825reopening the device and requesting VBI data. For details see 2826<A 2827HREF="c174.htm#OPEN" 2828>Section 1.1</A 2829>.</P 2830><P 2831>No replacement exists for <CODE 2832CLASS="CONSTANT" 2833>VIDIOCKEY</CODE 2834>, 2835and the V4L functions for microcode programming. A new interface for 2836MPEG compression and playback devices is documented in <A 2837HREF="x802.htm" 2838>Section 1.9</A 2839>.</P 2840></DIV 2841></DIV 2842></DIV 2843><DIV 2844CLASS="NAVFOOTER" 2845><HR 2846ALIGN="LEFT" 2847WIDTH="100%"><TABLE 2848SUMMARY="Footer navigation table" 2849WIDTH="100%" 2850BORDER="0" 2851CELLPADDING="0" 2852CELLSPACING="0" 2853><TR 2854><TD 2855WIDTH="33%" 2856ALIGN="left" 2857VALIGN="top" 2858><A 2859HREF="c14592.htm" 2860ACCESSKEY="P" 2861>Prev</A 2862></TD 2863><TD 2864WIDTH="34%" 2865ALIGN="center" 2866VALIGN="top" 2867><A 2868HREF="book1.htm" 2869ACCESSKEY="H" 2870>Home</A 2871></TD 2872><TD 2873WIDTH="33%" 2874ALIGN="right" 2875VALIGN="top" 2876><A 2877HREF="x15446.htm" 2878ACCESSKEY="N" 2879>Next</A 2880></TD 2881></TR 2882><TR 2883><TD 2884WIDTH="33%" 2885ALIGN="left" 2886VALIGN="top" 2887>V4L2 Driver Programming</TD 2888><TD 2889WIDTH="34%" 2890ALIGN="center" 2891VALIGN="top" 2892> </TD 2893><TD 2894WIDTH="33%" 2895ALIGN="right" 2896VALIGN="top" 2897>Changes of the V4L2 API</TD 2898></TR 2899></TABLE 2900></DIV 2901></BODY 2902></HTML 2903> 2904