source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/vbi/7552/bvbi.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 199.6 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2011, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bvbi.h $
11 * $brcm_Revision: Hydra_Software_Devel/14 $
12 * $brcm_Date: 9/9/11 5:14p $
13 *
14 * Module Description:
15 *   See Module Overview below
16 *
17 * Revision History:
18 *
19 * $brcm_Log: /magnum/portinginterface/vbi/7400/bvbi.h $
20 *
21 * Hydra_Software_Devel/14   9/9/11 5:14p darnstein
22 * SW7425-1217: document ordering of AMOL data.
23 *
24 * Hydra_Software_Devel/13   3/22/11 12:57p darnstein
25 * SW7420-1693: CGMS for 480P video needs to take "VEC double rate
26 * sampling" into account.
27 *
28 * Hydra_Software_Devel/12   3/15/11 7:13p darnstein
29 * SW7335-1139: document the fact that "method 2" is now the default style
30 * for CGMS-B.
31 *
32 * Hydra_Software_Devel/11   2/14/11 5:02p darnstein
33 * SW7420-1456: Merge BVBI work to main branch: power management.
34 *
35 * Hydra_Software_Devel/10   2/10/11 5:34p darnstein
36 * SW7422-255: The two set/get functions for AMOL data now have a length
37 * argument.
38 *
39 * Hydra_Software_Devel/9   1/12/11 4:42p darnstein
40 * SW3548-3123: New function BVBI_Encode_GetInterruptName().
41 *
42 * Hydra_Software_Devel/8   11/16/10 5:12p darnstein
43 * SW7405-4995: don't use memcmp on structs. Compare each struct field
44 * individually.
45 *
46 * Hydra_Software_Devel/7   10/28/10 6:15p darnstein
47 * SW7422-46: Use new SCTE features in CCE hardware core, where available.
48 *
49 * Hydra_Software_Devel/6   1/21/10 3:18p darnstein
50 * SW35230-16: VBI data structures have been moved to bavc_vbi.h.
51 *
52 * Hydra_Software_Devel/5   11/20/09 3:44p darnstein
53 * SW7468-24: If chipset cannot do TVG2x output, then flag error if user
54 * asks for it.
55 *
56 * Hydra_Software_Devel/4   11/18/09 3:54p darnstein
57 * SW7468-24: Gemstar options now placed in dedicated data structure.
58 *
59 * Hydra_Software_Devel/3   5/5/09 8:14p darnstein
60 * PR53827: #include "bstd.h". That way, the user doesn't have to.
61 *
62 * Hydra_Software_Devel/2   12/3/08 7:55p darnstein
63 * PR45819: New, more modular form of most BVBI source files.
64 *
65 * Hydra_Software_Devel/61   10/1/08 2:50p darnstein
66 * PR47070: The data structure for Gemstar data changes to include line
67 * number information and line-by-line parity error information. This is
68 * an API change, so applications software will need to adapt.
69 *
70 * Hydra_Software_Devel/60   9/15/08 8:57p darnstein
71 * PR46356: VPS decoder software in BVBI is ready for test.
72 *
73 * Hydra_Software_Devel/59   9/12/08 1:24p darnstein
74 * PR46112: Implement variant of CGMS-B (output) defined in CEA-805-D.
75 *
76 * Hydra_Software_Devel/58   9/8/08 1:34p darnstein
77 * PR40709: support for CGMS-B.
78 *
79 * Hydra_Software_Devel/57   5/28/08 5:35p darnstein
80 * PR23220: Some implementation of Gemstar decoding was missing.
81 *
82 * Hydra_Software_Devel/56   5/13/08 2:08p darnstein
83 * PR34584: Port over changes from 7401 dedicated branch. Allow user to
84 * choose bit shift direction for teletext encoding.
85 *
86 * Hydra_Software_Devel/55   4/14/08 8:10p darnstein
87 * PR41309: Put in a 6-bit preamble in BVBI_WSS2CGMS(). I don't think that
88 * is enough though.
89 *
90 * Hydra_Software_Devel/54   4/4/08 3:07p darnstein
91 * PR41359: port PR36108 to main branch. Use CGMSAE core to produce
92 * WSS/576P waveform.
93 *
94 * Hydra_Software_Devel/53   4/3/08 5:45p darnstein
95 * PR38956,PR40709: New API elements supporting CGMS-B encoding.
96 *
97 * Hydra_Software_Devel/52   9/11/07 5:11p darnstein
98 * PR25708: First release of SCTE encoder software.
99 *
100 * Hydra_Software_Devel/51   6/6/07 12:48p darnstein
101 * PR30411: multi-line closed caption encoding is ready for test.
102 *
103 * Hydra_Software_Devel/50   1/17/07 5:31p darnstein
104 * PR26464: correctly handle teletext output to multiple VECs
105 *
106 * Hydra_Software_Devel/49   11/8/06 5:12p darnstein
107 * PR23247: Serial output of teletext is partially supported now.
108 *
109 * Hydra_Software_Devel/48   5/26/06 1:20p darnstein
110 * PR21710: A field handle can be dequeued for encoding at any one of
111 * three times: top field, bottom field, or FRAME. FRAME is the new
112 * choice. The field handles themselves continue to be defined as top
113 * field, bottom field, or both. The new logic is when a field handle is
114 * dequeued at time FRAME, it is always encoded immediately. The rest of
115 * the logic is the same: a "top" field handle is only dequeued and
116 * encoded at "top field" time, same for bottoms. When setting up field
117 * interrupt callbacks, for progressive video output, the argument
118 * BAVC_Polarity_eFrame should be used now.
119 *
120 * Hydra_Software_Devel/49   11/8/06 5:12p darnstein
121 * PR23247: Serial output of teletext is partially supported now.
122 *
123 * Hydra_Software_Devel/48   5/26/06 1:20p darnstein
124 * PR21710: A field handle can be dequeued for encoding at any one of
125 * three times: top field, bottom field, or FRAME. FRAME is the new
126 * choice. The field handles themselves continue to be defined as top
127 * field, bottom field, or both. The new logic is when a field handle is
128 * dequeued at time FRAME, it is always encoded immediately. The rest of
129 * the logic is the same: a "top" field handle is only dequeued and
130 * encoded at "top field" time, same for bottoms. When setting up field
131 * interrupt callbacks, for progressive video output, the argument
132 * BAVC_Polarity_eFrame should be used now.
133 *
134 * Hydra_Software_Devel/47   4/14/06 2:17p darnstein
135 * PR20429: fix stupid typo that caused many compiler warnings.
136 *
137 * Hydra_Software_Devel/46   4/11/06 7:26p darnstein
138 * PR20429: first cut at AMOL encoder software.
139 *
140 * Hydra_Software_Devel/45   3/13/06 2:03p darnstein
141 * PR18343: Document intention to start PAL teletext at line 6.
142 *
143 * Hydra_Software_Devel/44   12/21/05 6:17p darnstein
144 * PR18342: Support encoding of inverted teletext by providing a #define
145 * BVBI_TT_ETS_INVERTED_FRAMING_CODE of 0xE4. The problem of decoding
146 * inverted teletext will be filed as a separate PR.
147 *
148 * Hydra_Software_Devel/43   11/14/05 7:09p darnstein
149 * PR17732: Add some #defines to support Gemstar error conditions.
150 *
151 * Hydra_Software_Devel/42   10/20/05 1:56p darnstein
152 * PR17732: Gemstar features not ready yet. However, the build for 97038
153 * is not broken.
154 *
155 * Hydra_Software_Devel/41   8/22/05 8:10p darnstein
156 * PR16057: To support many different chips, use private #defines that
157 * specify number of VECs, VDECs, and (separately) pass-through VECs.
158 *
159 * Hydra_Software_Devel/40   7/7/05 3:33p darnstein
160 * PR 16008: The default settings struct for BVBI_Open() now allows the
161 * user to choose a buffer size for capturing ancillary data packets in
162 * incoming ITU-R 656 digital video.
163 *
164 * Hydra_Software_Devel/39   7/6/05 6:06p darnstein
165 * PR 16008: disable BVBI_P_UNSAFE_IN656. I forgot to do this in the
166 * previous version.
167 *
168 * Hydra_Software_Devel/38   7/6/05 5:54p darnstein
169 * PR 16008: Input of closed caption data in SAA7113 ancillary data
170 * packets of ITU-R 656 digital video has been confirmed. SAA7114 input
171 * almost certainly needs some debugging though.
172 *
173 * Hydra_Software_Devel/37   7/22/04 12:44p darnstein
174 * PR 9080: change names of BVBI GetDisplayFormat functions to
175 * GetVideoFormat.  This change should have been made in the revision
176 * Hydra_Software_Devel/32 on 4/2/04.
177 *
178 * Hydra_Software_Devel/36   7/16/04 7:06p darnstein
179 * PR 9080: merge in 656 input and output work. Some testing and debugging
180 * remains to be done.
181 *
182 * Hydra_Software_Devel/I656/3   7/15/04 5:50p darnstein
183 * Add sdid choice to BVBI_Encode_656_SetFormat() and
184 * BVBI_Encode_656_GetFormat().
185 *
186 * Hydra_Software_Devel/I656/2   7/8/04 7:44p darnstein
187 * ITU-R 656 decoding of VBI seems to be ready for bring up.  Expect bugs.
188 *
189 * Hydra_Software_Devel/I656/1   6/28/04 1:10p darnstein
190 * 656 output is ready for testing.
191 *
192 * Hydra_Software_Devel/35   6/17/04 6:19p darnstein
193 * PR 11443: Get rid of a kludge that was only needed in revision -A0 of
194 * the hardware.
195 *
196 * Hydra_Software_Devel/34   6/17/04 5:54p darnstein
197 * PR 9080: Do a better job of handling the fact that WSS and VPS only
198 * occur on top field.
199 *
200 * Hydra_Software_Devel/33   5/24/04 5:08p jasonh
201 * PR 11189: Merge down from B0 to main-line
202 *
203 * Hydra_Software_Devel/Refsw_Devel_7038_B0/1   5/3/04 2:47p darnstein
204 * PR 8543: #ifdef out kludge for this PR because the hardware is fixed in
205 * -B0.
206 *
207 * Hydra_Software_Devel/32   4/2/04 2:12p darnstein
208 * PR 9080: change names of BVBI SetDisplayFormat functions to
209 * SetVideoFormat. This change prevents wastage of VS cycles.
210 *
211 * Hydra_Software_Devel/31   3/26/04 1:41p darnstein
212 * PR 8543: Workaround for "teletext lines in use" hardware bug
213 *
214 * Hydra_Software_Devel/30   3/12/04 5:51p darnstein
215 * PR 9080: Teletext for NTSC is working, with a kludge for an A0 hardware
216 * flaw.  There is a lot of debug code that will be removed later.
217 *
218 * Hydra_Software_Devel/29   2/27/04 6:12p darnstein
219 * PR 9080: Add checks for valid video format.
220 *
221 * Hydra_Software_Devel/28   2/6/04 11:36a darnstein
222 * PR 9080: Change error code definitions.
223 *
224 * Hydra_Software_Devel/27   2/3/04 4:42p darnstein
225 * PR 9080: fix logic errors in handling decoding errors. A few other
226 * minor fixes.
227 *
228 * Hydra_Software_Devel/26   1/27/04 6:22p darnstein
229 * PR 9080: Don't check for overrun errors on encoding.  It is only
230 * possible for closed caption encoding, anyway.
231 *
232 * Hydra_Software_Devel/25   1/21/04 5:21p darnstein
233 * PR 9080: The porting interface API refers to closed caption data as a
234 * pair of bytes per video field.  Internally, the CC data is still
235 * stored as a 16-bit quantity, for speedy access to the chip registers.
236 *
237 * Hydra_Software_Devel/24   1/15/04 4:25p darnstein
238 * PR 9080: Some refactoring and name changing.  Closed caption encoding
239 * seems to work now.
240 *
241 * Hydra_Software_Devel/23   12/19/03 5:03p darnstein
242 * PR 9080: adapt to changed BAVC enum for field polarity.
243 *
244 * Hydra_Software_Devel/22   10/17/03 6:04p darnstein
245 * Define a user-friendly data structure for holding teletext data.
246 *
247 * Hydra_Software_Devel/21   10/17/03 3:38p darnstein
248 * VBI encoding can be disabled for one field time.
249 *
250 * Hydra_Software_Devel/20   10/14/03 11:25a darnstein
251 * Change polarity to polarityMask in BVBI_P_Field_Handle.
252 *
253 * Hydra_Software_Devel/19   10/9/03 4:00p darnstein
254 * Change name of several API functions to indicate that they may be
255 * called from an ISR.  Add polarity attribute to BVBI_Field_Handle and
256 * use it in the API.  Fix some typing errors.
257 *
258 * Hydra_Software_Devel/18   10/9/03 1:17p darnstein
259 * Add "use count" attribute to BVBI_Field_Handle.  Not for general use!
260 *
261 * Hydra_Software_Devel/17   9/25/03 4:48p darnstein
262 * BVBI module is mostly complete. The only things that I know are missing
263 * are the critical sections, 656 support, macrovision support, and LOTS
264 * OF TESTING.
265 *
266 * Hydra_Software_Devel/16   9/24/03 1:14p darnstein
267 * Reformat parameter descriptions for generation of stubs for testing
268 * automation.  Change BVBI_Close to return void.
269 *
270 * Hydra_Software_Devel/15   9/24/03 10:34a darnstein
271 * Added some #defines and comments, mostly.
272 *
273 * Hydra_Software_Devel/14   9/17/03 4:08p darnstein
274 * Fix some docjet errors discovered by Lars.  Also, too many changes to
275 * list.
276 *
277 * Hydra_Software_Devel/13   9/12/03 6:49p darnstein
278 * Done except for VPS, teletext, critical sections, and (lots of)
279 * testing.
280 *
281 * Hydra_Software_Devel/12   9/11/03 2:03p darnstein
282 * A customer asked some questions of Lars that revealed some ambiguities
283 * in the descriptions of some of the functions.  I added more details to
284 * these descriptions.
285 *
286 * Hydra_Software_Devel/11   9/10/03 6:15p darnstein
287 * Respond to documentation requests and suggestions by Lars, Jason, and
288 * John.  There are stubs or real code for all API functions.  There is a
289 * long "module overview" paper embedded within.  All functions have
290 * documented return values, although more will be added later.
291 *
292 * Hydra_Software_Devel/10   9/10/03 5:20p darnstein
293 * Change API according to agreement with Jason (yesterday).  Add
294 * documentation of function return values.  More documentation is needed
295 * though.
296 *
297 * Hydra_Software_Devel/9   9/9/03 7:52p darnstein
298 * I think all API functions have been implemented, though some with
299 * stubs.
300 *
301 * Hydra_Software_Devel/8   9/2/03 8:08p darnstein
302 * Still not ready for use.
303 *
304 * Hydra_Software_Devel/7   8/29/03 6:56p darnstein
305 * Still much work to do.
306 *
307 * Hydra_Software_Devel/6   8/29/03 11:39a darnstein
308 * Respond to error corrections from Lars.  This file is still not
309 * finished.
310 *
311 * Hydra_Software_Devel/5   8/28/03 11:38a darnstein
312 * Updated to reflect input from Jason Herrick.  More changes will follow.
313 *
314 * Hydra_Software_Devel/4   4/18/03 3:25p ngibbs
315 * Finished update from code review.
316 *
317 * Hydra_Software_Devel/3   4/18/03 9:17a ngibbs
318 * Update from code review - not totally complete, but mostly.
319 *
320 * Hydra_Software_Devel/2   3/13/03 9:39a ngibbs
321 * Fixed up for code review -- conforms to new comment style, some actual
322 * code changes.
323 *
324 ***************************************************************************/
325
326#ifndef BVBI_H__
327#define BVBI_H__
328
329#include "bstd.h"
330#include "breg_mem.h"
331#include "bmem.h"
332#include "bint.h"
333#include "bchp.h"
334#include "berr_ids.h"
335#include "bfmt.h"
336#include "bavc.h"
337#include "bavc_vbi.h"
338#include "bavc_hdmi.h"
339
340#ifdef __cplusplus
341extern "C" {
342#endif
343
344/* TODO: change description of ALL parity variables to refer to the content
345         of the associated BVBI_Field_Handle, not to the interrupt that caused
346         the function to be called. */
347
348
349/*=************************ Module Overview ********************************
350<verbatim>
351
352  Proposed:
353
354  Tested:
355  (Nothing)
356
357                                                                        Overview
358                                                                        --------
359
360  The BVBI module controls access to the chip's core VBI registers.  It
361  permits both encoding and decoding data in the Closed Captioning,
362  CGMS, WSS and Teletext formats for SD output modes.  It may (or may
363  not) permit HD output of CGMS data in 1080i, 720p and 480p HD video
364  format.
365
366                                                                        Design
367                                                                        ------
368
369The usage of the VBI API can be divided into three parts:
370 o Initializing the VBI module
371 o Setting up recurring VBI encoding and decoding tasks
372 o Performing VBI encoding and decoding
373
374User programming of the first two parts will typically occur in a
375normal (as opposed to interrupt) context of execution.  The third
376part will typically occur in the context of an interrupt.
377
378The above three parts of the API are described in more detail below,
379in separate sections.
380
381Initializing The VBI Module
382---------------------------
383
384The API defines a data type BVBI_Handle that controls the state
385of all VBI encoding and decoding hardware on the chip.  The user
386should create a single BVBI_Handle for the entire chip by calling
387BVBI_Open() when the software application is launched.
388
389The API also provides a function BVBI_Close() that frees resources
390that were reserved by BVBI_Open().  Should the user wish to reset the
391VBI hardware, he should call BVBI_Close() and then call BVBI_Open()
392again.
393
394After the VBI module is initialized through a call to BVBI_Open(), the
395user should create a small collection of data types BVBI_Field_Handle.
396Each BVBI_Field_Handle can contain VBI data for a single field of
397video.  A BVBI_Field_Handle can be used for encoding and decoding VBI
398data.  A single BVBI_Field_Handle may contain several types of VBI
399data (for example, both Closed Caption data and Teletext data).
400
401An empty BVBI_Field_Handle data type is created by calling
402function BVBI_Field_Create().  It is destroyed by calling function
403BVBI_Field_Destroy(). 
404
405When VBI data is decoded by the chip hardware, it is placed
406in a BVBI_Field_Handle.  The API provides several functions for
407extracting this data, such as BVBI_Field_GetCCData(), which extracts
40816 bits of closed caption data.  The API also provides a function
409BVBI_Field_GetErrorInfo_isr() that discloses any errors that the hardware
410detected while attempting to decode VBI data from a field of video.
411
412When VBI data is encoded by the chip hardware, this data must come
413from a BVBI_Field_Handle.  This BVBI_Field_Handle may have been
414filled with VBI data by a previous call to BVBI_Field_Decode.
415The user may modify this VBI data (or create it "from scratch")
416by calling one of several provided API functions.  For example,
417function BVBI_Field_SetCGMSAData() will place CGMS data into a
418BVBI_Field_Handle.
419
420When working with closed caption, CGMS, and WSS, the manipulations of
421BVBI_Field_Handles are straight forward.  For all other forms of VBI
422data, a level of indirection is involved.  This is because the other
423forms of VBI data can be fairly large in size, and the designers
424did now wish to burden applications with the (memory) expense of
425supporting these forms if the capability is not in use.  To cite a
426particular example, the BVBI_Field_Handle is not capable of holding
427teletext data when the handle is first created.  If the user expects
428to work with teletext, he must modify his BVBI_Field_Handle(s)
429by calling BVBI_Field_TT_Allocate().  This function effectively
430"enlarges" a BVBI_Field_Handle so that it can hold a user-specified
431amount of teletext data.  When the user wishes to return memory
432resources to the system, he simply calls BVBI_Field_Destroy().
433The user takes no special action to free the "extra" resources
434required for teletext data, BVBI_Field_Destroy() does it all.
435
436Setting Up Recurring VBI Encoding And Decoding Tasks
437----------------------------------------------------
438
439The user expresses which VBI encoding and decoding operations he
440wants by creating and modifying two data types BVBI_Encode_Handle
441and BVBI_Decode_Handle.  These data types are created by calling
442functions BVBI_Encode_Create() and BVBI_Decode_Create(),
443respectively.  These data types are always associated with
444a BVBI_Handle data type.  Several BVBI_Encode_Handles and
445BVBI_Decode_Handles may be associated with a single BVBI_Handle.
446Each BVBI_Encode_Handle is associated with a unique video destination
447when created.  Similarly, each BVBI_Decode_Handle is associated with
448a unique video source when created.  The software will not allow two
449BVBI_Encode_Handles to be associated with the same video destination.
450Similarly, the software will not allow two BVBI_Decode_Handles to
451be associated with the same video source.
452
453The API also provides function BVBI_Encode_Destroy() and
454BVBI_Decode_Destroy() to release resources allocated by
455BVBI_Encode_Create() and BVBI_Decode_Create().  Note that a call
456to BVBI_Close() will fail if its BVBI_Handle argument has any open
457BVBI_Encode_Handles or BVBI_Decode_Handles associated with it.
458In other words, the user must shut down all 'code_Handles before
459attempting to shut down (or re-open) the entire VBI module.
460
461After a 'code_Handle is created, it is modified to express what
462sort of coding the user desires.  Some examples:
463 o Calling function BVBI_Decode_SetCGMS() causes a BVBI_Decode_Handle
464   to enable subsequent decoding of CGMS data.
465 o Calling function BVBI_Encode_SetVideoFormat() will cause any
466   subsequent VBI encoding operations to assume a specific video
467   format (PAL or NTSC).
468
469The collection of functions that are described in the previous
470paragraph do NOT change the operation of the chip hardware.
471They serve to record the user's wishes.  When the user has finished
472calling these functions, his recipe for VBI encoding and/or decoding
473is complete.  At that time, the user should call the functions
474BVBI_Decode_ApplyChanges() and/or BVBI_Encode_Apply_Changes()
475to commit the software settings to chip hardware.
476
477The function BVBI_Decode_Apply_Changes() takes a BVBI_Decode_Handle
478as its argument.  All decode operations expressed by the and
479BVBI_Decode_Handle are committed to chip hardware by calling
480BVBI_Decode_ApplyChanges().
481
482Similarly, the function BVBI_Encode_Apply_Changes() takes a
483BVBI_Encode_Handle as its argument and modifies the operation of
484the VBI encoding hardware within the chip.
485
486Performing VBI Encoding And Decoding
487------------------------------------
488
489Typically, this will be the main "real time" bit of programming
490involving the VBI API.  It is accomplished by calling two functions
491BVBI_Encode_Data_isr() and BVBI_Decode_Data_isr().  As their names
492suggest, these functions are designed to be called in interrupt
493context.  The chip hardware provides one interrupt that marks the
494start of active video in a field of video being encoded, and another
495interrupt that marks the same event in decoded video.  These are
496the interrupts from which te two functions should be called.
497
498Calling BVBI_Encode_Data_isr() provides VBI data to the hardware for
499encoding in the next field of specified parity (the caller states
500this parity: even or odd field).  Therefore, the call chould be made
501before the field of desired parity begins.  The user is encouraged to
502use the interrupt that marks the start of active video in a field.
503As a result, the user would typically call BVBI_Encode_Data_isr()
504with even field data when the interrupt for (start active video;
505odd field) fires.
506
507Calling BVBI_Decode_Data_isr() reads VBI data from the hardware for
508a field of specified parity that has already occurred.  Therefore,
509the call should be made after the field of desired parity ends.
510The user is encouraged to use the interrupt that marks the start of
511actived video in a field.  As a result, the user would typically
512call BVBI_Decode_Data_isr() requesting even field data when the
513interrupt for (start active video; even field) fires.
514
515The functions BVBI_Decode_Data_isr() and BVBI_Encode_Data_isr()
516both use the data type BVBI_Field_Handle as a container for the VBI
517data to be encoded or decoded.  It is the user's responsibility
518to protect these data objects from concurrent use during the two
519interrupt contexts (start active video decode and start active video
520encode).  The user must also prevent access conflicts occurring
521between interrupt and non interupt context.  Typically, this would
522mean managing an array of BVBI_Field_Handle objects that are all
523allocated before VBI processing begins.
524
525Note that these two functions are the only ones in the API that
526are safe to call from interrupt context.
527
528The VBI API provides a collection of functions that put VBI
529data into a BVBI_Field_Handle object, or take it back out.
530These functions include (for example) BVBI_Field_GetCGMSAData()
531and BVBI_Field_SetWSSData().  There is BVBI_Field_GetErrorInfo_isr(),
532for obtaining detailed information about a failure to encode or
533decode VBI data.
534
535                                    Usage/Sample Code
536                        -----------------
537
538
539Initializing The VBI Module
540---------------------------
541
542The following should be performed when the chip is initialized:
543
544    // Error code, should be checked after calling API functions
545    BERR_Code eErr;
546
547    // Provided by other porting interface initialization functions:
548    BCHP_Handle chipHandle;
549    BREG_Handle regHandle;
550    BMEM_Handle memHandle;
551
552    // Which video decoder (VDEC) to use. 
553    // Can be queried from the VDC module
554    BAVC_SourceId eSource;
555
556    // Which video decoder (VEC) to use. 
557    // Can be queried from the VDC module
558    BAVC_VbiPath eDestination;
559
560    // Result of initializing VBI API, save these for future use
561    BVBI_Handle vbiHandle;
562    BVBI_Field_Handle fieldHandle[16];
563    BVBI_Decode_Handle decodeHandle;
564    BVBI_Encode_Handle decodeHandle;
565
566    // Initialize the entire VBI module
567    eErr = BVBI_Open (&vbiHandle, chipHandle, regHandle, memHandle, NULL);
568
569    // Allocate some containers for VBI data
570    for (index = 0 ; index < 16 ; ++index)
571    {
572        eErr = BVBI_Field_Create (&fieldHandle[index], vbiHandle);
573    }
574
575    // Allocate rules for encoding and decoding actions
576    eErr = BVBI_Decode_Create (vbiHandle, &decodeHandle, eSource);
577    eErr = BVBI_Encode_Create (vbiHandle, &encodeHandle, eDestination);
578
579Setting Up Recurring VBI Encoding And Decoding Tasks
580----------------------------------------------------
581
582This code will be executed whenever the rules for VBI encode/decode
583change.  Most of the variables are those initialized in the previous
584section.
585
586    // Express that closed caption data and CGMS data are to be
587    // decoded
588    eErr = BVBI_Decode_SetCC   (decodeHande, true);
589    eErr = BVBI_Decode_SetCGMS (decodeHande, true);
590
591    // Express that the relevant VDEC is processing NTSC video
592    eErr = BVBI_Decode_SetVideoFormat (decodeHandle, BFMT_VideoFmt_eNTSC);
593
594    // Apply all the above decoder settings to chip hardware
595    eErr = BVBI_Decode_ApplyChanges (decodeHandle);
596
597    // On the encoding side, we will only output closed caption data
598    eErr = BVBI_Encode_SetCC   (encodeHande, true);
599    eErr = BVBI_Encode_SetVideoFormat (encodeHandle, BFMT_VideoFmt_eNTSC);
600
601    // Apply all the above encoder settings to chip hardware
602    eErr = BVBI_Encode_ApplyChanges (decodeHandle);
603
604Performing VBI Encoding And Decoding
605------------------------------------
606
607This code will be executed in the context of the interrupt that marks
608the start of active video for incoming (decoded) video.
609
610    // Which field data object to put data into.  The user must manage
611    // this to avoid concurrent access to data by different contexts of
612    // execution.
613    int index;
614
615    // Specific decoding error conditions (bitmask)
616    uint32_t errInfo;
617
618    // Some VBI data extracted from hardware
619    uint32_t CGMSAData;
620
621    // Even/odd field parity, can be obtained from the VDC module.
622    BAVC_Polarity polarity;
623
624    // The data that is ready is not the data that is currently being
625    // decoded.  The data that is ready is from the PREVIOUS field.
626    if (polarity == BAVC_Polarity_eTopField)
627        polarity = BAVC_Polarity_eBottomField;
628    else if (polarity == BAVC_Polarity_eBottomField)
629        polarity = BAVC_Polarity_eTopField;
630        // If polarity == BAVC_Polarity_eFrame, let it be.
631
632    // Pull closed caption data and CGMS data from VDEC hardware
633    eErr = BVBI_Decode_Data_isr (vbiHandle, fieldHandle[index], polarity);
634
635    // Check for decoding errors.  Depending on results, the rest of
636    // the code in this section may have to be skipped
637    // (not shown here)
638    eErr = BVBI_Field_GetErrorInfo_isr (fieldHandle[index], &errInfo);
639    if (eErr != BERR_Success)
640    {
641        // Check for conditions such as BVBI_LINE_ERROR_CC_OVERRUN
642        // defined in bvbi.h
643    }
644
645    // Extract the CGMS data (if any) for use by customer's application
646    eErr = BVBI_Field_GetCGMSAData (fieldHandle[index], &CGMSAData);
647
648This code will be executed in the context of the interrupt that marks
649the start of active video for outgoing (encoded) video.
650
651    // Which field data object to use as source of VBI data.  The user
652    // must manage this to avoid concurrent access to data by
653    // different contexts of execution.
654    int index;
655
656    // Specific decoding error conditions (bitmask)
657    uint32_t errInfo;
658
659    // Even/odd field parity, can be obtained from the VDC module.
660    BAVC_Polarity polarity;
661
662    // The VBI data that is about to be encoded must be ready before
663    // its field is created by hardware.  Thus, if the interrupt has
664    // just fired for an odd field, it is too late to encode odd field
665    // VBI data.  We would provide some even field data instead, which
666    // will be encoded in the NEXT field to be created.
667    if (polarity == BAVC_Polarity_eTopField)
668        polarity = BAVC_Polarity_eBottomField;
669    else if (polarity == BAVC_Polarity_eBottomField)
670        polarity = BAVC_Polarity_eTopField;
671        // If polarity == BAVC_Polarity_eFrame, let it be.
672
673    // Encode VBI data.  For this example, assume that the provided
674    // BVBI_Field_Handle (argument 2) was filled in by a previous call
675    // to BVBI_Decode_Data_isr().  The value of "index" must be
676    // computed by the user to point to the right set of VBI data.
677    eErr = BVBI_Encode_Data_isr (vbiHandle, fieldHandle[index], polarity);
678
679
680                                                        Miscellaneous
681                                                        -------------
682
683When teletext is used with PAL video, the porting interface supports ETSI 300
684706 "Enhanced" teletext. In particular, the teletext data may be placed on
685lines 6-22 on the top field, and lines 318 through 335 on the bottom field.
686This is relevant when calling these functions:
687        BVBI_Field_GetTTData_isr()
688        BVBI_Field_SetTTData_isr()
689
690</verbatim>
691***************************************************************************/
692
693/* Constants */
694
695/* The maximum number of lines of teletext data that is supported.  Also
696   determines the space required to get and set teletext data by certain
697   functions. */
698#define BVBI_TT_MAX_LINES 18
699
700/* The maximum number of characters per line of teletext data that is
701   supported.  Also determines the space required to get and set teletext
702   data by certain functions. */ 
703#define BVBI_TT_MAX_LINESIZE BAVC_VBI_TT_MAX_LINESIZE
704#define BVBI_TT_MAX_LINELENGTH (BAVC_VBI_TT_MAX_LINESIZE + 1)
705
706/* The framing codes for teletext lines, for NTSC and PAL.  The final symbol is
707   to indicate that no valid data is on the line. */
708#define BVBI_TT_NABTS_FRAMING_CODE              0xE7
709#define BVBI_TT_ETS_FRAMING_CODE                0x27
710#define BVBI_TT_ETS_INVERTED_FRAMING_CODE       0xE4
711#define BVBI_TT_INVALID_FRAMING_CODE            0xFF
712
713/* The maximum number of lines of Gemstar data that is supported.  Also
714   determines the space required to get and set Gemstar data by certain
715   functions. */
716#define BVBI_GS_MAX_LINES BAVC_VBI_GS_MAX_LINES
717
718/* Structures */
719
720/*****************************************************************************
721  Summary:
722    Structure for initial VBI settings
723   
724  Description:
725    The BVBI_Settings structure is used by the VBI API to set up
726    a VBI Handle initially.  It is initialized with
727        BVBI_GetDefaultSettings, and passed to BVBI_Open().
728
729  TODO:  document how interrupts work, VPS format, List of display formats
730    for each VBI format, EIA document numbers
731
732  See Also:
733    BVBI_Open, BVBI_GetDefaultSettings
734 *****************************************************************************/
735typedef struct BVBI_Settings
736{
737        size_t   in656bufferSize;       /* Size of capture buffer (in bytes) for
738                                       ancillary data packets captured from
739                                                                   incoming ITU-R 656 digital video.         */
740        bool  tteShiftDirMsb2Lsb;   /* If true, teletext encoder shift direction
741                                       will be set to MSBToLSB. Otherwise, it
742                                                                   will be set to LSBToMSB. The default
743                                                                   value is FALSE.                           */
744} 
745BVBI_Settings;
746
747
748/* See bavc_vbi.h */
749#define BVBI_TT_Line BAVC_VBI_TT_Line
750
751/*****************************************************************************
752  Summary:
753    Structure for holding Gemstar options
754   
755  Description:
756    The BVBI_GSoptions structure contains options controlling Gemstar
757        waveforms.
758
759  See Also:
760        BVBI_Encode_SetGemstarOptions
761 *****************************************************************************/
762typedef struct BVBI_GSOptions
763{
764        bool           bTvg2x; /* If true, the TVG2X waveform specified in
765                                  CEA-2020 will be used. If false, the waveform
766                                                          specified in the proprietary Gemstar standard
767                                                          will be used.                                  */
768        uint16_t baseline_top; /* The video line number corresponding to the
769                                  first bit in the following bit mask.           */
770        uint16_t linemask_top; /* Bit mask that indicates which video lines
771                                                          carry Gemstar data in top video fields.        */
772        uint16_t baseline_bot; /* The video line number corresponding to the
773                                                          first bit in the following bit mask. Must be
774                                                          greater than 256.                              */
775        uint16_t linemask_bot; /* Bit mask that indicates which video lines
776                                                          carry Gemstar data in bottom video fields.     */
777} 
778BVBI_GSOptions;
779#define BVBI_GSOptions_Version (1)
780
781/* See bavc_vbi.h */
782#define BVBI_GSData      BAVC_VBI_GSData
783#define BVBI_MCCData     BAVC_VBI_MCCData
784#define BVBI_CGMSB_Datum BAVC_VBI_CGMSB_Datum
785#define BVBI_VPSData     BAVC_VBI_VPSData
786
787/*****************************************************************************
788  Summary:
789    Handle for VBI module
790   
791  Description:
792    The BVBI_Handle, once opened, represents VBI activity of some
793    kind on the part of the system.  Usually it indicates that VBI
794    registers are being set and that VBI output is occurring for at
795    least one output.  It can be allocated with a call to BVBI_Open.
796        It is passed as the first argument to a number of BVBI
797        functions, and a BVBI_Encode_Handle or BVBI_Decode_Handle
798        may be opened from it.
799
800  See Also:
801    BVBI_Open, BVBI_Encode_Create, BVBI_Decode_Create
802 *****************************************************************************/
803typedef struct BVBI_P_Handle *BVBI_Handle;  /* Opaque */
804
805
806/*****************************************************************************
807  Summary:
808    Handle for VBI encoding functionality
809   
810  Description:
811    The BVBI_Encode_Handle is used to control how VBI encoding is done,
812    and in what formats.  It is used by a number of encoding-related
813    functions.  It is allocated by BVBI_Encode_Create.  Encoding
814        of specific data is controlled by BVBI_Encode_Data_isr.  Format
815        output is controlled by BVBI_Encode_SetCC and related functions.
816
817  See Also:
818    BVBI_Encode_Create, BVBI_Decode_Create, BVBI_Encode_Data_isr,
819        BVBI_Encode_SetCC
820 *****************************************************************************/
821typedef struct BVBI_P_Encode_Handle *BVBI_Encode_Handle;  /* Opaque */
822
823
824/*****************************************************************************
825  Summary:
826    Handle for VBI decoding functionality
827   
828  Description:
829    The BVBI_Decode_Handle is used to control how VBI decoding is done, and in
830        what formats.  It is used by a number of decoding-related functions.
831        It is allocated by BVBI_Decode_Create.  Decoding of specific data is
832        controlled by BVBI_Decode_Data_isr.  Format output is controlled by
833        BVBI_Decode_SetCC and related functions.
834
835  See Also:
836    BVBI_Encode_Create, BVBI_Decode_Create, BVBI_Decode_Data_isr,
837        BVBI_Decode_SetCC
838 *****************************************************************************/
839typedef struct BVBI_P_Decode_Handle *BVBI_Decode_Handle;  /* Opaque */
840
841
842/*****************************************************************************
843  Summary:
844    Structure for one field's VBI data
845
846  Description:
847    BVBI_Field_Handle can be created by BVBI_Field_Create and filled
848        in by BVBI_Decode_Data_isr or BVBI_Field_Set_*Data.  The data
849        can be read by functions like BVBI_Field_Get*Data.      It can be
850        passed to BVBI_Encode_Data_isr to set the current output for the
851        formats that it represents.
852
853    Note that the BVBI_Field_Handle is not related to any
854        BVBI_Decode_Handle it may have been read from.  The data
855        may be used with other handles and read and written freely
856        no matter what BVBI_Encode_Handle or BVBI_Decode_Handle
857        may have been opened or closed.
858
859        Note also that the BVBI_Field_Handle is not related to any
860        BVBI_Handles.  A BVBI_Field_Handle is simply a container for VBI
861        data that can occur in a single field of video.
862
863  See Also:
864    BVBI_Encode_Data_isr, BVBI_Decode_Data_isr, BVBI_Field_SetCCData,
865        BVBI_Field_GetCCData.
866 *****************************************************************************/
867typedef struct BVBI_P_Field_Handle *BVBI_Field_Handle;  /* Opaque */
868
869
870/* Enumerations and Constants */
871
872/* Identifies which variant of the AMOL specification to use */
873typedef enum BVBI_AMOL_Type
874{
875        BVBI_AMOL_Type_None=0,          /* No AMOL. Used to disable a feature, etc. */
876        BVBI_AMOL_Type_I,                       /* AMOL I                                   */
877        BVBI_AMOL_Type_II_Lowrate,      /* AMOL II, 1 Mbit/s.                       */
878        BVBI_AMOL_Type_II_Highrate      /* AMOL II, 2 Mbit/s.                       */
879
880} BVBI_AMOL_Type;
881
882/*
883 * Programming note: the above must be in order of AMOL data size per video
884 * ----------------  field
885 */
886
887/* Identifies which variant of the SCTE specification to use */
888typedef enum BVBI_SCTE_Type
889{
890        BVBI_SCTE_Type_NONE=0,          /* No SCTE. Used to disable a feature, etc. */
891        BVBI_SCTE_Type_CCONLY,      /* Closed caption like data only.           */
892        BVBI_SCTE_Type_CCNRTV,      /* Closed caption like and NRTV data.       */
893        BVBI_SCTE_Type_CCPAM,       /* Closed caption like and PAM data.        */
894        BVBI_SCTE_Type_CCMONO,      /* Closed caption like and monochrome data. */
895        BVBI_SCTE_Type_LAST                     /* Do not use this!                         */
896
897} BVBI_SCTE_Type;
898
899/* The SCTE encoder core must "know" what colorspace is in use. */
900typedef enum BVBI_CSC {
901        BVBI_CSC_SCTE_MYIQ=0,
902        BVBI_CSC_SCTE_NTSCYIQ=1,
903        BVBI_CSC_SCTE_YUV=2,
904        BVBI_CSC_SCTE_CO=3,
905        BVBI_CSC_NONE=4
906} BVBI_CSC;
907
908#define BVBI_SCTE_MAX_ITEMS 32
909
910typedef struct BVBI_SCTE_CC_Data
911{
912        uint8_t valid;
913        uint8_t priority;
914        uint8_t line_number;    /* Between 10 and 41, inclusive. */
915        uint8_t cc_data_1;
916        uint8_t cc_data_2;
917
918} BVBI_SCTE_CC_Data;
919
920typedef struct BVBI_SCTE_NRTV_Data
921{
922        uint8_t valid;
923        uint8_t priority;
924        uint8_t line_number;    /* Between 10 and 41, inclusive. */
925        uint8_t sequence_number;
926        uint8_t segment_number;
927        uint8_t y_data[32];
928        uint8_t cbcr_data[32];
929
930} BVBI_SCTE_NRTV_Data;
931
932typedef struct BVBI_SCTE_Mono_Data
933{
934        bool first_segment_flag;
935        bool last_segment_flag;
936        uint8_t line_number;    /* Between 10 and 41, inclusive. */
937        uint16_t first_pixel_position;
938        uint8_t n_pixels;
939        uint8_t Y_data[256];
940
941} BVBI_SCTE_Mono_Data;
942
943
944/*****************************************************************************
945  Summary:
946    Structure for holding SCTE data
947   
948  Description:
949    The BVBI_SCTE_Data structure is a container for an entire field of
950        SCTE data.
951
952    The BVBI_SCTE_Data structure contains _size elements, _count
953    elements, and data pointers.
954
955        The user is responsible for setting the data pointers to
956        reasonable values. However, if the corresponding _count
957        element is zero, then BVBI software will not make use of
958        the data pointer. BVBI software does not allocate or free
959        memory indicated by the data pointers in any case.
960
961        The _size elements are for the convenience of the user,
962        they are not used by BVBI software.
963
964        The _count elements indicate the amount of data contained
965        in the corresponding data pointers. The units of the _count
966        elements vary, but they are defined below.
967
968  See Also:
969    BVBI_Field_GetSCTEData_isr, BVBI_Field_SetSCTEData_isr
970 *****************************************************************************/
971typedef struct BVBI_SCTE_Data
972{
973        size_t cc_count;                 /* Number of meaningful entries in the
974                                            following cc_data array.             */
975        size_t cc_size;                  /* Capacity of following cc_data array,
976                                            in units of BVBI_SCTE_CC_Data.       */
977        BVBI_SCTE_CC_Data* cc_data;      /* The closed caption data. If zero,
978                                            then no space has been allocated.    */
979        size_t nrtv_count;               /* Number of meaningful entries in the
980                                            following nrtv_data array. Must be
981                                                                            zero or one.                         */
982        size_t nrtv_size;                /* Capacity of following nrtv_data
983                                            array, in units of
984                                                                                BVBI_SCTE_NRTV_Data                  */
985        BVBI_SCTE_NRTV_Data* nrtv_data;  /* The NRTV data. If zero, then no
986                                            space has been allocated.            */
987        size_t pam_count;                /* Number of meaningful bytes in the
988                                            following luma_PAM_data buffer. The
989                                                                                maximum value allowed is 4095.       */
990        size_t pam_size;                 /* Capacity of following luma_PAM_data
991                                            buffer, in bytes. If zero, then no
992                                                                                space has been allocated.            */
993        uint8_t* luma_PAM_data;          /* Buffer containing one piece of
994                                            luma_PAM_data, as defined in SCTE-21
995                                                                                section 5.5.                         */
996        size_t mono_count;               /* Number of meaningful entries in the
997                                            following mono_data array. Must be
998                                                                            zero, one, or two.                   */
999        size_t mono_size;                /* Capacity of following mono_data
1000                                            array, in units of
1001                                                                                BVBI_SCTE_Mono_Data                  */
1002        BVBI_SCTE_Mono_Data* mono_data;  /* The monochrome data. If zero, then
1003                                            no space has been allocated.         */
1004        uint8_t field_number;            /* Field number, from SCTE data
1005                                            structure. In the case of SCTE 20
1006                                                                                ATSC CC data, it is field_type. In
1007                                                                                the case of monochrome data, this is
1008                                                                                the field_parity element.            */
1009} BVBI_SCTE_Data;
1010
1011/* The supported methods for encapsulating VBI data into ITU-R 656
1012   (digital) bitstreams */
1013typedef enum BVBI_656Fmt
1014{
1015        BVBI_656Fmt_SAA7113 = 0,
1016        BVBI_656Fmt_Modified_SAA7113,
1017        BVBI_656Fmt_SAA7114,
1018        BVBI_656Fmt_SAA7114A,
1019        BVBI_656Fmt_SAA7114B,
1020        BVBI_656Fmt_SAA7114C,
1021        BVBI_656Fmt_SAA7115,
1022        BVBI_656Fmt_SMPTE291,
1023        BVBI_656Fmt_LAST
1024
1025} BVBI_656Fmt;
1026
1027/* An enum specifying type of VBI data encountered */
1028typedef enum BVBI_656_VbiType
1029{
1030        BVBI_656_VbiType_None = 0,      /* No VBI data present */
1031        BVBI_656_VbiType_EuroCC,        /* European closed caption data */
1032        BVBI_656_VbiType_WSS,           /* WSS data */
1033        BVBI_656_VbiType_USCC,          /* U.S. Closed caption data */
1034        BVBI_656_VbiType_TT,            /* (European) Teletext data */
1035        BVBI_656_VbiType_NABTS,         /* (U.S.) NABTS data */
1036        BVBI_656_VbiType_VPS,           /* VPS data */
1037        BVBI_656_VbiType_GS,            /* Gemstar data */
1038        BVBI_656_VbiType_AMOL,          /* AMOL data */
1039        BVBI_656_VbiType_MCC,           /* Multi-line, closed caption data */
1040        BVBI_656_VbiType_SCTE           /* SCTE data */
1041
1042} BVBI_656_VbiType;
1043
1044/* Information necessary to use parsed SMPTE 291M data */
1045typedef struct
1046{
1047        BVBI_656_VbiType vbiType;       /* Defined above */
1048        BAVC_Polarity polarity;         
1049        int lineNumber;                         /* Video line, enter 0 for "don't care" */
1050
1051} BVBI_SMPTE291M_Description;
1052
1053/*****************************************************************************
1054  Summary:
1055    Enumeration for expressing choice of data for teletext serial port output.
1056   
1057  Description:
1058    For chipsets that are capable of sending teletext data to an auxiliary
1059    serial port, there is a choice of what data to send to the port. This
1060    enumeration is a list of those choices.
1061
1062  See Also:
1063    BVBI_Open, BVBI_GetDefaultSettings
1064 *****************************************************************************/
1065typedef enum BVBI_XSER_DataContent
1066{
1067    BVBI_TTserialDataContent_None,         /* No data. Disable the serial
1068                                                  port feature. */
1069    BVBI_TTserialDataContent_DataOnly,     /* Output only the teletext data. */
1070    BVBI_TTserialDataContent_DataMag,      /* Output teletext data and
1071                                                  magazine. */
1072    BVBI_TTserialDataContent_DataMagFrm,   /* Output teletext data  magazine
1073                                                  and frame code. */
1074    BVBI_TTserialDataContent_DataMagFrmRun /* Output teletext data magazine
1075                                                  frame code  and run-in
1076                                                                                          sequence. */
1077} BVBI_XSER_DataContent;
1078
1079/*****************************************************************************
1080  Summary:
1081    Enumeration for expressing choice of control for output of data to
1082    teletext serial port.
1083   
1084  Description:
1085    For chipsets that are capable of sending teletext data to an
1086    auxiliary serial port, there is a choice of methods to control
1087    the output. The serial teletext output may occur at a certain
1088    stage of ITU-R 656 digital video output, or the output may
1089    be sent in response to an electrical signal from an external
1090    device. This enumeration is a list of those choices.
1091
1092  See Also:
1093    BVBI_Open, BVBI_GetDefaultSettings
1094 *****************************************************************************/
1095typedef enum BVBI_TTserialDataSync
1096{
1097    BVBI_TTserialDataSync_EAV,  /* Output synchronized with video EAV.  */
1098    BVBI_TTserialDataSync_SAV,  /* Output synchronized with video SAV.  */
1099    BVBI_TTserialDataSync_RQ    /* Output synchronized with external RQ
1100                                   (TTX request) signal.                */
1101
1102} BVBI_TTserialDataSync;
1103
1104/*****************************************************************************
1105  Summary:
1106    Structure for initial VBI encoder settings
1107   
1108  Description:
1109    The BVBI_XSER_Settings structure is used by the VBI API to set up
1110    the external UART (used with teletext output).  It can be initialized with
1111    BVBI_Encode_XSER_GetOptions, and passed to BVBI_Encode_XSER_SetOptions().
1112
1113  See Also:
1114    BVBI_Encode_Create, BVBI_Encode_GetDefaultSettings
1115 *****************************************************************************/
1116typedef struct BVBI_XSER_Settings
1117{
1118    BVBI_XSER_DataContent
1119        xsSerialDataContent;    /* Specify serial output of data.  Ignored
1120                                           if chipset does not have this capability. */
1121    BVBI_TTserialDataSync
1122        ttSerialDataSync;       /* Specify timing of serial output of
1123                                   teletext data. Ignored if chipset does
1124                                   not have this capability.                 */
1125   uint16_t 
1126    iTTserialDataSyncDelay;     /* Specify delay count (27 MHz cycles) for
1127                                   serial output of teletext data. Ignored
1128                                   if chipset does not have this capability. */
1129} 
1130BVBI_XSER_Settings;
1131#define BVBI_XSER_Settings_Version (1)
1132
1133/*****************************************************************************
1134  Summary:
1135    Prototype for callback that provides the parsing mechanism for incoming
1136        SMPTE 291M packets.
1137
1138  Description:
1139    SMPTE 291M is a standard for encapsulating user data in
1140    ancillary data packets for inclusion in an ITU-R 656 bitstream.
1141        SMPTE 291M is an "open" standard that allows the user
1142        data to be expressed in a variety of ways.  The user must
1143        provide a callback function to parse incoming data
1144        according to the user's method.  This is the function prototype
1145        for such a callback function.
1146
1147  Returns:
1148    BERR_SUCCESS for success; any other value will cause data to be ignored.
1149
1150 *****************************************************************************/
1151typedef BERR_Code (*BVBI_Decode_656_SMPTE291M_Cb) (
1152        void*         arg0, /*  [in] The "arg0"value provided to
1153                                     BVBI_Decode_656_SetSMPTE291Moptions().      */
1154        BFMT_VideoFmt
1155                  eVideoFormat, /*  [in] Video format of input 656 port              */
1156        BAVC_Polarity
1157                  polarity, /*  [in] The field polarity according to BVBI
1158                                             interrupts.                                 */
1159        uint8_t    data_id, /*  [in] The first identification field in the
1160                                     SMPTE 291M packet header.                   */
1161        uint8_t  second_id, /*  [in] The second identification field in the
1162                                     SMPTE 291M packet header.                   */
1163        uint8_t data_count, /*  [in] The DATA COUNT field in the SMPTE 291M
1164                                     packet header.                              */
1165        uint8_t*    packet, /*  [in] The SMPTE 291M ancillary data packet,
1166                                     starting with the first byte of the
1167                                                                 payload.  Note that the three header bytes
1168                                                                 have already been parsed by the BVBI
1169                                                                 software when this callback function is
1170                                                                 called.  The final checksum byte has also
1171                                                                 been read and verified by the BVBI
1172                                                                 software and is not available to this
1173                                                                 callback function.                          */
1174    uint8_t**  vbiData, /* [out] The parsed VBI data.  For example, if the
1175                                     SMPTE 291M packet contains closed caption
1176                                                                 data, then this argument should be returned
1177                                                                 with the two bytes of closed caption data. 
1178                                                                 This data can overwrite the data provided
1179                                                                 as the argument "packet" if desired.        */
1180    BVBI_SMPTE291M_Description*
1181                pktDesc         /* [out] Describes the above argument vbiData.       */
1182);
1183
1184/*****************************************************************************
1185  Summary:
1186    Structure for VBI standby settings
1187   
1188  See Also:
1189    BVBI_Standby, BVBI_Resume
1190 *****************************************************************************/
1191typedef struct BVBI_StandbySettings
1192{
1193        bool dummy; /* placeholder */
1194} BVBI_StandbySettings;
1195
1196/*****************************************************************************
1197        Module specific standard BERR codes
1198 *****************************************************************************/
1199/* This error indicates that field data has a problem */
1200#define BVBI_ERR_FIELD_BADDATA                  BERR_MAKE_CODE(BERR_VBI_ID, 0x0000)
1201/* This error field data does not exist */
1202#define BVBI_ERR_FIELD_NODATA                   BERR_MAKE_CODE(BERR_VBI_ID, 0x0001)
1203/* This error indicates that the the user attempted to use multiple handles to
1204   control a single encoder or decoder core */
1205#define BVBI_ERR_HW_CONFLICT                    BERR_MAKE_CODE(BERR_VBI_ID, 0x0002)
1206/* This error indicates that the user attempted to set/get data from a field
1207   handle that does not have the right allocation */
1208#define BVBI_ERR_FLDH_CONFLICT                  BERR_MAKE_CODE(BERR_VBI_ID, 0x0003)
1209/* This error indicates that the video format in use is not supported */
1210#define BVBI_ERR_VFMT_CONFLICT                  BERR_MAKE_CODE(BERR_VBI_ID, 0x0004)
1211/* This error indicates that the user attempted to encode VBI data with the
1212   wrong field polarity */
1213#define BVBI_ERR_INVALID_FIELD_POLARITY BERR_MAKE_CODE(BERR_VBI_ID, 0x0005)
1214/* This error indicates unrecognizable ITU-R 656 ancillary packet data */
1215#define BVBI_ERR_656_PARSE                              BERR_MAKE_CODE(BERR_VBI_ID, 0x0006)
1216/* This error indicates that the user attempted to use a single VBI encoder
1217   or decoder core to do two different jobs. Example: closed caption and
1218   multi-line, closed caption data. */
1219#define BVBI_ERR_CORE_CONFLICT          BERR_MAKE_CODE(BERR_VBI_ID, 0x0007)
1220/* This error indicates that the user attempted to use a feature that is
1221 * not supported by the chip hardware. */
1222#define BVBI_ERR_HW_UNSUPPORTED                 BERR_MAKE_CODE(BERR_VBI_ID, 0x0008)
1223
1224/*****************************************************************************
1225    Error constants for BVBI_Field_GetErrorInfo_isr
1226
1227        Note that these are NOT standard BERR codes.
1228 *****************************************************************************/
1229#define BVBI_LINE_ERROR_CC_NODATA                      0x00000001
1230#define BVBI_LINE_ERROR_CC_OVERRUN                     0x00000002
1231#define BVBI_LINE_ERROR_CC_PARITY                      0x00000004
1232#define BVBI_LINE_ERROR_CGMS_NODATA                    0x00000008
1233#define BVBI_LINE_ERROR_CGMS_OVERRUN                   0x00000010
1234#define BVBI_LINE_ERROR_CGMS_CRC                       0x00000020
1235#define BVBI_LINE_ERROR_WSS_NODATA                     0x00000040
1236#define BVBI_LINE_ERROR_WSS_OVERRUN                    0x00000080
1237#define BVBI_LINE_ERROR_WSS_PARITY                     0x00000100
1238#define BVBI_LINE_ERROR_TELETEXT_NODATA                0x00000200
1239#define BVBI_LINE_ERROR_TELETEXT_OVERRUN               0x00000400
1240#define BVBI_LINE_ERROR_TELETEXT_INCOMPLETE            0x00000800
1241#define BVBI_LINE_ERROR_TELETEXT_INVALIDLINES          0x00001000
1242#define BVBI_LINE_ERROR_VPS_NODATA                     0x00002000
1243#define BVBI_LINE_ERROR_VPS_OVERRUN                    0x00004000
1244#define BVBI_LINE_ERROR_VPS_BIPHASE                    0x00008000
1245#define BVBI_LINE_ERROR_FLDH_CONFLICT                              0x00010000
1246#define BVBI_LINE_ERROR_PARITY_CONFLICT                            0x00020000
1247#define BVBI_LINE_ERROR_GEMSTAR_NODATA                 0x00040000
1248#define BVBI_LINE_ERROR_GEMSTAR_PARITY                 0x00080000
1249#define BVBI_LINE_ERROR_GEMSTAR_OVERRUN                0x00100000
1250#define BVBI_LINE_ERROR_AMOL_NODATA                    0x00200000
1251#define BVBI_LINE_ERROR_AMOL_OVERRUN                   0x00400000
1252#define BVBI_LINE_ERROR_MCC_NODATA                     0x00800000
1253#define BVBI_LINE_ERROR_MCC_OVERRUN                    0x01000000
1254#define BVBI_LINE_ERROR_SCTE_NODATA                    0x02000000
1255#define BVBI_LINE_ERROR_SCTE_OVERRUN                   0x04000000
1256
1257/* These combinations express conditions of a field handle
1258   which prevent encoding of the VBI data contained within. */
1259#define BVBI_LINE_ERROR_CC_NOENCODE                     (       \
1260        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1261        BVBI_LINE_ERROR_CC_NODATA                               |       \
1262        BVBI_LINE_ERROR_CC_PARITY                               )
1263#define BVBI_LINE_ERROR_CGMS_NOENCODE           (       \
1264        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1265        BVBI_LINE_ERROR_CGMS_NODATA                     |       \
1266        BVBI_LINE_ERROR_CGMS_CRC                                )
1267#define BVBI_LINE_ERROR_WSS_NOENCODE            (       \
1268        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1269        BVBI_LINE_ERROR_WSS_NODATA                              |       \
1270        BVBI_LINE_ERROR_WSS_PARITY                              )
1271#define BVBI_LINE_ERROR_TELETEXT_NOENCODE       (       \
1272        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1273        BVBI_LINE_ERROR_TELETEXT_NODATA                 |       \
1274        BVBI_LINE_ERROR_TELETEXT_INCOMPLETE             |       \
1275        BVBI_LINE_ERROR_TELETEXT_INVALIDLINES   )
1276#define BVBI_LINE_ERROR_VPS_NOENCODE            (       \
1277        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1278        BVBI_LINE_ERROR_VPS_BIPHASE                     |       \
1279        BVBI_LINE_ERROR_VPS_NODATA                              )
1280#define BVBI_LINE_ERROR_GEMSTAR_NOENCODE        (       \
1281        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1282        BVBI_LINE_ERROR_GEMSTAR_NODATA              |   \
1283        BVBI_LINE_ERROR_GEMSTAR_PARITY                  )
1284#define BVBI_LINE_ERROR_AMOL_NOENCODE       (   \
1285        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1286        BVBI_LINE_ERROR_AMOL_NODATA                         )
1287#define BVBI_LINE_ERROR_MCC_NOENCODE        (   \
1288        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1289        BVBI_LINE_ERROR_MCC_NODATA                          )
1290#define BVBI_LINE_ERROR_SCTE_NOENCODE       (   \
1291        BVBI_LINE_ERROR_FLDH_CONFLICT                   |       \
1292        BVBI_LINE_ERROR_SCTE_NODATA                         )
1293
1294/*****************************************************************************
1295 * Public API
1296 *****************************************************************************/
1297
1298
1299/*****************************************************************************
1300  Summary:
1301    Initialize a settings structure to defaults
1302
1303  Description:
1304    This function initializes the BVBI_Settings structure with the
1305    module's default values.  It returns an error code indicating
1306    success or failure.  These settings may be used with BVBI_Open.
1307
1308  Returns:
1309        BERR_SUCCESS           - Success.
1310        BERR_INVALID_PARAMETER - Function argument was NULL.
1311
1312  See Also:
1313    BVBI_Open
1314 *****************************************************************************/
1315BERR_Code BVBI_GetDefaultSettings( 
1316        BVBI_Settings *pSettings        /* [out] Pointer to an allocated
1317                                                                                 BVBI_Settings object    */
1318);
1319
1320
1321/*****************************************************************************
1322  Summary:
1323    Initialize the VBI module
1324
1325  Description:
1326    This function Takes a BREG_Handle and VBI settings and opens a new
1327    BVBI_Handle with those settings.  The BVBI_Settings should be
1328    initialized using BVBI_GetDefaultSettings and optionally modified.  If
1329    NULL is passed for pSettings, the defaults are assumed.
1330
1331  Returns:
1332        BERR_SUCCESS              - The handle was successfully created.
1333        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1334                                                            possibly NULL.
1335        BERR_OUT_OF_SYSTEM_MEMORY - Memory allocation failed.
1336
1337  See Also:
1338    BVBI_Close, BVBI_GetDefaultSettings
1339 *****************************************************************************/
1340BERR_Code BVBI_Open( 
1341        BVBI_Handle  *pVbiHandle,       /* [out] A pointer to an allocated
1342                                                                                 BVBI_Handle                     */
1343        BCHP_Handle   chipHandle,       /*  [in] A handle to the chip            */
1344        BREG_Handle    regHandle,       /*  [in] A handle to the chip's register
1345                                                                                 settings                        */
1346        BMEM_Handle    memHandle,       /*  [in] The local memory heap handle    */
1347        const BVBI_Settings* 
1348                           pSettings    /*  [in] A pointer to a BVBI_Settings
1349                                                                                 structure, or NULL              */
1350); 
1351
1352
1353/*****************************************************************************
1354  Summary:
1355    Close a BVBI_Handle.
1356
1357  Description:
1358    This function frees the BVBI_Handle structure and all associated data.
1359        It also shuts down the VBI operations of the specified handle.  If no
1360        other handles are active, or none are active for a given output, no VBI
1361        data will be sent on that output.  Closing a BVBI_Handle assumes that
1362        any associated BVBI_Encode_Handle or BVBI_Decode_Handle objects are
1363        closed as well.  If not, a BDBG_ASSERT error occurs.
1364
1365 *****************************************************************************/
1366void BVBI_Close( 
1367        BVBI_Handle vbiHandle   /* [in] A valid BVBI_Handle object */
1368);
1369
1370/*****************************************************************************
1371  Summary:
1372    Get default standby settings
1373
1374  See Also:
1375    BVBI_Standby
1376*****************************************************************************/
1377void BVBI_GetDefaultStandbySettings(
1378    BVBI_StandbySettings *pSettings
1379    );
1380
1381/*****************************************************************************
1382  Summary:
1383    Enter standby mode
1384
1385  Description:
1386    This function enters standby mode with the VBI module, if supported.
1387    The VBI module must not be in use in order to successfully enter
1388    standby mode.
1389    If standby mode is not supported, calling this function has no effect.
1390
1391    When in standby mode, the device clocks are turned off,
1392    resulting in a minimal power state.
1393
1394    No BVBI_* calls should be made until standby mode is exitted by calling
1395    BVBI_Resume().
1396
1397  Returns:
1398    BERR_SUCCESS - If standby is successful, otherwise error
1399
1400  See Also:
1401    BVBI_Resume
1402*****************************************************************************/
1403BERR_Code BVBI_Standby
1404    ( BVBI_Handle hVbi,
1405      BVBI_StandbySettings *pSettings);
1406
1407/*****************************************************************************
1408  Summary:
1409    Exit standby mode
1410
1411  Description:
1412    This function exits from standby mode with the VBI module, if supported.
1413    After exitting standby mode, upper-level SW is free to call
1414    BVBI_* functions.
1415
1416  Returns:
1417    BERR_SUCCESS - If standby is successful, otherwise error
1418
1419  See Also:
1420    BVBI_Standby
1421*****************************************************************************/
1422BERR_Code BVBI_Resume
1423    ( BVBI_Handle hVbi);
1424
1425
1426/*****************************************************************************
1427  Summary:
1428    Create a BVBI_Decode_Handle.
1429
1430  Description:
1431    This function creates a BVBI_Decode_Handle for the specified
1432    source.  That handle will be used to decode specific VBI
1433    formats for that source.  The BVBI_Handle must have been
1434    activated with a BVBI_Open call.  It is a good idea to call
1435    BVBI_Decode_SetVideoFormat, although the default format
1436    BFMT_VideoFmt_eNTSC will be imposed when BVBI_Decode_Create
1437    is called.
1438
1439  Returns:
1440        BERR_SUCCESS              - The handle was successfully created.
1441        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1442                                                            possibly NULL.
1443        BERR_OUT_OF_SYSTEM_MEMORY - Memory allocation failed.
1444        BVBI_ERR_HW_CONFLICT      - A BVBI_Decode_Handle already exists, and
1445                                                                controls the same eSource that is passed in.
1446                                                                It is not possible for two BVBI_Decode_Handles
1447                                                                to control the same video source.
1448 *****************************************************************************/
1449BERR_Code BVBI_Decode_Create( 
1450        BVBI_Handle             vbiHandle,      /*  [in] A valid BVBI_Handle object */
1451        BAVC_SourceId             eSource,      /*  [in] A BAVC_SourceId object
1452                                                                                                 specifying the source of
1453                                                                                                 data                       */
1454        BVBI_Decode_Handle *pDecodeHandle       /* [out] A pointer to a
1455                                                                                                 BVBI_Decode_Handle to be
1456                                                                                                 initialized                */
1457);
1458
1459
1460/*****************************************************************************
1461  Summary:
1462    Create a BVBI_Encode_Handle.
1463
1464  Description:
1465    This function creates a BVBI_Encode_Handle for the specified
1466    destination.  That handle will be used to encode specific
1467    VBI formats for that destination.  The BVBI_Handle must have
1468    been activated with a BVBI_Open call.  It is a good idea to
1469    call BVBI_Encode_SetVideoFormat, although the default format
1470    BFMT_VideoFmt_eNTSC will be imposed when BVBI_Decode_Create
1471
1472  Returns:
1473        BERR_SUCCESS              - The handle was successfully created.
1474        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1475                                                            possibly NULL.
1476        BERR_OUT_OF_SYSTEM_MEMORY - Memory allocation failed.
1477        BVBI_ERR_HW_CONFLICT      - A BVBI_Encode_Handle already exists, and
1478                                                                controls the same eDestination that is passed
1479                                                                in.  It is not possible for two
1480                                                                BVBI_Encode_Handles to control the same video
1481                                                                destination.
1482 *****************************************************************************/
1483BERR_Code BVBI_Encode_Create( 
1484        BVBI_Handle             vbiHandle,      /*  [in] A valid BVBI_Handle object  */
1485        BAVC_VbiPath         eDestination,      /*  [in] An enum specifying the
1486                                                                                             destination (VEC) of the
1487                                                                                                 VBI data                    */
1488        BVBI_Encode_Handle *pEncodeHandle       /* [out] A pointer to a
1489                                                                                                 BVBI_Encode_Handle to be
1490                                                                                                 initialized                 */
1491);
1492
1493
1494/*****************************************************************************
1495  Summary:
1496    Apply new attributes to the BVBI_Decode_Handle.
1497
1498  Description:
1499    This function applies any pending Set operations to the
1500    BVBI_Decode_Handle, such as BVBI_Decode_SetVideoFormat.  On failure
1501    it will attempt to fully restore the settings that existed
1502    prior to the BVBI_Decode_ApplyChanges call, if any.
1503
1504  Returns:
1505        BERR_SUCCESS              - The hardware was successfully programmed.
1506        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1507                                                                possibly NULL.
1508 *****************************************************************************/
1509BERR_Code BVBI_Decode_ApplyChanges( 
1510        BVBI_Decode_Handle decodeHandle /* [in] A valid BVBI_Handle object */
1511);
1512
1513
1514/*****************************************************************************
1515  Summary:
1516    Set the video display format used for decoding VBI.
1517
1518  Description:
1519    This function sets the video display format to use with the supplied
1520    BVBI_Decode_Handle.  The change to video format will be programmed into
1521        hardware when BVBI_Decode_ApplyChanges is next called.
1522
1523  Returns:
1524        BERR_SUCCESS              - The function call succeeded.
1525        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1526                                                            possibly NULL.
1527 *****************************************************************************/
1528BERR_Code BVBI_Decode_SetVideoFormat( 
1529        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
1530                                                                                                object                     */
1531        BFMT_VideoFmt      eVideoFormat         /* [in] The desired display format */
1532);
1533
1534
1535/*****************************************************************************
1536  Summary:
1537    Get the video display format used for decoding VBI.
1538
1539  Description:
1540    This function returns the video display format in use with the supplied
1541    BVBI_Decode_Handle.
1542
1543  Returns:
1544        BERR_SUCCESS              - The information was successfully retrieved.
1545        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1546                                                            possibly NULL.
1547 *****************************************************************************/
1548BERR_Code BVBI_Decode_GetVideoFormat( 
1549        BVBI_Decode_Handle decodeHandle,        /*  [in] A valid BVBI_Decode_Handle
1550                                                                                                 object                     */
1551        BFMT_VideoFmt    *peVideoFormat         /* [out] The display format in use
1552                                                                                                 with the above object      */
1553);
1554
1555
1556/*****************************************************************************
1557  Summary:
1558    Set ITU-R 656 encapsulation method for VBI decoding
1559
1560  Description:
1561    If a VBI decoder is created to support input via the ITU-R 656
1562    port, then this call will cause the decoder to expect the
1563        encapsulated VBI data to occur in a specific format.  Only
1564        one specific format can be used at a time.  The requested
1565        change is implemented the next time BVBI_Decode_ApplyChanges
1566        is called on the associated BVBI_Decode_Handle.
1567
1568  Returns:
1569        BERR_SUCCESS              - The function call succeeded.
1570        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1571                                                            possibly NULL.
1572 *****************************************************************************/
1573BERR_Code BVBI_Decode_656_SetFormat (
1574        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
1575                                                                                                object                       */
1576        BVBI_656Fmt       anci656Fmt            /* [in] The encapsulation format to
1577                                                                                                be expected.                 */
1578);
1579
1580
1581/*****************************************************************************
1582  Summary:
1583    Callback that provides the default parsing mechanism for incoming SMPTE
1584        291M packets.
1585
1586  Description:
1587    SMPTE 291M is a standard for encapsulating user data in ancillary
1588    data packets for inclusion in an ITU-R 656 bitstream.  SMPTE 291M
1589        is an "open" standard that allows the user data to be expressed in
1590        a variety of ways.  The user must provide a callback function to
1591        parse incoming data according to the user's method.  This callback
1592        function is the default function used by the porting interface. 
1593        It expects the incoming SMPTE 291M packets to be in the proprietary
1594        Broadcom format.
1595
1596        Because the SMPTE 291M standard is so flexible, it is
1597        necessary that this callback function make a specific
1598        assumption about the incoming ancillary data packets.
1599        It assumes that the DATA ID field of the packet identifies
1600        the packet content as follows:
1601                - 0x30 indicates closed caption data is in the packet.
1602                - 0x31 indicates teletext or NABTS data is in the packet.
1603                - 0x32 indicates WSS data is in the packet.
1604                - 0x33 indicates VPS data is in the packet.
1605
1606        In addition, this function does not choose a video line number for
1607        the VBI data, which causes the BVBI module to choose a default.
1608
1609        The above assumptions are completely arbitrary.  In most applications, the
1610        user will write his own callback function to replace this one, and install
1611        it by calling BVBI_Decode_656_SetSMPTE291Moptions().
1612
1613  Returns:
1614    BERR_SUCCESS
1615        TODO
1616
1617 *****************************************************************************/
1618BERR_Code BVBI_Decode_656_SMPTE291MbrcmCb_isr (
1619        void*         arg0, /*  [in] Not used.                                   */
1620        BFMT_VideoFmt
1621              eVideoFormat, /*  [in] Video format of input 656 port              */
1622        BAVC_Polarity
1623                  polarity, /*  [in] The field polarity according to BVBI
1624                                             interrupts.                                 */
1625        uint8_t    data_id, /*  [in] The first identification field in the
1626                                     SMPTE 291M packet header.                   */
1627        uint8_t  second_id, /*  [in] The second identification field in the
1628                                     SMPTE 291M packet header.                   */
1629        uint8_t data_count, /*  [in] The DATA COUNT field in the SMPTE 291M
1630                                     packet header.                              */
1631        uint8_t*    packet, /*  [in] The SMPTE 291M ancillary data packet,
1632                                     starting with the first byte of the
1633                                                                 payload.  Note that the three header bytes
1634                                                                 have already been parsed by the BVBI
1635                                                                 software when this callback function is
1636                                                                 called.  The final checksum byte has also
1637                                                                 been read and verified by the BVBI
1638                                                                 software and is not available to this
1639                                                                 callback function.                          */
1640    uint8_t**  vbiData, /* [out] The parsed VBI data.  For example, if the
1641                                     SMPTE 291M packet contains closed caption
1642                                                                 data, then this argument will be the
1643                                                                 two bytes of closed caption data.  This
1644                                                                 function will overwrite the data pointed
1645                                                                 to by the above argument "packet."          */
1646        BVBI_SMPTE291M_Description*
1647            pktDesc         /* [out] Describes the above argument vbiData.       */
1648);
1649
1650
1651/*****************************************************************************
1652  Summary:
1653    Set options for decoding of SMPTE 291M ancillary data packets.
1654
1655  Description:
1656    If a VBI decoder is created to support input via the ITU-R 656
1657        port, and if BVBI_Decode_656_SetFormat() has been called to
1658        set the expected format of encapsulated data to SMPTE 291M,
1659        then this function will allow the user to specify how exactly
1660        to decode the SMPTE 291M data packets.  SMPTE 291M is an
1661        "open" standard that does not specify exactly what to do
1662        with the "payload" of the  packet.  This function allows
1663        the user to do so.
1664
1665  Returns:
1666        BERR_SUCCESS              - The function call succeeded.
1667        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1668                                                            possibly NULL.
1669 *****************************************************************************/
1670BERR_Code BVBI_Decode_656_SetSMPTE291Moptions (
1671        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
1672                                                                                                object.                      */
1673        BVBI_Decode_656_SMPTE291M_Cb
1674                       fParserCb_isr,           /* [in] The parsing function for the
1675                                                        SMPTE 291M packet.  Note
1676                                                                                                that the default callback is
1677                                                                        BVBI_Decode_656_SMPTE291MbrcmCb_isr().   */
1678        void*               arg0,           /* [in] First argument passed to
1679                                                    the above callback function.
1680                                                                                                Note that the defaut is 0x0. */
1681        bool         bLongHeader,           /* [in] If true, then incomping
1682                                                    SMPTE 291M packets are
1683                                                                                                expected to have the three
1684                                                                                                byte "component stream"
1685                                                                                                header 00 FF FF.  Otherwise,
1686                                                                                                packets are expected to have
1687                                                                                                the one byte "composite
1688                                                                                                stream" header FF.  Note
1689                                                                                                that the default for the
1690                                                                                                decode handle is "false."    */
1691        bool    bBrokenDataCount            /* [in] If true, then the incoming
1692                                                    SMPTE 291M packets are
1693                                                                                                expected to be in the
1694                                                                                                historical, incorrect format
1695                                                                                                produced by Broadcom ITU-R
1696                                                                                                656 encoders.  In particular,
1697                                                                                                the packet DATA COUNT field
1698                                                                                                counts bytes instead of
1699                                                                                                DWORDs, and the accompanying
1700                                                                                                parity bits are not present.
1701                                                                                                Note that the default for
1702                                                                                                the decode handle is "true." */
1703);
1704
1705
1706/*****************************************************************************
1707  Summary:
1708    Set ITU-R 656 encapsulation method for VBI decoding
1709
1710  Description:
1711    This function returns the format in use for extracting VBI data from
1712        ancillary data packets in the ITU-R 656 bitstream input by the supplied
1713    BVBI_Decode_Handle.
1714
1715  Returns:
1716        BERR_SUCCESS              - The information was successfully retrieved.
1717        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1718                                                            possibly NULL.
1719 *****************************************************************************/
1720BERR_Code BVBI_Decode_656_GetFormat( 
1721        BVBI_Decode_Handle decodeHandle,        /*  [in] A valid BVBI_Decode_Handle
1722                                                                                                 object                     */
1723        BVBI_656Fmt*        pAnci656Fmt         /* [out] The format in use
1724                                                                                                 with the above object      */
1725);
1726
1727
1728/*****************************************************************************
1729  Summary:
1730    Apply new attributes to the BVBI_Encode_Handle.
1731
1732  Description:
1733    This function applies any pending Set operations to the
1734    BVBI_Encode_Handle, such as BVBI_Encode_SetVideoFormat.     On failure
1735    it will attempt to fully restore the settings that existed
1736    prior to the BVBI_Encode_ApplyChanges call, if any.
1737
1738  Returns:
1739        BERR_SUCCESS              - The chip hardware was successfully programmed.
1740        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1741                                                            possibly NULL.
1742 *****************************************************************************/
1743BERR_Code BVBI_Encode_ApplyChanges( 
1744        BVBI_Encode_Handle encodeHandle /* [in] A valid BVBI_Handle object */
1745);
1746
1747
1748/*****************************************************************************
1749  Summary:
1750    Set the video display format used for encoding VBI.
1751
1752  Description:
1753    This function sets the video display format to use with the supplied
1754    BVBI_Encode_Handle.
1755
1756  Returns:
1757        BERR_SUCCESS              - The function call succeeded.
1758        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1759                                                            possibly NULL.
1760 *****************************************************************************/
1761BERR_Code BVBI_Encode_SetVideoFormat( 
1762        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
1763                                                                                                 object                      */
1764        BFMT_VideoFmt      eVideoFormat         /*  [in] The desired display format  */
1765);
1766
1767
1768/*****************************************************************************
1769  Summary:
1770    Set the video display pixel repetition used for encoding VBI.
1771
1772  Description:
1773    This function sets the video display pixel repetition to use with the
1774        supplied BVBI_Encode_Handle.
1775
1776        This function is only needed in a fairly limited environment. If ALL
1777        of the following conditions hold, then the user must call this function
1778        to indicate how HDMI output is configured:
1779         - The chipset does NOT have orthogonal VEC architecture.
1780         - The VEC path relevant to the supplied BVBI_Encode_Handle also provides
1781           HDMI output.
1782         - The VEC path relevant to the supplied BVBI_Encode_Handle will be used
1783           for 480P analog output (in addition to HDMI output).
1784         - The VEC path relevant to the supplied BVBI_Encode_Handle will be used
1785           to output CGMS-A or CGMS-B waveforms in the VBI.
1786
1787    This function has no effect on chipsets that have orthogonal VEC
1788        architecture.
1789
1790  Returns:
1791        BERR_SUCCESS              - The function call succeeded.
1792        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1793                                                            possibly NULL.
1794 *****************************************************************************/
1795BERR_Code BVBI_Encode_SetHdmiPixelRepetition( 
1796        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
1797                                                                                                 object                      */
1798        BAVC_HDMI_PixelRepetition ePixRep   /*  [in] The desired HDMI pixel
1799                                                     repetition value            */
1800);
1801
1802
1803/*****************************************************************************
1804  Summary:
1805    Set the video color space used for encoding VBI.
1806
1807  Description:
1808    This function sets the color space format to use with the
1809    supplied BVBI_Encode_Handle. Currently, this only setting is
1810    only required by the SCTE encoder core. All other forms of VBI
1811    data encoding function independendly of color space.
1812
1813  Returns:
1814        BERR_SUCCESS              - The function call succeeded.
1815        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1816                                                            possibly NULL.
1817 *****************************************************************************/
1818BERR_Code BVBI_Encode_SetCSC( 
1819        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
1820                                                                                                 object                      */
1821        BVBI_CSC                   eCsc,    /*  [in] The desired color space.    */
1822        BVBI_CSC                 eCoCsc     /*  [in] The desired color space for
1823                                                     the "component only" DACS,
1824                                                                                                 if the VEC path supports
1825                                                                                                 this. Use BVBI_CSC_NONE
1826                                                                                                 otherwise.                  */
1827);
1828
1829
1830/*****************************************************************************
1831  Summary:
1832    Get the video display format used for encoding VBI.
1833
1834  Description:
1835    This function returns the video display format in use with the supplied
1836    BVBI_Encode_Handle.
1837
1838  Returns:
1839        BERR_SUCCESS              - The information was successfully retrieved.
1840        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1841                                                            possibly NULL.
1842 *****************************************************************************/
1843BERR_Code BVBI_Encode_GetVideoFormat( 
1844        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
1845                                                                                                 object                     */
1846        BFMT_VideoFmt    *peVideoFormat         /* [out] The display format in use
1847                                                                                                 with the above object      */
1848);
1849
1850
1851/*****************************************************************************
1852  Summary:
1853    Get the video display HDMI pixel repetition value used for encoding VBI.
1854
1855  Description:
1856    This function returns the video display HDMI pixel repetition value in
1857        use with the supplied BVBI_Encode_Handle.
1858
1859        If the chipset has orthogonal VEC architecture, then this function will
1860        always return BAVC_HDMI_PixelRepetition_eNone. This is because for such
1861        chipsets, function # (see which) is a no-op.
1862
1863  Returns:
1864        BERR_SUCCESS              - The information was successfully retrieved.
1865        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1866                                                            possibly NULL.
1867 *****************************************************************************/
1868BERR_Code BVBI_Encode_GetHdmiPixelRepetition( 
1869        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
1870                                                                                                 object                     */
1871        BAVC_HDMI_PixelRepetition* pePixRep     /* [out] The display HDMI pixel
1872                                                     repetition value in use
1873                                                                                                 with the above object      */
1874);
1875
1876
1877/*****************************************************************************
1878  Summary:
1879    Get the color space used for encoding VBI.
1880
1881  Description:
1882    This function returns the color space in use with the supplied
1883    BVBI_Encode_Handle. Note that at this time, the only VBI encoding
1884    function affected by this setting is SCTE data encoding.
1885
1886  Returns:
1887        BERR_SUCCESS              - The information was successfully retrieved.
1888        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1889                                                            possibly NULL.
1890 *****************************************************************************/
1891BERR_Code BVBI_Encode_GetCSC( 
1892        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
1893                                                                                                 object.                     */
1894        BVBI_CSC                 *peCsc,        /* [out] The color space in use
1895                                                                                                 with the above object.      */
1896        BVBI_CSC               *peCoCsc         /* [out] The color space in use, for
1897                                                     the "component only" DACs,
1898                                                                                                 if they exist for the VEC
1899                                                                                                 path. BVBI_CSC_NONE
1900                                                                                                 otherwise.                  */
1901);
1902
1903
1904
1905/*****************************************************************************
1906  Summary:
1907    Destroy a BVBI_Decode_Handle.
1908
1909  Description:
1910    This function destroys a valid BVBI_Decode_Handle created by
1911        BVBI_Decode_Create.
1912
1913  Returns:
1914        BERR_SUCCESS              - The handle was successfully destroyed.
1915        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
1916                                                            possibly NULL.
1917 *****************************************************************************/
1918BERR_Code BVBI_Decode_Destroy( 
1919        BVBI_Decode_Handle decodeHandle /* [in] A BVBI_Decode_Handle to be
1920                                                                                        destroyed                        */
1921);
1922
1923
1924/*****************************************************************************
1925  Summary:
1926    Destroy a BVBI_Encode_Handle.
1927
1928  Description:
1929    This function destroys a valid BVBI_Encode_Handle created by
1930        BVBI_Encode_Create.
1931
1932  Returns:
1933        BERR_SUCCESS              - The handle was successfully destroyed.
1934        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
1935                                                            possibly NULL.
1936 *****************************************************************************/
1937BERR_Code BVBI_Encode_Destroy( 
1938        BVBI_Encode_Handle encodeHandle /* [in] A BVBI_Encode_Handle to be
1939                                                                                        destroyed                        */
1940);
1941
1942
1943/*****************************************************************************
1944  Summary:
1945    Set CC input on the given handle
1946
1947  Description:
1948    This call enables or disables CC decode on the supplied active
1949    BVBI_Decode_Handle.  CC decode is enabled or disabled for the
1950    given BVBI_Decode_Handle the next time BVBI_Decode_ApplyChanges
1951    is called on the associated BVBI_Decode_Handle. If bEnabled is true
1952    (nonzero), CC decode is enabled.  If bEnabled is false, CC
1953    decode is disabled.
1954
1955  Returns:
1956        BERR_SUCCESS              - The function call succeeded.
1957        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1958                                                            possibly NULL.
1959 *****************************************************************************/
1960BERR_Code BVBI_Decode_SetCC(
1961        BVBI_Decode_Handle decodeHandle, /* [in] A valid BVBI_Decode_Handle
1962                                                                                         object                       */
1963        bool                   bEnabled  /* [in] Whether to enable or disable
1964                                                                                         decode                       */
1965);
1966
1967
1968/*****************************************************************************
1969  Summary:
1970    Set CGMS input on the given handle
1971
1972  Description:
1973    This call enables or disables CGMS decode on the supplied active
1974    BVBI_Decode_Handle.  CGMS decode is enabled or disabled for the
1975    given BVBI_Decode_Handle the next time BVBI_Decode_ApplyChanges
1976    is called on the associated BVBI_Decode_Handle. If bEnabled is true
1977    (nonzero), CGMS decode is enabled.  If bEnabled is false,
1978    CGMS decode is disabled.
1979
1980  Returns:
1981        BERR_SUCCESS              - The function call succeeded.
1982        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
1983                                                            possibly NULL.
1984 *****************************************************************************/
1985BERR_Code BVBI_Decode_SetCGMS(
1986        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
1987                                                                                                object                       */
1988        bool                   bEnabled         /* [in] Whether to enable or disable
1989                                                                                                decode                       */
1990);
1991
1992
1993/*****************************************************************************
1994  Summary:
1995    Set WSS input on the given handle
1996
1997  Description:
1998    This call enables or disables WSS decode on the supplied active
1999    BVBI_Decode_Handle.  WSS decode is enabled or disabled for the
2000    given BVBI_Decode_Handle the next time BVBI_Decode_ApplyChanges
2001    is called on the associated BVBI_Decode_Handle. If bEnabled is true
2002    (nonzero), WSS decode is enabled.  If bEnabled is false, WSS
2003    decode is disabled.
2004
2005  Returns:
2006        BERR_SUCCESS              - The function call succeeded.
2007        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2008                                                            possibly NULL.
2009 *****************************************************************************/
2010BERR_Code BVBI_Decode_SetWSS(
2011        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
2012                                                                                                object                       */
2013        bool                   bEnabled         /* [in] Whether to enable or disable
2014                                                                                                decode                       */
2015);
2016
2017
2018/*****************************************************************************
2019  Summary:
2020    Set VPS input on the given handle
2021
2022  Description:
2023    This call enables or disables VPS decode on the supplied active
2024    BVBI_Decode_Handle.  VPS decode is enabled or disabled for the
2025    given BVBI_Decode_Handle the next time BVBI_Decode_ApplyChanges
2026    is called on the associated BVBI_Decode_Handle. If bEnabled is true
2027    (nonzero), VPS decode is enabled.  If bEnabled is false, VPS
2028    decode is disabled.
2029
2030  Returns:
2031        BERR_SUCCESS              - The function call succeeded.
2032        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2033                                                            possibly NULL.
2034 *****************************************************************************/
2035BERR_Code BVBI_Decode_SetVPS(
2036        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
2037                                                                                                object                       */
2038        bool                   bEnabled         /* [in] Whether to enable or disable
2039                                                                                                decode                       */
2040);
2041
2042
2043/*****************************************************************************
2044  Summary:
2045    Set Teletext input on the given handle
2046
2047  Description:
2048    This call enables or disables Teletext decode on the supplied
2049    active BVBI_Decode_Handle.  Teletext decode is enabled
2050    or disabled for the given BVBI_Decode_Handle the next time
2051    BVBI_Decode_ApplyChanges is called on the associated BVBI_Decode_Handle.
2052    If bEnabled is true (nonzero), Teletext decode is enabled.
2053    If bEnabled is false, Teletext decode is disabled.
2054
2055  Returns:
2056        BERR_SUCCESS              - The function call succeeded.
2057        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2058                                                            possibly NULL.
2059 *****************************************************************************/
2060BERR_Code BVBI_Decode_SetTeletext(
2061        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
2062                                                                                                object                       */
2063        bool                   bEnabled         /* [in] Whether to enable or disable
2064                                                                                                decode                       */
2065);
2066
2067
2068/*****************************************************************************
2069  Summary:
2070    Gets the status of CC input on the given handle
2071
2072  Description:
2073    This call determines whether CC is currently enabled or disabled
2074    on the current handle.  Any pending change of status will not be
2075    returned by this call until BVBI_Decode_ApplyChanges is called.
2076    pbEnabled will be set to 1 if input is enabled and 0 if it isn't.
2077
2078  Returns:
2079        BERR_SUCCESS              - The function call succeeded.
2080        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2081                                                            possibly NULL.
2082 *****************************************************************************/
2083BERR_Code BVBI_Decode_GetCC(
2084        BVBI_Decode_Handle decodeHandle,        /*  [in] A valid BVBI_Decode_Handle
2085                                                                                                 object                      */
2086        bool*                 pbEnabled         /* [out] Whether encode is enabled
2087                                                                                                 or disabled                 */
2088);
2089
2090
2091/*****************************************************************************
2092  Summary:
2093    Gets the status of CGMS input on the given handle
2094
2095  Description:
2096    This call determines whether CGMS is currently enabled or
2097    disabled on the current handle.  Any pending change of status
2098    will not be returned by this call until BVBI_Decode_ApplyChanges
2099    is called.  pbEnabled will be set to 1 if input is enabled and
2100    0 if it isn't.
2101
2102  Returns:
2103        BERR_SUCCESS              - The function call succeeded.
2104        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2105                                                            possibly NULL.
2106 *****************************************************************************/
2107BERR_Code BVBI_Decode_GetCGMS(
2108        BVBI_Decode_Handle decodeHandle,        /*  [in] A valid BVBI_Decode_Handle
2109                                                                                                 object                      */
2110        bool*                 pbEnabled         /* [out] Whether encode is enabled
2111                                                                                                 or disabled                 */
2112);
2113
2114
2115/*****************************************************************************
2116  Summary:
2117    Gets the status of WSS input on the given handle
2118
2119  Description:
2120    This call determines whether WSS is currently enabled or disabled
2121    on the current handle.  Any pending change of status will not be
2122    returned by this call until BVBI_Decode_ApplyChanges is called.
2123    pbEnabled will be set to 1 if input is enabled and 0 if it isn't.
2124
2125  Returns:
2126        BERR_SUCCESS              - The function call succeeded.
2127        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2128                                                            possibly NULL.
2129 *****************************************************************************/
2130BERR_Code BVBI_Decode_GetWSS(
2131        BVBI_Decode_Handle decodeHandle,        /*  [in] A valid BVBI_Decode_Handle
2132                                                                                                 object                      */
2133        bool*                 pbEnabled         /* [out] Whether encode is enabled
2134                                                                                                 or disabled                 */
2135);
2136
2137
2138/*****************************************************************************
2139  Summary:
2140    Gets the status of VPS input on the given handle
2141
2142  Description:
2143    This call determines whether VPS is currently enabled or disabled
2144    on the current handle.  Any pending change of status will not be
2145    returned by this call until BVBI_Decode_ApplyChanges is called.
2146    pbEnabled will be set to 1 if input is enabled and 0 if it isn't.
2147
2148  Returns:
2149        BERR_SUCCESS              - The function call succeeded.
2150        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2151                                                            possibly NULL.
2152 *****************************************************************************/
2153BERR_Code BVBI_Decode_GetVPS(
2154        BVBI_Decode_Handle decodeHandle,        /*  [in] A valid BVBI_Decode_Handle
2155                                                                                                 object                      */
2156        bool*                 pbEnabled         /* [out] Whether encode is enabled
2157                                                                                                 or disabled                 */
2158);
2159
2160
2161/*****************************************************************************
2162  Summary:
2163    Gets the status of Teletext input on the given handle
2164
2165  Description:
2166    This call determines whether Teletext is currently enabled or
2167    disabled on the current handle.  Any pending change of status
2168    will not be returned by this call until BVBI_Decode_ApplyChanges
2169    is called.  pbEnabled will be set to 1 if input is enabled and
2170    0 if it isn't.
2171
2172  Returns:
2173        BERR_SUCCESS              - The function call succeeded.
2174        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2175                                                            possibly NULL.
2176 *****************************************************************************/
2177BERR_Code BVBI_Decode_GetTeletext( 
2178        BVBI_Decode_Handle decodeHandle,        /*  [in] A valid BVBI_Decode_Handle
2179                                                                                                 object                      */
2180        bool*                 pbEnabled         /* [out] Whether encode is enabled
2181                                                                                                 or disabled                 */
2182);
2183
2184/*****************************************************************************
2185  Summary:
2186    Set Gemstar input on the given handle
2187
2188  Description:
2189    This call enables or disables Gemstar decode on the supplied
2190    active BVBI_Decode_Handle.  Gemstar decode is enabled
2191    or disabled for the given BVBI_Decode_Handle the next time
2192    BVBI_Decode_ApplyChanges is called on the associated BVBI_Decode_Handle.
2193    If bEnabled is true (nonzero), Gemstar decode is enabled.
2194    If bEnabled is false, Gemstar decode is disabled.
2195
2196  Returns:
2197    BERR_SUCCESS              - The function call succeeded.
2198    BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2199                                possibly NULL.
2200 *****************************************************************************/
2201BERR_Code BVBI_Decode_SetGemstar(
2202    BVBI_Decode_Handle decodeHandle,    /* [in] A valid BVBI_Decode_Handle
2203                                                object                       */
2204    bool                   bEnabled     /* [in] Whether to enable or disable
2205                                                decode                       */
2206);
2207
2208
2209/*****************************************************************************
2210  Summary:
2211    Get Gemstar input on the given handle
2212
2213  Description:
2214    This call determines whether Gemstar is currently enabled or disabled on
2215    the curent handle. Any pending change of status will not be returned by
2216    this call until BVBI_Decode_ApplyChanges is called. pbEnabled will be set
2217    to 1 if input is enabled and 0 if it isn't.
2218
2219  Returns:
2220    BERR_SUCCESS              - The function call succeeded.
2221    BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2222                                possibly NULL.
2223 *****************************************************************************/
2224BERR_Code BVBI_Decode_GetGemstar(
2225    BVBI_Decode_Handle decodeHandle,    /* [in] A valid BVBI_Decode_Handle
2226                                                object                       */
2227    bool*                 pbEnabled     /* [in] Whether decode is enabled
2228                                                or disabled.                 */
2229);
2230
2231
2232/*****************************************************************************
2233  Summary:
2234    Set CC output on the given handle
2235
2236  Description:
2237    This call enables or disables CC encode on the supplied active
2238    BVBI_Encode_Handle.  CC encode is enabled or disabled for the
2239    given BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges
2240    is called on the associated BVBI_Handle. If bEnabled is true
2241    (nonzero), CC encode is enabled.  If bEnabled is false, CC
2242    encode is disabled.
2243
2244  Returns:
2245        BERR_SUCCESS              - The function call succeeded.
2246        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2247                                                            possibly NULL.
2248 *****************************************************************************/
2249BERR_Code BVBI_Encode_SetCC(
2250        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2251                                                                                                object                       */
2252        bool                   bEnabled         /* [in] Whether to enable or disable
2253                                                                                                encode                       */
2254);
2255
2256
2257/*****************************************************************************
2258  Summary:
2259    Set CGMS-A output on the given handle
2260
2261  Description:
2262    This call enables or disables CGMS-A encode on the supplied active
2263    BVBI_Encode_Handle.  CGMS-A encode is enabled or disabled for the
2264    given BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges
2265    is called on the associated BVBI_Handle. If bEnabled is true
2266    (nonzero), CGMS-A encode is enabled.  If bEnabled is false,
2267    CGMS-A encode is disabled.
2268
2269  Returns:
2270        BERR_SUCCESS              - The function call succeeded.
2271        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2272                                                            possibly NULL.
2273    BVBI_ERR_HW_CONFLICT      - User attempted to activate CGMS-A and CGMS-B
2274                                    on the same VEC.
2275 *****************************************************************************/
2276BERR_Code BVBI_Encode_SetCGMSA(
2277        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2278                                                                                                object                       */
2279        bool                   bEnabled         /* [in] Whether to enable or disable
2280                                                                                                encode                       */
2281);
2282/* Backwards compatibility, DEPRECATED! */
2283#define BVBI_Encode_SetCGMS BVBI_Encode_SetCGMSA
2284
2285
2286/*****************************************************************************
2287  Summary:
2288    Set CGMS-B output on the given handle
2289
2290  Description:
2291    This call enables or disables CGMS-B encode on the supplied active
2292    BVBI_Encode_Handle.  CGMS-B encode is enabled or disabled for the
2293    given BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges
2294    is called on the associated BVBI_Handle. If bEnabled is true
2295    (nonzero), CGMS-B encode is enabled.  If bEnabled is false,
2296    CGMS-B encode is disabled.
2297
2298  Returns:
2299        BERR_SUCCESS              - The function call succeeded.
2300        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2301                                                            possibly NULL.
2302    BVBI_ERR_HW_CONFLICT      - User attempted to activate CGMS-A and CGMS-B
2303                                    on the same VEC.
2304 *****************************************************************************/
2305BERR_Code BVBI_Encode_SetCGMSB(
2306        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2307                                                                                                object                       */
2308        bool                   bEnabled         /* [in] Whether to enable or disable
2309                                                                                                encode                       */
2310);
2311
2312
2313/*****************************************************************************
2314  Summary:
2315    Set CGMS-B style on the given encoder handle
2316
2317  Description:
2318    This call changes the output style for CGMS-B data on the supplied active
2319    BVBI_Encode_Handle.  Change takes effect on the
2320    given BVBI_Encode_Handle the next time
2321        1. CGMS-B output is enabled.
2322        2. BVBI_Encode_ApplyChanges is called on the associated BVBI encode handle.
2323
2324        Note: older chipsets are not capable of CEA-805-D "new style"
2325        ----  output. For these chipsets, this API function is not provided.
2326
2327        Note: For newer chipsets that support "new style" output, this is the
2328        ----  default. Since "new style" output is recommended, this function
2329              will not be needed by most applications.
2330
2331  Returns:
2332        BERR_SUCCESS              - The function call succeeded.
2333        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2334                                                            possibly NULL.
2335 *****************************************************************************/
2336BERR_Code BVBI_Encode_SetCGMSBstyle(
2337        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2338                                                                                                object                       */
2339        bool              bCea805dStyle         /* [in] Whether to enable the newer
2340                                                    CRC computation ("method 2")
2341                                                                                                defined in CEA-805-D. If
2342                                                                                                true, the bit order is also
2343                                                                                                changed from "LSB first" to
2344                                                                                                "MSB first."                 */
2345);
2346
2347
2348/*****************************************************************************
2349  Summary:
2350    Get CGMS-B style on the given encoder handle
2351
2352  Description:
2353    This reports the output style for CGMS-B data on the supplied active
2354    BVBI_Encode_Handle. 
2355
2356        Note: older chipsets are not capable of CEA-805-D "new style"
2357        ----  output. For these chipsets, this API function is not provided.
2358
2359  Returns:
2360        BERR_SUCCESS              - The function call succeeded.
2361        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2362                                                            possibly NULL.
2363 *****************************************************************************/
2364BERR_Code BVBI_Encode_GetCGMSBstyle(
2365        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2366                                                                                                 object                      */
2367        bool*            pbCea805dStyle         /* [out] Whether the newer CRC
2368                                                     computation ("method 2")
2369                                                                                                 defined in CEA-805-D is in
2370                                                                                                 use.                        */
2371);
2372
2373
2374/*****************************************************************************
2375  Summary:
2376    Set WSS output on the given handle
2377
2378  Description:
2379    This call enables or disables WSS encode on the supplied active
2380    BVBI_Encode_Handle.  WSS encode is enabled or disabled for the
2381    given BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges
2382    is called on the associated BVBI_Encode_Handle. If bEnabled is true
2383    (nonzero), WSS encode is enabled.  If bEnabled is false, WSS
2384    encode is disabled.
2385
2386  Returns:
2387        BERR_SUCCESS              - The function call succeeded.
2388        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2389                                                            possibly NULL.
2390 *****************************************************************************/
2391BERR_Code BVBI_Encode_SetWSS(
2392        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2393                                                                                                object                       */
2394        bool                   bEnabled         /* [in] Whether to enable or disable
2395                                                                                                encode                       */
2396);
2397
2398
2399/*****************************************************************************
2400  Summary:
2401    Set Teletext output on the given handle
2402
2403  Description:
2404    This call enables or disables Teletext encode on the supplied
2405    active BVBI_Encode_Handle.  Teletext encode is enabled
2406    or disabled for the given BVBI_Encode_Handle the next time
2407    BVBI_Encode_ApplyChanges is called on the associated BVBI_Encode_Handle.
2408    If bEnabled is true (nonzero), Teletext encode is enabled.
2409    If bEnabled is false, Teletext encode is disabled.
2410
2411  Returns:
2412        BERR_SUCCESS              - The function call succeeded.
2413        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2414                                                            possibly NULL.
2415 *****************************************************************************/
2416BERR_Code BVBI_Encode_SetTeletext( 
2417        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2418                                                                                                object                       */
2419        bool                   bEnabled         /* [in] Whether to enable or disable
2420                                                                                                encode                       */
2421);
2422
2423
2424/*****************************************************************************
2425  Summary:
2426    Set VPS output on the given handle
2427
2428  Description:
2429    This call enables or disables VPS encode on the supplied active
2430    BVBI_Encode_Handle.  VPS encode is enabled or disabled for the
2431    given BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges
2432    is called on the associated BVBI_Encode_Handle. If bEnabled is true
2433    (nonzero), VPS encode is enabled.  If bEnabled is false, VPS
2434        encode is disabled.
2435
2436  Returns:
2437        BERR_SUCCESS              - The function call succeeded.
2438        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2439                                                            possibly NULL.
2440 *****************************************************************************/
2441BERR_Code BVBI_Encode_SetVPS ( 
2442        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2443                                                                                                object                       */
2444        bool                   bEnabled         /* [in] Whether to enable or disable
2445                                                                                                encode                       */
2446);
2447
2448
2449/*****************************************************************************
2450  Summary:
2451    Set Gemstar output on the given handle
2452
2453  Description:
2454    This call enables or disables Gemstar encode on the supplied active
2455    BVBI_Encode_Handle.  Gemstar encode is enabled or disabled for the
2456    given BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges
2457    is called on the associated BVBI_Encode_Handle. If bEnabled is true
2458    (nonzero), Gemstar encode is enabled.  If bEnabled is false, Gemstar
2459        encode is disabled.
2460
2461  Returns:
2462        BERR_SUCCESS              - The function call succeeded.
2463        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2464                                                            possibly NULL.
2465 *****************************************************************************/
2466BERR_Code BVBI_Encode_SetGemstar ( 
2467        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2468                                                                                                object                       */
2469        bool                   bEnabled         /* [in] Whether to enable or disable
2470                                                                                                encode                       */
2471);
2472
2473
2474/*****************************************************************************
2475  Summary:
2476    Set AMOL output on the given handle
2477
2478  Description:
2479    This call enables or disables AMOL encode on the supplied active
2480    BVBI_Encode_Handle.  AMOL encode is enabled or disabled for the
2481    given BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges
2482    is called on the associated BVBI_Encode_Handle.
2483
2484  Returns:
2485        BERR_SUCCESS              - The function call succeeded.
2486        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2487                                                            possibly NULL.
2488 *****************************************************************************/
2489BERR_Code BVBI_Encode_SetAMOL ( 
2490        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2491                                                                                                object                       */
2492        bool                   bEnabled         /* [in] Whether to enable or disable
2493                                                                                                encode                       */
2494);
2495
2496
2497/*****************************************************************************
2498  Summary:
2499    Set multi-line closed caption data output on the given handle
2500
2501  Description:
2502    This call enables or disables multi-line closed caption encode on
2503        the supplied active BVBI_Encode_Handle.  multi-line closed caption
2504        encode is enabled or disabled for the given BVBI_Encode_Handle the
2505        next time BVBI_Encode_ApplyChanges is called on the associated
2506        BVBI_Encode_Handle.
2507
2508  Returns:
2509        BERR_SUCCESS              - The function call succeeded.
2510        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2511                                                            possibly NULL.
2512 *****************************************************************************/
2513BERR_Code BVBI_Encode_SetMCC ( 
2514        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2515                                                                                                object                       */
2516        bool                   bEnabled         /* [in] Whether to enable or disable
2517                                                                                                encode                       */
2518);
2519
2520
2521/*****************************************************************************
2522  Summary:
2523    Set SCTE output on the given handle
2524
2525  Description:
2526    This call enables or disables SCTE encode on the supplied active
2527    BVBI_Encode_Handle.  SCTE encode is enabled or disabled for the
2528    given BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges
2529    is called on the associated BVBI_Encode_Handle.
2530
2531  Returns:
2532        BERR_SUCCESS              - The function call succeeded.
2533        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2534                                                            possibly NULL.
2535 *****************************************************************************/
2536BERR_Code BVBI_Encode_SetSCTE ( 
2537        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2538                                                                                                object                       */
2539        bool                   bEnabled         /* [in] Whether to enable or disable
2540                                                                                                encode                       */
2541);
2542
2543
2544/*****************************************************************************
2545  Summary:
2546    Gets the status of CC output on the given handle
2547
2548  Description:
2549    This call determines whether CC is currently enabled or disabled
2550    on the current handle.  Any pending change of status will
2551    not be returned by this call until BVBI_Encode_ApplyChanges
2552    is called.  pbEnabled will be set to 1 if output is enabled
2553    and 0 if it isn't.
2554
2555  Returns:
2556        BERR_SUCCESS              - The function call succeeded.
2557        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2558                                                            possibly NULL.
2559 *****************************************************************************/
2560BERR_Code BVBI_Encode_GetCC(
2561        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2562                                                                                                 object                     */
2563        bool*                 pbEnabled         /* [out] Whether encode is enabled
2564                                                                                                 or disabled                */
2565);
2566
2567
2568/*****************************************************************************
2569  Summary:
2570    Gets the status of CGMS-A output on the given handle
2571
2572  Description:
2573    This call determines whether CGMS-A is currently enabled or
2574    disabled on the current handle.  Any pending change of status
2575    will not be returned by this call until BVBI_Encode_ApplyChanges
2576    is called.  pbEnabled will be set to 1 if output is enabled
2577    and 0 if it isn't.
2578
2579  Returns:
2580        BERR_SUCCESS              - The function call succeeded.
2581        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2582                                                            possibly NULL.
2583 *****************************************************************************/
2584BERR_Code BVBI_Encode_GetCGMSA(
2585        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2586                                                                                                 object                     */
2587        bool*                 pbEnabled         /* [out] Whether encode is enabled
2588                                                                                                 or disabled                */
2589);
2590/* Backwards compatibility, DEPRECATED! */
2591#define BVBI_Encode_GetCGMS BVBI_Encode_GetCGMSA
2592
2593
2594/*****************************************************************************
2595  Summary:
2596    Gets the status of CGMS-B output on the given handle
2597
2598  Description:
2599    This call determines whether CGMS-B is currently enabled or
2600    disabled on the current handle.  Any pending change of status
2601    will not be returned by this call until BVBI_Encode_ApplyChanges
2602    is called.  pbEnabled will be set to 1 if output is enabled
2603    and 0 if it isn't.
2604
2605  Returns:
2606        BERR_SUCCESS              - The function call succeeded.
2607        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2608                                                            possibly NULL.
2609 *****************************************************************************/
2610BERR_Code BVBI_Encode_GetCGMSB(
2611        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2612                                                                                                 object                     */
2613        bool*                 pbEnabled         /* [out] Whether encode is enabled
2614                                                                                                 or disabled                */
2615);
2616
2617
2618/*****************************************************************************
2619  Summary:
2620    Gets the status of WSS output on the given handle
2621
2622  Description:
2623    This call determines whether WSS is currently enabled or
2624    disabled on the current handle.  Any pending change of status
2625    will not be returned by this call until BVBI_Encode_ApplyChanges
2626    is called.  pbEnabled will be set to 1 if output is enabled
2627    and 0 if it isn't.
2628
2629  Returns:
2630        BERR_SUCCESS              - The function call succeeded.
2631        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2632                                                            possibly NULL.
2633 *****************************************************************************/
2634BERR_Code BVBI_Encode_GetWSS(
2635        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2636                                                                                                 object                     */
2637        bool*                 pbEnabled         /* [out] Whether encode is enabled
2638                                                                                                 or disabled                */
2639);
2640
2641
2642/*****************************************************************************
2643  Summary:
2644    Gets the status of Teletext output on the given handle
2645
2646  Description:
2647    This call determines whether Teletext is currently enabled or
2648    disabled on the current handle.  Any pending change of status
2649    will not be returned by this call until BVBI_Encode_ApplyChanges
2650    is called.  pbEnabled will be set to 1 if output is enabled
2651    and 0 if it isn't.
2652
2653  Returns:
2654        BERR_SUCCESS              - The function call succeeded.
2655        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2656                                                            possibly NULL.
2657 *****************************************************************************/
2658BERR_Code BVBI_Encode_GetTeletext( 
2659        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2660                                                                                                 object                     */
2661        bool*                 pbEnabled         /* [out] Whether encode is enabled
2662                                                                                                 or disabled                */
2663);
2664
2665
2666/*****************************************************************************
2667  Summary:
2668    Gets the status of VPS output on the given handle
2669
2670  Description:
2671    This call determines whether VPS is currently enabled or
2672    disabled on the current handle.  Any pending change of status
2673    will not be returned by this call until BVBI_Encode_ApplyChanges
2674    is called.  pbEnabled will be set to 1 if output is enabled
2675    and 0 if it isn't.
2676
2677  Returns:
2678        BERR_SUCCESS              - The function call succeeded.
2679        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2680                                                            possibly NULL.
2681 *****************************************************************************/
2682BERR_Code BVBI_Encode_GetVPS (
2683        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2684                                                                                                 object                     */
2685        bool*                 pbEnabled         /* [out] Whether encode is enabled
2686                                                                                                 or disabled                */
2687);
2688
2689
2690/*****************************************************************************
2691  Summary:
2692    Gets the status of Gemstar output on the given handle
2693
2694  Description:
2695    This call determines whether Gemstar is currently enabled or
2696    disabled on the current handle.  Any pending change of status
2697    will not be returned by this call until BVBI_Encode_ApplyChanges
2698    is called.  pbEnabled will be set to 1 if output is enabled
2699    and 0 if it isn't.
2700
2701  Returns:
2702        BERR_SUCCESS              - The function call succeeded.
2703        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2704                                                            possibly NULL.
2705 *****************************************************************************/
2706BERR_Code BVBI_Encode_GetGemstar (
2707        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2708                                                                                                 object                     */
2709        bool*                 pbEnabled         /* [out] Whether encode is enabled
2710                                                                                                 or disabled                */
2711);
2712
2713
2714/*****************************************************************************
2715  Summary:
2716    Gets the status of AMOL output on the given handle
2717
2718  Description:
2719    This call determines what type of AMOL (if any) is currently enabled
2720    on the current handle.  Any pending change of status will not be returned
2721        by this call until BVBI_Encode_ApplyChanges is called. 
2722
2723  Returns:
2724        BERR_SUCCESS              - The function call succeeded.
2725        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2726                                                            possibly NULL.
2727 *****************************************************************************/
2728BERR_Code BVBI_Encode_GetAMOL (
2729        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2730                                                                                                 object                     */
2731        bool*                 pbEnabled         /* [out] Whether encode is enabled
2732                                                                                                 or disabled                */
2733);
2734
2735
2736/*****************************************************************************
2737  Summary:
2738    Gets the status of multi-line closed caption data output on the
2739        given handle
2740
2741  Description:
2742    This call determines what type of multi-line closed caption data
2743        (if any) is currently enabled on the current handle.  Any pending
2744        change of status will not be returned by this call until
2745        BVBI_Encode_ApplyChanges is called. 
2746
2747  Returns:
2748        BERR_SUCCESS              - The function call succeeded.
2749        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2750                                                            possibly NULL.
2751 *****************************************************************************/
2752BERR_Code BVBI_Encode_GetMCC (
2753        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2754                                                                                                 object                     */
2755        bool*                 pbEnabled         /* [out] Whether encode is enabled
2756                                                                                                 or disabled                */
2757);
2758
2759
2760/*****************************************************************************
2761  Summary:
2762    Gets the status of SCTE output on the given handle
2763
2764  Description:
2765    This call determines what type of SCTE (if any) is currently enabled
2766    on the current handle.  Any pending change of status will not be returned
2767        by this call until BVBI_Encode_ApplyChanges is called. 
2768
2769  Returns:
2770        BERR_SUCCESS              - The function call succeeded.
2771        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2772                                                            possibly NULL.
2773 *****************************************************************************/
2774BERR_Code BVBI_Encode_GetSCTE (
2775        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2776                                                                                                 object                     */
2777        bool*                 pbEnabled         /* [out] Whether encode is enabled
2778                                                                                                 or disabled                */
2779);
2780
2781
2782/*****************************************************************************
2783  Summary:
2784    Set ITU-R 656 closed caption output on the given handle
2785
2786  Description:
2787    This call enables or disables ITU-R 656 closed caption encode on
2788    the supplied active BVBI_Encode_Handle.  closed caption encode
2789    is enabled or disabled for the given BVBI_Encode_Handle the
2790    next time BVBI_Encode_ApplyChanges is called on the associated
2791    BVBI_Encode_Handle. If bEnabled is true (nonzero), ITU-R 656 closed
2792    caption encode is enabled.  If bEnabled is false, ITU-R 656
2793    closed caption encode is disabled.
2794
2795  Returns:
2796        BERR_SUCCESS              - The function call succeeded.
2797        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2798                                                            possibly NULL.
2799 *****************************************************************************/
2800BERR_Code BVBI_Encode_656_SetCC(
2801        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2802                                                                                                object                       */
2803        bool                   bEnabled         /* [in] Whether to enable or disable
2804                                                                                                encode                       */
2805);
2806
2807
2808/*****************************************************************************
2809  Summary:
2810    Set ITU-R 656 teletext output on the given handle
2811
2812  Description:
2813    This call enables or disables ITU-R 656 teletext encode on
2814    the supplied active BVBI_Encode_Handle.  Teletext encode
2815    is enabled or disabled for the given BVBI_Encode_Handle the
2816    next time BVBI_Encode_ApplyChanges is called on the associated
2817    BVBI_Encode_Handle. If bEnabled is true (nonzero), ITU-R 656 teletext
2818    encode is enabled.  If bEnabled is false, ITU-R 656 teletext
2819    encode is disabled.
2820
2821  Returns:
2822        BERR_SUCCESS              - The function call succeeded.
2823        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2824                                                            possibly NULL.
2825 *****************************************************************************/
2826BERR_Code BVBI_Encode_656_SetTeletext(
2827        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2828                                                                                                object                       */
2829        bool                   bEnabled         /* [in] Whether to enable or disable
2830                                                                                                encode                       */
2831);
2832
2833
2834/*****************************************************************************
2835  Summary:
2836    Set ITU-R 656 WSS output on the given handle
2837
2838  Description:
2839    This call enables or disables ITU-R 656 WSS encode on
2840    the supplied active BVBI_Encode_Handle.  WSS encode
2841    is enabled or disabled for the given BVBI_Encode_Handle the
2842    next time BVBI_Encode_ApplyChanges is called on the associated
2843    BVBI_Encode_Handle. If bEnabled is true (nonzero), ITU-R 656 WSS
2844    encode is enabled.  If bEnabled is false, ITU-R 656 WSS
2845    encode is disabled.
2846
2847  Returns:
2848        BERR_SUCCESS              - The function call succeeded.
2849        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2850                                                            possibly NULL.
2851 *****************************************************************************/
2852BERR_Code BVBI_Encode_656_SetWSS(
2853        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2854                                                                                                object                       */
2855        bool                   bEnabled         /* [in] Whether to enable or disable
2856                                                                                                encode                       */
2857);
2858
2859
2860/*****************************************************************************
2861  Summary:
2862    Set ITU-R 656 Gemstar output on the given handle
2863
2864  Description:
2865    This call enables or disables ITU-R 656 Gemstar encode on
2866    the supplied active BVBI_Encode_Handle.  Gemstar encode
2867    is enabled or disabled for the given BVBI_Encode_Handle the
2868    next time BVBI_Encode_ApplyChanges is called on the associated
2869    BVBI_Encode_Handle. If bEnabled is true (nonzero), ITU-R 656 Gemstar
2870    encode is enabled.  If bEnabled is false, ITU-R 656 Gemstar
2871    encode is disabled.
2872
2873  Returns:
2874        BERR_SUCCESS              - The function call succeeded.
2875        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2876                                                            possibly NULL.
2877 *****************************************************************************/
2878BERR_Code BVBI_Encode_656_SetGemstar(
2879        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2880                                                                                                object                       */
2881        bool                   bEnabled         /* [in] Whether to enable or disable
2882                                                                                                encode                       */
2883);
2884
2885
2886/*****************************************************************************
2887  Summary:
2888    Set ITU-R 656 AMOL output on the given handle
2889
2890  Description:
2891    This call enables or disables ITU-R 656 AMOL encode on
2892    the supplied active BVBI_Encode_Handle.  AMOL encode
2893    is enabled or disabled for the given BVBI_Encode_Handle the
2894    next time BVBI_Encode_ApplyChanges is called on the associated
2895    BVBI_Encode_Handle.
2896
2897  Returns:
2898        BERR_SUCCESS              - The function call succeeded.
2899        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2900                                                            possibly NULL.
2901 *****************************************************************************/
2902BERR_Code BVBI_Encode_656_SetAMOL (
2903        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2904                                                                                                object                       */
2905        bool                   bEnabled         /* [in] Whether to enable or disable
2906                                                                                                encode                       */
2907);
2908
2909
2910/*****************************************************************************
2911  Summary:
2912    Set ITU-R 656 multi-line closed caption output on the given handle
2913
2914  Description:
2915    This call enables or disables ITU-R 656 multi-line closed caption
2916        encode on the supplied active BVBI_Encode_Handle.  multi-line
2917        closed caption encode is enabled or disabled for the given
2918        BVBI_Encode_Handle the next time BVBI_Encode_ApplyChanges is
2919        called on the associated BVBI_Encode_Handle.
2920
2921  Returns:
2922        BERR_SUCCESS              - The function call succeeded.
2923        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2924                                                            possibly NULL.
2925 *****************************************************************************/
2926BERR_Code BVBI_Encode_656_SetMCC (
2927        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2928                                                                                                object                       */
2929        bool                   bEnabled         /* [in] Whether to enable or disable
2930                                                                                                encode                       */
2931);
2932
2933
2934/*****************************************************************************
2935  Summary:
2936    Set ITU-R 656 SCTE output on the given handle
2937
2938  Description:
2939    This call enables or disables ITU-R 656 SCTE encode on
2940    the supplied active BVBI_Encode_Handle.  SCTE encode
2941    is enabled or disabled for the given BVBI_Encode_Handle the
2942    next time BVBI_Encode_ApplyChanges is called on the associated
2943    BVBI_Encode_Handle.
2944
2945  Returns:
2946        BERR_SUCCESS              - The function call succeeded.
2947        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2948                                                            possibly NULL.
2949 *****************************************************************************/
2950BERR_Code BVBI_Encode_656_SetSCTE (
2951        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
2952                                                                                                object                       */
2953        bool                   bEnabled         /* [in] Whether to enable or disable
2954                                                                                                encode                       */
2955);
2956
2957
2958/*****************************************************************************
2959  Summary:
2960    Gets the status of ITU-R 656 closed caption output on the
2961    given handle
2962
2963  Description:
2964    This call determines whether ITU-R 656 closed caption
2965    is currently enabled or disabled on the current handle.
2966    Any pending change of status will not be returned by this call
2967    until BVBI_Encode_ApplyChanges is called.  pbEnabled will be
2968    set to 1 if output is enabled and 0 if it isn't.
2969
2970  Returns:
2971        BERR_SUCCESS              - The function call succeeded.
2972        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2973                                                            possibly NULL.
2974 *****************************************************************************/
2975BERR_Code BVBI_Encode_656_GetCC (
2976        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
2977                                                                                                 object                     */
2978        bool*                 pbEnabled         /* [out] Whether encode is enabled
2979                                                                                                 or disabled                */
2980);
2981
2982
2983/*****************************************************************************
2984  Summary:
2985    Gets the status of ITU-R 656 teletext output on the given handle
2986
2987  Description:
2988    This call determines whether ITU-R 656 teletext is currently
2989    enabled or disabled on the current handle.  Any pending
2990    change of status will not be returned by this call until
2991    BVBI_Encode_ApplyChanges is called.  pbEnabled will be set to
2992    1 if output is enabled and 0 if it isn't.
2993
2994  Returns:
2995        BERR_SUCCESS              - The function call succeeded.
2996        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
2997                                                            possibly NULL.
2998 *****************************************************************************/
2999BERR_Code BVBI_Encode_656_GetTeletext (
3000        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
3001                                                                                                 object                     */
3002        bool*                 pbEnabled         /* [out] Whether encode is enabled
3003                                                                                                 or disabled                */
3004);
3005
3006
3007/*****************************************************************************
3008  Summary:
3009    Gets the status of ITU-R 656 WSS output on the given handle
3010
3011  Description:
3012    This call determines whether ITU-R 656 WSS is currently
3013    enabled or disabled on the current handle.  Any pending
3014    change of status will not be returned by this call until
3015    BVBI_Encode_ApplyChanges is called.  pbEnabled will be set to
3016    1 if output is enabled and 0 if it isn't.
3017
3018  Returns:
3019        BERR_SUCCESS              - The function call succeeded.
3020        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3021                                                            possibly NULL.
3022 *****************************************************************************/
3023BERR_Code BVBI_Encode_656_GetWSS (
3024        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
3025                                                                                                 object                     */
3026        bool*                 pbEnabled         /* [out] Whether encode is enabled
3027                                                                                                 or disabled                */
3028);
3029
3030
3031/*****************************************************************************
3032  Summary:
3033    Gets the status of ITU-R 656 Gemstar output on the given handle
3034
3035  Description:
3036    This call determines whether ITU-R 656 Gemstar is currently
3037    enabled or disabled on the current handle.  Any pending
3038    change of status will not be returned by this call until
3039    BVBI_Encode_ApplyChanges is called.  pbEnabled will be set to
3040    1 if output is enabled and 0 if it isn't.
3041
3042  Returns:
3043        BERR_SUCCESS              - The function call succeeded.
3044        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3045                                                            possibly NULL.
3046 *****************************************************************************/
3047BERR_Code BVBI_Encode_656_GetGemstar (
3048        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
3049                                                                                                 object                     */
3050        bool*                 pbEnabled         /* [out] Whether encode is enabled
3051                                                                                                 or disabled                */
3052);
3053
3054
3055/*****************************************************************************
3056  Summary:
3057    Gets the status of ITU-R 656 AMOL output on the given handle
3058
3059  Description:
3060    This call determines what type of ITU-R 656 AMOL (if any) is currently
3061    enabled on the current handle.  Any pending change of status will not be
3062        returned by this call until BVBI_Encode_ApplyChanges is called. 
3063
3064  Returns:
3065        BERR_SUCCESS              - The function call succeeded.
3066        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3067                                                            possibly NULL.
3068 *****************************************************************************/
3069BERR_Code BVBI_Encode_656_GetAMOL (
3070        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
3071                                                                                                 object                     */
3072        bool*                 pbEnabled         /* [out] Whether encode is enabled
3073                                                                                                 or disabled                */
3074);
3075
3076
3077/*****************************************************************************
3078  Summary:
3079    Gets the status of ITU-R 656 multi-line closed caption output on
3080        the given handle
3081
3082  Description:
3083    This call determines what type of ITU-R 656 multi-line closed
3084        caption data (if any) is currently enabled on the current handle.
3085        Any pending change of status will not be returned by this call
3086        until BVBI_Encode_ApplyChanges is called. 
3087
3088  Returns:
3089        BERR_SUCCESS              - The function call succeeded.
3090        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3091                                                            possibly NULL.
3092 *****************************************************************************/
3093BERR_Code BVBI_Encode_656_GetMCC (
3094        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
3095                                                                                                 object                     */
3096        bool*                 pbEnabled         /* [out] Whether encode is enabled
3097                                                                                                 or disabled                */
3098);
3099
3100
3101/*****************************************************************************
3102  Summary:
3103    Gets the status of ITU-R 656 SCTE output on the given handle
3104
3105  Description:
3106    This call determines what type of ITU-R 656 SCTE (if any) is currently
3107    enabled on the current handle.  Any pending change of status will not be
3108        returned by this call until BVBI_Encode_ApplyChanges is called. 
3109
3110  Returns:
3111        BERR_SUCCESS              - The function call succeeded.
3112        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3113                                                            possibly NULL.
3114 *****************************************************************************/
3115BERR_Code BVBI_Encode_656_GetSCTE (
3116        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
3117                                                                                                 object                     */
3118        bool*                 pbEnabled         /* [out] Whether encode is enabled
3119                                                                                                 or disabled                */
3120);
3121
3122/*****************************************************************************
3123  Summary:
3124    Set ITU-R 656 encapsulation method for VBI encoding
3125
3126  Description:
3127    This call determines which format is used to encapsulate VBI data
3128    into ancillary data packets within an ITU-R 656 bitstream output
3129        by the device.  An active VBI encoder handle is required.
3130    The requested change is implemented the next time
3131    BVBI_Encode_ApplyChanges is called on the associated BVBI_Encode_Handle.
3132
3133  Returns:
3134        BERR_SUCCESS              - The function call succeeded.
3135        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3136                                                            possibly NULL.
3137 *****************************************************************************/
3138BERR_Code BVBI_Encode_656_SetFormat (
3139        BVBI_Encode_Handle encodeHandle,  /* [in] A valid BVBI_Encode_Handle
3140                                                                                          object                         */
3141        BVBI_656Fmt          anci656Fmt,  /* [in] The encapsulation format to
3142                                                                                          be used.  Note that the
3143                                                                                          default is
3144                                                                                          BVBI_656Fmt_SAA7113.           */
3145        uint8_t                    sdid   /* [in] The value to be encoded in
3146                                                  the SDID field of the
3147                                                                                          packet header.  Only the least
3148                                                                                          significant 6 bits are used.
3149                                                                                          Note that the default is 0.    */
3150);
3151
3152
3153/*****************************************************************************
3154  Summary:
3155    Get the format used for encapsulating VBI data into ancillary
3156    data packets within an ITU-R 656 bitstream output by the device.
3157
3158  Description:
3159    This function returns the format in use for encapsulating VBI data into
3160        ancillary data packets in the ITU-R 656 bitstream output by the supplied
3161    BVBI_Encode_Handle.
3162
3163  Returns:
3164        BERR_SUCCESS              - The information was successfully retrieved.
3165        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3166                                                            possibly NULL.
3167 *****************************************************************************/
3168BERR_Code BVBI_Encode_656_GetFormat( 
3169        BVBI_Encode_Handle encodeHandle,        /*  [in] A valid BVBI_Encode_Handle
3170                                                                                                 object                      */
3171        BVBI_656Fmt*        pAnci656Fmt,        /* [out] The format in use
3172                                                                                                 with the above object       */
3173        uint8_t*                  psdid     /* [out] The value to be encoded in
3174                                                     the SDID field of the
3175                                                                                             packet header.  The two most
3176                                                                                             significant bits are are
3177                                                                                             parity bits.                */
3178);
3179
3180/*****************************************************************************
3181  Summary:
3182    Set teletext external serial output on the given handle
3183
3184  Description:
3185    This call enables or disables teletext output through external serial
3186    port for the supplied active BVBI_Encode_Handle.  Teletext output is
3187    enabled or disabled for the given BVBI_Encode_Handle the next time
3188    BVBI_Encode_ApplyChanges is called on the associated BVBI_Encode_Handle.
3189    If bEnabled is true (nonzero), teletext output is enabled.
3190    If bEnabled is false, teletext output is disabled.
3191
3192  Returns:
3193    BERR_SUCCESS              - The function call succeeded.
3194    BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3195                                possibly NULL.
3196 *****************************************************************************/
3197BERR_Code BVBI_Encode_XSER_SetTeletext(
3198    BVBI_Encode_Handle encodeHandle,    /* [in] A valid BVBI_Encode_Handle
3199                                                object                       */
3200    bool                   bEnabled     /* [in] Whether to enable or disable
3201                                                output                       */
3202);
3203
3204
3205/*****************************************************************************
3206  Summary:
3207    Get state of teletext output to external serial port on the given handle
3208
3209  Description:
3210    This call determines whether teletext output to external serial port is
3211    currently enabled or disabled on the current handle. Any pending change
3212    of status will not be returned by this call until
3213    BVBI_Encode_ApplyChanges is called. pbEnabled will be set to 1 if output
3214    is enabled and 0 if it isn't.
3215
3216  Returns:
3217    BERR_SUCCESS              - The function call succeeded.
3218    BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3219                                possibly NULL.
3220 *****************************************************************************/
3221BERR_Code BVBI_Encode_XSER_GetTeletext(
3222    BVBI_Encode_Handle encodeHandle,    /* [in] A valid BVBI_Encode_Handle
3223                                                object                       */
3224    bool*                 pbEnabled     /* [in] Whether output is enabled
3225                                                or disabled.                 */
3226);
3227
3228/*****************************************************************************
3229  Summary:
3230    Sets options for VBI output through external serial port.
3231
3232  Description:
3233    This function takes an active BVBI_Encode_Handle and sets options
3234    related to output to the external serial port. These options take effect
3235    at the next call to BVBI_Encode_ApplyChanges.
3236
3237  Returns:
3238    BERR_SUCCESS              - The function call succeeded.
3239    BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3240                                possibly NULL.
3241 *****************************************************************************/
3242BERR_Code BVBI_Encode_XSER_SetOptions(
3243    BVBI_Encode_Handle encodeHandle,    /* [in] A valid BVBI_Encode_Handle
3244                                                object                       */
3245    BVBI_XSER_Settings*   pSettings     /* [in] Settings for serial port
3246                                                output.                      */
3247);
3248
3249/*****************************************************************************
3250  Summary:
3251    Gets options related to VBI output through external serial port.
3252
3253  Description:
3254    This function takes an active BVBI_Encode_Handle and retrieves
3255    options related to output through the external serial port. Any
3256    pending change of status will not be returned by this call
3257    until BVBI_Encode_ApplyChanges is called.
3258
3259  Returns:
3260    BERR_SUCCESS              - The function call succeeded.
3261    BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3262                                possibly NULL.
3263 *****************************************************************************/
3264BERR_Code BVBI_Encode_XSER_GetOptions(
3265    BVBI_Encode_Handle encodeHandle,    /*  [in] A valid BVBI_Encode_Handle
3266                                                 object                      */
3267    BVBI_XSER_Settings*   pSettings     /* [out] Settings for serial port
3268                                                 output.                     */
3269);
3270
3271
3272/*****************************************************************************
3273  Summary:
3274    Sets options for Gemstar encoding
3275
3276  Description:
3277    This function takes an active BVBI_Encode_Handle and sets options
3278        related to Gemstar encoding. These options take effect at the next call to
3279        BVBI_Encode_ApplyChanges.
3280
3281  Returns:
3282        BERR_SUCCESS              - The function call succeeded.
3283        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3284                                                            possibly NULL.
3285 *****************************************************************************/
3286BERR_Code BVBI_Encode_SetGemstarOptions(
3287        BVBI_Encode_Handle  encodeHandle,       /* [in] A valid BVBI_Encode_Handle
3288                                                                                                object                       */
3289        const BVBI_GSOptions* pGsOptions    /* [in] Options for Gemstar output.  */
3290);
3291
3292
3293/*****************************************************************************
3294  Summary:
3295    Gets options for Gemstar encoding
3296
3297  Description:
3298    This function takes an active BVBI_Encode_Handle and retrieves options
3299        related to Gemstar encoding.  Any pending change of status will not be
3300        returned by this call until BVBI_Encode_ApplyChanges is called.
3301
3302  Returns:
3303        BERR_SUCCESS              - The function call succeeded.
3304        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3305                                                            possibly NULL.
3306 *****************************************************************************/
3307BERR_Code BVBI_Encode_GetGemstarOptions(
3308        BVBI_Encode_Handle encodeHandle,   /*  [in] A valid BVBI_Encode_Handle
3309                                                                                                object                       */
3310        BVBI_GSOptions*      pGsOptions    /* [out] Options for Gemstar output.  */
3311);
3312
3313
3314/*****************************************************************************
3315  Summary:
3316    Sets options for AMOL encoding
3317
3318  Description:
3319    This function takes an active BVBI_Encode_Handle and sets options
3320        related to AMOL encoding. These options take effect at the next call to
3321        BVBI_Encode_ApplyChanges.
3322
3323  Returns:
3324        BERR_SUCCESS              - The function call succeeded.
3325        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3326                                                            possibly NULL.
3327 *****************************************************************************/
3328BERR_Code BVBI_Encode_SetAMOLOptions(
3329        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
3330                                                                                                object                       */
3331        BVBI_AMOL_Type         amolType     /* [in] Which variant of AMOL to
3332                                                    be output.                   */
3333);
3334
3335
3336/*****************************************************************************
3337  Summary:
3338    Sets options for SCTE encoding
3339
3340  Description:
3341    This function takes an active BVBI_Encode_Handle and sets options
3342        related to SCTE encoding. These options take effect at the next call to
3343        BVBI_Encode_ApplyChanges.
3344
3345  Returns:
3346        BERR_SUCCESS              - The function call succeeded.
3347        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3348                                                            possibly NULL.
3349 *****************************************************************************/
3350BERR_Code BVBI_Encode_SetSCTEOptions(
3351        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
3352                                                                                                object                       */
3353        BVBI_SCTE_Type         scteType     /* [in] Which type of SCTE data to
3354                                                    output.                      */
3355);
3356
3357
3358/*****************************************************************************
3359  Summary:
3360    Gets options for AMOL encoding
3361
3362  Description:
3363    This function takes an active BVBI_Encode_Handle and retrieves options
3364        related to AMOL encoding.  Any pending change of status will not be
3365        returned by this call until BVBI_Encode_ApplyChanges is called.
3366
3367  Returns:
3368        BERR_SUCCESS              - The function call succeeded.
3369        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3370                                                            possibly NULL.
3371 *****************************************************************************/
3372BERR_Code BVBI_Encode_GetAMOLOptions(
3373        BVBI_Encode_Handle encodeHandle,   /*  [in] A valid BVBI_Encode_Handle
3374                                                                                                object                       */
3375        BVBI_AMOL_Type*       pAmolType    /* [out] Which type of AMOL encoding
3376                                                    is being output.             */
3377);
3378
3379
3380/*****************************************************************************
3381  Summary:
3382    Gets options for SCTE encoding
3383
3384  Description:
3385    This function takes an active BVBI_Encode_Handle and retrieves options
3386        related to SCTE encoding.  Any pending change of status will not be
3387        returned by this call until BVBI_Encode_ApplyChanges is called.
3388
3389  Returns:
3390        BERR_SUCCESS              - The function call succeeded.
3391        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3392                                                            possibly NULL.
3393 *****************************************************************************/
3394BERR_Code BVBI_Encode_GetSCTEOptions(
3395        BVBI_Encode_Handle encodeHandle,   /*  [in] A valid BVBI_Encode_Handle
3396                                                                                                object                       */
3397        BVBI_SCTE_Type*       pScteType    /* [out] Which type of SCTE data
3398                                                    is being output.             */
3399);
3400
3401
3402/*****************************************************************************
3403  Summary:
3404    Encodes one field worth of VBI data
3405
3406  Description:
3407    This function takes an active BVBI_Encode_Handle and valid
3408    BVBI_Field_Handle and encodes that data appropriately for the
3409    next available field(s).  Note that some formats may have a
3410    delay on output, and so the same supplied BVBI_Field_Handle may
3411    be output to more than one video field and may not be output
3412    immediately.  A valid BVBI_Encode_Handle may be created with
3413    BVBI_Encode_Create.  A valid (but empty) BVBI_Field_Handle may
3414    be acquired from BVBI_Field_Create.  A BVBI_Field_Handle can
3415    be made non-empty by calling BVBI_Decode_Data_isr or one of the
3416        functions BVBI_Field_Set*Data.
3417
3418        This function is intended to be called from the interrupt
3419        that marks the beginning of a field of encoded active video.
3420
3421        Setting the polarity parameter is a bit tricky.  The parameter
3422        itself refers to the VBI data that is to be encoded into a
3423        video field.  This field will be either even or odd, but it has
3424        not been created yet.  Also, this function is called at the
3425        start of active video for an even or odd field.  But almost
3426        certainly, the parity of these two fields will be opposite.
3427        For example, if this function was called from the interrupt for
3428        start of active video in odd field, the VBI data will be encoded
3429        soonest if the user specifies even parity.  As a special case,
3430        if the video being encoded is progressive, then this function
3431        parameter should always be set to BAVC_Polarity_eFrame.
3432
3433  Returns:
3434        BERR_SUCCESS              - The function call succeeded.
3435        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3436                                                            possibly NULL.
3437        BVBI_ERR_FLDH_CONFLICT    - The encode handle is configured to encode a
3438                                                                bulky data format such as teletext, but the
3439                                                                field handle is not properly sized for this.
3440        BVBI_ERR_INVALID_FIELD_POLARITY   
3441                                                          - The field polarity of the supplied field handle
3442                                                            conflicts with the function's polarity argument.
3443 *****************************************************************************/
3444BERR_Code BVBI_Encode_Data_isr(
3445        BVBI_Encode_Handle encodeHandle,        /* [in] A valid BVBI_Encode_Handle
3446                                                                                                object                       */
3447        BVBI_Field_Handle   fieldHandle,        /* [in] A valid BVBI_Field_Handle
3448                                                                                                object.  If NULL, then the VBI
3449                                                                                                encoders will be disabled for
3450                                                                                                one field.                   */
3451        BAVC_Polarity          polarity         /* [in] Which field (even, odd or
3452                                                    frame) to encode data into   */
3453);
3454
3455
3456/*****************************************************************************
3457  Summary:
3458    Get the interrupt name for VEC/VBI video field start.
3459
3460  Description:
3461    This function returns the interrupt name required by the BVBI_Encode_
3462        submodule, from which context BVBI_Encode_Data_isr() must be called.
3463
3464        Example;
3465          BVDC_Display_Handle hDisplay;
3466      BAVC_VbiPath eVbiPath;
3467          BINT_Id interruptName;
3468          BAVC_Polarity eFieldPolarity,
3469          hDisplay = ...
3470          BVDC_Display_GetVbiPath (hDisplay, &eVbiPath);
3471          eFieldPolarity = ...
3472          BVBI_Encode_GetInterruptName (eVbiPath, eFieldPolarity, &interruptName);
3473          BINT_CreateCallback (..., interruptName, ...);
3474
3475  Returns:
3476    BERR_INVALID_PARAMETER - Some parameter is invalid.
3477    BERR_SUCCESS - Successfully returned interrupt id
3478
3479  See Also:
3480    BVBI_Encode_Data_isr().
3481 *****************************************************************************/
3482BERR_Code BVBI_Encode_GetInterruptName(
3483    BAVC_VbiPath  eVbiPath,       /*  [in] The VEC path to program
3484                                               interrupts for, obtained from BVDC
3485                                                                                   porting interface module          */
3486    BAVC_Polarity eFieldPolarity, /*  [in] The video field polarity to
3487                                               program interrupts for.           */
3488        BINT_Id*      pInterruptName  /* [out] The interrupt to use for VEC/VBI
3489                                               operations with the above VEC
3490                                                                                   path and video field polarity.    */
3491);
3492
3493
3494/*****************************************************************************
3495  Summary:
3496    Decodes one field of VBI data
3497
3498  Description:
3499    This function takes an active BVBI_Decode_Handle and an allocated
3500    BVBI_Field_Handle and decodes the next available field(s) into that
3501    BVBI_Field_Handle object.  The BVBI_Field_Handle object must be
3502    allocated but need not already be filled with  VBI data.  If it
3503    contains VBI data, that data is lost. 
3504
3505        This function is intended to be called from the interrupt that
3506        marks the beginning of a field of decoded active video.
3507
3508        Setting the polarity parameter is a bit tricky.  The parameter
3509        itself refers to the VBI data that was collected.  This VBI
3510        data was collected from either an even or odd field.  Also,
3511        this function was called at the start of active video for an
3512        even or odd field.  But almost certainly, the parity of these
3513        two fields will be opposite.  For example, if this function was
3514        called from the interrupt for start of active video in odd field,
3515        then almost certainly, the most recent VBI data available is
3516        from the previous even field.  As a special case, if the video
3517        being decoded is progressive, then this function parameter should
3518        always be set to BAVC_Polarity_eFrame.
3519
3520  Returns:
3521        BERR_SUCCESS              - The function call succeeded.
3522        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3523                                                            possibly NULL.
3524        BVBI_ERR_FLDH_CONFLICT    - The decode handle is configured to decode a
3525                                                                bulky data format such as teletext, but the
3526                                                                field handle is not properly sized for this.
3527 *****************************************************************************/
3528BERR_Code BVBI_Decode_Data_isr(
3529        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
3530                                                                                                object                       */
3531        BVBI_Field_Handle   fieldHandle,        /* [in] A BVBI_Field_Handle object   */
3532        BAVC_Polarity          polarity         /* [in] Which field (even, odd, or
3533                                                    frame) to extract data for   */
3534);
3535
3536
3537/*****************************************************************************
3538  Summary:
3539    Creates new empty field data
3540
3541  Description:
3542    This creates new, empty field data for the specified BVBI_Handle.
3543    This BVBI_Field_Handle structure can be filled with data by
3544    functions like BVBI_Field_SetCCData, and encoded using
3545        BVBI_Encode_Data_isr. 
3546
3547        A BVBI_Field_Handle is a container that holds VBI data.
3548        It has the capacity to simultaneously hold all the closed
3549        caption data, WSS data, and CGMS data that can occur in a
3550        single field of video.  However, all other types of VBI
3551        data are so bulky that by default, a BVBI_Field_Handle
3552        will not hold them.  The user must call a function such
3553        as BVBI_Field_TT_Allocate() in order to change the holding
3554        capacity of his BVBI_Field_Handle to match his application.
3555
3556  Returns:
3557        BERR_SUCCESS              - The handle was successfully created.
3558        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3559                                                            possibly NULL.
3560 *****************************************************************************/
3561BERR_Code BVBI_Field_Create(
3562        BVBI_Field_Handle* pFieldHandle,        /* [out] A pointer to a
3563                                                                                                 BVBI_Field_Handle object */
3564        BVBI_Handle vbiHandle                   /*  [in] A valid BVBI_Field_Handle
3565                                                                                             object                    */
3566);
3567
3568
3569/*****************************************************************************
3570  Summary:
3571    Destroys a field data structure
3572
3573  Description:
3574    fieldHandle should be a valid, allocated BVBI_Field_Handle structure
3575        created by BVBI_Field_Create.  This function frees the structure and all
3576        associated data.
3577
3578  Returns:
3579        BERR_SUCCESS              - The handle was successfully destroyed.
3580        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
3581                                                            possibly NULL.
3582 *****************************************************************************/
3583BERR_Code BVBI_Field_Destroy(
3584        BVBI_Field_Handle fieldHandle   /* [in] A BVBI_Field_Handle object */
3585);
3586
3587
3588/*****************************************************************************
3589  Summary:
3590    Changes how much teletext data a field data structure is capable
3591        of holding.
3592
3593  Description:
3594    fieldHandle should be a valid, allocated BVBI_Field_Handle
3595    structure created by BVBI_Field_Create. This function changes the
3596        internal properties of the structure so that it is capable
3597        of holding a specific amount of teletext data.
3598
3599        When a BVBI_Field_Handle is first created (by calling
3600        BVBI_Field_Create()), it is not capable of holding any
3601        teletext data at all.  before it is capable of holding
3602        teletext data, BVBI_Field_TT_Allocate() must be called.
3603
3604        Calling this function will cause any teletext data contained in
3605        the BVBI_Field_Handle to be lost!
3606
3607  Returns:
3608        BERR_SUCCESS              - The function call succeeded.
3609        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3610                                                            possibly NULL.
3611 *****************************************************************************/
3612BERR_Code BVBI_Field_TT_Allocate( 
3613        BVBI_Field_Handle fieldHandle,  /* [in] A BVBI_Field_Handle object       */
3614        uint8_t            ucMaxLines,  /* [in] The maximum number of lines of
3615                                                                                        teletext data that the above
3616                                                                                        fieldHandle will be capable of
3617                                                                                    holding.  Set this to zero to
3618                                                                                        make the fieldHandle as small as
3619                                                                                        possible (no teletext data may
3620                                                                                        be stored within).  For NTSC
3621                                                                                        video, this number never needs
3622                                                                                        to be any larger than 11.  For
3623                                                                                        PAL video, this number never
3624                                                                                        needs to be any larger than 18.  */
3625        uint8_t            ucLineSize   /* [in] The number of characters per
3626                                                                                        line of teletext data that the
3627                                                                                        above fieldHandle will be hold. 
3628                                                                                        For NTSC video, this must be 34. 
3629                                                                                        For PAL video, this must be 43. 
3630                                                                                        Special case: if the above
3631                                                                                        parameter ulMaxLines is zero,
3632                                                                                        then this parameter is ignored   */
3633);
3634
3635/*****************************************************************************
3636  Summary:
3637    Changes whether or not a field data structure is capable
3638        of of holding VPS data.
3639
3640  Description:
3641    fieldHandle should be a valid, allocated BVBI_Field_Handle
3642    structure created by BVBI_Field_Create. This function changes the
3643        internal properties of the structure so that it is capable
3644        (or not) of holding VPS data.
3645
3646        When a BVBI_Field_Handle is first created (by calling
3647        BVBI_Field_Create()), it is not capable of holding VPS
3648        data.  before it is capable of holding
3649        VPS data, BVBI_Field_VPS_Allocate() must be called.
3650
3651        Calling this function will cause any VPS data contained in
3652        the BVBI_Field_Handle to be lost!
3653  Returns:
3654        BERR_SUCCESS              - The function call succeeded.
3655        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3656                                                            possibly NULL.
3657 *****************************************************************************/
3658BERR_Code BVBI_Field_VPS_Allocate( 
3659        BVBI_Field_Handle fieldHandle,  /* [in] A BVBI_Field_Handle object       */
3660        bool                  bEnable   /* [in] If true, the BVBI_Field_Handle
3661                                                                                        object will be made capable of
3662                                                                                        holding VPS data.  If false, the
3663                                                                                        object will lose this
3664                                                                                        capability, thus saving memory.  */
3665);
3666
3667/*****************************************************************************
3668  Summary:
3669    Changes whether or not a field data structure is capable
3670        of of holding Gemstar data.
3671
3672  Description:
3673    fieldHandle should be a valid, allocated BVBI_Field_Handle
3674    structure created by BVBI_Field_Create. This function changes the
3675        internal properties of the structure so that it is capable
3676        (or not) of holding Gemstar data.
3677
3678        When a BVBI_Field_Handle is first created (by calling
3679        BVBI_Field_Create()), it is not capable of holding Gemstar
3680        data.  before it is capable of holding
3681        Gemstar data, BVBI_Field_GS_Allocate() must be called.
3682
3683        Calling this function will cause any Gemstar data contained in
3684        the BVBI_Field_Handle to be lost!
3685  Returns:
3686        BERR_SUCCESS              - The function call succeeded.
3687        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3688                                                            possibly NULL.
3689 *****************************************************************************/
3690BERR_Code BVBI_Field_GS_Allocate( 
3691        BVBI_Field_Handle fieldHandle,  /* [in] A BVBI_Field_Handle object       */
3692        bool                  bEnable   /* [in] If true, the BVBI_Field_Handle
3693                                                                                        object will be made capable of
3694                                                                                        holding Gemstar data.  If false,
3695                                                                                        the object will lose this
3696                                                                                        capability, thus saving memory.  */
3697);
3698
3699/*****************************************************************************
3700  Summary:
3701    Changes what type of AMOL data (if any) a field handle is capable of
3702        holding.
3703
3704  Description:
3705    fieldHandle should be a valid, allocated BVBI_Field_Handle
3706    structure created by BVBI_Field_Create. This function changes the
3707        internal properties of the structure so that it is capable
3708        (or not) of holding AMOL data. Depending on its arguments, the field
3709        handle will then be capable of holding AMOL I, AMOL II 1 Mbit/s., or
3710        AMOL II 2 Mbit/s. data. Or, none at all (returns allocated memory).
3711
3712        When a BVBI_Field_Handle is first created (by calling
3713        BVBI_Field_Create()), it is not capable of holding AMOL
3714        data.  before it is capable of holding AMOL data,
3715        BVBI_Field_AMOL_Allocate() must be called.
3716
3717        Calling this function will cause any AMOL data contained in
3718        the BVBI_Field_Handle to be lost!
3719  Returns:
3720        BERR_SUCCESS              - The function call succeeded.
3721        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3722                                                            possibly NULL.
3723 *****************************************************************************/
3724BERR_Code BVBI_Field_AMOL_Allocate( 
3725        BVBI_Field_Handle fieldHandle,  /* [in] A BVBI_Field_Handle object       */
3726        BVBI_AMOL_Type       amolType   /* [in] Which type of AMOL to allocate
3727                                                space for. As a special case,
3728                                                                                        BVBI_AMOL_Type_None removes all
3729                                                                                        capability, thus saving memory.  */
3730);
3731
3732/*****************************************************************************
3733  Summary:
3734    Adds or removes space in a field handle to store multi-line closed caption
3735        data.
3736
3737  Description:
3738    fieldHandle should be a valid, allocated BVBI_Field_Handle
3739    structure created by BVBI_Field_Create. This function changes the
3740        internal properties of the structure so that it is capable
3741        (or not) of holding multi-line closed caption data. Depending
3742        on its arguments, the field handle will then be capable of
3743        holding this data, or not.
3744
3745        When a BVBI_Field_Handle is first created (by calling
3746        BVBI_Field_Create()), it is not capable of holding multi-line
3747        closed caption data.  before it is capable of holding this
3748        data, BVBI_Field_MCC_Allocate() must be called.
3749
3750        Calling this function will cause any multi-line closed
3751        caption data contained in the BVBI_Field_Handle to be lost!
3752
3753  Returns:
3754        BERR_SUCCESS              - The function call succeeded.
3755        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3756                                                            possibly NULL.
3757 *****************************************************************************/
3758BERR_Code BVBI_Field_MCC_Allocate( 
3759        BVBI_Field_Handle fieldHandle,  /* [in] A BVBI_Field_Handle object       */
3760        bool                    alloc   /* [in] If true, space for the MCC
3761                                                data is allocated. If false,
3762                                                                                        this space (capability) is
3763                                                                                        removed, thus saving memory.     */
3764);
3765
3766/*****************************************************************************
3767  Summary:
3768    Changes what type of SCTE data (if any) a field handle is capable of
3769        holding.
3770
3771  Description:
3772    fieldHandle should be a valid, allocated BVBI_Field_Handle
3773    structure created by BVBI_Field_Create. This function changes the
3774        internal properties of the structure so that it is capable
3775        (or not) of holding SCTE data. Depending on its arguments, the field
3776        handle will then be capable of holding closed caption (like) data only,
3777        closed caption plus NRTV, closed caption plus PAM, or closed caption plus
3778        monochrome. Or, none at all (returns allocated memory).
3779
3780        Calling this routine is destructive. Regardless of the arguments supplied,
3781        all SCTE data contained in the field handle will be destroyed.
3782
3783        When a BVBI_Field_Handle is first created (by calling
3784        BVBI_Field_Create()), it is not capable of holding SCTE
3785        data.  before it is capable of holding SCTE data,
3786        BVBI_Field_SCTE_Allocate() must be called.
3787
3788        Calling this function will cause any SCTE data contained in
3789        the BVBI_Field_Handle to be lost!
3790  Returns:
3791        BERR_SUCCESS              - The function call succeeded.
3792        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3793                                                            possibly NULL.
3794 *****************************************************************************/
3795BERR_Code BVBI_Field_SCTE_Allocate( 
3796        BVBI_Field_Handle fieldHandle,  /* [in] A BVBI_Field_Handle object       */
3797        size_t                cc_size,  /* [in] Number of pieces of closed
3798                                                caption data to make room for.   */
3799    bool           scteEnableNrtv,  /* [in] Whether to allocate space to
3800                                                make SCTE NRTV data processing
3801                                                                                        possible.                        */
3802        size_t               pam_size,  /* [in] Number of bytes of luma_PAM_data
3803                                                to make room for.                */
3804    bool           scteEnableMono   /* [in] Whether to allocate space to
3805                                                make ETSI EN 301 775 monochrome
3806                                                                                        data processing possible.        */
3807);
3808
3809/*****************************************************************************
3810  Summary:
3811    Changes whether or not a field data structure is capable
3812        of of holding CGMS-B data.
3813
3814  Description:
3815    fieldHandle should be a valid, allocated BVBI_Field_Handle
3816    structure created by BVBI_Field_Create. This function changes the
3817        internal properties of the structure so that it is capable
3818        (or not) of holding CGMS-B data.
3819
3820        When a BVBI_Field_Handle is first created (by calling
3821        BVBI_Field_Create()), it is not capable of holding CGMS-B
3822        data.  before it is capable of holding
3823        CGMS-B data, BVBI_Field_CGMSB_Allocate() must be called.
3824
3825        Calling this function will cause any Gemstar data contained in
3826        the BVBI_Field_Handle to be lost!
3827  Returns:
3828        BERR_SUCCESS              - The function call succeeded.
3829        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3830                                                            possibly NULL.
3831 *****************************************************************************/
3832BERR_Code BVBI_Field_CGMSB_Allocate( 
3833        BVBI_Field_Handle fieldHandle,  /* [in] A BVBI_Field_Handle object       */
3834        bool                  bEnable   /* [in] If true, the BVBI_Field_Handle
3835                                                                                        object will be made capable of
3836                                                                                        holding CGMS-B data.  If false,
3837                                                                                        the object will lose this
3838                                                                                        capability, thus saving memory.  */
3839);
3840
3841
3842/*****************************************************************************
3843  Summary:
3844    Sets options for WSS decoding
3845
3846  Description:
3847    This function takes an active BVBI_Decode_Handle and sets options
3848        related to WSS decoding. These options take effect at the next call to
3849        BVBI_Decode_ApplyChanges.
3850
3851        This function allows the user to decode WSS data from a non-standard
3852        video line number.
3853
3854  Returns:
3855        BERR_SUCCESS              - The function call succeeded.
3856        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3857                                                            possibly NULL.
3858 *****************************************************************************/
3859BERR_Code BVBI_Decode_SetWssOptions(
3860        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
3861                                                                                                object                       */
3862        uint16_t              vline576i         /* [in] The video line number to use
3863                                                    for 576I/PAL decoding.       */
3864);
3865
3866
3867/*****************************************************************************
3868  Summary:
3869    Reports options used for WSS decoding
3870
3871  Description:
3872    This function takes an active BVBI_Decode_Handle and reports the options
3873        related to WSS decoding.
3874
3875  Returns:
3876        BERR_SUCCESS              - The function call succeeded.
3877        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3878                                                            possibly NULL.
3879 *****************************************************************************/
3880BERR_Code BVBI_Decode_GetWssOptions(
3881        BVBI_Decode_Handle decodeHandle,   /*  [in] A valid BVBI_Decode_Handle
3882                                                                                                object                       */
3883        uint16_t*            pVline576i    /* [out] The video line number used
3884                                                    for 576I/PAL decoding.       */
3885);
3886
3887
3888/*****************************************************************************
3889  Summary:
3890    Sets options for Gemstar decoding
3891
3892  Description:
3893    This function takes an active BVBI_Decode_Handle and sets options
3894        related to Gemstar decoding. These options take effect at the next call to
3895        BVBI_Decode_ApplyChanges.
3896
3897  Returns:
3898        BERR_SUCCESS              - The function call succeeded.
3899        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3900                                                            possibly NULL.
3901 *****************************************************************************/
3902BERR_Code BVBI_Decode_SetGemstarOptions(
3903        BVBI_Decode_Handle  decodeHandle,       /* [in] A valid BVBI_Decode_Handle
3904                                                                                                object                       */
3905        const BVBI_GSOptions* pGsOptions    /* [in] Options for Gemstar input.   */
3906);
3907
3908
3909/*****************************************************************************
3910  Summary:
3911    Gets options for Gemstar decoding
3912
3913  Description:
3914    This function takes an active BVBI_Decode_Handle and sets options
3915        related to Gemstar decoding. These options take effect at the next call to
3916        BVBI_Decode_ApplyChanges.
3917
3918  Returns:
3919        BERR_SUCCESS              - The function call succeeded.
3920        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3921                                                            possibly NULL.
3922 *****************************************************************************/
3923BERR_Code BVBI_Decode_GetGemstarOptions(
3924        BVBI_Decode_Handle decodeHandle,        /* [in] A valid BVBI_Decode_Handle
3925                                                                                                object                       */
3926        BVBI_GSOptions*      pGsOptions    /* [out] Options for Gemstar input.   */
3927);
3928
3929
3930/*****************************************************************************
3931  Summary:
3932    Gets field parity attribute of VBI field data handle
3933
3934  Description:
3935        This function returns the "field parity" attribute of a BVBI_Field_Handle.
3936        The attribute is a bitfield, and it will be one of: zero,
3937        (1<<BAVC_Polarity_eTopField), (1<<BAVC_Polarity_eBotField), or
3938        ((1<<BAVC_Polarity_eTopField) | (1<<BAVC_Polarity_eBotField)).  The last
3939        value indicates that the VBI data is suitable for encoding in either a top
3940        field or a bottom field.  Other values will cause encoding of this VBI data
3941        to fail.
3942
3943  Returns:
3944        BERR_SUCCESS              - The function call succeeded.
3945        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3946                                                            possibly NULL.
3947 *****************************************************************************/
3948BERR_Code BVBI_Field_GetPolarity_isr( 
3949        BVBI_Field_Handle vbiHandle,    /*  [in] A valid BVBI_Field_Handle
3950                                                                                         object                    */
3951        uint32_t      *pPolarityMask    /* [out] The bitmask indicating
3952                                                                                         field polarity            */
3953);
3954
3955
3956/*****************************************************************************
3957  Summary:
3958    Sets field parity attribute of VBI field data handle
3959
3960  Description:
3961        This function sets the "field parity" attribute of a BVBI_Field_Handle.
3962        The attribute is a bitfield, and it should be one of:
3963        (1<<BAVC_Polarity_eTopField), (1<<BAVC_Polarity_eBotField), or
3964        ((1<<BAVC_Polarity_eTopField) | (1<<BAVC_Polarity_eBotField)).  The last
3965        value indicates that the VBI data is suitable for encoding in either a top
3966        field or a bottom field.  Other values will cause encoding of this VBI data
3967        to fail.
3968
3969    A BVBI_Field_Handle "filled" by calling BVBI_Decode_Data_isr will have this
3970        attribute set already.  However, the user may still wish to use
3971        BVBI_Field_SetPolarity_isr in this case.  For example, setting the
3972        attribute to ((1<<BAVC_Polarity_eTopField) | (1<<BAVC_Polarity_eBotField))
3973        will cause the BVBI_Field_Handle to be encoded as quickly as possible;
3974        the user will not have to wait for a field of the desired polarity to occur.
3975
3976  Returns:
3977        BERR_SUCCESS              - The function call succeeded.
3978        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
3979                                                            possibly NULL.
3980 *****************************************************************************/
3981BERR_Code BVBI_Field_SetPolarity_isr( 
3982        BVBI_Field_Handle vbiHandle,    /*  [in] A valid BVBI_Field_Handle
3983                                                                                         object                    */
3984        uint32_t        polarityMask    /*  [in] The bitmask indicating
3985                                                                                         field polarity            */
3986);
3987
3988/*****************************************************************************
3989  Summary:
3990    Gets information about a decoding error
3991
3992  Description:
3993    This function returns more information for the most recent encode
3994    or decode error on the specified BVBI_Field_Handle.  pErrInfo has
3995    a bit set for each of the various error types that has occurred
3996        on it.  See the earlier parts of this header for the error
3997        constants.
3998
3999    Calling BVBI_Encode_Data_isr or BVBI_Decode_Data_isr on the
4000    BVBI_Field_Handle will clear the BVBI_Field_Handle's error data
4001    and replace it with data for the most recent call.
4002
4003  Returns:
4004        BERR_SUCCESS              - The function call succeeded.
4005        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4006                                                            possibly NULL.
4007 *****************************************************************************/
4008BERR_Code BVBI_Field_GetErrorInfo_isr( 
4009        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4010                                                                                         object                    */
4011        uint32_t            *pErrInfo   /* [out] The bitmask to use for
4012                                                                                         returning line errors     */
4013);
4014
4015
4016/*****************************************************************************
4017  Summary:
4018    Gets CC data from the supplied field data
4019
4020  Description:
4021    This function extracts one field's worth of CC data from a
4022    BVBI_Field_Handle structure.  That field data may come from
4023    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4024
4025        If the function returns an error, the user may immediately
4026        call BVBI_Field_GetErrorInfo_isr() to determine the cause of the error.
4027
4028  Returns:
4029        BERR_SUCCESS              - The function call succeeded.
4030        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4031                                                            possibly NULL.
4032        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4033                                                                BVBI_Field_GetErrorInfo_isr for further info.
4034 *****************************************************************************/
4035BERR_Code BVBI_Field_GetCCData_isr(
4036        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4037                                                                                         object                          */
4038        uint8_t           *pucLowByte,  /* [out] A pointer to an 8-bit int for
4039                                                                                         CC data.  This is the "low
4040                                                                                         byte" of closed caption data,
4041                                                                                         as defined in the spec.  For
4042                                                                                         some applications, the user
4043                                                                                         could "AND" this data with the
4044                                                                                         value 0x7F in order to clear
4045                                                                                         the parity bits.  As an aid to
4046                                                                                         troubleshooting, this function
4047                                                                                         will return data even if there
4048                                                                                         is a parity error.  For all
4049                                                                                         other cases, 0x00 is returned.  */ 
4050        uint8_t          *pucHighByte   /* [out] A pointer to an 8-bit int for
4051                                                                                         CC data.  This is the "high
4052                                                                                         byte" of closed caption data,
4053                                                                                         as defined in the spec.  The
4054                                                                                         comments regarding the above
4055                                                                                         argument hold for this one as
4056                                                                                         well.                           */
4057);
4058
4059
4060/*****************************************************************************
4061  Summary:
4062    Sets CC data in the supplied field data
4063
4064  Description:
4065    This function writes one field's worth of CC data to a
4066    BVBI_Field_Handle structure.  That field data may come from
4067    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4068    encoded using BVBI_Encode_Data_isr.
4069
4070  Returns:
4071        BERR_SUCCESS              - The function call succeeded.
4072        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4073                                                            possibly NULL.
4074 *****************************************************************************/
4075BERR_Code BVBI_Field_SetCCData_isr(
4076        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4077                                                                                         object                          */
4078         uint8_t             cLowByte,  /*  [in] 8 bits of closed caption data
4079                                                                                         to insert.  This is the "low
4080                                                                                         byte" of closed caption data,
4081                                                                                         as defined in the spec.         */
4082        uint8_t             cHighByte   /*  [in] 8 bits of closed caption data
4083                                                                                         to insert.  This is the "high
4084                                                                                         byte" of closed caption data,
4085                                                                                         as defined in the spec.         */
4086);
4087
4088
4089/*****************************************************************************
4090  Summary:
4091    Clears CC data in the supplied field data
4092
4093  Description:
4094    This function flags a field data structure as having no closed caption
4095        data.  It effectively undoes the action of BVBI_Field_SetCCData_isr().
4096
4097  Returns:
4098        BERR_SUCCESS              - The function call succeeded.
4099        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4100                                                            possibly NULL.
4101 *****************************************************************************/
4102BERR_Code BVBI_Field_ClearCCData_isr(
4103        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4104);
4105
4106
4107/*****************************************************************************
4108  Summary:
4109    Gets CGMS-A data from the supplied field data
4110
4111  Description:
4112    This function extracts one field's worth of CGMS-A data from a
4113    BVBI_Field_Handle structure.  That field data may come from
4114    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4115
4116  Returns:
4117        BERR_SUCCESS              - The function call succeeded.
4118        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4119                                                            possibly NULL.
4120        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4121                                                                BVBI_Field_GetErrorInfo_isr for further info.
4122 *****************************************************************************/
4123BERR_Code BVBI_Field_GetCGMSAData_isr(
4124        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4125                                                                                         object                        */
4126        uint32_t         *pulCGMSData   /* [out] A pointer to a 32-bit int for
4127                                                                                         CGMS-A data                   */
4128);
4129/* Backward compatibility, DEPRECATED! */
4130#define BVBI_Field_GetCGMSData_isr BVBI_Field_GetCGMSAData_isr
4131
4132
4133/*****************************************************************************
4134  Summary:
4135    Gets CGMS-B data from the supplied field data
4136
4137  Description:
4138    This function extracts one field's worth of CGMS-B data from a
4139    BVBI_Field_Handle structure.  That field data may come from
4140    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4141
4142  Returns:
4143        BERR_SUCCESS              - The function call succeeded.
4144        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4145                                                            possibly NULL.
4146        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4147                                                                BVBI_Field_GetErrorInfo_isr for further info.
4148 *****************************************************************************/
4149BERR_Code BVBI_Field_GetCGMSBData_isr(
4150        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4151                                                                                         object                        */
4152        BAVC_VBI_CGMSB_Datum*  pDatum   /* [out] CGMS-B data contained in
4153                                             the above field handle.       */
4154);
4155
4156
4157/*****************************************************************************
4158  Summary:
4159    Sets CGMS-A data in the supplied field data
4160
4161  Description:
4162    This function writes one field's worth of CGMS-A data to a
4163    BVBI_Field_Handle structure.  That field data may come from
4164    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4165    encoded using BVBI_Encode_Data_isr.
4166
4167  Returns:
4168        BERR_SUCCESS              - The function call succeeded.
4169        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4170                                                            possibly NULL.
4171 *****************************************************************************/
4172BERR_Code BVBI_Field_SetCGMSAData_isr(
4173        BVBI_Field_Handle fieldHandle,  /* [in] A valid BVBI_Field_Handle object */
4174        uint32_t           ulCGMSData   /* [in] A 32-bit int containing CGMS-A
4175                                                                                        data                             */
4176);
4177/* Backward compatibility, DEPRECATED! */
4178#define BVBI_Field_SetCGMSData_isr BVBI_Field_SetCGMSAData_isr
4179
4180
4181/*****************************************************************************
4182  Summary:
4183    Sets CGMS-B data in the supplied field data
4184
4185  Description:
4186    This function writes one field's worth of CGMS-B data to a
4187    BVBI_Field_Handle structure.  That field data may come from
4188    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4189    encoded using BVBI_Encode_Data_isr.
4190
4191  Returns:
4192        BERR_SUCCESS              - The function call succeeded.
4193        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4194                                                            possibly NULL.
4195 *****************************************************************************/
4196BERR_Code BVBI_Field_SetCGMSBData_isr(
4197        BVBI_Field_Handle fieldHandle,  /* [in] A valid BVBI_Field_Handle object */
4198        BAVC_VBI_CGMSB_Datum*  pDatum   /* [in] CGMS-B data to copy in to the
4199                                                 above field handle.             */
4200);
4201
4202
4203/*****************************************************************************
4204  Summary:
4205    Clears CGMS-A data in the supplied field data
4206
4207  Description:
4208    This function flags a field data structure as having no closed caption
4209        data.  It effectively undoes the action of BVBI_Field_SetCGMSAData_isr().
4210
4211  Returns:
4212        BERR_SUCCESS              - The function call succeeded.
4213        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4214                                                            possibly NULL.
4215 *****************************************************************************/
4216BERR_Code BVBI_Field_ClearCGMSAData_isr(
4217        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4218);
4219/* Backward compatibility, DEPRECATED! */
4220#define BVBI_Field_ClearCGMSData_isr BVBI_Field_ClearCGMSAData_isr
4221
4222
4223/*****************************************************************************
4224  Summary:
4225    Clears CGMS-B data in the supplied field data
4226
4227  Description:
4228    This function flags a field data structure as having no closed caption
4229        data.  It effectively undoes the action of BVBI_Field_SetCGMSBData_isr().
4230
4231  Returns:
4232        BERR_SUCCESS              - The function call succeeded.
4233        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4234                                                            possibly NULL.
4235 *****************************************************************************/
4236BERR_Code BVBI_Field_ClearCGMSBData_isr(
4237        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4238);
4239
4240
4241/*****************************************************************************
4242  Summary:
4243    Gets WSS data from the supplied field data
4244
4245  Description:
4246    This function extracts one field's worth of WSS data from a
4247    BVBI_Field_Handle structure.  That field data may come from
4248    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4249
4250  Returns:
4251        BERR_SUCCESS              - The function call succeeded.
4252        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4253                                                            possibly NULL.
4254        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4255                                                                BVBI_Field_GetErrorInfo_isr for further info.
4256 *****************************************************************************/
4257BERR_Code BVBI_Field_GetWSSData_isr(
4258        BVBI_Field_Handle fieldHandle,  /* [in] A valid BVBI_Field_Handle object */
4259        uint16_t          *pusWSSData   /* [in] A pointer to a 16-bit int for
4260                                                                                        WSS data                         */
4261);
4262
4263
4264/*****************************************************************************
4265  Summary:
4266    Sets WSS data in the supplied field data
4267
4268  Description:
4269    This function writes one field's worth of WSS data to a
4270    BVBI_Field_Handle structure.  That field data may come from
4271    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4272    encoded using BVBI_Encode_Data_isr.
4273
4274  Returns:
4275        BERR_SUCCESS              - The function call succeeded.
4276        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4277                                                            possibly NULL.
4278 *****************************************************************************/
4279BERR_Code BVBI_Field_SetWSSData_isr(
4280        BVBI_Field_Handle fieldHandle,  /* [in] A valid BVBI_Field_Handle object */
4281        uint16_t            usWSSData   /* [in] A 16-bit int containing WSS data */
4282);
4283
4284
4285/*****************************************************************************
4286  Summary:
4287    Clears WSS data in the supplied field data
4288
4289  Description:
4290    This function flags a field data structure as having no closed caption
4291        data.  It effectively undoes the action of BVBI_Field_SetWSSData_isr().
4292
4293  Returns:
4294        BERR_SUCCESS              - The function call succeeded.
4295        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4296                                                            possibly NULL.
4297 *****************************************************************************/
4298BERR_Code BVBI_Field_ClearWSSData_isr(
4299        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4300);
4301
4302
4303/*****************************************************************************
4304  Summary:
4305    Gets teletext data from the supplied field data
4306
4307  Description:
4308    This function extracts one field's worth of teletext data from a
4309    BVBI_Field_Handle structure.  That field data may come from
4310    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4311
4312  Returns:
4313        BERR_SUCCESS              - The function call succeeded.
4314        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4315                                                            possibly NULL.  In particular, if there are
4316                                                                more than ttLine's of teletext data waiting for
4317                                                                the caller, then this function will fail
4318                                                                completely and return this error code.
4319        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4320                                                                allocation to call this function.  The
4321                                                                allocation should have been done by calling
4322                                                                BVBI_Field_TT_Allocate.
4323        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4324                                                                BVBI_Field_GetErrorInfo_isr for further info.
4325 *****************************************************************************/
4326BERR_Code BVBI_Field_GetTTData_isr ( 
4327        BVBI_Field_Handle fieldHandle, /*  [in] A valid BVBI_Field_Handle object */
4328        int                    nLines, /*  [in] The number of entries in the
4329                                                                                        following array                  */
4330        BAVC_VBI_TT_Line *    ttLines  /* [out] An array of teletext data
4331                                                                                        structures..  Each element of
4332                                                                                        the array is a line of teletext
4333                                                                                        data.  If an element has a
4334                                                                                        ucFramingCode attribute equal
4335                                                                                        to
4336                                                                                        BVBI_TT_INVALID_FRAMING_CODE,
4337                                                                                        then that line of data is
4338                                                                                        invalid or not present.          */
4339);
4340
4341
4342/*****************************************************************************
4343  Summary:
4344    Gets Gemstar data from the supplied field data
4345
4346  Description:
4347    This function extracts one field's worth of Gemstar data from a
4348    BVBI_Field_Handle structure.  That field data may come from
4349    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4350
4351  Returns:
4352        BERR_SUCCESS              - The function call succeeded.
4353        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4354                                                            possibly NULL.  In particular, if there are
4355                                                                more than ttLine's of Gemstar data waiting for
4356                                                                the caller, then this function will fail
4357                                                                completely and return this error code.
4358        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4359                                                                allocation to call this function.  The
4360                                                                allocation should have been done by calling
4361                                                                BVBI_Field_GS_Allocate.
4362        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4363                                                                BVBI_Field_GetErrorInfo_isr for further info.
4364 *****************************************************************************/
4365BERR_Code BVBI_Field_GetGSData_isr ( 
4366        BVBI_Field_Handle fieldHandle, /*  [in] A valid BVBI_Field_Handle object */
4367        BAVC_VBI_GSData *      pGSData /* [out] One field's worth of Gemstar
4368                                                data.                            */
4369);
4370
4371
4372/*****************************************************************************
4373  Summary:
4374    Sets teletext data in the supplied field data
4375
4376  Description:
4377    This function writes one field's worth of teletext data to a
4378    BVBI_Field_Handle structure.  That field data may come from
4379    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4380    encoded using BVBI_Encode_Data_isr.
4381
4382  Returns:
4383        BERR_SUCCESS              - The function call succeeded.
4384        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4385                                                            possibly NULL.
4386        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4387                                                                allocation to call this function.  The
4388                                                                allocation should have been done by calling
4389                                                                BVBI_Field_TT_Allocate.
4390 *****************************************************************************/
4391BERR_Code BVBI_Field_SetTTData_isr ( 
4392        BVBI_Field_Handle fieldHandle, /*  [in] A valid BVBI_Field_Handle object */
4393        BFMT_VideoFmt    eVideoFormat, /*  [in] The video standard in use. 
4394                                                                                        Determines line width.           */
4395        int                    nLines, /*  [in] The number of entries in the
4396                                                                                        following array                  */
4397        BAVC_VBI_TT_Line *    ttLines  /*  [in] An array of teletext data
4398                                                                                        structures..  Each element of
4399                                                                                        the array is a line of teletext
4400                                                                                        data.  If an element has a
4401                                                                                        ucFramingCode attribute equal
4402                                                                                        to
4403                                                                                        BVBI_TT_INVALID_FRAMING_CODE,
4404                                                                                        then that line of data will not
4405                                                                                        be encoded.                      */
4406);
4407
4408
4409/*****************************************************************************
4410  Summary:
4411    Sets Gemstar data in the supplied field data
4412
4413  Description:
4414    This function writes one field's worth of Gemstar data to a
4415    BVBI_Field_Handle structure.  That field data may come from
4416    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4417    encoded using BVBI_Encode_Data_isr.
4418
4419  Returns:
4420        BERR_SUCCESS              - The function call succeeded.
4421        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4422                                                            possibly NULL.
4423        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4424                                                                allocation to call this function.  The
4425                                                                allocation should have been done by calling
4426                                                                BVBI_Field_TT_Allocate.
4427 *****************************************************************************/
4428BERR_Code BVBI_Field_SetGSData_isr ( 
4429        BVBI_Field_Handle fieldHandle, /*  [in] A valid BVBI_Field_Handle object */
4430        BAVC_VBI_GSData *      pGSData /*  [in] One field's worth of Gemstar
4431                                                data.                            */
4432);
4433
4434
4435/*****************************************************************************
4436  Summary:
4437    Clears teletext data in the supplied field data
4438
4439  Description:
4440    This function flags a field data structure as having no teletext
4441        data.  It effectively undoes the action of BVBI_Field_SetTTData_isr().
4442
4443  Returns:
4444        BERR_SUCCESS              - The function call succeeded.
4445        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4446                                                            possibly NULL.
4447 *****************************************************************************/
4448BERR_Code BVBI_Field_ClearTTData_isr(
4449        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4450);
4451
4452
4453/*****************************************************************************
4454  Summary:
4455    Clears Gemstar data in the supplied field data
4456
4457  Description:
4458    This function flags a field data structure as having no Gemstar
4459        data.  It effectively undoes the action of BVBI_Field_SetGSData_isr().
4460
4461  Returns:
4462        BERR_SUCCESS              - The function call succeeded.
4463        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4464                                                            possibly NULL.
4465 *****************************************************************************/
4466BERR_Code BVBI_Field_ClearGSData_isr(
4467        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4468);
4469
4470
4471/*****************************************************************************
4472  Summary:
4473    Gets VPS data from the supplied field data
4474
4475  Description:
4476    This function extracts one field's worth of VPS data from a
4477    BVBI_Field_Handle structure.  That field data may come from
4478    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4479
4480  Returns:
4481        BERR_SUCCESS              - The function call succeeded.
4482        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4483                                                            possibly NULL.
4484        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4485                                                                allocation to call this function.  The
4486                                                                allocation should have been done by calling
4487                                                                BVBI_Field_VPS_Allocate.
4488        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4489                                                                BVBI_Field_GetErrorInfo_isr for further info.
4490 *****************************************************************************/
4491BERR_Code BVBI_Field_GetVPSData_isr(
4492        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4493                                                                                         object                      */
4494        BAVC_VBI_VPSData    *pVPSData   /* [out] A pointer to a the VPS data */
4495);
4496
4497
4498/*****************************************************************************
4499  Summary:
4500    Sets VPS data in the supplied field data
4501
4502  Description:
4503    This function writes one field's worth of VPS data to a
4504    BVBI_Field_Handle structure.  That field data may come from
4505    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4506    encoded using BVBI_Encode_Data_isr.
4507
4508  Returns:
4509        BERR_SUCCESS              - The function call succeeded.
4510        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4511                                                            possibly NULL.
4512        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4513                                                                allocation to call this function.  The
4514                                                                allocation should have been done by calling
4515                                                                BVBI_Field_VPS_Allocate.
4516 *****************************************************************************/
4517BERR_Code BVBI_Field_SetVPSData_isr(
4518        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4519                                                                                         object                      */
4520        BAVC_VBI_VPSData    *pVPSData   /* [out] A pointer to a the VPS data */
4521);
4522
4523
4524/*****************************************************************************
4525  Summary:
4526    Clears VPS data in the supplied field data
4527
4528  Description:
4529    This function flags a field data structure as having no closed caption
4530        data.  It effectively undoes the action of BVBI_Field_SetVPSData_isr().
4531
4532  Returns:
4533        BERR_SUCCESS              - The function call succeeded.
4534        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4535                                                            possibly NULL.
4536 *****************************************************************************/
4537BERR_Code BVBI_Field_ClearVPSData_isr(
4538        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4539);
4540
4541
4542/*****************************************************************************
4543  Summary:
4544    Gets AMOL data from the supplied field data
4545
4546  Description:
4547    This function extracts one field's worth of AMOL data from a
4548    BVBI_Field_Handle structure.  That field data may come from
4549    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4550
4551        The AMOL data byte array is converted to a waveform as follows.
4552         - 0x01 0x00 0x00 ...
4553           This is the pulse that occurs earliest in time.
4554         - 0x80 0x00 0x00 ...
4555           This is a pulse that occurs later in time than above.
4556         - 0x00 0x01 0x00 ...
4557           This is a pulse that occurs later in time than above.
4558         - and so forth.
4559
4560  Returns:
4561        BERR_SUCCESS              - The function call succeeded.
4562        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4563                                                            possibly NULL.
4564        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4565                                                                allocation to call this function.  The
4566                                                                allocation should have been done by calling
4567                                                                BVBI_Field_AMOL_Allocate.
4568        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4569                                                                BVBI_Field_GetErrorInfo_isr for further info.
4570 *****************************************************************************/
4571BERR_Code BVBI_Field_GetAMOLData_isr(
4572        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4573                                                                                         object                          */
4574        BVBI_AMOL_Type     *pAmolType,  /* [out] Which type of AMOL data is
4575                                                 returned.                       */
4576        uint8_t            *pAMOLData,  /* [out] A pointer to up to 24 bytes
4577                                                 of AMOL data. See Description
4578                                                                                         section for details.            */
4579    unsigned int*         pLength       /* [out] size of data pointed to by
4580                                                 pAMOLData in bytes              */
4581);
4582
4583
4584/*****************************************************************************
4585  Summary:
4586    Gets multi-line closed caption data from the supplied field data
4587
4588  Description:
4589    This function extracts one field's worth of multi-line closed
4590        caption data from a BVBI_Field_Handle structure.  That field data
4591        may come from BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4592
4593  Returns:
4594        BERR_SUCCESS              - The function call succeeded.
4595        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4596                                                            possibly NULL.
4597        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4598                                                                BVBI_Field_GetErrorInfo_isr for further info.
4599 *****************************************************************************/
4600BERR_Code BVBI_Field_GetMCCData_isr(
4601        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4602                                                                                         object                          */
4603        BAVC_VBI_MCCData*   pMCCData    /* [out] A pointer to multi-line closed
4604                                                   caption data.                 */
4605);
4606
4607
4608/*****************************************************************************
4609  Summary:
4610    Gets SCTE data from the supplied field data
4611
4612  Description:
4613    This function extracts one field's worth of SCTE data from a
4614    BVBI_Field_Handle structure.  That field data may come from
4615    BVBI_Decode_Data_isr or BVBI_Field_Create originally.
4616
4617  Returns:
4618        BERR_SUCCESS              - The function call succeeded.
4619        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4620                                                            possibly NULL.
4621        BVBI_ERR_FLDH_CONFLICT    - The supplied BVBI_SCTE_Data does not have
4622                                    room to hold the SCTE data in the field
4623                                                                handle.
4624        BVBI_ERR_FIELD_NODATA     - No SCTE data in the field handle.
4625        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4626                                                                BVBI_Field_GetErrorInfo_isr for further info.
4627 *****************************************************************************/
4628BERR_Code BVBI_Field_GetSCTEData_isr(
4629        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4630                                                                                         object                          */
4631        BVBI_SCTE_Data     *pScteData   /* [out] A pointer to SCTE data. For
4632                                                 each data pointer element in
4633                                                                                         this stuct, if the
4634                                                                                         corresponding _size element is
4635                                                                                         checcked to determine if there
4636                                                                                         is room to copy out the data.
4637                                                                                         Because of this complexity, it
4638                                                                                         is probably required to call
4639                                                                                         BVBI_Field_GetSCTEData_Size_isr
4640                                                                                         prior to calling
4641                                                                                         BVBI_Field_GetSCTEData_isr.     */
4642);
4643
4644
4645/*****************************************************************************
4646  Summary:
4647    Gets SCTE count information from the supplied field data
4648
4649  Description:
4650    This function discloses how much SCTE data is contained in a
4651    BVBI_Field_Handle structure.  The information returned is the
4652        amount of useful data, NOT the maximum holding capacity of
4653        the structure.
4654
4655  Returns:
4656        BERR_SUCCESS              - The function call succeeded.
4657        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4658                                                            possibly NULL.
4659        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4660                                                                BVBI_Field_GetErrorInfo_isr for further info.
4661 *****************************************************************************/
4662BERR_Code BVBI_Field_GetSCTEData_Count_isr(
4663        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4664                                                                                         object                          */
4665        size_t*   pcc_count,            /* [out] Number of meaningful SCTE
4666                                                 closed caption data entries in
4667                                                                                         the field handle.               */
4668        size_t* pnrtv_count,            /* [out] Number of meaningful SCTE
4669                                                 NRTV data entries in the field
4670                                                                                         handle.                         */
4671        size_t*  ppam_count,            /* [out] Number of meaningful SCTE PAM
4672                                                 data bytes in the field handle. */
4673        size_t* pmono_count             /* [out] Number of meaningful SCTE
4674                                                 monochrome bytes contained in
4675                                                                                         each of the two monochrome data
4676                                                                                         line stores, in the field
4677                                                                                         handle.                         */
4678);
4679
4680
4681/*****************************************************************************
4682  Summary:
4683    Gets SCTE count information from the supplied field data
4684
4685  Description:
4686    This function discloses the capacity to hold SCTE data in a
4687    BVBI_Field_Handle structure.  The information returned is the
4688        amount of space available, NOT the amount of useful data currently in
4689        the structure.
4690
4691  Returns:
4692        BERR_SUCCESS              - The function call succeeded.
4693        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4694                                                            possibly NULL.
4695        BVBI_ERR_FIELD_BADDATA    - Requested data has a problem.  Call
4696                                                                BVBI_Field_GetErrorInfo_isr for further info.
4697 *****************************************************************************/
4698BERR_Code BVBI_Field_GetSCTEData_Size_isr(
4699        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4700                                                                                         object                          */
4701        size_t*    pcc_size,            /* [out] Number of meaningful SCTE
4702                                                 closed caption data entries
4703                                             that the field handle can hold. */
4704        size_t*  pnrtv_size,            /* [out] Number of SCTE NRTV data
4705                                                 entries that the field handle
4706                                                                                         can hold.                       */
4707        size_t*   ppam_size,            /* [out] Number of SCTE PAM data bytes
4708                                                 that the field handle can hold. */
4709        size_t*  pmono_size             /* [out] Number of SCTE monochrome bytes
4710                                                 contained in each of the two
4711                                                                                         monochrome data line stores,
4712                                                                                         that the field handle can hold. */
4713);
4714
4715
4716/*****************************************************************************
4717  Summary:
4718    Sets AMOL data in the supplied field data
4719
4720  Description:
4721    This function writes one field's worth of AMOL data to a
4722    BVBI_Field_Handle structure.  That field data may come from
4723    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4724    encoded using BVBI_Encode_Data_isr.
4725
4726  Returns:
4727        BERR_SUCCESS              - The function call succeeded.
4728        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4729                                                            possibly NULL.
4730        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4731                                                                allocation to call this function.  The
4732                                                                allocation should have been done by calling
4733                                                                BVBI_Field_AMOL_Allocate.
4734 *****************************************************************************/
4735BERR_Code BVBI_Field_SetAMOLData_isr(
4736        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4737                                                                                         object                          */
4738        BVBI_AMOL_Type        amolType, /*  [in] Which type of AMOL data is
4739                                                 supplied.                       */
4740        uint8_t             *pAMOLData, /*  [in] A pointer to up to 24 bytes
4741                                                 of AMOL data. See
4742                                                                                         BVBI_Field_GetAMOLData_isr()
4743                                                                                         for details about this data.    */
4744    unsigned int            length      /*  [in] size of data pointed to by
4745                                                 pAMOLData in bytes              */
4746);
4747
4748
4749/*****************************************************************************
4750  Summary:
4751    Sets multi-line closed caption data in the supplied field data
4752
4753  Description:
4754    This function writes one field's worth of multi-line closed
4755        caption data to a BVBI_Field_Handle structure.  That field data
4756        may come from BVBI_Decode_Data_isr or BVBI_Field_Create
4757        originally.  It may be encoded using BVBI_Encode_Data_isr.
4758
4759  Returns:
4760        BERR_SUCCESS              - The function call succeeded.
4761        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4762                                                            possibly NULL.
4763 *****************************************************************************/
4764BERR_Code BVBI_Field_SetMCCData_isr(
4765        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4766                                                                                         object                          */
4767        BAVC_VBI_MCCData*    pMCCData   /*  [in] A pointer to multi-line closed
4768                                                 caption data.                   */
4769);
4770
4771
4772/*****************************************************************************
4773  Summary:
4774    Sets SCTE data in the supplied field data
4775
4776  Description:
4777    This function writes one field's worth of SCTE data to a
4778    BVBI_Field_Handle structure.  That field data may come from
4779    BVBI_Decode_Data_isr or BVBI_Field_Create originally.  It may be
4780    encoded using BVBI_Encode_Data_isr.
4781
4782  Returns:
4783        BERR_SUCCESS              - The function call succeeded.
4784        BERR_INVALID_PARAMETER    - One of the supplied parameters was invalid,
4785                                                            possibly NULL.
4786        BVBI_ERR_FLDH_CONFLICT    - The field handle does not have the proper
4787                                                                allocation to call this function.  The
4788                                                                allocation should have been done by calling
4789                                                                BVBI_Field_SCTE_Allocate.
4790 *****************************************************************************/
4791BERR_Code BVBI_Field_SetSCTEData_isr(
4792        BVBI_Field_Handle fieldHandle,  /*  [in] A valid BVBI_Field_Handle
4793                                                                                         object                      */
4794        BVBI_SCTE_Data      *pScteData  /*  [in] SCTE data to apply.         */
4795);
4796
4797
4798/*****************************************************************************
4799  Summary:
4800    Clears AMOL data in the supplied field data
4801
4802  Description:
4803    This function flags a field data structure as having no closed caption
4804        data.  It effectively undoes the action of BVBI_Field_SetAMOLData_isr().
4805
4806  Returns:
4807        BERR_SUCCESS              - The function call succeeded.
4808        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4809                                                            possibly NULL.
4810 *****************************************************************************/
4811BERR_Code BVBI_Field_ClearAMOLData_isr(
4812        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4813);
4814
4815
4816/*****************************************************************************
4817  Summary:
4818    Clears multi-line closed caption data in the supplied field data
4819
4820  Description:
4821    This function flags a field data structure as having no closed caption
4822        data.  It effectively undoes the action of BVBI_Field_SetMCCData_isr().
4823
4824  Returns:
4825        BERR_SUCCESS              - The function call succeeded.
4826        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4827                                                            possibly NULL.
4828 *****************************************************************************/
4829BERR_Code BVBI_Field_ClearMCCData_isr(
4830        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4831);
4832
4833
4834/*****************************************************************************
4835  Summary:
4836    Clears SCTE data in the supplied field data
4837
4838  Description:
4839    This function flags a field data structure as having no closed caption
4840        data.  It effectively undoes the action of BVBI_Field_SetSCTEData_isr().
4841
4842  Returns:
4843        BERR_SUCCESS              - The function call succeeded.
4844        BERR_INVALID_PARAMETER    - The supplied parameter was invalid,
4845                                                            possibly NULL.
4846 *****************************************************************************/
4847BERR_Code BVBI_Field_ClearSCTEData_isr(
4848        BVBI_Field_Handle fieldHandle   /* [in] A valid BVBI_Field_Handle object */
4849);
4850
4851
4852/*****************************************************************************
4853  Summary:
4854    Translates a CGMS-A data word into a WSS data word.
4855
4856  Description:
4857        This function accepts a 13-bit integer and encodes
4858        it into a 32-bit integer, using the bi-phase-L coding
4859        (modulation coding) specified in IEC-62375, and in the WSS
4860        specifications. This function is designed to allow the CGMSAE
4861        hardware core to be used to create the "WSS-like" waveform
4862        specified by IEC-62375, at the video standard 576P. In
4863        this scenario, the user has a 13-bit integer that he would
4864        like to send out according to IEC-62375. He first calls
4865        this function to obtain a corresponding 32-bit value. He
4866        then sends this 32-bit value to the CGMSAE encoder core,
4867        with the usual function BVBI_Field_SetCGMSData_isr().
4868
4869  Returns:
4870        32-bit equivalent of the input argument, with bi-phase-L coding.
4871 *****************************************************************************/
4872uint32_t BVBI_WSS2CGMS (
4873        uint16_t wssData        /* [in] The 13-bit value to be encoded,
4874                                    right-justified.                             */
4875);
4876
4877/*****************************************************************************
4878 * Public convenience functions
4879 *****************************************************************************/
4880/* Debug code */
4881#if 0
4882void BVBI_Field_Check(BVBI_Field_Handle fieldHandle);
4883#endif
4884
4885#ifdef __cplusplus
4886}
4887#endif
4888
4889#endif /* #ifndef BVBI_H__ */
4890
4891/* end of file */
Note: See TracBrowser for help on using the repository browser.