source: svn/newcon3bcm2_21bu/BSEAV/api/include/bsettop_vbi.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 8.9 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2008, 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: bsettop_vbi.h $
11 * $brcm_Revision: 6 $
12 * $brcm_Date: 3/20/08 5:12p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /BSEAV/api/include/bsettop_vbi.h $
19 *
20 * 6   3/20/08 5:12p vsilyaev
21 * PR 40468: Updated description of the bdisplay_vbi_tt_write
22 *
23 * PR8365/1   2/15/06 8:29p shyam
24 * PR 8365 : Put in CC708 changes for efficiently handling cc708 and demux
25 * 608 data and 708 data
26 *
27 * 4   2/13/06 3:35p katrep
28 * PR18943: added bdisplay_vbi_tt_write and bstream_vbi_tt_read (not
29 * implemented)
30 *
31 * 3   10/28/05 7:55p rjlewis
32 * PR17043: Added ability to disable CGMS and WSS output.
33 * Added ability to determine if CGMS & WSS output is enabled.
34 *
35 * 2   3/21/05 9:06a erickson
36 * PR13306: added cgms and wss set functions
37 *
38 * 1   2/7/05 7:07p dlwin
39 * Merge down for release 2005_REFSW_MERGETOMAIN:
40 *
41 * Irvine_BSEAVSW_Devel/5   2/3/05 12:59p erickson
42 * PR13305: added bdisplay_vbi_cc_write api
43 *
44 * Irvine_BSEAVSW_Devel/4   11/16/04 1:01p shyam
45 * PR 8365 : Changed for supporting CC708
46 *
47 * Irvine_BSEAVSW_Devel/3   7/6/04 3:54p erickson
48 * PR11771: settop api dataflow redesign
49 *
50 * Irvine_BSEAVSW_Devel/2   6/29/04 11:28a erickson
51 * PR11135: updated deprecation notices for settop api
52 *
53 * Irvine_BSEAVSW_Devel/1   11/14/03 2:10p erickson
54 * PR8612: added vbi support to settop api
55 *
56 ***************************************************************************/
57#ifndef BSETTOP_VBI_H__
58#define BSETTOP_VBI_H__
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64/*=****************************************
65The vbi api supports close captioning, teletext and other formats.
66You can decode and capture vbi from an analog or digital stream.
67You can route the vbi information out to certain analog displays (e.g. composite and
68svideo)
69or capture it as data for use by the application.
70
71After getting a new stream (either from btuner_tune_XXX or from bstream_open), all
72vbi outputs default to off. You must explicitly turn each output by assigning
73display handles to the bstream_vbi_settings structure.
74
75The reason we default vbi to off is that the settop api cannot guess the correct
76output in certain configurations. Consider a PIP system. You have two decodes and
77only one can output vbi at a time. The application must decide.
78*******************************************/
79
80/*
81Summary:
82Settings structure to control decoding, capture and routing of VBI to displays.
83*/
84typedef struct bstream_vbi_settings {
85        struct {
86                bdisplay_t display;     /* if NULL, then disabled */
87                unsigned line;  /* only applies to PAL */
88        } cc;
89        struct {
90                bdisplay_t display;     /* if NULL, then disabled */
91                unsigned lines[10];
92        } tt;
93        struct {
94                bdisplay_t display;     /* if NULL, then disabled */
95        } cgms;
96        struct {
97                bdisplay_t display;     /* if NULL, then disabled */
98        } wss;
99
100        bsettop_callback cc_data_ready_callback; /* Callback when notifies the user
101                when data is available in the bstream_vbi_cc_read function.
102                It is permissible to call bstream_vbi_cc_read from inside the callback. */
103        void *callback_context; /* User defined context which is passed to
104                the above callback. */
105} bstream_vbi_settings;
106
107/*
108Summary:
109Get current vbi settings.
110*/
111void bstream_vbi_get_settings(
112        bstream_t stream,                                       /* analog or digital stream */
113        bstream_vbi_settings *settings  /* [out] */
114        );
115
116/*
117Summary:
118Set new vbi settings.
119*/
120bresult bstream_vbi_set_settings(
121        bstream_t stream,                                       /* analog or digital stream */
122        const bstream_vbi_settings *settings    /* new settings */
123        );
124
125/*
126Summary:
127VBI closed captioning data atom
128*/
129typedef struct bstream_vbi_cc {
130        uint8_t data[2];
131        int field;      /* 0 is top, 1 is bottom */
132        int cc_type;    /* 0/1 means 608, 2/3 means 708 */
133} bstream_vbi_cc;
134
135/*
136Summary:
137Read vbi closed caption data from a stream.
138
139Description:
140This function never blocks. Use the bstream_vbi_settings.cc_data_ready_callback
141callback to know when data is available.
142*/
143bresult bstream_vbi_cc_read(
144        bstream_t stream,                       /* analog or digital stream */
145        bstream_vbi_cc *data,           /* [out,size_is(length)] */
146        size_t length,                          /* # of bstream_vbi_cc's pointed to by data param */
147        size_t *length_read                     /* [out] actual number of bstream_vbi_cc's read into data buffer */
148        );
149
150/*
151Summary:
152CC708 VBI closed captioning data atom
153*/
154typedef struct bstream_cc_708 {
155        uint8_t cc_type;        /* 0/1 means 608, 2/3 means 708 */
156        uint8_t data[2];
157} bstream_cc_708;
158
159/*
160Summary:
161Read CC708 vbi closed caption data from a stream.
162
163Description:
164This function never blocks. Use the bstream_vbi_settings.cc_data_ready_callback
165callback to know when data is available.
166*/
167bresult bstream_vbi_cc708_read(
168        bstream_t stream,                       /* analog or digital stream */
169        bstream_cc_708 *data,           /* [out,size_is(length)] */
170        size_t length,                          /* # of bstream_vbi_cc's pointed to by data param */
171        size_t *length_read                     /* [out] actual number of bstream_vbi_cc's read into data buffer */
172        );
173
174/*
175Summary:
176Write vbi closed caption data for output to the VEC
177
178Description:
179This function never blocks. There is no callback to know when space
180is available, but in general one data item is consumed every field.
181*/
182bresult bdisplay_vbi_cc_write(
183        bdisplay_t display,                     /* display (must be SD format) */
184        const bstream_vbi_cc *data,     /* [size_is(length)] */
185        size_t length,                          /* # of bstream_vbi_cc's pointed to by data param */
186        size_t *length_written          /* The actual number of bstream_vbi_cc's writen
187                                                                        into the display queue. This is used for flow
188                                                                        control. */
189        );
190
191/*
192Summary
193VBI teletext data
194*/
195typedef struct bstream_vbi_tt {
196        uint8_t framingCode;
197        uint8_t data[42];
198}bstream_vbi_tt;
199
200/*
201Summary:
202Read vbi teletext data from a stream.
203
204Description:
205This function never blocks.
206*/
207bresult bstream_vbi_tt_read(
208        bstream_t stream,                       /* analog or digital stream */
209        bstream_vbi_tt *data,           /* [out,size_is(length)] */
210        size_t length,                          /* # of bstream_vbi_cc's pointed to by data param */
211        size_t *length_read                     /* [out] actual number of bstream_vbi_cc's read into data buffer */
212        );
213
214/*
215Summary:
216Write vbi teletext data for output to the VEC
217
218Description:
219This function never blocks. There is no callback to know when space
220is available, but in general one data item is consumed every field. But,
221if the function returns an error, for flowcontrol, the line is not consumed
222and the user should retry.
223*/
224
225
226bresult bdisplay_vbi_tt_write(
227        bdisplay_t display,                     /* display (must be SD format) */
228        const bstream_vbi_tt *data,     /* [size_is(length)] */
229        size_t length,                          /* # of bstream_vbi_cc's pointed to by data param */
230    uint8_t polarity             /* 0 = bottom , 1= top field */
231        );
232
233#define BDISPLAY_VBI_INVALID_CGMS (0xffffffff) /* use to disable CGMS output */
234
235/**
236Summary:
237Set the CGMS value to be encoded into display.
238
239Description:
240This only works if the display is SD and has the VBI encoder.
241On dual output systems, this is usually the SD-only output.
242
243This requires that bstream_vbi_settings.cgms.display is false. Otherwise
244the value will be overwritten by the stream input. Use cgms_value of
245BDISPLAY_VBI_INVALID_CGMS to disable CGMS output.
246**/
247bresult bdisplay_vbi_set_cgms(
248        bdisplay_t display,                     /* display (must be SD format) */
249        uint32_t cgms_value                     /* CGMS value to pass out VBI */
250        );
251
252#define BDISPLAY_VBI_INVALID_WSS (0xffff) /* use to disable WSS output */
253
254/**
255Summary:
256Set the WSS value to be encoded into display.
257
258Description:
259This only works if the display is SD and has the VBI encoder.
260On dual output systems, this is usually the SD-only output.
261
262This requires that bstream_vbi_settings.wss.display is false. Otherwise
263the value will be overwritten by the stream input.  Use wss_value of
264BDISPLAY_VBI_INVALID_WSS to disable WSS output.
265**/
266bresult bdisplay_vbi_set_wss(
267        bdisplay_t display,                     /* display (must be SD format) */
268        uint16_t wss_value                      /* WSS value to pass out VBI */
269        );
270
271/**
272Summary:
273Determine if the CGMS value is being encoded into display.
274
275Description:
276This only works if the display is SD and has the VBI encoder.
277On dual output systems, this is usually the SD-only output.
278
279This requires that bstream_vbi_settings.cgms.display is false.
280**/
281bresult bdisplay_vbi_get_cgms(
282        bdisplay_t display,                     /* display (must be SD format) */
283        bool *enabled
284        );
285
286/**
287Summary:
288Determine if WSS value is being encoded into display.
289
290Description:
291This only works if the display is SD and has the VBI encoder.
292On dual output systems, this is usually the SD-only output.
293
294This requires that bstream_vbi_settings.wss.display is false.
295**/
296bresult bdisplay_vbi_get_wss(
297        bdisplay_t display,                     /* display (must be SD format) */
298        bool *enabled
299        );
300
301#ifdef __cplusplus
302}
303#endif
304
305#endif /* BSETTOP_VBI_H__ */
Note: See TracBrowser for help on using the repository browser.