source: svn/newcon3bcm2_21bu/nexus/app/bsettop_stream.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: 6.1 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2005, 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_stream.h $
11 * $brcm_Revision: 4 $
12 * $brcm_Date: 8/10/05 3:17p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /BSEAV/api/include/bsettop_stream.h $
19 ***************************************************************************/
20#ifndef BSETTOP_STREAM_H__
21#define BSETTOP_STREAM_H__
22
23#include "bapp_types.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/*
30Summary:
31Maximum number of video or audio programs which the bstream_mpeg data structure stores.
32stores.
33Description:
34If your application needs more, you'll need to override this value.
35*/
36#define BSETTOP_MAX_PROGRAMS 1
37/*
38Summary:
39        Maximum number of streams.
40*/
41
42#define BSETTOP_MAX_STREAMS 3
43
44/*
45Summary:
46        Beginning PID channel for video.
47*/
48#define B_VIDEO_PIDCH   0
49/*
50Summary:
51        PCR PID channel.
52*/
53#define B_PCR_PIDCH             6
54/*
55Summary:
56        DMA PID channel for video.
57*/
58#define B_DMA_PIDCH             7
59/*
60Summary:
61        PCR PID channel for audio.
62*/
63#define B_AUDIO_PIDCH   7
64
65/*
66Summary:
67        Default transport parser band from internal tuner/demodulator.
68*/
69
70#define DEF_PARSER_BAND 0
71
72/*
73Summary:
74        Macro to set playback parser band flag.  i.e BSETTOP_PB_PARSER(DEF_PARSER_BAND).
75*/
76
77#define BSETTOP_PB_PARSER( x )     ( ( x ) | 0x8000 )
78
79/*
80Summary:
81        Invalid PID channel definition.
82*/
83
84#define B_INVALID_PIDCH     ((unsigned int)-1)
85
86/*
87Summary:
88        A stream is either a digital or analog program which can be decoded or recorded.
89Description:
90        Streams are produced by one of the following:
91                - tuning linein or rf (btuner_tune_rf or btuner_tune_linein)
92                - tuning digital and selecting mpeg params (btuner_tune_qpsk/qam and bstream_set_mpeg)
93                - starting playback (bplay_start)
94                - direct transport input (bstream_set)
95*/
96typedef struct bstream *bstream_t;
97
98/*
99Summary:
100MPEG parameters for a single program with the same pcr pid which are passed to bstream_open and bplayback_start.
101
102Description:
103The reason for multiple video and audio pids is to support multiple elementary
104streams within the same program. All video and audio pids should use the same
105pcr pid.
106
107Multiple audio elementary streams are needed for multiple language support (i.e. English
108and Spansih). Multiple video elementary streams might be needed for multiple
109viewing angles of the same program.
110
111You should not use this structure to store mutliple programs for channel change.
112Each "channel" should have its own bstream_mpeg structure because each channel
113has its own pcr pid.
114
115For PES decode the pid value is used to represent the PES packet id.  Typically this
116will be 0xE0 for video, 0xC0 for mpeg audio, and 0xBD for ac3 audio. 
117
118For VOB decode, video and mpeg audio type streams are handled identically to a PES
119based decode.  AC3 and DTS tracks ares slightly different as the upper 8 bits
120of the pid value represent the substream id that is to be decoded.  For example:
121pid==0x00BD would correspond to AC3/DTS track 0, while 0x01BD would correspond to
122AC3/DTS track 1.
123*/
124typedef struct bstream_mpeg {
125  struct {
126        uint16_t pid;
127        uint8_t format;
128  } video[BSETTOP_MAX_PROGRAMS];        /* video stream pids */
129  struct {
130        uint16_t pid;
131        uint8_t format;
132  } audio[BSETTOP_MAX_PROGRAMS];        /* audio stream pids */
133  uint16_t pcr_pid;
134} bstream_mpeg;
135
136/*
137Summary:
138Stream structure provides access to band, program PIDs and currently assigned PID channels.
139
140Description:
141
142*/
143
144
145/*
146Summary:
147        Required to initialize int bstream_mpeg data structure.
148*/
149void bstream_mpeg_init(
150        bstream_mpeg *mpeg              /* [out] */
151        );
152
153/**
154Summary:
155Dynamically create a digital stream using a band and mpeg parameters.
156
157Description:
158This is used for digital streams which are created from a tuned band or streamer band.
159The application supplies MPEG parameters which are obtained from scanning PSI information
160or stored separately.
161
162On some platforms, you can call bstream_open on the same band more than once. In this case,
163the transport block routes the data from one input band to multiple parser bands.
164
165You must call bstream_close to release resources.
166**/
167bstream_t bstream_open(
168        bband_t band,   /* input band */
169        const bstream_mpeg *mpegparams  /* MPEG pids to filter */
170        );
171
172/*
173 * Summary:
174 *     Digital stream status returned by bstream_get_mpeg_parameters.
175 *     **/
176typedef struct bstream_status {
177        bband_t band;
178        uint32_t stc;
179        uint32_t pcr;
180        bstream_mpeg mpeg;
181        unsigned long tsrate;   /* in bits per second */
182} bstream_status;
183
184/**
185 * Summary:
186 *    Get status information from a digital stream.
187 *  Description:
188 *      This is useful for getting MPEG parameters from an encoded stream
189 *      where the bsettop_mpeg structure
190 *  is created internally.
191 **/
192
193bresult
194bstream_get_status(
195                    bstream_t stream,
196                        bstream_status *status  /* [out]*/
197                        );
198
199
200/*
201 * Summary:
202 *     Global transport configuration settings.
203 *     **/
204typedef struct bstream_config {
205        unsigned int cdb_size;          /* CDB Size in bytes */
206        unsigned int itb_size;          /* ITB Size in bytes */
207} bstream_config;
208
209/**
210 * Summary:
211 *        Get global transport configuraiton settings.
212 **/
213
214bresult
215bstream_get_config(
216                        bstream_config *config  /* [out]*/
217                        );
218
219/**
220 * Summary:
221 *        Set global transport configuraiton settings.
222 **/
223
224bresult
225bstream_set_config(
226                        bstream_config *config  /* [in]*/
227                        );
228
229/**
230Summary:
231Close a stream.
232
233Description:
234This is required if you use bstream_open to obtain a stream.
235This is allowed but not required if you get an analog stream from btuner or
236any stream from bplayback or bplaypump.
237**/
238void bstream_close(
239        bstream_t stream        /* Handle returned by bstream_open, btuner_tune_rf,
240                                                        btuner_tune_linein or bplayback_start. */
241        );
242
243
244/**
245Summary:
246Callback function after XPT interrupt fires
247
248Description:
249This allows a function to be called after an interrupt fires.
250**/
251void bstream_callback(
252                void *data
253         );
254
255
256
257#ifdef __cplusplus
258}
259#endif
260
261#endif /* BSETTOP_STREAM_H__ */
262
263
Note: See TracBrowser for help on using the repository browser.