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>Sliced VBI Data Interface</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="Interfaces" 14HREF="c6488.htm"><LINK 15REL="PREVIOUS" 16TITLE="Raw VBI Data Interface" 17HREF="x7013.htm"><LINK 18REL="NEXT" 19TITLE="Teletext Interface" 20HREF="x7561.htm"></HEAD 21><BODY 22CLASS="SECTION" 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="x7013.htm" 49ACCESSKEY="P" 50>Prev</A 51></TD 52><TD 53WIDTH="80%" 54ALIGN="center" 55VALIGN="bottom" 56>Chapter 4. Interfaces</TD 57><TD 58WIDTH="10%" 59ALIGN="right" 60VALIGN="bottom" 61><A 62HREF="x7561.htm" 63ACCESSKEY="N" 64>Next</A 65></TD 66></TR 67></TABLE 68><HR 69ALIGN="LEFT" 70WIDTH="100%"></DIV 71><DIV 72CLASS="SECTION" 73><H1 74CLASS="SECTION" 75><A 76NAME="SLICED" 77>4.8. Sliced VBI Data Interface</A 78></H1 79><P 80>VBI stands for Vertical Blanking Interval, a gap in the 81sequence of lines of an analog video signal. During VBI no picture 82information is transmitted, allowing some time while the electron beam 83of a cathode ray tube TV returns to the top of the screen.</P 84><P 85>Sliced VBI devices use hardware to demodulate data transmitted 86in the VBI. V4L2 drivers shall <SPAN 87CLASS="emphasis" 88><I 89CLASS="EMPHASIS" 90>not</I 91></SPAN 92> do this by 93software, see also the <A 94HREF="x7013.htm" 95>raw VBI 96interface</A 97>. The data is passed as short packets of fixed size, 98covering one scan line each. The number of packets per video frame is 99variable.</P 100><P 101>Sliced VBI capture and output devices are accessed through the 102same character special files as raw VBI devices. When a driver 103supports both interfaces, the default function of a 104<TT 105CLASS="FILENAME" 106>/dev/vbi</TT 107> device is <SPAN 108CLASS="emphasis" 109><I 110CLASS="EMPHASIS" 111>raw</I 112></SPAN 113> VBI 114capturing or output, and the sliced VBI function is only available 115after calling the <A 116HREF="r10944.htm" 117><CODE 118CLASS="CONSTANT" 119>VIDIOC_S_FMT</CODE 120></A 121> ioctl as defined below. Likewise a 122<TT 123CLASS="FILENAME" 124>/dev/video</TT 125> device may support the sliced VBI API, 126however the default function here is video capturing or output. 127Different file descriptors must be used to pass raw and sliced VBI 128data simultaneously, if this is supported by the driver.</P 129><DIV 130CLASS="SECTION" 131><H2 132CLASS="SECTION" 133><A 134NAME="AEN7248" 135>4.8.1. Querying Capabilities</A 136></H2 137><P 138>Devices supporting the sliced VBI capturing or output API 139set the <CODE 140CLASS="CONSTANT" 141>V4L2_CAP_SLICED_VBI_CAPTURE</CODE 142> or 143<CODE 144CLASS="CONSTANT" 145>V4L2_CAP_SLICED_VBI_OUTPUT</CODE 146> flag respectively, in 147the <CODE 148CLASS="STRUCTFIELD" 149>capabilities</CODE 150> field of struct <A 151HREF="r13105.htm#V4L2-CAPABILITY" 152>v4l2_capability</A 153> 154returned by the <A 155HREF="r13105.htm" 156><CODE 157CLASS="CONSTANT" 158>VIDIOC_QUERYCAP</CODE 159></A 160> ioctl. At least one of the 161read/write, streaming or asynchronous <A 162HREF="c5742.htm" 163>I/O 164methods</A 165> must be supported. Sliced VBI devices may have a tuner 166or modulator.</P 167></DIV 168><DIV 169CLASS="SECTION" 170><H2 171CLASS="SECTION" 172><A 173NAME="AEN7258" 174>4.8.2. Supplemental Functions</A 175></H2 176><P 177>Sliced VBI devices shall support <A 178HREF="x309.htm" 179>video 180input or output</A 181> and <A 182HREF="x394.htm" 183>tuner or 184modulator</A 185> ioctls if they have these capabilities, and they may 186support <A 187HREF="x542.htm" 188>control</A 189> ioctls. The <A 190HREF="x448.htm" 191>video standard</A 192> ioctls provide information 193vital to program a sliced VBI device, therefore must be 194supported.</P 195></DIV 196><DIV 197CLASS="SECTION" 198><H2 199CLASS="SECTION" 200><A 201NAME="AEN7265" 202>4.8.3. Sliced VBI Format Negotiation</A 203></H2 204><P 205>To find out which data services are supported by the 206hardware applications can call the <A 207HREF="r12051.htm" 208><CODE 209CLASS="CONSTANT" 210>VIDIOC_G_SLICED_VBI_CAP</CODE 211></A 212> ioctl. 213All drivers implementing the sliced VBI interface must support this 214ioctl. The results may differ from those of the <A 215HREF="r10944.htm" 216><CODE 217CLASS="CONSTANT" 218>VIDIOC_S_FMT</CODE 219></A 220> ioctl 221when the number of VBI lines the hardware can capture or output per 222frame, or the number of services it can identify on a given line are 223limited. For example on PAL line 16 the hardware may be able to look 224for a VPS or Teletext signal, but not both at the same time.</P 225><P 226>To determine the currently selected services applications 227set the <CODE 228CLASS="STRUCTFIELD" 229>type </CODE 230> field of struct <A 231HREF="r10944.htm#V4L2-FORMAT" 232>v4l2_format</A 233> to 234<CODE 235CLASS="CONSTANT" 236> V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</CODE 237> or <CODE 238CLASS="CONSTANT" 239>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</CODE 240>, and the <A 241HREF="r10944.htm" 242><CODE 243CLASS="CONSTANT" 244>VIDIOC_G_FMT</CODE 245></A 246> 247ioctl fills the <CODE 248CLASS="STRUCTFIELD" 249>fmt.sliced</CODE 250> member, a 251struct <A 252HREF="x7236.htm#V4L2-SLICED-VBI-FORMAT" 253>v4l2_sliced_vbi_format</A 254>.</P 255><P 256>Applications can request different parameters by 257initializing or modifying the <CODE 258CLASS="STRUCTFIELD" 259>fmt.sliced</CODE 260> 261member and calling the <A 262HREF="r10944.htm" 263><CODE 264CLASS="CONSTANT" 265>VIDIOC_S_FMT</CODE 266></A 267> ioctl with a pointer to the 268<CODE 269CLASS="STRUCTNAME" 270>v4l2_format</CODE 271> structure.</P 272><P 273>The sliced VBI API is more complicated than the raw VBI API 274because the hardware must be told which VBI service to expect on each 275scan line. Not all services may be supported by the hardware on all 276lines (this is especially true for VBI output where Teletext is often 277unsupported and other services can only be inserted in one specific 278line). In many cases, however, it is sufficient to just set the 279<CODE 280CLASS="STRUCTFIELD" 281>service_set</CODE 282> field to the required services 283and let the driver fill the <CODE 284CLASS="STRUCTFIELD" 285>service_lines</CODE 286> 287array according to hardware capabilities. Only if more precise control 288is needed should the programmer set the 289<CODE 290CLASS="STRUCTFIELD" 291>service_lines</CODE 292> array explicitly.</P 293><P 294>The <A 295HREF="r10944.htm" 296><CODE 297CLASS="CONSTANT" 298>VIDIOC_S_FMT</CODE 299></A 300> ioctl returns an <SPAN 301CLASS="ERRORCODE" 302>EINVAL</SPAN 303> error code only when the 304given parameters are ambiguous, otherwise it modifies the parameters 305according to hardware capabilities. When the driver allocates 306resources at this point, it may return an <SPAN 307CLASS="ERRORCODE" 308>EBUSY</SPAN 309> error code if the required 310resources are temporarily unavailable. Other resource allocation 311points which may return <SPAN 312CLASS="ERRORCODE" 313>EBUSY</SPAN 314> can be the 315<A 316HREF="r13817.htm" 317><CODE 318CLASS="CONSTANT" 319>VIDIOC_STREAMON</CODE 320></A 321> ioctl and the first <A 322HREF="r14264.htm" 323><CODE 324CLASS="FUNCTION" 325>read()</CODE 326></A 327>, <A 328HREF="r14496.htm" 329><CODE 330CLASS="FUNCTION" 331>write()</CODE 332></A 333> and 334<A 335HREF="r14390.htm" 336><CODE 337CLASS="FUNCTION" 338>select()</CODE 339></A 340> call.</P 341><DIV 342CLASS="TABLE" 343><A 344NAME="V4L2-SLICED-VBI-FORMAT" 345></A 346><P 347><B 348>Table 4-6. struct 349<CODE 350CLASS="STRUCTNAME" 351>v4l2_sliced_vbi_format</CODE 352></B 353></P 354><TABLE 355BORDER="0" 356FRAME="void" 357WIDTH="100%" 358CLASS="CALSTABLE" 359><COL 360WIDTH="25%" 361TITLE="C1"><COL 362WIDTH="25%" 363TITLE="C2"><COL 364WIDTH="17%" 365TITLE="C3"><COL 366WIDTH="17%" 367TITLE="C4"><COL 368WIDTH="17%" 369TITLE="C5"><TBODY 370VALIGN="TOP" 371><TR 372><TD 373>__u32</TD 374><TD 375><CODE 376CLASS="STRUCTFIELD" 377>service_set</CODE 378></TD 379><TD 380COLSPAN="3" 381><P 382>If 383<CODE 384CLASS="STRUCTFIELD" 385>service_set</CODE 386> is non-zero when passed with 387<A 388HREF="r10944.htm" 389><CODE 390CLASS="CONSTANT" 391>VIDIOC_S_FMT</CODE 392></A 393> or <A 394HREF="r10944.htm" 395><CODE 396CLASS="CONSTANT" 397>VIDIOC_TRY_FMT</CODE 398></A 399>, the 400<CODE 401CLASS="STRUCTFIELD" 402>service_lines</CODE 403> array will be filled by the 404driver according to the services specified in this field. For example, 405if <CODE 406CLASS="STRUCTFIELD" 407>service_set</CODE 408> is initialized with 409<CODE 410CLASS="CONSTANT" 411>V4L2_SLICED_TELETEXT_B | V4L2_SLICED_WSS_625</CODE 412>, a 413driver for the cx25840 video decoder sets lines 7-22 of both 414fields<SUP 415>a</SUP 416> to <CODE 417CLASS="CONSTANT" 418>V4L2_SLICED_TELETEXT_B</CODE 419> 420and line 23 of the first field to 421<CODE 422CLASS="CONSTANT" 423>V4L2_SLICED_WSS_625</CODE 424>. If 425<CODE 426CLASS="STRUCTFIELD" 427>service_set</CODE 428> is set to zero, then the values 429of <CODE 430CLASS="STRUCTFIELD" 431>service_lines</CODE 432> will be used instead.</P 433><P 434>On return the driver sets this field to the union of all 435elements of the returned <CODE 436CLASS="STRUCTFIELD" 437>service_lines</CODE 438> 439array. It may contain less services than requested, perhaps just one, 440if the hardware cannot handle more services simultaneously. It may be 441empty (zero) if none of the requested services are supported by the 442hardware.</P 443></TD 444></TR 445><TR 446><TD 447>__u16</TD 448><TD 449><CODE 450CLASS="STRUCTFIELD" 451>service_lines</CODE 452>[2][24]</TD 453><TD 454COLSPAN="3" 455><P 456>Applications initialize this 457array with sets of data services the driver shall look for or insert 458on the respective scan line. Subject to hardware capabilities drivers 459return the requested set, a subset, which may be just a single 460service, or an empty set. When the hardware cannot handle multiple 461services on the same line the driver shall choose one. No assumptions 462can be made on which service the driver chooses.</P 463><P 464>Data 465services are defined in <A 466HREF="x7236.htm#VBI-SERVICES2" 467>Table 4-7</A 468>. Array indices 469map to ITU-R line numbers (see also <A 470HREF="x7013.htm#VBI-525" 471>Figure 4-2</A 472> and <A 473HREF="x7013.htm#VBI-625" 474>Figure 4-3</A 475>) as follows: </P 476></TD 477></TR 478><TR 479><TD 480> </TD 481><TD 482> </TD 483><TD 484>Element</TD 485><TD 486>525 line systems</TD 487><TD 488>625 line systems</TD 489></TR 490><TR 491><TD 492> </TD 493><TD 494> </TD 495><TD 496><CODE 497CLASS="STRUCTFIELD" 498>service_lines</CODE 499>[0][1]</TD 500><TD 501ALIGN="CENTER" 502>1</TD 503><TD 504ALIGN="CENTER" 505>1</TD 506></TR 507><TR 508><TD 509> </TD 510><TD 511> </TD 512><TD 513><CODE 514CLASS="STRUCTFIELD" 515>service_lines</CODE 516>[0][23]</TD 517><TD 518ALIGN="CENTER" 519>23</TD 520><TD 521ALIGN="CENTER" 522>23</TD 523></TR 524><TR 525><TD 526> </TD 527><TD 528> </TD 529><TD 530><CODE 531CLASS="STRUCTFIELD" 532>service_lines</CODE 533>[1][1]</TD 534><TD 535ALIGN="CENTER" 536>264</TD 537><TD 538ALIGN="CENTER" 539>314</TD 540></TR 541><TR 542><TD 543> </TD 544><TD 545> </TD 546><TD 547><CODE 548CLASS="STRUCTFIELD" 549>service_lines</CODE 550>[1][23]</TD 551><TD 552ALIGN="CENTER" 553>286</TD 554><TD 555ALIGN="CENTER" 556>336</TD 557></TR 558><TR 559><TD 560> </TD 561><TD 562> </TD 563><TD 564COLSPAN="3" 565>Drivers must set 566<CODE 567CLASS="STRUCTFIELD" 568>service_lines</CODE 569>[0][0] and 570<CODE 571CLASS="STRUCTFIELD" 572>service_lines</CODE 573>[1][0] to zero.</TD 574></TR 575><TR 576><TD 577>__u32</TD 578><TD 579><CODE 580CLASS="STRUCTFIELD" 581>io_size</CODE 582></TD 583><TD 584COLSPAN="3" 585>Maximum number of bytes passed by 586one <A 587HREF="r14264.htm" 588><CODE 589CLASS="FUNCTION" 590>read()</CODE 591></A 592> or <A 593HREF="r14496.htm" 594><CODE 595CLASS="FUNCTION" 596>write()</CODE 597></A 598> call, and the buffer size in bytes for 599the <A 600HREF="r12878.htm" 601><CODE 602CLASS="CONSTANT" 603>VIDIOC_QBUF</CODE 604></A 605> and <A 606HREF="r12878.htm" 607><CODE 608CLASS="CONSTANT" 609>VIDIOC_DQBUF</CODE 610></A 611> ioctl. Drivers set this field to 612the size of struct <A 613HREF="x7236.htm#V4L2-SLICED-VBI-DATA" 614>v4l2_sliced_vbi_data</A 615> times the number of non-zero 616elements in the returned <CODE 617CLASS="STRUCTFIELD" 618>service_lines</CODE 619> 620array (that is the number of lines potentially carrying data).</TD 621></TR 622><TR 623><TD 624>__u32</TD 625><TD 626><CODE 627CLASS="STRUCTFIELD" 628>reserved</CODE 629>[2]</TD 630><TD 631COLSPAN="3" 632>This array is reserved for future 633extensions. Applications and drivers must set it to zero.</TD 634></TR 635></TBODY 636><TR 637><TD 638COLSPAN="5" 639>Notes:<BR><A 640NAME="FTN.AEN7329" 641>a. </A 642>According to <A 643HREF="b17127.htm#ETS300706" 644>ETS 300 706</A 645> lines 6-22 of the 646first field and lines 5-22 of the second field may carry Teletext 647data.<BR></TD 648></TR 649></TABLE 650></DIV 651><DIV 652CLASS="TABLE" 653><A 654NAME="VBI-SERVICES2" 655></A 656><P 657><B 658>Table 4-7. Sliced VBI services</B 659></P 660><TABLE 661BORDER="0" 662FRAME="void" 663WIDTH="100%" 664CLASS="CALSTABLE" 665><COL 666WIDTH="25%" 667TITLE="C1"><COL 668WIDTH="12%" 669TITLE="C2"><COL 670WIDTH="12%" 671TITLE="C3"><COL 672WIDTH="25%" 673TITLE="C4"><COL 674WIDTH="25%" 675TITLE="C5"><THEAD 676><TR 677><TH 678>Symbol</TH 679><TH 680>Value</TH 681><TH 682>Reference</TH 683><TH 684>Lines, usually</TH 685><TH 686>Payload</TH 687></TR 688></THEAD 689><TBODY 690VALIGN="TOP" 691><TR 692><TD 693><CODE 694CLASS="CONSTANT" 695>V4L2_SLICED_TELETEXT_B</CODE 696> 697(Teletext System B)</TD 698><TD 699>0x0001</TD 700><TD 701><A 702HREF="b17127.htm#ETS300706" 703><ABBR 704CLASS="ABBREV" 705>ETS 300 706</ABBR 706></A 707>, <A 708HREF="b17127.htm#ITU653" 709><ABBR 710CLASS="ABBREV" 711>ITU BT.653</ABBR 712></A 713></TD 714><TD 715>PAL/SECAM line 7-22, 320-335 (second field 7-22)</TD 716><TD 717>Last 42 of the 45 byte Teletext packet, that is 718without clock run-in and framing code, lsb first transmitted.</TD 719></TR 720><TR 721><TD 722><CODE 723CLASS="CONSTANT" 724>V4L2_SLICED_VPS</CODE 725></TD 726><TD 727>0x0400</TD 728><TD 729><A 730HREF="b17127.htm#ETS300231" 731><ABBR 732CLASS="ABBREV" 733>ETS 300 231</ABBR 734></A 735></TD 736><TD 737>PAL line 16</TD 738><TD 739>Byte number 3 to 15 according to Figure 9 of 740ETS 300 231, lsb first transmitted.</TD 741></TR 742><TR 743><TD 744><CODE 745CLASS="CONSTANT" 746>V4L2_SLICED_CAPTION_525</CODE 747></TD 748><TD 749>0x1000</TD 750><TD 751><A 752HREF="b17127.htm#EIA608" 753><ABBR 754CLASS="ABBREV" 755>EIA 608-B</ABBR 756></A 757></TD 758><TD 759>NTSC line 21, 284 (second field 21)</TD 760><TD 761>Two bytes in transmission order, including parity 762bit, lsb first transmitted.</TD 763></TR 764><TR 765><TD 766><CODE 767CLASS="CONSTANT" 768>V4L2_SLICED_WSS_625</CODE 769></TD 770><TD 771>0x4000</TD 772><TD 773><A 774HREF="b17127.htm#ITU1119" 775><ABBR 776CLASS="ABBREV" 777>ITU BT.1119</ABBR 778></A 779>, <A 780HREF="b17127.htm#EN300294" 781><ABBR 782CLASS="ABBREV" 783>EN 300 294</ABBR 784></A 785></TD 786><TD 787>PAL/SECAM line 23</TD 788><TD 789><PRE 790CLASS="SCREEN" 791>Byte 0 1 792 msb lsb msb lsb 793 Bit 7 6 5 4 3 2 1 0 x x 13 12 11 10 9</PRE 794></TD 795></TR 796><TR 797><TD 798><CODE 799CLASS="CONSTANT" 800>V4L2_SLICED_VBI_525</CODE 801></TD 802><TD 803>0x1000</TD 804><TD 805COLSPAN="3" 806>Set of services applicable to 525 807line systems.</TD 808></TR 809><TR 810><TD 811><CODE 812CLASS="CONSTANT" 813>V4L2_SLICED_VBI_625</CODE 814></TD 815><TD 816>0x4401</TD 817><TD 818COLSPAN="3" 819>Set of services applicable to 625 820line systems.</TD 821></TR 822></TBODY 823></TABLE 824></DIV 825><P 826>Drivers may return an <SPAN 827CLASS="ERRORCODE" 828>EINVAL</SPAN 829> error code when applications attempt to 830read or write data without prior format negotiation, after switching 831the video standard (which may invalidate the negotiated VBI 832parameters) and after switching the video input (which may change the 833video standard as a side effect). The <A 834HREF="r10944.htm" 835><CODE 836CLASS="CONSTANT" 837>VIDIOC_S_FMT</CODE 838></A 839> ioctl may return 840an <SPAN 841CLASS="ERRORCODE" 842>EBUSY</SPAN 843> error code when applications attempt to change the format while i/o is 844in progress (between a <A 845HREF="r13817.htm" 846><CODE 847CLASS="CONSTANT" 848>VIDIOC_STREAMON</CODE 849></A 850> and <A 851HREF="r13817.htm" 852><CODE 853CLASS="CONSTANT" 854>VIDIOC_STREAMOFF</CODE 855></A 856> call, 857and after the first <A 858HREF="r14264.htm" 859><CODE 860CLASS="FUNCTION" 861>read()</CODE 862></A 863> or <A 864HREF="r14496.htm" 865><CODE 866CLASS="FUNCTION" 867>write()</CODE 868></A 869> call).</P 870></DIV 871><DIV 872CLASS="SECTION" 873><H2 874CLASS="SECTION" 875><A 876NAME="AEN7483" 877>4.8.4. Reading and writing sliced VBI data</A 878></H2 879><P 880>A single <A 881HREF="r14264.htm" 882><CODE 883CLASS="FUNCTION" 884>read()</CODE 885></A 886> or <A 887HREF="r14496.htm" 888><CODE 889CLASS="FUNCTION" 890>write()</CODE 891></A 892> call must pass all data 893belonging to one video frame. That is an array of 894<CODE 895CLASS="STRUCTNAME" 896>v4l2_sliced_vbi_data</CODE 897> structures with one or 898more elements and a total size not exceeding 899<CODE 900CLASS="STRUCTFIELD" 901>io_size</CODE 902> bytes. Likewise in streaming I/O 903mode one buffer of <CODE 904CLASS="STRUCTFIELD" 905>io_size</CODE 906> bytes must 907contain data of one video frame. The <CODE 908CLASS="STRUCTFIELD" 909>id</CODE 910> of 911unused <CODE 912CLASS="STRUCTNAME" 913>v4l2_sliced_vbi_data</CODE 914> elements must be 915zero.</P 916><DIV 917CLASS="TABLE" 918><A 919NAME="V4L2-SLICED-VBI-DATA" 920></A 921><P 922><B 923>Table 4-8. struct 924<CODE 925CLASS="STRUCTNAME" 926>v4l2_sliced_vbi_data</CODE 927></B 928></P 929><TABLE 930BORDER="0" 931FRAME="void" 932WIDTH="100%" 933CLASS="CALSTABLE" 934><COL 935WIDTH="38%" 936TITLE="C1"><COL 937WIDTH="12%" 938TITLE="C2"><COL 939WIDTH="50%" 940TITLE="C3"><TBODY 941VALIGN="TOP" 942><TR 943><TD 944>__u32</TD 945><TD 946><CODE 947CLASS="STRUCTFIELD" 948>id</CODE 949></TD 950><TD 951>A flag from <A 952HREF="r12051.htm#VBI-SERVICES" 953>Table 2</A 954> 955identifying the type of data in this packet. Only a single bit must be 956set. When the <CODE 957CLASS="STRUCTFIELD" 958>id</CODE 959> of a captured packet is 960zero, the packet is empty and the contents of other fields are 961undefined. Applications shall ignore empty packets. When the 962<CODE 963CLASS="STRUCTFIELD" 964>id</CODE 965> of a packet for output is zero the 966contents of the <CODE 967CLASS="STRUCTFIELD" 968>data</CODE 969> field are undefined 970and the driver must no longer insert data on the requested 971<CODE 972CLASS="STRUCTFIELD" 973>field</CODE 974> and 975<CODE 976CLASS="STRUCTFIELD" 977>line</CODE 978>.</TD 979></TR 980><TR 981><TD 982>__u32</TD 983><TD 984><CODE 985CLASS="STRUCTFIELD" 986>field</CODE 987></TD 988><TD 989>The video field number this data has been captured 990from, or shall be inserted at. <CODE 991CLASS="CONSTANT" 992>0</CODE 993> for the first 994field, <CODE 995CLASS="CONSTANT" 996>1</CODE 997> for the second field.</TD 998></TR 999><TR 1000><TD 1001>__u32</TD 1002><TD 1003><CODE 1004CLASS="STRUCTFIELD" 1005>line</CODE 1006></TD 1007><TD 1008>The field (as opposed to frame) line number this 1009data has been captured from, or shall be inserted at. See <A 1010HREF="x7013.htm#VBI-525" 1011>Figure 4-2</A 1012> and <A 1013HREF="x7013.htm#VBI-625" 1014>Figure 4-3</A 1015> for valid 1016values. Sliced VBI capture devices can set the line number of all 1017packets to <CODE 1018CLASS="CONSTANT" 1019>0</CODE 1020> if the hardware cannot reliably 1021identify scan lines. The field number must always be valid.</TD 1022></TR 1023><TR 1024><TD 1025>__u32</TD 1026><TD 1027><CODE 1028CLASS="STRUCTFIELD" 1029>reserved</CODE 1030></TD 1031><TD 1032>This field is reserved for future extensions. 1033Applications and drivers must set it to zero.</TD 1034></TR 1035><TR 1036><TD 1037>__u8</TD 1038><TD 1039><CODE 1040CLASS="STRUCTFIELD" 1041>data</CODE 1042>[48]</TD 1043><TD 1044>The packet payload. See <A 1045HREF="r12051.htm#VBI-SERVICES" 1046>Table 2</A 1047> for the contents and number of 1048bytes passed for each data type. The contents of padding bytes at the 1049end of this array are undefined, drivers and applications shall ignore 1050them.</TD 1051></TR 1052></TBODY 1053></TABLE 1054></DIV 1055><P 1056>Packets are always passed in ascending line number order, 1057without duplicate line numbers. The <A 1058HREF="r14496.htm" 1059><CODE 1060CLASS="FUNCTION" 1061>write()</CODE 1062></A 1063> function and the 1064<A 1065HREF="r12878.htm" 1066><CODE 1067CLASS="CONSTANT" 1068>VIDIOC_QBUF</CODE 1069></A 1070> ioctl must return an <SPAN 1071CLASS="ERRORCODE" 1072>EINVAL</SPAN 1073> error code when applications violate 1074this rule. They must also return an <SPAN 1075CLASS="ERRORCODE" 1076>EINVAL</SPAN 1077> error code when applications pass an 1078incorrect field or line number, or a combination of 1079<CODE 1080CLASS="STRUCTFIELD" 1081>field</CODE 1082>, <CODE 1083CLASS="STRUCTFIELD" 1084>line</CODE 1085> and 1086<CODE 1087CLASS="STRUCTFIELD" 1088>id</CODE 1089> which has not been negotiated with the 1090<A 1091HREF="r10944.htm" 1092><CODE 1093CLASS="CONSTANT" 1094>VIDIOC_G_FMT</CODE 1095></A 1096> or <A 1097HREF="r10944.htm" 1098><CODE 1099CLASS="CONSTANT" 1100>VIDIOC_S_FMT</CODE 1101></A 1102> ioctl. When the line numbers are 1103unknown the driver must pass the packets in transmitted order. The 1104driver can insert empty packets with <CODE 1105CLASS="STRUCTFIELD" 1106>id</CODE 1107> set 1108to zero anywhere in the packet array.</P 1109><P 1110>To assure synchronization and to distinguish from frame 1111dropping, when a captured frame does not carry any of the requested 1112data services drivers must pass one or more empty packets. When an 1113application fails to pass VBI data in time for output, the driver 1114must output the last VPS and WSS packet again, and disable the output 1115of Closed Caption and Teletext data, or output data which is ignored 1116by Closed Caption and Teletext decoders.</P 1117><P 1118>A sliced VBI device may support <A 1119HREF="c5742.htm#RW" 1120>read/write</A 1121> and/or streaming (<A 1122HREF="x5791.htm" 1123>memory mapping</A 1124> and/or <A 1125HREF="x5884.htm" 1126>user 1127pointer</A 1128>) I/O. The latter bears the possibility of synchronizing 1129video and VBI data by using buffer timestamps.</P 1130></DIV 1131></DIV 1132><DIV 1133CLASS="NAVFOOTER" 1134><HR 1135ALIGN="LEFT" 1136WIDTH="100%"><TABLE 1137SUMMARY="Footer navigation table" 1138WIDTH="100%" 1139BORDER="0" 1140CELLPADDING="0" 1141CELLSPACING="0" 1142><TR 1143><TD 1144WIDTH="33%" 1145ALIGN="left" 1146VALIGN="top" 1147><A 1148HREF="x7013.htm" 1149ACCESSKEY="P" 1150>Prev</A 1151></TD 1152><TD 1153WIDTH="34%" 1154ALIGN="center" 1155VALIGN="top" 1156><A 1157HREF="book1.htm" 1158ACCESSKEY="H" 1159>Home</A 1160></TD 1161><TD 1162WIDTH="33%" 1163ALIGN="right" 1164VALIGN="top" 1165><A 1166HREF="x7561.htm" 1167ACCESSKEY="N" 1168>Next</A 1169></TD 1170></TR 1171><TR 1172><TD 1173WIDTH="33%" 1174ALIGN="left" 1175VALIGN="top" 1176>Raw VBI Data Interface</TD 1177><TD 1178WIDTH="34%" 1179ALIGN="center" 1180VALIGN="top" 1181><A 1182HREF="c6488.htm" 1183ACCESSKEY="U" 1184>Up</A 1185></TD 1186><TD 1187WIDTH="33%" 1188ALIGN="right" 1189VALIGN="top" 1190>Teletext Interface</TD 1191></TR 1192></TABLE 1193></DIV 1194></BODY 1195></HTML 1196> 1197