source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/xpt/7552/bxpt_rave.h

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

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 90.3 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: bxpt_rave.h $
11 * $brcm_Revision: Hydra_Software_Devel/11 $
12 * $brcm_Date: 12/16/11 2:59p $
13 *
14 * Porting interface code for the data transport RAVE engine
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/portinginterface/xpt/base2/bxpt_rave.h $
19 *
20 * Hydra_Software_Devel/11   12/16/11 2:59p gmullen
21 * SW7425-1838: Merged to Hydra
22 *
23 * Hydra_Software_Devel/SW7425-1838/1   12/6/11 5:01p gmullen
24 * SW7425-1838: Ported dynamic splicing to base2 files
25 *
26 * Hydra_Software_Devel/10   12/2/11 10:10a gmullen
27 * SW7231-500: Added support for IEEE 1394 LPCM
28 *
29 * Hydra_Software_Devel/9   10/7/11 9:35a gmullen
30 * SW7425-1427: BXPT_Rave_P_FlowControl returns BERR_NOT_SUPPORTED on
31 * devices that don't require the workaround
32 *
33 * Hydra_Software_Devel/8   9/30/11 12:14p jtna
34 * SW7425-1266: merge BXPT_Rave_AllocCx() and related changes
35 *
36 * Hydra_Software_Devel/7   9/21/11 10:17a gmullen
37 * SW7425-1323: Merged to Hydra
38 *
39 * Hydra_Software_Devel/SW7425-1323/1   9/21/11 10:02a gmullen
40 * SW7425-1323: Potential workaround.
41 *
42 * Hydra_Software_Devel/6   6/27/11 2:39p gmullen
43 * SW7231-186: Merged power management code to Hydra branch
44 *
45 * Hydra_Software_Devel/SW7231-186/1   6/13/11 5:59p gmullen
46 * SW7231-186: Implemented SRAM save and restore for XPT standby/resume
47 *
48 * Hydra_Software_Devel/5   2/14/11 1:47p gmullen
49 * SW7425-92: Forced CDB and ITB alignments for AV contexts, per decoder
50 * requirements (Waqar)
51 *
52 * Hydra_Software_Devel/4   1/17/11 8:54p gmullen
53 * SW7422-115: Removed SvcModeEn from BXPT_Rave_RecordSettings struct and
54 * add SvcMvcEn to BXPT_Rave_IndexerSettings
55 *
56 * Hydra_Software_Devel/SW7422-115/1   1/10/11 1:31p gmullen
57 * SW7422-115: Removed SvcModeEn from BXPT_Rave_RecordSettings struct and
58 * add  SvcMvcEn to BXPT_Rave_IndexerSettings.
59 *
60 * Hydra_Software_Devel/3   1/3/11 10:54a gmullen
61 * SW7422-179: Added EMM support
62 *
63 * Hydra_Software_Devel/2   11/30/10 9:33p gmullen
64 * SW7422-115: Added SvcModeEn to enable extraction of additional bytes
65 * during record.
66 *
67 * Hydra_Software_Devel/1   10/25/10 2:09p gmullen
68 * SW7425-15: Moved srcs to base2 folder
69 *
70 * Hydra_Software_Devel/2   10/25/10 9:12a gmullen
71 * SW7425-15: Updated headers and added stub versions of C files
72 *
73 * Hydra_Software_Devel/1   10/8/10 2:58p gmullen
74 * SW7425-15: Added header files
75 *
76 * Hydra_Software_Devel/97   8/4/10 2:14p gmullen
77 * SW3548-3039: Incorrect defines for overflow and wraparound thresholds
78 *
79 * Hydra_Software_Devel/96   5/11/10 10:41a gmullen
80 * SW7405-4105: capture full TS packet to ITB when more than 10 startcodes
81 * are seen
82 *
83 * Hydra_Software_Devel/95   2/10/10 10:26a gmullen
84 * SW7335-671: Moved overflow and threshold defines to .h
85 *
86 * Hydra_Software_Devel/94   2/8/10 2:43p jtna
87 * SW3556-1003: added BXPT_RaveSoftMode_eDivX_noReorder
88 *
89 * Hydra_Software_Devel/93   1/14/10 3:33p piyushg
90 * SW7335-664: Restoring the BAND_HOLD_EN values for RAVE contexts
91 * after BXPT_Playback_StopChannel processing.
92 *
93 * Hydra_Software_Devel/92   11/23/09 11:57a gmullen
94 * SW7630-55: Added BXPT_Rave_AllocSoftContextFromHeap
95 *
96 * Hydra_Software_Devel/91   9/21/09 11:19a gmullen
97 * SW7405-3052: Ported fix from 3548Bx
98 *
99 * Hydra_Software_Devel/90   9/21/09 10:40a gmullen
100 * SW7405-2716: Merged fix to mainline
101 *
102 * Hydra_Software_Devel/89   9/11/09 2:59p gmullen
103 * SW7630-44: Added BXPT_Rave_AllocContextFromHeap()
104 *
105 * Hydra_Software_Devel/88   9/2/09 2:15p piyushg
106 * SW3548-2363: restore SC_OR_MODE for cleaner scrambling detection.
107 * Currently avaibale in 3549B1 and higher chips. Enable in others as
108 * and when RDB is updated.
109 *
110 * Hydra_Software_Devel/87   9/1/09 9:20a gmullen
111 * SW3548-2368: Merged fix to mainline
112 *
113 * Hydra_Software_Devel/SW3548-2368/1   8/23/09 4:09p gmullen
114 * PRSW3548-2368: Created new context type for VCT handling
115 *
116 * Hydra_Software_Devel/86   7/31/09 2:44p gmullen
117 * PR54331: Added 35130 to XPT support.
118 *
119 * Hydra_Software_Devel/85   7/16/09 11:25a gmullen
120 * PR56657: Added function proto.
121 *
122 * Hydra_Software_Devel/84   7/14/09 10:44p gmullen
123 * PR56657: Added VCT support.
124 *
125 * Hydra_Software_Devel/83   7/14/09 10:22a piyushg
126 * PR56771: Add XPT PI code for 7342.
127 *
128 * Hydra_Software_Devel/82   6/17/09 6:46p gmullen
129 * PR56110: Added support.xpt/7550/uif_image/a0
130 *
131 * Hydra_Software_Devel/81   4/28/09 6:41p gmullen
132 * PR54619: Changed conditional compile checks for GetScramblingCtrl API.
133 *
134 * Hydra_Software_Devel/80   4/27/09 5:11p piyushg
135 * PR52986: Ported BXPT_Rave_AdjustCdbLength API from 7601
136 * tree to main PI for 7635 support.
137 *
138 * Hydra_Software_Devel/79   4/27/09 9:23a gmullen
139 * PR54619: Added scrambling control support.
140 *
141 * Hydra_Software_Devel/78   4/20/09 2:31p gmullen
142 * PR48905: Disable band hold temporarily at playback stop.
143 *
144 * Hydra_Software_Devel/PR48905/1   4/20/09 12:51p gmullen
145 * PR48905: Disable band hold temporarily at playback stop.
146 *
147 * Hydra_Software_Devel/77   4/16/09 7:20p piyushg
148 * PR53728: Each of the XC buffer clients (Remux, RAVE, and the Mesg
149 * filters) would get a separate API to set
150 * their input bitrates. That API would take a client handle and the ID of
151 * the parser band. The XPT PI would
152 * then walk backwards through the pipeline, increasing only the bitrates
153 * for the XC and RS buffers that it
154 * needs to.
155 *
156 * Hydra_Software_Devel/76   4/16/09 3:39p gmullen
157 * PR54222: Merged 7002-specific changes to mainline. Created symlinks for
158 * 7002 files back to 7400.
159 *
160 * Hydra_Software_Devel/75   4/7/09 5:25p piyushg
161 * PR52986: Add support for 7635
162 * Added directory element "7635".
163 *
164 * Hydra_Software_Devel/74   3/13/09 4:54p piyushg
165 * PR35015: Enable read/write of Scrambling Control
166 * registers for 7325.
167 *
168 * Hydra_Software_Devel/73   2/9/09 5:08p piyushg
169 * PR51625: Fixed compilation error for 7336.
170 *
171 * Hydra_Software_Devel/72   2/6/09 2:47p gmullen
172 * PR51892: Updated per PR
173 *
174 * Hydra_Software_Devel/71   2/4/09 8:31a piyushg
175 * PR51826: Fix compilation error. Restrict VCT changes for
176 * 93548B0 only.
177 *
178 * Hydra_Software_Devel/70   2/3/09 4:34p piyushg
179 * PR51826: Added XPT API for controlling VCT contect modification.
180 *
181 * Hydra_Software_Devel/69   1/27/09 1:10p gmullen
182 * PR51625: Added 7336 support
183 *
184 * Hydra_Software_Devel/68   12/19/08 1:59p yili
185 * PR42660:IPTV integration
186 *
187 * Hydra_Software_Devel/67   12/17/08 1:51p gmullen
188 * PR50347: Added index-only record support to soft rave
189 *
190 * Hydra_Software_Devel/66   11/26/08 4:15p gmullen
191 * PR47755: Added support for 7420.
192 *
193 * Hydra_Software_Devel/65   11/10/08 4:42p gmullen
194 * PR48835: Added requested support.
195 *
196 * Hydra_Software_Devel/64   11/6/08 9:24a gmullen
197 * PR48717: Added support for PES Stream ID exclusion.
198 *
199 * Hydra_Software_Devel/63   9/3/08 10:47a piyushg
200 * PR46103: Enable Scrambling Control read from Rave for
201 * 7403 chip.
202 *
203 * Hydra_Software_Devel/62   8/7/08 9:56a piyushg
204 * PR44875: Enhanced splice to support one pid channel going to
205 * multiple context. Rave firmware also modified for this feature.
206 *
207 * Hydra_Software_Devel/61   7/10/08 4:14p gmullen
208 * PR44699: Enabled BXPT_Rave_GetScramblingCtrl() support.
209 *
210 * Hydra_Software_Devel/60   7/8/08 3:09p mward
211 * PR39833: For generic program stream support, the
212 * BXPT_Rave_ContextSettings needs GenericPsEnable and GenericPsSsid for
213 * 7118 too.
214 *
215 * Hydra_Software_Devel/59   6/6/08 6:42a gmullen
216 * PR43383: Enabled SC calls for 7401Cx
217 *
218 * Hydra_Software_Devel/58   5/30/08 7:25p gmullen
219 * PR43123: Fixed ITB alignment bug in soft RAVE config.
220 *
221 * Hydra_Software_Devel/57   4/16/08 9:56a piyushg
222 * PR39833: Add support for Generic program streams for 7401 and 7118
223 * chips.
224 *
225 * Hydra_Software_Devel/56   3/26/08 11:24a gmullen
226 * PR38954: Added 3548 support to XPT PI.
227 *
228 * Hydra_Software_Devel/55   3/18/08 11:08a gmullen
229 * PR37893: Added separate call to reset soft contexts.
230 *
231 * Hydra_Software_Devel/54   3/14/08 11:40a piyushg
232 * PR35121: Added BXPT_Rave_RemoveAllPidChannel to remove
233 * all Pid Channels from a context. record contexts may have
234 * several Pidchannels in same context. Also fix for PR29990.
235 *
236 * Hydra_Software_Devel/53   3/10/08 3:46p gmullen
237 * PR37893: Soft context can be reset through BXPT_Rave_ResetContext
238 *
239 * Hydra_Software_Devel/52   2/28/08 11:24a gmullen
240 * PR37893: Ported soft RAVE to XPT PI.
241 *
242 * Hydra_Software_Devel/51   12/4/07 6:23p mward
243 * PR37908: Use 7401 DVD LPCM support for 7118.
244 *
245 * Hydra_Software_Devel/50   11/29/07 3:57p gmullen
246 * PR37062: Removed BAVC_ItbEsType_eDvdMpeg2Video support.
247 * BXPT_Rave_AvSettings.VobMode is now used to indicate VOB streams for
248 * 7401.
249 *
250 * Hydra_Software_Devel/49   11/28/07 5:01p gmullen
251 * PR37062: Added BAVC_ItbEsType_eDvdMpeg2Video for 7401 only.
252 *
253 * Hydra_Software_Devel/48   11/28/07 12:05p gmullen
254 * PR36900: Added 7335 support
255 *
256 * Hydra_Software_Devel/47   11/28/07 9:02a gmullen
257 * PR37062: Added support for LPCM on the 7401.
258 *
259 * Hydra_Software_Devel/46   11/1/07 12:23p gmullen
260 * PR36449: Added 7401 support to BXPT_Rave_GetContextConfig and
261 * _SetContextConfig.
262 *
263 * Hydra_Software_Devel/45   10/31/07 4:44p piyushg
264 * PR32599: Add new ITB entry type enums for 7440 graphics and HLI format.
265 * Add new API BXPT_Rave_AddBppChannel to add multiple pid in the same
266 * context without overwriting the previous SCD values.
267 *
268 * Hydra_Software_Devel/44   10/31/07 2:40p jrubio
269 * PR35015: add 7325
270 *
271 * Hydra_Software_Devel/43   10/30/07 3:12p gmullen
272 * PR35018: Added support for 7325
273 *
274 * Hydra_Software_Devel/42   10/1/07 5:02p gmullen
275 * PR35529: Added BXPT_Rave_GetBufferInfo_isr(). BAVC_CdbItbConfig * in
276 * BXPT_Rave_AllocContext() is now const.
277 *
278 * Hydra_Software_Devel/41   9/24/07 11:55a gmullen
279 * PR35312: Added context enable status to BXPT_Rave_GetContextStatus()
280 *
281 * Hydra_Software_Devel/40   9/19/07 4:44p piyushg
282 * PR31956: Add BXPT_Rave_ClearSCRegister API to clear Scramble Control
283 * Register.
284 *
285 * Hydra_Software_Devel/39   9/14/07 3:54p gmullen
286 * PR32771: Added BXPT_Rave_GetCdbBasePtr() for IP support.
287 *
288 * Hydra_Software_Devel/38   9/12/07 12:05p gmullen
289 * PR32771: Merged Refsw_Xpt_AVoIP_Devel to Hydra_Software_Devel
290 *
291 * Hydra_Software_Devel/37   9/11/07 9:15a gmullen
292 * PR34770: Added PES stream ID extension and substream filtering.
293 *
294 * Hydra_Software_Devel/36   8/9/07 3:59p gmullen
295 * PR28843: Changed minimum number of ES bytes extracted to 2 in RAVE PI.
296 *
297 * Hydra_Software_Devel/35   7/31/07 12:51p gmullen
298 * PR33018: Added support to enable RTS/PCR extraction only when needed.
299 *
300 * Hydra_Software_Devel/34   7/18/07 3:35p gmullen
301 * PR29691: Incorporated workaround. See PR for details.
302 *
303 * Hydra_Software_Devel/33   7/3/07 1:54p gmullen
304 * PR32748: Added BXPT_Rave_ClearOverflow.
305 *
306 * Hydra_Software_Devel/32   6/8/07 4:03p katrep
307 * PR29959: Added BXPT_Rave_ResetContext api to use with multimode
308 * recording using single allocated context.
309 *
310 * Hydra_Software_Devel/31   5/17/07 6:16p piyushg
311 * PR30376: Added support to read Scrambling Control bits.
312 *
313 * Hydra_Software_Devel/30   5/1/07 1:34p gmullen
314 * PR29688: Added BandHoldEn to BXPT_Rave_RecordSettings struct.
315 *
316 * Hydra_Software_Devel/29   4/27/07 8:44a katrep
317 * PR29959: Added support in RAVE to change the CDB context end pointer
318 * required for DSS,MPEG,TimeStamp support
319 *
320 * Hydra_Software_Devel/28   4/12/07 3:01p gmullen
321 * PR29688: Added BXPT_Rave_SetScdUsingPid() to API
322 *
323 * Hydra_Software_Devel/27   3/26/07 4:13p katrep
324 * PR28320: Updated comments
325 *
326 * Hydra_Software_Devel/26   3/22/07 11:52a gmullen
327 * PR28909: Added Transcoding bool to struct BXPT_Rave_AvSettings
328 *
329 * Hydra_Software_Devel/25   3/1/07 6:27p katrep
330 * PR28297: Added BXPT_Rave_PesExtSearchMode to BXPT_Rave_ContextSettings
331 * for 7440.
332 *
333 * Hydra_Software_Devel/22   11/30/06 11:32a gmullen
334 * PR26269: Supported 0-sized ITBs.
335 *
336 * Hydra_Software_Devel/21   11/22/06 4:58p gmullen
337 * PR26109: Updated for 7403.
338 *
339 * Hydra_Software_Devel/20   11/8/06 11:44a gmullen
340 * PR25693: Added BXPT_Rave_ComputeThresholds()
341 *
342 * Hydra_Software_Devel/19   11/6/06 4:00p gmullen
343 * PR25402: RAVE now uses RHeap handle passed from BXPT_Open.
344 *
345 * Hydra_Software_Devel/18   11/2/06 6:30p katrep
346 * PR25395: Added support for disabling packet errors in the ITBs.
347 *
348 * Hydra_Software_Devel/17   11/2/06 11:30a gmullen
349 * PR25399: Added BXPT_Rave_SetTpitEcms to set ECM Odd/EVEN TID
350 *
351 * Hydra_Software_Devel/16   10/19/06 2:06p gmullen
352 * PR24896: Added MpegMode to BXPT_Rave_TpitEntry struct.
353 *
354 * Hydra_Software_Devel/15   10/18/06 3:58p gmullen
355 * PR24937: Put back BXPT_Rave_GetDefaultThresholds() .
356 *
357 * Hydra_Software_Devel/14   10/18/06 2:48p gmullen
358 * PR24937: Added BXPT_Rave_SetThresholds
359 *
360 * Hydra_Software_Devel/13   10/13/06 5:16p gmullen
361 * PR24937: Added BXPT_Rave_SetThresholds()
362 *
363 * Hydra_Software_Devel/12   9/13/06 11:00a gmullen
364 * PR15309: BXPT_Rave_GetDefaultThresholds() returns all 4 thresholds.
365 * Also removed dead code.
366 *
367 * Hydra_Software_Devel/11   9/11/06 10:22a katrep
368 * PR23114: Fixed typo
369 *
370 * Hydra_Software_Devel/10   8/22/06 9:29a gmullen
371 * PR23792: Noted that thresholds are given in units of 256 bytes.
372 *
373 * Hydra_Software_Devel/9   8/17/06 6:04p katrep
374 * PR23114: Added support for 7440
375 *
376 * Hydra_Software_Devel/8   8/11/06 11:50a gmullen
377 * PR22634: Added BXPT_Rave_GetDefaultThreshold()
378 *
379 * Hydra_Software_Devel/7   7/5/06 2:43p katrep
380 * PR22388: Added CTD/ITB threshold settings for CDB/ITB thresholds.
381 *
382 * Hydra_Software_Devel/6   6/28/06 4:05p katrep
383 * PR22358: Added support to set TPIT_PKT_TIMEOUT & TPIT_EVE_TIMEOUT to
384 * the XPT Rave PI.
385 *
386 * Hydra_Software_Devel/5   6/5/06 11:57a gmullen
387 * PR18998: Added TPIT fixes from 7401.
388 *
389 * Hydra_Software_Devel/4   3/16/06 5:10p gmullen
390 * PR20218: PES SYNC mode not initialized. Fixed and tested.
391 *
392 * Hydra_Software_Devel/3   2/27/06 2:04p gmullen
393 * PR18998: Changed formula to compute value for EsCount
394 *
395 * Hydra_Software_Devel/2   2/17/06 3:32p gmullen
396 * PR18998: Fixed memory overwrite in InitContext().
397 *
398 * Hydra_Software_Devel/1   1/16/06 2:09p gmullen
399 * PR18998: Initial checkin for 7400
400 *
401 *
402 ***************************************************************************/
403
404/*= Module Overview *********************************************************
405Overview
406
407Sample Code
408
409    / * Configuration for AVC video decoding. * /
410    BERR_Code Res;
411    BXPT_Rave_ChannelSettings RaveDefaults;
412    BXPT_Rave_Handle hRave;
413    BXPT_RaveCx_Handle hCtx;
414    BAVC_XptContextMap CtxMap;
415    BXPT_Rave_ContextPtrs CtxPtrs;
416    BXPT_Rave_AvSettings AvCtxCfg;
417
418    / * The CdbItb struct is normally filled out by the decoder PI. Dummy values are used here. * /
419    BAVC_CdbItbConfig CdbItb = { { 512 * 1024, 4, false }, { 512 * 1024, 4, false } };
420
421    Res = BXPT_Rave_GetChannelDefaultSettings( hXpt, RAVE_CHNL_NUM, &RaveDefaults );
422    BDBG_ASSERT( !Res );
423 
424    Res = BXPT_Rave_OpenChannel( hXpt, &hRave, RAVE_CHNL_NUM, &RaveDefaults );
425    BDBG_ASSERT( !Res );
426
427    Res =  BXPT_Rave_AllocContext( hRave, BXPT_RaveCx_eAv, &CdbItb, &hCtx );
428    BDBG_ASSERT( !Res );
429
430    / * PID channel 0 carries PID 0x810 from parser band 1 * /
431    BXPT_ConfigurePidChannel( hXpt, 0, 0x810, 1 );
432    BXPT_EnablePidChannel( hXpt, 0 );
433
434    BXPT_Rave_AddPidChannel( hCtx, 0, false );
435
436    / * Parser band 1 gets data from input band 2. * /
437    Res = BXPT_SetParserDataSource( hXpt, 1, BXPT_DataSource_eInputBand, 2 );
438    BDBG_ASSERT( !Res );
439
440    Res = BXPT_SetParserEnable( hXpt, 1, true );
441    BDBG_ASSERT( !Res );
442
443    BXPT_Rave_GetAvConfig( hCtx, &AvCtxCfg );
444    AvCtxCfg.InputFormat = BAVC_StreamType_eTsMpeg;
445    AvCtxCfg.ItbFormat = BAVC_ItbEsType_eAvcVideo;
446    AvCtxCfg.OutputFormat = BAVC_StreamType_eEs;
447    AvCtxCfg.EsRanges[ 0 ].RangeHi = 0xFE;
448    AvCtxCfg.EsRanges[ 0 ].RangeLo = 0;
449    AvCtxCfg.EsRanges[ 0 ].Enable = true;
450    AvCtxCfg.EsRanges[ 1 ].Enable = false;
451    AvCtxCfg.EsRanges[ 2 ].Enable = false;
452    AvCtxCfg.EsRanges[ 3 ].Enable = false;
453    AvCtxCfg.StreamIdHi = 0xEF;
454    AvCtxCfg.StreamIdLo = 0xBD;
455    AvCtxCfg.BandHoldEn = false;
456    Res = BXPT_Rave_SetAvConfig( hCtx, &AvCtxCfg );
457    BDBG_ASSERT( !Res );
458
459    Res = BXPT_Rave_EnableContext( hCtx );
460    BDBG_ASSERT( !Res );
461
462***************************************************************************/
463
464#ifndef BXPT_RAVE_H__
465#define BXPT_RAVE_H__
466
467#include "bxpt.h"
468#include "bavc.h"
469#include "bxpt_playback.h"
470
471#ifdef __cplusplus
472extern "C" {
473#endif
474
475/***************************************************************************
476Summary:
477Misc defines used by the RAVE API.
478****************************************************************************/
479#define BXPT_MAX_STARTCODE_RANGES 4     /* The number of startcode ranges that the SCD indexers support. */
480#define BXPT_NUM_AV_RANGES 4            /* The number of ES startcode ranges that the AV contexts support. */
481
482/***************************************************************************
483Summary:
484Defines for the minimum and maximum number of ES bytes that the startcode
485detection logic in the record contexts can extract.
486
487Note that this number includes the startcode value itself. For example,
488in the stream
489  00 00 01 XX YY ZZ
490an EsCount value of 2 will extract the startcode XX and the first value
491following it, YY.
492****************************************************************************/
493#define BXPT_MIN_ES_COUNT       2                       /* Minimum of 2 to avoid PR 28843. */
494
495#define BXPT_MAX_ES_COUNT       9                       /* Maximum number of ES bytes extracted */
496
497/***************************************************************************
498Summary:
499Context overflow and wraparound thresholds.
500****************************************************************************/
501#define BXPT_RAVE_WRAP_THRESH       ( 0x100 )
502#define BXPT_RAVE_OVERFLOW_THRESH   ( 3 * BXPT_RAVE_WRAP_THRESH )
503                 
504/***************************************************************************
505Summary:
506The handle structures contain data global to all code that uses the RAVE
507channel. Users should not access the contents.
508****************************************************************************/
509typedef struct BXPT_P_RaveHandle *BXPT_Rave_Handle;
510typedef struct BXPT_P_ContextHandle *BXPT_RaveCx_Handle;
511typedef struct BXPT_P_IndexerHandle *BXPT_RaveIdx_Handle;
512
513/***************************************************************************
514Summary:
515Enumeration of all supported interrupts in a Rave context.
516****************************************************************************/
517typedef enum BXPT_RaveIntName
518{
519    BXPT_RaveIntName_eEmuErr = 0,               /* Emulation byte removal error */
520    BXPT_RaveIntName_ePusiErr = 1,          /* PUSI error */
521    BXPT_RaveIntName_eTeiErr = 2,               /* TEI error */
522    BXPT_RaveIntName_eCcErr = 3,                /* CC error */
523    BXPT_RaveIntName_eCdbOverflow = 4,      /* CDB overflow error */
524    BXPT_RaveIntName_eItbOverflow = 5,      /* ITB overflow error */
525    BXPT_RaveIntName_eSplice = 6,               /* Splice event */
526    BXPT_RaveIntName_eLastCmd = 7,          /* BTP or BPP Last command encountered  interrupt */
527    BXPT_RaveIntName_eCdbLowerThresh = 8,       /* CDB below lower threshold */
528    BXPT_RaveIntName_eCdbUpperThresh = 9,       /* CDB above upper threshold */
529    BXPT_RaveIntName_eItbLowerThresh = 10,  /* ITB below lower threshold */
530    BXPT_RaveIntName_eItbUpperThresh = 11       /* ITB above upper threshold */
531}
532BXPT_RaveIntName;
533
534/***************************************************************************
535Summary:
536Enumeration of the different types of contexts supported. Applications that
537don't do security-related AV or records should use BXPT_RaveCx_eAv and/or
538BXPT_RaveCx_eRecord .
539****************************************************************************/
540typedef enum BXPT_RaveCx
541{
542    BXPT_RaveCx_eAv,        /* AV context, for moving data to the decoders. */
543    BXPT_RaveCx_eRecord,    /* Record context, for PVR applications. */
544
545    BXPT_RaveCx_eAvR,       /* AV context, using buffers allocated from the RHeap handle */
546    BXPT_RaveCx_eRecordR,   /* Record context, using buffers allocated from the RHeap handle. */
547
548        BXPT_RaveCx_eIp,                /* IP record context */
549        BXPT_RaveCx_eVctNull    /* */
550}
551BXPT_RaveCx;
552
553/***************************************************************************
554Summary:
555Enumeration of the different types of index table generation that the RAVE
556currently supports.
557****************************************************************************/
558typedef enum BXPT_RaveIdx
559{
560    BXPT_RaveIdx_eScd,      /* Startcode detection. */
561    BXPT_RaveIdx_eTpit      /* Transport parser index tables. */
562}
563BXPT_RaveIdx;
564
565/***************************************************************************
566Summary:
567Some of the global items in the RAVE channel. This structure is used, among
568other things, to get and set the defaults during the channel open.
569****************************************************************************/
570
571typedef BERR_Code (*RaveChannelOpenCB)(void);
572
573typedef struct BXPT_Rave_ChannelSettings
574{
575    /* These items are for TPIT filtering, and are global to all record contexts */
576    uint32_t TpitEventTimeout;      /* Number of 108 MHz clocks before triggering a record event timeout. */
577    uint32_t TpitPacketTimeout;     /* Number of 108 MHz clocks before triggering a record packet timeout. */
578    uint32_t TimeTick;              /* Number of 108-MHz cycles to wait before triggering a time tick event */
579    RaveChannelOpenCB chanOpenCB;
580        unsigned ThresholdGranularityInBytes;
581}
582BXPT_Rave_ChannelSettings;
583
584/***************************************************************************
585Summary:
586Settings for the Record contexts.
587****************************************************************************/
588typedef struct BXPT_Rave_RecordSettings
589{
590    /* The type of transport we are recording. Set to true if MPEG, false if DirecTV */
591    bool MpegMode; 
592
593    /*
594    ** Type of compressed data output from RAVE. From this enum, only these
595    ** types are supported:
596    **  BAVC_StreamType_eTsMpeg,        MPEG or DirecTV Transport Stream
597    **  BAVC_StreamType_ePes,           PES Stream
598    **  BAVC_StreamType_eEs,            ES Stream
599    */
600    BAVC_StreamType OutputFormat;       
601
602    /* Set to true if timestamps should be prepended to the packets during record. */
603    bool UseTimeStamps;
604   
605    bool TsInitEn;          /* InitTs will be used as the initial timestamp value */
606    uint32_t InitialTs;     /* Initial value for timestamps ( if TsInitEn == true ). */ 
607
608    /*
609    ** Selects the type of timestamps that will be prepended to the packets
610    ** if UseTimeStamps (below) is true. See bxpt_playback.h for further
611    ** details.
612    */
613    BXPT_TimestampMode TimestampMode;
614
615    /*
616    ** Disable parity checking for timestamps that will be prepended to the
617    ** packets if UseTimeStamps (above) is true. See bxpt_playback.h for further
618    ** details.
619    */
620    bool DisableTimestampParityCheck;
621
622    /*
623    ** The upper and lower bounds (non-inclusive) of the PES stream IDs that will be accepted
624    ** during startcode generation.
625    */
626    uint8_t StreamIdHi;
627    uint8_t StreamIdLo;
628
629    /*
630    ** Upper and lower thresholds. An interrupt to the CPU will be generated when data
631    ** in the CDB when the exceeds the CdbUpperThreshold or drops below the CdbLowerThreshold.
632    ** The ItbUpperThreshold and ItbLowerThreshold provide similar functions for ITB data.
633    ** NOTE: These tresholds are specified in units of 256 bytes. Thus, to set a threshold
634    ** to 1024 bytes, the treshold param must be set to 4.
635    */
636    uint16_t CdbUpperThreshold, CdbLowerThreshold; 
637    uint16_t ItbUpperThreshold, ItbLowerThreshold;
638
639    /*
640    ** Use the CDB bufffer smaller then actually allocated by  BXPT_Rave_AllocContext,
641    ** For the non 0 UseCdbSize, the CDB end pointer is adjusted to reflect UseCdbSize.
642    ** Use of this parameter is optional,should be set to 0 in normal usage modes   
643    */
644    uint32_t UseCdbSize;
645
646    /* If true, do not check CC bits for packets on this context. */
647    bool DisableContinuityCheck;
648
649        /*RLQ, hacked */
650        bool DisablePacketErrors;
651
652    /* If true, recorded count used in TPIT entries will be packets. Otherwise, the count is bytes. */
653    bool CountRecordedPackets;
654
655    /*
656    ** BandHoldEn allows the context to pause a playback channel, in order to prevent
657    ** data loss if the host cannot service the buffers quickly enough. It is meant for
658    ** transcoding or re-recording of playback data; it should be false for recording
659    ** live data.
660    */
661    bool BandHoldEn;
662
663        bool EmmModeEn;
664}
665BXPT_Rave_RecordSettings;
666
667/***************************************************************************
668Summary:
669For each range that is enabled, only the startcode that fall between
670these non-inclusive limits will appear in the ES index table. To
671enable all startcodes, simply set RangeHi of any pair to 0xFF, then
672RangeLo to 0x00, and enable that pair.
673****************************************************************************/
674typedef struct BXPT_Rave_EsRanges
675{
676    uint8_t RangeHi;    /* High end of ES range. */
677    uint8_t RangeLo;    /* Low end of ES range. */
678    bool RangeIsASlice; /* True if codes in this range are slices */
679    bool Enable;        /* Enable flag for this range */
680}
681BXPT_Rave_EsRanges;
682
683/***************************************************************************
684Summary:
685Settings for the Audio/Video contexts.
686****************************************************************************/
687typedef struct BXPT_Rave_AvSettings
688{
689    /*
690    ** The format of the input stream. From this enum, only the following
691    ** types are supported.
692    **   BAVC_StreamType_eTsMpeg          MPEG transport packets
693    **   BAVC_StreamType_eDssEs           DirecTV transport carrying ES data
694    **   BAVC_StreamType_eDssPes          DirecTV transport carrying PES data
695    **   BAVC_StreamType_eVCD             MPEG1 style PES packetized as MPEG transport packets
696    */
697    BAVC_StreamType InputFormat;
698
699    BAVC_ItbEsType ItbFormat;           /* Type of ES data that ITB entries are built for. */
700
701    /*
702    ** Type of compressed data output from RAVE. From this enum, only these
703    ** types are supported:
704    **  BAVC_StreamType_eTsMpeg,        MPEG Transport Stream
705    **  BAVC_StreamType_ePes,           PES Stream
706    **  BAVC_StreamType_eEs,            ES Stream
707    */
708    BAVC_StreamType OutputFormat;       
709
710    BXPT_Rave_EsRanges EsRanges[ BXPT_NUM_AV_RANGES ];
711
712    /*
713    ** The upper and lower bounds (non-inclusive) of the PES stream IDs that will be accepted
714    ** during startcode generation.
715    */
716    uint8_t StreamIdHi;
717    uint8_t StreamIdLo;
718
719    /*
720    ** Upper and lower thresholds. An interrupt to the CPU will be generated when data
721    ** in the CDB when the exceeds the CdbUpperThreshold or drops below the CdbLowerThreshold.
722    ** The ItbUpperThreshold and ItbLowerThreshold provide similar functions for ITB data.
723    */
724    uint16_t CdbUpperThreshold, CdbLowerThreshold; 
725    uint16_t ItbUpperThreshold, ItbLowerThreshold;
726
727    /*
728    ** BandHoldEn allows the AV context to pause a playback channel, if the decoder
729    ** requires it. This functionality is similar to AV Pause in the older chipsets,
730    ** except that it is implemented here in RAVE rather than the playback channels.
731    */
732    bool BandHoldEn;
733
734    /* If true, do not check CC bits for packets on this context. */
735    bool DisableContinuityCheck;
736
737    /* If true, disable all packet errors in the ITB.Default value is enabled, should be enabled
738       for debugging purposes only */
739    bool DisablePacketErrors;
740
741    /* Enable searching for BPP packets. */
742    bool EnableBPPSearch;
743
744    /*
745    ** For transcoding applications, we need to keep the emulation prevention bytes. Set this
746    ** to true for transcoding only.
747    */
748    bool Transcoding;
749
750        /*
751        ** Include PCR/RTS entries in the ITB. By default, this is false. Set to true for
752        ** host operations such as software RAVE.
753        */
754        bool PcrRtsEntryEn;
755
756        /*
757        ** Upper and lower bounds for PES stream IDs that should be dropped. In some cases, the Stream
758        ** ID range specified by StreamIdHi and StreamIdLo may include data you don't want. An example
759        ** would be 0xBE, the PES stream used for stuffing bytes. By specifying 0xBE in both PesSidExcludeHi
760        ** and PesSidExcludeLo, the stuffing bytes won't be captured into the CDB.
761        */
762        uint8_t PesSidExcludeHi;
763        uint8_t PesSidExcludeLo;
764
765        /* PR57627 :
766    ** SC_OR_MODE is used to select the way scramble control bits are reported.
767    ** 0 = Disable OR-ing of current and previous scramble control bits (Default).
768    ** 1 = Enable OR-ing of current and previous scramble control bits. This is to
769        ** support streams which have mixture of scrambled and unscrambled packets within
770        ** the same PID. In such case, these PIDs will be treated as scramble PIDs.
771        ** By default this is disabled.
772        */
773        bool ScOrMode;      /* Default value is true, per hw guys recommendation. */
774}
775BXPT_Rave_AvSettings;
776
777/***************************************************************************
778Summary:
779The parse table entry consists of enables for each bitfield in the transport
780packet that can be parsed. In most cases, there is also a value that the
781bitfield must match in order to have an index generated.
782****************************************************************************/
783typedef struct BXPT_Rave_TpitEntry
784{
785    unsigned Pid;               /* The PID to build TPIT entries for. */
786    bool CorruptionEnable;      /* Corrupt packet if it matches the filter criterion below. Disabled by default */
787    bool MpegMode;              /* The type of transport we are recording. Set to true if MPEG, false if DirecTV */
788
789    union
790    {
791        struct 
792        {
793            bool EcmPolarityChangeEn;
794            bool SectionFilterEn;
795
796            bool AdaptationExtensionFlagEnable;         /* Store an index table entry if this bit is set and the adaptation_field_extension_flag matches the corresponding compare value. */
797            bool AdaptationExtensionFlagCompValue;      /* The value to compare adaptation_field_extension_flag with. */
798
799            bool PrivateDataFlagEnable;                 /* Store an index table entry if this bit is set and the transport_private_data_flag matches the corresponding compare value. */   
800            bool PrivateDataFlagCompValue;              /* The value to compare transport_private_data_flag with. */ 
801
802            bool SplicingPointFlagEnable;               /* Store an index table entry if this bit is set and the splicing_point_flag matches SplicingPointFlagCompValue */
803            bool SplicingPointFlagCompValue;            /* The value to compare splicing_point_flag with. */ 
804
805            bool OpcrFlagEnable;                        /* Store an index table entry if this bit is set and the OPCR_flag  matches the corresponding compare value */
806            bool OpcrFlagCompValue;                     /* The value to compare OPCR_flag with. */ 
807
808            bool PcrFlagEnable;                         /* Store an index table entry if this bit is set and the PCR_flag  matches the corresponding compare value */
809            bool PcrFlagCompValue;                      /* The value to compare PCR_flag with. */ 
810
811            bool EsPriorityIndicatorEnable;             /* Store an index table entry if this bit is set and the elementary_stream_priority_indicator matches the corresponding compare value */
812            bool EsPriorityIndicatorCompValue;          /* The value to compare elementary_stream_priority_indicator with. */ 
813
814            bool RandomAccessIndicatorEnable;           /* Store an index table entry if this bit is set and the random_access_indicator matches the corresponding compare value */
815            bool RandomAccessIndicatorCompValue;        /* The value to compare random_access_indicator with. */ 
816
817            bool DiscontinuityIndicatorEnable;          /* Store an index table entry if this bit is set and the discontinuity_indicator matches the corresponding compare value */
818            bool DiscontinuityIndicatorCompValue;       /* The value to compare discontinuity_indicator with. */ 
819
820            bool AdaptationFieldChangeEnable;           /* Store an index table entry if a change is detected in the adaptation field control field (enable only) */
821            bool ScramblingControlChangeEnable;         /* Store an index table entry if a change is detected in the scrambling control field control field (enable only) */
822
823            bool TransportPriorityEnable;               /* Store an index table entry if this bit is set and the transport_priority matches the corresponding compare value */
824            bool TransportPriorityCompValue;            /* The value to compare transport_priority with. */ 
825
826            bool PayloadUnitStartEnable;                /* Store an index table entry if this bit is set and the payload_unit_start_indicator matches the corresponding compare value */
827            bool PayloadUnitStartCompValue;             /* The value to compare payload_unit_start_indicator with. */ 
828        }
829        Mpeg;
830
831        struct
832        {
833            bool FilterHdEnable;        /* Enable HD filtering for this PID. */
834            unsigned short HdFilter;    /* The HD value to filter on. Transport packet matching this value are NOT recorded. */
835
836            bool TcDetEn;           /* Store an index table entry if a valid timecode is contained in the packet (enable only) */
837
838            bool CwpDetEn;          /* Store an index table entry if a valid CWP is contained in the packet (enable only) */
839
840            bool RtsDetEn;          /* Store an index table entry if a valid RTS is contained in the packet (enable only) */ 
841
842            bool CffEn;             /* Store an index table entry if this bit is set and the current field flag matches the corresponding compare value */
843            bool CffComp;           /* The current field flag must match this value if the corresponding enable bit is set in order for an index table entry to be made */
844
845            bool MfEn;              /* Store an index table entry if this bit is set and the modifiable flag matches the corresponding compare value */
846            bool MfComp;            /* The modifiable flag must match this value if the corresponding enable bit is set in order for an index table entry to be made */
847
848            bool HdEn;              /* Store an index table entry for any bit set in this field and the respective compare bit matches the
849                                        respective header designator bit (only for valid HD i.e. unencrypted packets) */
850            uint8_t HdMask;         /* The header designator bits must bitwise match this value if the corresponding enable bit is set in order for an index table entry to be made.
851                                        (only for valid HD i.e. unencrypted packets) */
852
853            bool CsAuxChangeEn;     /* Store an index table entry if a change is detected in the control sync for CWP packets (enable only) */
854
855            bool CsChangeEn;        /* Store an index table entry if a change is detected in the control sync for content (non AUX)packets (enable only) */
856
857            bool CfChangeEn;        /* Store an index table entry if a change is detected in the control flag for content (non AUX)packets (enable only) */
858
859            bool BbEn;              /* Store an index table entry if this bit is set and the bundle boundary matches the corresponding compare value */
860            bool BbComp;            /* The bundle boundary must match this value if the corresponding enable bit is set in order for an index table entry to be made */
861        }
862        DirecTv;
863    }
864    Cfg;
865}
866BXPT_Rave_TpitEntry;
867
868/***************************************************************************
869Summary:
870Settings for the Record contexts. Used by BXPT_Rave_SetScdEntry() and
871BXPT_Rave_SetScdUsingPid(). NOTE: When used by BXPT_Rave_SetScdUsingPid(),
872the PidChannel member is ignored.
873****************************************************************************/
874typedef struct BXPT_Rave_ScdEntry
875{
876    unsigned PidChannel;    /* The PID channel caryring the PIDs to build startcode entries for. */
877    bool ExtractPts;        /* Extract PTS values from the stream and add them to the SCD tables. */
878   
879    /*
880    ** Number of bytes, including the startcode, to capture.
881    ** Min is BXPT_MIN_ES_COUNT, max is BXPT_MAX_ES_COUNT
882    */
883    uint8_t EsCount;       
884}
885BXPT_Rave_ScdEntry;
886
887/***************************************************************************
888Summary:
889Global settings for startcode and transport index table generation.
890****************************************************************************/
891typedef struct 
892{
893    uint8_t RangeHi;        /* Upper limit (non-inclusive) of the startcode range */
894    uint8_t RangeLo;        /* Lower limit (non-inclusive) of the startcode range. */   
895    bool RangeIsASlice;     /* true if this range of startcodes is for a slice */
896    bool RangeEnable;       /* Startcodes for this range are enabled for index table entry. */
897}
898IndexerScRange;
899
900typedef struct BXPT_Rave_IndexerSettings
901{
902    union 
903    {
904        /* Settings for Transport Parser Index table generation. Used by all filters on a given record context. */
905        struct 
906        {
907            bool FirstPacketEnable;     /* Store an index table entry for the first packet recorded. */ 
908            bool StorePcrMsb;           /* Store the 32 MSB of the PCR if true; store the 32 LSB if false (default) */
909
910            /*
911            ** The TPIT block can corrupt the contents of packets that match Pid above, when CorruptionEnable is true.
912            ** Corruption is enabled on a per-PID basis, by setting BXPT_Rave_TpitEntry.CorruptionEnable = true .
913            */
914            uint8_t CorruptionByte;         /* Byte to use in corruption. */
915            unsigned int CorruptionStart;   /* The start offset for the range of bytes within the packet to corrupt (0 is the first offset in the packet). */
916            unsigned int CorruptionEnd;     /* The end offset for the range of bytes within the packet to corrupt */ 
917
918            bool IdleEventEnable;       /* Store an event if no other events have occurred for TpitEventTimeout number of 108 MHz clocks. */
919            bool RecordEventEnable;     /* Store an event if no packets have been recorded for TpitEventTimeout number of 108 MHz clocks. */
920
921            bool TimeTickEn;
922        }
923        Tpit;
924
925        /* Settings for Startcode detection. */
926        struct
927        {
928            bool Atsc01IsUnscrambled;       /* If the packet's scrambling control field == 01b, it is treated as unscrambled if Atsc01IsUnscrambled = true. */                 
929            bool ParseScramblingControl;    /* If true, skip packet if scrambling control bits are non-zero. */
930
931            /* Startcode ranges that the SCDs can filter on. Only codes between the defined ranges will appear in the tables. */
932            IndexerScRange ScRange[ BXPT_MAX_STARTCODE_RANGES ];
933
934            bool SvcMvcMode;    /* Configure for indexing an SVC or MVC stream. Default is false. */
935        }
936        Scd;
937    }
938    Cfg;
939}
940BXPT_Rave_IndexerSettings;
941
942/***************************************************************************
943Summary:
944Pointers to new context data and the number of new bytes. The data is stored
945in a hardware ring buffer, so wrap around can and will occur. The wrap
946pointers will be non-zero if a wrap around occurred.
947****************************************************************************/
948typedef struct BXPT_Rave_DataPtrs
949{
950    uint8_t *DataPtr;       /* Start of new data, before wrap around */
951    size_t ByteCount;       /* Number of new bytes, before wrap around */
952
953    uint8_t *WrapDataPtr;   /* Start of new data, after wrap around. NULL if no wrap occurred */
954    size_t WrapByteCount;   /* Number of new bytes, after wrap around. 0 if no wrap. */
955}
956BXPT_Rave_DataPtrs;
957
958/***************************************************************************
959Summary:
960Pointers to new context ITB and CDB data.
961****************************************************************************/
962typedef struct BXPT_Rave_ContextPtrs
963{
964    BXPT_Rave_DataPtrs Cdb, Itb;
965}
966BXPT_Rave_ContextPtrs;
967
968/***************************************************************************
969Summary:
970Statistics for a record context.
971****************************************************************************/
972typedef struct BXPT_Rave_RecordStats
973{
974    uint32_t ElapsedTime;   /* 1.26 uSec ticks since record started. */
975    uint32_t ByteCount;     /* Number of bytes recorded. */ 
976}
977BXPT_Rave_RecordStats;
978
979/***************************************************************************
980Summary:
981CDB depth and size information.
982****************************************************************************/
983typedef struct BXPT_Rave_BufferInfo
984{
985    size_t CdbSize;
986    size_t CdbDepth;
987}
988BXPT_Rave_BufferInfo;
989
990/***************************************************************************
991Summary:
992Miscellaneous status for a given context.
993****************************************************************************/
994typedef struct BXPT_RaveCx_Status
995{
996        bool ContextEnabled;    /* true if context is currently enabled, false otherwise */
997    bool CdbOverflow;           /* CDB is in an overflow condition. */
998    bool ItbOverflow;           /* ITB is in an overflow condition. */
999}
1000BXPT_RaveCx_Status;
1001
1002/***************************************************************************
1003Summary:
1004Upper and lower thresholds. An interrupt to the CPU will be generated when data
1005in the CDB when the exceeds the CdbUpperThreshold or drops below the CdbLowerThreshold.
1006The ItbUpperThreshold and ItbLowerThreshold provide similar functions for ITB data.
1007NOTE: These tresholds are specified in units of 256 bytes. Thus, to set a threshold
1008to 1024 bytes, the treshold param must be set to 4.
1009****************************************************************************/
1010typedef struct BXPT_Rave_ContextThresholds
1011{
1012    uint32_t CdbUpper;
1013    uint32_t CdbLower;
1014    uint32_t ItbUpper;
1015    uint32_t ItbLower;
1016}
1017BXPT_Rave_ContextThresholds;
1018
1019/******************************************************************************
1020Summary;
1021Scrambling Control Monitor. This register is used to monitor SC bits(Scrambling Control bits)
1022from Transport packet. HOST MIPS should write 0 to this register during channel change.
1023******************************************************************************/
1024typedef struct BXPT_Rave_ScrambleCtrl
1025{
1026    bool PusiValid;    /* SC_PUSI_VALID is set if the transport packet has PUSI set */
1027    uint8_t Pusi;      /* SC_PUSI bits are updated only if transport packet has PUSI set. */
1028    bool AllValid;     /* SC_ALL_VALID is set when RAVE receives any Transport packet on corresponding context. */
1029    uint8_t ScAll;     /* SC_ALL indicates the scrambling control bits in Transport packet. */
1030}
1031BXPT_Rave_ScrambleCtrl;
1032
1033/*****************************************************************************
1034Summary:
1035Return the Scrambling Control bits.
1036
1037Description:
1038For the given Context, return the Scrambing Control Monitor values.
1039
1040Returns:
1041    BERR_SUCCESS                - Retrieved channel count.
1042    BERR_INVALID_PARAMETER      - Bad input parameter
1043*****************************************************************************/
1044BERR_Code BXPT_Rave_GetScramblingCtrl(
1045    BXPT_RaveCx_Handle hCtx,
1046    BXPT_Rave_ScrambleCtrl *ScrambleCtrl
1047    );
1048
1049/*****************************************************************************
1050Summary:
1051Clears the Scrambling Control Register for given context.
1052
1053Description:
1054For the given Context, clear the Scrambing Control register.
1055
1056Returns:
1057    BERR_SUCCESS                - Retrieved channel count.
1058    BERR_INVALID_PARAMETER      - Bad input parameter
1059*****************************************************************************/
1060BERR_Code BXPT_Rave_ClearSCRegister(
1061        BXPT_RaveCx_Handle hCtx
1062        );
1063
1064/***************************************************************************
1065Summary:
1066Return the number of RAVE channels.
1067
1068Description:
1069For the given transport core, return the number of RAVE channels that are
1070instantiated.
1071
1072Returns:
1073    BERR_SUCCESS                - Retrieved channel count.
1074    BERR_INVALID_PARAMETER      - Bad input parameter
1075****************************************************************************/
1076BERR_Code BXPT_Rave_GetTotalChannels( 
1077    BXPT_Handle hXpt,           /* [in] Handle for this transport instance. */
1078    unsigned *TotalChannels     /* [out] The number of RAVE channels supported */
1079    );
1080
1081/***************************************************************************
1082Summary:
1083Return the default settings for the RAVE channel.
1084
1085Description:
1086The RAVE channel has certain default settings which the user can override
1087when the device is opened. This function returns those defaults in a structure
1088that can be changed, and then passed to BXPT_Rave_OpenChannel().
1089
1090Returns:
1091    BERR_SUCCESS                - Returned the default settings.
1092    BERR_INVALID_PARAMETER      - Bad input parameter
1093 
1094See Also:
1095BXPT_Rave_OpenChannel
1096****************************************************************************/
1097BERR_Code BXPT_Rave_GetChannelDefaultSettings( 
1098    BXPT_Handle hXpt,                           /* [in] Handle for this transport instance */
1099    unsigned ChannelNo,                         /* [in] Which RAVE instance to get defaults for */
1100    BXPT_Rave_ChannelSettings *RaveDefSettings  /* [out] The defaults. */
1101    );
1102
1103/***************************************************************************
1104Summary:
1105Open the given RAVE channel.
1106
1107Description:
1108Reset the given RAVE channel, configure it using the given defaults, then
1109return a handle to access that channel.
1110
1111Returns:
1112    BERR_SUCCESS                    - RAVE channel opened.
1113    BXPT_ERR_NO_AVAILABLE_RESOURCES - Invalid ChannelNo.
1114    BERR_OUT_OF_SYSTEM_MEMORY       - Not enough RAM for the handle.
1115****************************************************************************/
1116BERR_Code BXPT_Rave_OpenChannel( 
1117    BXPT_Handle hXpt,                                   /* [in] Handle for this transport instance */
1118    BXPT_Rave_Handle *hRave,                            /* [out] Handle for the RAVE channel */
1119    unsigned ChannelNo,                                 /* [in] Which RAVE channel to open */
1120    const BXPT_Rave_ChannelSettings *RaveDefSettings    /* [in] Default settings to use */
1121    );
1122
1123/***************************************************************************
1124Summary:
1125Close a given RAVE channel.
1126
1127Description:
1128Shutdown a given RAVE channel. Interrupts from it are disabled. All context
1129and indexer DRAM buffers are freed.
1130
1131Returns:
1132    BERR_SUCCESS                - RAVE channel closed.
1133    BERR_INVALID_PARAMETER      - Bad input parameter
1134****************************************************************************/
1135BERR_Code BXPT_Rave_CloseChannel( 
1136    BXPT_Rave_Handle hRave     /* [in] Handle for this RAVE instance */
1137    );
1138
1139/***************************************************************************
1140Summary:
1141Allocate a RAVE context.
1142
1143Description:
1144The RAVE AV and record contexts are allocated from logical pools. All contexts
1145within a pool are identical. This call allocates a context of ContextType.
1146
1147For AV contexts, BufferCfg should have the buffer size needed by the decoder.
1148Aligment will be forced to 256 bytes CDB and 128 bytes for ITB. This is a
1149requirement from the decoders.
1150 
1151For record contexts, the buffer size should be large enough to accomodate
1152the host CPU's latency in servicing the context interrupts. The alignment
1153should be a multiple of 32-bit words.
1154
1155Returns:
1156    BERR_SUCCESS                    - Context allocated successfully.
1157    BERR_INVALID_PARAMETER          - Bad ContextType parameter
1158    BXPT_ERR_NO_AVAILABLE_RESOURCES - The requested context is already in use.
1159****************************************************************************/
1160BERR_Code BXPT_Rave_AllocContext( 
1161    BXPT_Rave_Handle hRave,         /* [in] Handle for this RAVE channel */
1162    BXPT_RaveCx RequestedType,      /* [in] The type of context to allcoate */
1163    const BAVC_CdbItbConfig *BufferCfg,   /* [in] Size and alignment for ITB and CDB */
1164    BXPT_RaveCx_Handle *Context     /* [out] The allocated context */
1165    );
1166
1167/***************************************************************************
1168Summary:
1169Allocate a RAVE context, using the given heap for CDB and ITB memory.
1170
1171Description:
1172The RAVE AV and record contexts are allocated from logical pools. All contexts
1173within a pool are identical. This call allocates a context of ContextType.
1174
1175For AV contexts, BufferCfg should have the buffer size needed by the decoder.
1176Aligment will be forced to 256 bytes CDB and 128 bytes for ITB. This is a
1177requirement from the decoders.
1178 
1179For record contexts, the buffer size should be large enough to accomodate
1180the host CPU's latency in servicing the context interrupts. The alignment
1181should be a multiple of 32-bit words.
1182
1183The API allows the caller to specify a different BMEM heap from which the
1184CDB and ITB are allocated. For contexts of type BXPT_RaveCx_eAvR or
1185BXPT_RaveCx_eRecordR, the allocations will still use the RHeap defined
1186when BXPT_Open() is called.
1187
1188Returns:
1189    BERR_SUCCESS                    - Context allocated successfully.
1190    BERR_INVALID_PARAMETER          - Bad ContextType parameter
1191    BXPT_ERR_NO_AVAILABLE_RESOURCES - The requested context is already in use.
1192****************************************************************************/
1193BERR_Code BXPT_Rave_AllocContextFromHeap( 
1194    BXPT_Rave_Handle hRave,         /* [in] Handle for this RAVE channel */
1195    BXPT_RaveCx RequestedType,      /* [in] The type of context to allcoate */
1196    const BAVC_CdbItbConfig *BufferCfg,   /* [in] Size and alignment for ITB and CDB */
1197    BMEM_Handle ContextHeap,         /* [in] This context's memory heap handle */
1198    BXPT_RaveCx_Handle *Context     /* [out] The allocated context */
1199    );
1200
1201/***************************************************************************
1202Summary:
1203Enable or disable a RAVE context.
1204
1205Description:
1206This call will enable the given audio/video or record context.
1207
1208Returns:
1209    BERR_SUCCESS                    - Context allocated successfully.
1210    BERR_INVALID_PARAMETER          - Bad ContextType parameter
1211    BXPT_ERR_NO_AVAILABLE_RESOURCES - The requested context is already in use.
1212****************************************************************************/
1213BERR_Code BXPT_Rave_EnableContext( 
1214    BXPT_RaveCx_Handle Context      /* [in] The context. */
1215    );
1216
1217/***************************************************************************
1218Summary:
1219Disable a RAVE context.
1220
1221Description:
1222This call will disable a given RAVE context. 
1223
1224Returns:
1225    BERR_SUCCESS                    - Context allocated successfully.
1226    BERR_INVALID_PARAMETER          - Bad ContextType parameter
1227****************************************************************************/
1228BERR_Code BXPT_Rave_DisableContext( 
1229    BXPT_RaveCx_Handle Context      /* [in] The context. */
1230    );
1231
1232/***************************************************************************
1233Summary:
1234Allocate a record channel indexer.
1235
1236Description:
1237The RAVE currently supports automatic generation of index tables, which are
1238handy to have around for PVR applications. There are several types of indexers.
1239This function will allocated one (or more, if supported) indexer(s) of the
1240requested type and map it to the record channel given by RecordContextNum.
1241
1242If multiple startcode indexers will be used on the same record, they must be
1243allocated at the same time. The NumIndexer argument is ignored when TPIT
1244indexers are requested, since only 1 TPIT may be mapped to a record.
1245
1246Note that there are some restrictions:
1247Only 1 TPIT indexer may be allocated to record context.
1248At most 8 SCD indexers may be allocated to a record context.
1249
1250Returns:
1251    BERR_SUCCESS                    - Context allocated successfully.
1252    BERR_INVALID_PARAMETER          - Bad ContextType parameter
1253    BXPT_ERR_NO_AVAILABLE_RESOURCES - Not enough resources to meet the request.
1254****************************************************************************/
1255BERR_Code BXPT_Rave_AllocIndexer( 
1256    BXPT_Rave_Handle hRave,         /* [in] Handle for this RAVE channel */
1257    BXPT_RaveIdx IndexerType,       /* [in] Which type of indexer */
1258    unsigned NumIndexers,           /* [in] Number of indexers requested */
1259    BXPT_RaveCx_Handle Context,     /* [in] The record context that this indexer should be mapped to */
1260    BXPT_RaveIdx_Handle *Indexer    /* [out] Handle for the allocated indexer */
1261    );
1262
1263/***************************************************************************
1264Summary:
1265Free a RAVE context.
1266
1267Description:
1268Disable the given context, then free up any internal-allocated memory.
1269
1270Returns:
1271    BERR_SUCCESS                    - Context freed successfully.
1272    BERR_INVALID_PARAMETER          - Bad parameter
1273****************************************************************************/
1274BERR_Code BXPT_Rave_FreeContext( 
1275    BXPT_RaveCx_Handle Context      /* [in] The context to free. */
1276    );
1277       
1278/***************************************************************************
1279Summary:
1280Free a record channel indexer.
1281
1282Description:
1283Disable the given indexer, then free up any internal-allocated memory.
1284
1285Returns:
1286    BERR_SUCCESS                    - Context freed successfully.
1287    BERR_INVALID_PARAMETER          - Bad parameter
1288****************************************************************************/
1289BERR_Code BXPT_Rave_FreeIndexer( 
1290    BXPT_RaveIdx_Handle Indexer     /* [in] The indexer to free. */
1291    );
1292
1293/***************************************************************************
1294Summary:
1295Get the configuration for a record indexer.
1296
1297Description:
1298The current hardware settings for the given indexer are returned.
1299
1300Returns:
1301    BERR_SUCCESS                    - Configuration read successfully.
1302    BERR_INVALID_PARAMETER          - Bad parameter
1303****************************************************************************/
1304BERR_Code BXPT_Rave_GetIndexerConfig( 
1305    BXPT_RaveIdx_Handle Indexer,        /* [in] Handle for the allocated indexer */
1306    BXPT_Rave_IndexerSettings *Config   /* [out] The indexer settings */
1307    );
1308
1309/***************************************************************************
1310Summary:
1311Set the configuration for a record indexer.
1312
1313Description:
1314The current hardware settings for the given indexer are written to hardware.
1315
1316Returns:
1317    BERR_SUCCESS                    - Configuration read successfully.
1318    BERR_INVALID_PARAMETER          - Bad parameter
1319****************************************************************************/
1320BERR_Code BXPT_Rave_SetIndexerConfig( 
1321    BXPT_RaveIdx_Handle Indexer,            /* [in] Handle for the allocated indexer */
1322    const BXPT_Rave_IndexerSettings *Config /* [in] The indexer settings */
1323    );
1324
1325/***************************************************************************
1326Summary:
1327Set the filter criterion for the given startcode detector.
1328
1329Description:
1330The startcode detector can produce tables when certain PIDs are seen in the
1331transport stream. This function sets the PID channel and other required settings. The
1332caller supplies the indexer handle that was returned by BXPT_Rave_AllocIndexer().
1333Since record contexts may have up to 8 separate startcode detectors, the
1334WhichScd argument is used to select which one to configure. 
1335
1336Returns:
1337    BERR_SUCCESS                    - Configuration loaded successfully.
1338    BERR_INVALID_PARAMETER          - Bad parameter
1339
1340See also:
1341BXPT_Rave_SetScdUsingPid
1342****************************************************************************/
1343BERR_Code BXPT_Rave_SetScdEntry( 
1344    BXPT_RaveIdx_Handle Indexer,            /* [in] Handle for the allocated indexer */
1345    unsigned WhichScd,                      /* [in] Which of the startcode detectors. */
1346    const BXPT_Rave_ScdEntry *ScdConfig     /* [in] The indexer settings */
1347    );
1348
1349/***************************************************************************
1350Summary:
1351Set the filter criterion for the given TPIT generator.
1352
1353Description:
1354The transport parser index table generator can produce tables when certain
1355flags are seen in the transport packets. This function sets the filtering
1356needed to recognize those flags.
1357
1358Each record context may have at most 1 TPIT generator. However, each TPIT
1359can support independent filtering for up to 16 different PIDs.
1360
1361Returns:
1362    BERR_SUCCESS                    - Configuration loaded successfully.
1363    BERR_INVALID_PARAMETER          - Bad parameter
1364****************************************************************************/
1365BERR_Code BXPT_Rave_SetTpitFilter( 
1366    BXPT_RaveIdx_Handle Indexer,            /* [in] Handle for the allocated indexer */
1367    unsigned WhichFilter,                   /* [in] Which of the 16 filters. */
1368    const BXPT_Rave_TpitEntry *Tpit         /* [in] The indexer settings */
1369    );
1370
1371/***************************************************************************
1372Summary:
1373Set the ECM Odd and Even table IDs.
1374
1375Description:
1376Set the ECM Odd and Even table IDs used by TPIT generation. These fields are
1377only used when BXPT_Rave_TpitEntry.Mpeg.EcmPolarityChangeEn is true. The TPIT
1378logic can filter on up to 3 Odd/Even pairs simultaneously, so the caller must
1379specify which pair of TIDs to set. Valid values for WhichPair are 1, 2, and 3.
1380
1381Returns:
1382    BERR_SUCCESS                    - Configuration loaded successfully.
1383    BERR_INVALID_PARAMETER          - Bad parameter
1384****************************************************************************/
1385BERR_Code BXPT_Rave_SetTpitEcms( 
1386    BXPT_RaveIdx_Handle Indexer,        /* [in] Handle for the allocated indexer */
1387    unsigned WhichPair,                 /* [in] ECM TID pair 1, 2, or 3 */
1388    unsigned EvenEcmTid,                /* [in] Even ECM TID */
1389    unsigned OddEcmTid                  /* [in] Odd ECM TID */
1390    );
1391
1392/***************************************************************************
1393Summary:
1394Return the addresses of the context regiseters needed by the RAVE clients.
1395
1396Description:
1397Clients must directly access the context pointer registers in RAVE to update
1398them in a timely manner. This call will return the addresses of the pointer
1399registers.
1400
1401Addresses are given as offsets from the start of HIF (Host Interface) block.
1402The addresses should not require modification before loading into hardware.
1403
1404Returns:
1405    BERR_SUCCESS                    - Numbers returned through pointers.
1406    BERR_INVALID_PARAMETER          - Bad parameter
1407****************************************************************************/
1408BERR_Code BXPT_Rave_GetContextRegisters( 
1409    BXPT_RaveCx_Handle Context,     /* [in] The context  */
1410    BAVC_XptContextMap *Map         /* [out] Channel info this context uses. */
1411    );
1412
1413/***************************************************************************
1414Summary:
1415Get the record context configuration.
1416
1417Description:
1418The current configuration of the given record context is returned.
1419
1420Returns:
1421    BERR_SUCCESS                    - Configuration read successfully.
1422    BERR_INVALID_PARAMETER          - Bad parameter
1423****************************************************************************/
1424BERR_Code BXPT_Rave_GetRecordConfig( 
1425    BXPT_RaveCx_Handle Context,         /* [in] The context  */
1426    BXPT_Rave_RecordSettings *Config    /* [out] The record settings. */
1427    );
1428
1429/***************************************************************************
1430Summary:
1431Get the record context configuration.
1432
1433Description:
1434The current configuration of the given record context is returned.
1435
1436Returns:
1437    BERR_SUCCESS                    - Configuration read successfully.
1438    BERR_INVALID_PARAMETER          - Bad parameter
1439****************************************************************************/
1440BERR_Code BXPT_Rave_SetRecordConfig( 
1441    BXPT_RaveCx_Handle Context,                     /* [in] The context  */
1442    const BXPT_Rave_RecordSettings *RecConfig       /* [in] The record settings. */
1443    );
1444
1445/***************************************************************************
1446Summary:
1447Get the AV context configuration.
1448
1449Description:
1450The current configuration of the given AV context is returned.
1451
1452Returns:
1453    BERR_SUCCESS                    - Configuration read successfully.
1454    BERR_INVALID_PARAMETER          - Bad parameter
1455****************************************************************************/
1456BERR_Code BXPT_Rave_GetAvConfig( 
1457    BXPT_RaveCx_Handle Context,         /* [in] The context  */
1458    BXPT_Rave_AvSettings *Config    /* [out] The AV settings. */
1459    );
1460
1461/***************************************************************************
1462Summary:
1463Set the AV context configuration.
1464
1465Description:
1466The given configuration is loaded into the AV context.
1467
1468Returns:
1469    BERR_SUCCESS                    - Configuration written successfully.
1470    BERR_INVALID_PARAMETER          - Bad parameter
1471****************************************************************************/
1472BERR_Code BXPT_Rave_SetAvConfig( 
1473    BXPT_RaveCx_Handle Context,         /* [in] The context  */
1474    const BXPT_Rave_AvSettings *Config  /* [out] The AV settings. */
1475    );
1476
1477/***************************************************************************
1478Summary:
1479Return the size and starting address of new data in the record context.
1480
1481Description:
1482If new data has been captured into the record context, this call will return
1483the location of the data and the number of bytes. The data is stored in a
1484hardware ring buffer, so wrap around conditions can and will occur.
1485
1486The BXPT_Rave_DataPtrs contains two sets of pointers and byte counts. The
1487first is used for data written prior to the wrap around. The second set,
1488along with the wrap around address, is used if the data did wrap. The second
1489pointer set and the wrap address will be 0 if no wrap around happened.
1490
1491NOTE: If either byte count is 0, meaning no new data in the buffer, the
1492corrosponding pointer will be set to NULL.
1493                                                 
1494Returns:
1495    BERR_SUCCESS                    - Returned size and starting address successfully.
1496    BERR_INVALID_PARAMETER          - Bad parameter
1497
1498See Also:
1499BXPT_Rave_UpdateReadOffset
1500****************************************************************************/
1501BERR_Code BXPT_Rave_CheckBuffer( 
1502    BXPT_RaveCx_Handle Context,         /* [in] The context  */
1503    BXPT_Rave_ContextPtrs *Ptrs         /* [out] Pointers to the buffer data */
1504    );
1505
1506/***************************************************************************
1507Summary:
1508Update the record context's read pointer.
1509
1510Description:
1511The read pointer is used to tell the context hardware what memory in the buffer
1512has been read by the caller. The caller sets *ByteCount to the number of
1513bytes read since the last time this function was called.
1514                                                 
1515Returns:
1516    BERR_SUCCESS                    - Read pointer updated.
1517    BERR_INVALID_PARAMETER          - Bad parameter
1518
1519See Also:
1520BXPT_Rave_CheckBuffer
1521****************************************************************************/
1522BERR_Code BXPT_Rave_UpdateReadOffset( 
1523    BXPT_RaveCx_Handle Context,         /* [in] The context  */
1524    size_t CdbByteCount,            /* [in] Number of CDB bytes read. */
1525    size_t ItbByteCount             /* [in] Number of ITB bytes read. */
1526    );
1527
1528/***************************************************************************
1529Summary:
1530Add a PID channel to a context.
1531
1532Description:
1533The contexts accept data from PID channels. This call adds a PID channel to
1534a context. Note that AV contexts may have no more than 1 PID channel, whereas
1535record contexts may have several.
1536
1537Returns:
1538    BERR_SUCCESS                - Channel added successfully.
1539    BERR_INVALID_PARAMETER      - Bad input parameter
1540
1541See Also:
1542BXPT_Rave_RemovePidChannel
1543****************************************************************************/
1544BERR_Code BXPT_Rave_AddPidChannel(
1545    BXPT_RaveCx_Handle Context,     /* [in] The context  */
1546    unsigned int PidChanNum,        /* [in] Which PID channel to add. */
1547    bool UseDecrypted               /* [in] Use decrypted versions of packets on this channel */
1548    );
1549
1550
1551/***************************************************************************
1552Summary:
1553Add a BPP PID channel to a context.
1554
1555Description:
1556The contexts accept data from PID channels. This call adds a PID channel to
1557a context. Note that AV contexts may have no more than 1 PID channel, whereas
1558record contexts may have several.
1559
1560Returns:
1561    BERR_SUCCESS                - Channel added successfully.
1562    BERR_INVALID_PARAMETER      - Bad input parameter
1563
1564See Also:
1565BXPT_Rave_RemovePidChannel
1566****************************************************************************/
1567BERR_Code BXPT_Rave_AddBppChannel(
1568    BXPT_RaveCx_Handle Context,     /* [in] The context  */
1569    unsigned int PidChanNum,        /* [in] Which PID channel to add. */
1570    bool UseDecrypted               /* [in] Use decrypted versions of packets on this channel */
1571    );
1572
1573
1574/***************************************************************************
1575Summary:
1576Remove a All PID channels from a context.
1577
1578Description:
1579The contexts accept data from PID channels. This call removes all PID channels
1580from a context. Record contexts may have several PID channels for same context.
1581
1582Returns:
1583    BERR_SUCCESS                - All Pid Channels removed successfully.
1584    BERR_INVALID_PARAMETER      - Bad input parameter
1585
1586See Also:
1587BXPT_Rave_AddPidChannel
1588****************************************************************************/
1589BERR_Code BXPT_Rave_RemoveAllPidChannel(
1590    BXPT_RaveCx_Handle Context         /* [in] The context  */
1591    );
1592
1593/***************************************************************************
1594Summary:
1595Remove a PID channel from a context.
1596
1597Description:
1598The contexts accept data from PID channels. This call removes a PID channel from
1599a context. Note that AV contexts may have no more than 1 PID channel, whereas
1600record contexts may have several.
1601
1602Returns:
1603    BERR_SUCCESS                - Channel removed successfully.
1604    BERR_INVALID_PARAMETER      - Bad input parameter
1605
1606See Also:
1607BXPT_Rave_AddPidChannel
1608****************************************************************************/
1609BERR_Code BXPT_Rave_RemovePidChannel(
1610    BXPT_RaveCx_Handle Context,         /* [in] The context  */
1611    unsigned int PidChanNum         /* [in] Which PID channel to remove. */
1612    );
1613
1614/***************************************************************************
1615Summary:
1616Set the user bits for 30-bit-format timestamp.
1617
1618Description:
1619In some configurations, the upper 2 bits of the packet's recorded timestamp
1620may be user-programmable. This function will set the upper 2 bits of the
1621timestamp prepended to the packet by the record engine. The 2 least
1622significant bits of the Bits argument are used as the new value of the user
1623programmable timestamp bits.
1624
1625Returns:
1626    BERR_SUCCESS                - New user bits have been set.
1627    BERR_INVALID_PARAMETER      - Bad input parameter
1628****************************************************************************/
1629BERR_Code BXPT_Rave_SetTimestampUserBits(
1630    BXPT_RaveCx_Handle Context,         /* [in] The record context  */
1631    unsigned int Bits                   /* [in] The new value for the user bits. */
1632    ); 
1633
1634/***************************************************************************
1635Summary:
1636Return some statistics for the given record context.
1637
1638Description:
1639The following information about the record context is returned:
1640
1641- The elapsed time since the record was enabled, expressed in 1.26 uSec ticks
1642- Number of bytes recorded since the record context was enabled.
1643
1644Returns:
1645    BERR_SUCCESS                - Obtained record count successfully.
1646    BERR_INVALID_PARAMETER      - Bad input parameter 
1647****************************************************************************/
1648BERR_Code BXPT_Rave_GetRecordStats(
1649    BXPT_RaveCx_Handle Context,         /* [in] The record context  */
1650    BXPT_Rave_RecordStats *Stats        /* [out] Record context statistics. */
1651    );
1652
1653/***************************************************************************
1654Summary:
1655Get CDB size and depth.
1656
1657Description:
1658Return the size and depth of the CDB associated with the given handle.
1659
1660Returns:
1661    BERR_SUCCESS                    - Valid info returned in BufferInfo.
1662    BERR_INVALID_PARAMETER          - Bad Context parameter
1663****************************************************************************/
1664BERR_Code BXPT_Rave_GetBufferInfo( 
1665    BXPT_RaveCx_Handle hCtx,            /* [in] The context. */
1666    BXPT_Rave_BufferInfo *BufferInfo    /* [out] CDB depth and size */
1667    );
1668
1669/***************************************************************************
1670Summary:
1671Get CDB size and depth from within an ISR context.
1672
1673Description:
1674Return the size and depth of the CDB associated with the given handle. Callable
1675by an ISR.
1676
1677Returns:
1678    BERR_SUCCESS                    - Valid info returned in BufferInfo.
1679    BERR_INVALID_PARAMETER          - Bad Context parameter
1680****************************************************************************/
1681#define BXPT_Rave_GetBufferInfo_isr     BXPT_Rave_GetBufferInfo
1682
1683/***************************************************************************
1684Summary:
1685Return BINT_Id for a given RAVE interrupt.
1686
1687Description:
1688Generate the correct BINT_Id for a context interrupt. The Name argument indicates
1689which of the context's interrupts is needed. The result is a BINT_Id value suitable
1690for use in BINT_CreateCallback().
1691
1692Returns:
1693    BERR_SUCCESS                - Id generated successfully.
1694    BERR_INVALID_PARAMETER      - Bad input parameter 
1695****************************************************************************/
1696BERR_Code BXPT_Rave_GetIntId(
1697    BXPT_RaveCx_Handle ThisCtx, 
1698    BXPT_RaveIntName Name,
1699    BINT_Id *IntId
1700    );
1701
1702BERR_Code BXPT_Rave_PushPidChannel(
1703    BXPT_RaveCx_Handle hCtx,        /* [in] The context. */
1704    unsigned int PidChannel,        /* [in] Current PID Channel. */
1705    unsigned int SplicePidChannel   /* [in] Channel carrying the PID to splice. */
1706    );
1707
1708BERR_Code BXPT_Rave_ClearQueue(
1709    BXPT_RaveCx_Handle hCtx         /* [in] The context. */
1710    );
1711
1712unsigned BXPT_Rave_GetQueueDepth(
1713    BXPT_RaveCx_Handle hCtx         /* [in] The context. */
1714    );
1715
1716/***************************************************************************
1717Summary:
1718Return context status.
1719
1720Description:
1721Get miscellaneous status values for the given context.
1722
1723Returns:
1724    BERR_SUCCESS                    - Valid info returned in CxStatus.
1725    BERR_INVALID_PARAMETER          - Bad Context parameter
1726****************************************************************************/
1727BERR_Code BXPT_Rave_GetContextStatus(
1728    BXPT_RaveCx_Handle hCtx,
1729    BXPT_RaveCx_Status *CxStatus
1730    );
1731
1732/***************************************************************************
1733Summary:
1734Flush the CDB and ITB.
1735
1736Description:
1737Clear the compressed data and index table buffers associated with the given
1738context. This is done by updating the CDB and ITB READ pointers to match
1739their respective VALID pointers.
1740
1741Returns:
1742    BERR_SUCCESS                    - Flush successful.
1743    BERR_INVALID_PARAMETER          - Bad Context parameter
1744****************************************************************************/
1745BERR_Code BXPT_Rave_FlushContext(
1746    BXPT_RaveCx_Handle hCtx
1747    );
1748
1749/***************************************************************************
1750Summary:
1751Reset the context.
1752
1753Description:
1754Reset the context to it orignal reset state, same state as after its allocated
1755by BXPT_Rave_AllocContext. In order to use the context, it must be
1756reconfigured using  BXPT_Rave_SetRecordConfig,BXPT_Rave_SetAvConfig.
1757This function should used when frequent allocation/deallocation of RAVE
1758context is not desirable. This function should not be used to resuse AV context
1759as Record and vice versa.
1760
1761Returns:
1762    BERR_SUCCESS                    - Flush successful.
1763    BERR_INVALID_PARAMETER          - Bad Context parameter
1764****************************************************************************/
1765BERR_Code BXPT_Rave_ResetContext(
1766    BXPT_RaveCx_Handle hCtx
1767    );
1768
1769/***************************************************************************
1770Summary:
1771Get picture count from an AV context.
1772
1773Description:
1774Return the number of pictures in the context's CDB. This call will return 0
1775if called for a record context, or if there is no picture counter assigned
1776to the given context.
1777
1778Returns:
1779    BERR_SUCCESS                    - Obtained a picture count.
1780    BERR_INVALID_PARAMETER          - Bad Context parameter
1781****************************************************************************/
1782BERR_Code BXPT_Rave_GetPictureCount(
1783    BXPT_RaveCx_Handle hCtx,
1784    unsigned *PictureCount
1785    );
1786
1787/***************************************************************************
1788Summary:
1789Return the default CDB and ITB thresholds for the given context.
1790
1791Description:
1792Return the default CDB and ITB thresholds for the given context.
1793
1794Returns:
1795    BERR_SUCCESS                - Retrieved thresholds.
1796    BERR_INVALID_PARAMETER      - Bad input parameter
1797****************************************************************************/
1798BERR_Code BXPT_Rave_GetDefaultThresholds(
1799    BXPT_RaveCx_Handle hCtx,
1800    BXPT_Rave_ContextThresholds *Thresholds
1801    );
1802
1803/***************************************************************************
1804Summary:
1805Return the CDB and ITB thrasholds for the given CDB and ITB lengths.
1806
1807Description:
1808Return the CDB and ITB thrasholds for the given CDB and ITB lengths. If a size
1809of 0 passed in length, the default values for the corrosponding threshold is
1810returned.
1811
1812Returns:
1813    BERR_SUCCESS                - Retrieved thresholds.
1814    BERR_INVALID_PARAMETER      - Bad input parameter
1815****************************************************************************/
1816BERR_Code BXPT_Rave_ComputeThresholds(
1817    BXPT_RaveCx_Handle hCtx,
1818    size_t CdbLength,
1819    size_t ItbLength,
1820    BXPT_Rave_ContextThresholds *Thresholds
1821    );
1822
1823/***************************************************************************
1824Summary:
1825Return the current CDB and ITB thresholds for the given context.
1826
1827Description:
1828Return the current CDB and ITB thresholds for the given context.
1829
1830Returns:
1831    BERR_SUCCESS                - Retrieved thresholds.
1832    BERR_INVALID_PARAMETER      - Bad input parameter
1833****************************************************************************/
1834BERR_Code BXPT_Rave_GetThresholds(
1835    BXPT_RaveCx_Handle hCtx,
1836    BXPT_Rave_ContextThresholds *Thresholds
1837    );
1838
1839/***************************************************************************
1840Summary:
1841Set the current CDB and ITB thresolds for the given context.
1842
1843Description:
1844Set the current CDB and ITB thresolds for the given context.
1845
1846Returns:
1847    BERR_SUCCESS                - Retrieved thresholds.
1848    BERR_INVALID_PARAMETER      - Bad input parameter
1849****************************************************************************/
1850BERR_Code BXPT_Rave_SetThresholds(
1851    BXPT_RaveCx_Handle hCtx,
1852    const BXPT_Rave_ContextThresholds *Thresholds
1853    );
1854
1855/***************************************************************************
1856Summary:
1857Set the filter criterion, including the PID, for the given startcode detector.
1858
1859Description:
1860The startcode detector can produce tables when certain PIDs are seen in the
1861transport stream. This function sets the PID and other required settings. The
1862caller supplies the indexer handle that was returned by BXPT_Rave_AllocIndexer().
1863
1864This API allows the caller to specify the PID to build startcodes for, rather
1865than the PID channel. When operating in this mode, record contexts may have up
1866to 4 separate startcode detectors, instead of the usual 8. The PidChannel
1867member of ScdConfig is ignored.
1868
1869Returns:
1870    BERR_SUCCESS                    - Configuration loaded successfully.
1871    BERR_INVALID_PARAMETER          - Bad parameter
1872
1873See also:
1874BXPT_Rave_SetScdEntry
1875****************************************************************************/
1876BERR_Code BXPT_Rave_SetScdUsingPid( 
1877    BXPT_RaveIdx_Handle Indexer,            /* [in] Handle for the allocated indexer */
1878    unsigned WhichScd,                      /* [in] Which of the startcode detectors. */
1879    unsigned Pid,                           /* [in] Which PID startcodes will be built for */
1880    const BXPT_Rave_ScdEntry *ScdConfig     /* [in] The indexer settings */
1881    );
1882
1883typedef enum BXPT_Rave_PesSidExtMode
1884{
1885    BXPT_Rave_PesSidExtNormal = 0,             /* Don't selectively drop packets based on stream ID extension values */
1886    BXPT_Rave_PesSidExtIndependent = 1,        /* Keep only independent substream. */
1887    BXPT_Rave_PesSidExtDependent =   2,        /* Keep only dependent substream */
1888    BXPT_Rave_PesSidExtKeepAll     = 3         /* Keep everything in stream and place match bits in ITB Address entry */
1889
1890}BXPT_Rave_PesSidExtMode;
1891
1892typedef enum BXPT_Rave_PesExtSearchMode
1893{
1894    BXPT_Rave_PesExtSearchNone =0x00,           /* Do not search for PES extension or stream ID extension */
1895    BXPT_Rave_PesExtSearchSpecial =0x01,        /* Search for extension and PES stream ID extension only when PES stream ID = 0xFD */
1896    BXPT_Rave_PesExtSearchAlways = 0x02         /* Always search for extension and PES stream ID extension (flags must be set in PES header) */
1897}BXPT_Rave_PesExtSearchMode;
1898
1899typedef struct BXPT_Rave_ContextSettings
1900{
1901    /* Context configuration setting to
1902       be used with  HD-DVD,PES and DVD playback */
1903
1904    bool    EnableBppSearch;         /* Enable/Disable BPP search,BPP is added by packetizer during PES and DVD PB modes */
1905    uint8_t AudFrameInfo;            /* Value of 0-14, indicates number of bytes of data to be removed after the end of PES header,
1906                                        Value of 15, indicates the length of audio private header is inside the data
1907                                        HW uses this length to determine the number of bytes to remove after PES header. */
1908
1909    bool    EnablePrivateHdrItbEntry; /* If AudFrameInfo above is > 0 and this field is set to true then stripped out
1910                                        private header is placed as an ITB entry */
1911    unsigned FilterPidStreamId;     /* This value is used to filter packets (either transport or PES) in order to determine
1912                                    which context they belong to. It should not be confused with the CX_Stream_ID_Range
1913                                    register, which specifies a range of stream IDs used only with transport-based format to
1914                                    determine the beginning of PES headers within a context.*/
1915
1916    /* Context configuration setting to
1917       be used with BlueRay playback */
1918
1919    bool    EnableCpChangeDetect;    /* Enable/Disable Copy Protection bit change detection */
1920
1921    BXPT_Rave_PesSidExtMode PesSidExtMode; 
1922    BXPT_Rave_PesExtSearchMode PesExtSearchMode;
1923    uint8_t SidExtDependent;         /* Dependent Stream ID extension value */
1924    uint8_t SidExtIndependent;       /* Independent Stream ID extension value */
1925}
1926BXPT_Rave_ContextSettings;
1927
1928BERR_Code BXPT_Rave_GetContextDefaultSettings( 
1929    BXPT_Rave_ContextSettings *ContextDefSettings   /* [out] The defaults. */
1930    );
1931
1932/***************************************************************************
1933Summary:
1934Get the context configuration.
1935
1936Description:
1937The current configuration of the given context is returned.
1938
1939Returns:
1940    BERR_SUCCESS                    - Configuration read successfully.
1941    BERR_INVALID_PARAMETER          - Bad parameter
1942****************************************************************************/
1943BERR_Code BXPT_Rave_GetContextConfig( 
1944    BXPT_RaveCx_Handle Context,         /* [in] The context  */
1945    BXPT_Rave_ContextSettings *Config   /* [out] The AV settings. */
1946    );
1947
1948/***************************************************************************
1949Summary:
1950Set the context configuration.
1951
1952Description:
1953The given configuration is loaded into the context.
1954
1955Returns:
1956    BERR_SUCCESS                    - Configuration written successfully.
1957    BERR_INVALID_PARAMETER          - Bad parameter
1958****************************************************************************/
1959BERR_Code BXPT_Rave_SetContextConfig( 
1960    BXPT_RaveCx_Handle Context,         /* [in] The context  */
1961    const BXPT_Rave_ContextSettings *Config /* [out] The AV settings. */
1962    );
1963
1964/***************************************************************************
1965Summary:
1966AV over IP configuration settings. Done on a per-context basis.
1967****************************************************************************/
1968typedef struct BXPT_Rave_IpConfig
1969{
1970        uint16_t IpHeaderChecksum;              /* Initial checksum value for each IP packet */
1971        uint8_t IpHeaderLength;                 /* Number of bytes skipped in the beginning of each IP packet */
1972        uint8_t NumTsPackets;                   /* Number of transport packets in each IP packet */
1973        uint16_t SequenceNumIncrement;  /* Added to the sequence_number field of each IP packet */
1974        uint32_t CurrentSequenceNum;    /* Initial value of sequence_num. */
1975        bool IsMpegTs;                                  /* True if TS packets are MPEG format, false otherwise */
1976}
1977BXPT_Rave_IpConfig;
1978
1979BERR_Code BXPT_Rave_GetIpConfig(
1980        BXPT_RaveCx_Handle hCtx,                /* [in] Handle for the IP context */
1981        BXPT_Rave_IpConfig *IpConfig    /* [out] The IP config params */
1982        );
1983
1984BERR_Code BXPT_Rave_SetIpConfig(
1985        BXPT_RaveCx_Handle hCtx,                        /* [in] Handle for the IP context */
1986        const BXPT_Rave_IpConfig *IpConfig      /* [out] The IP config params */
1987        );
1988
1989/***************************************************************************
1990Summary:
1991Return a pointer to the base of the context's CDB.
1992
1993Description:
1994Returns a CPU-usable pointer to the start of the context's CDB. Or NULL if
1995an error occurred.
1996
1997Returns:
1998        uint8_t * - Pointer to the start of the CDB
1999        NULL - An internal error occured.
2000****************************************************************************/
2001uint8_t *BXPT_Rave_GetCdbBasePtr(
2002    BXPT_RaveCx_Handle hCtx
2003    );
2004
2005/***************************************************************************
2006Summary: Soft RAVE support in the XPT PI.
2007
2008The XPT PI now incorporates the soft RAVE functions from bsettop_base_rave.c
2009with some additional features:
2010
2011- 2 or more soft RAVE contexts can run concurrently.
2012- The soft context may be reset, returning the state variables to their default
2013values. It isn't necessary to free the soft context and then reallocate to
2014achieve a full reset.
2015
2016Only a subset of the total RAVE PI is supported by the soft contexts. The
2017supported calls are:
2018
2019BXPT_Rave_FreeContext() - Free all memory allocated by the soft context.
2020BXPT_Rave_FlushContext() - Clear the soft context's CDB and ITB.
2021****************************************************************************/
2022
2023/***************************************************************************
2024Summary:
2025Enumeration of all supported soft RAVE modes.
2026****************************************************************************/
2027typedef enum BXPT_RaveSoftMode
2028{
2029        BXPT_RaveSoftMode_ePointersOnly,        /* don't copy ITB, just manage ITB pointers */
2030        BXPT_RaveSoftMode_eCopyItb,             /* copy ITB, but no transform */
2031        BXPT_RaveSoftMode_eVc1SimpleMain,       /* copy ITB and transform for VC1 simple/main */
2032        BXPT_RaveSoftMode_eDivX,                        /* copy ITB and transform for DivX 5 */
2033        BXPT_RaveSoftMode_eDivX_noReorder,      /* copy ITB and transform for DivX 5, but do not reorder timestamps */
2034        BXPT_RaveSoftMode_eDivX_311,            /* copy ITB and transform for DivX 3.11 */
2035        BXPT_RaveSoftMode_eIframeTrick,         /* I-Frame trick mode */
2036    BXPT_RaveSoftMode_eIndexOnlyRecord,  /* CDB is shared, but ITB is not. */
2037    BXPT_RaveSoftMode_eDynamic_Splice,      /* CDB is shared, but ITB is not. */
2038    BXPT_RaveSoftMode_eMax              /* End of the enum list */
2039}
2040BXPT_RaveSoftMode;
2041
2042/***************************************************************************
2043Summary:
2044Allocate a soft RAVE context.
2045
2046Description:
2047Allocate a software-RAVE AV context, using the CDB from the SrcContext. A context
2048handle suitable for use is returned in DestContext. Note that startcode
2049RAVE API calls will not work on the DestContext.
2050
2051This call replaces bsettop_p_setup_sw_rave().
2052
2053Returns:
2054    BERR_SUCCESS                    - Soft RAVE context allocated.
2055    BXPT_ERR_NO_AVAILABLE_RESOURCES - Not enough RAVE contexts remaining to allocate.
2056    BERR_OUT_OF_SYSTEM_MEMORY       - Not enough DRAM for the DestContext ITB.
2057****************************************************************************/
2058BERR_Code BXPT_Rave_AllocSoftContext( 
2059        BXPT_RaveCx_Handle SrcContext,          /* [in] The source context */
2060        BXPT_RaveSoftMode DestContextMode,      /* [in] The type of data that the destination should generate. */
2061        BXPT_RaveCx_Handle *DestContext         /* [out] The destination (soft) context */
2062        );
2063
2064/***************************************************************************
2065Summary:
2066Allocate a soft RAVE context, using the specified heap for the ITB.
2067
2068Description:
2069Allocate a software-RAVE AV context, using the CDB from the SrcContext. A context
2070handle suitable for use is returned in DestContext. Note that startcode
2071RAVE API calls will not work on the DestContext.
2072
2073This call replaces bsettop_p_setup_sw_rave().
2074
2075Returns:
2076    BERR_SUCCESS                    - Soft RAVE context allocated.
2077    BXPT_ERR_NO_AVAILABLE_RESOURCES - Not enough RAVE contexts remaining to allocate.
2078    BERR_OUT_OF_SYSTEM_MEMORY       - Not enough DRAM for the DestContext ITB.
2079****************************************************************************/
2080BERR_Code BXPT_Rave_AllocSoftContextFromHeap( 
2081    BXPT_RaveCx_Handle SrcContext,      /* [in] The source context */
2082    BXPT_RaveSoftMode DestContextMode,  /* [in] The type of data that the destination should generate. */
2083    BMEM_Handle ContextHeap,            /* [in] The soft-context's memory heap handle, or NULL */
2084    BXPT_RaveCx_Handle *DestContext     /* [out] The destination (soft) context */
2085    );
2086
2087/******************************************************************************
2088Summary;
2089Settings passed to BXPT_Rave_AllocCx.
2090******************************************************************************/
2091typedef struct BXPT_Rave_AllocCxSettings
2092{
2093    BXPT_RaveCx RequestedType;
2094    BAVC_CdbItbConfig BufferCfg;
2095    void *CdbBuffer; /* optional. if NULL, XPT will alloc. if not null, it must be uncached and size must match BufferCfg values. */
2096    void *ItbBuffer; /* optional. if NULL, XPT will alloc. if not null, it must be uncached and size must match BufferCfg values. */
2097
2098    BXPT_RaveCx_Handle SoftRaveSrcCx;   /* If non-NULL, a soft-rave context is allocated and paired with this source context */
2099    BXPT_RaveSoftMode SoftRaveMode; /* soft-rave mode of destination context. used only if SoftRaveSrcCx is not-null */
2100} BXPT_Rave_AllocCxSettings;
2101
2102/***************************************************************************
2103Summary:
2104Get default settings for BXPT_Rave_AllocCxSettings.
2105****************************************************************************/
2106void BXPT_Rave_GetDefaultAllocCxSettings(
2107    BXPT_Rave_AllocCxSettings *pSettings /* [out] default settings */
2108    );
2109
2110/***************************************************************************
2111Summary:
2112Allocate a RAVE or soft RAVE context.
2113
2114Description:
2115This function can be used to allocate a RAVE or soft RAVE context. It provides
2116the same functionality as BXPT_Rave_AllocContext and BXPT_Rave_AllocSoftContext
2117but also allows passing-in a pre-allocated CDB and/or ITB buffer.
2118
2119Returns:
2120    BERR_SUCCESS                    - Context allocated successfully.
2121    BERR_INVALID_PARAMETER          - Bad ContextType parameter
2122    BXPT_ERR_NO_AVAILABLE_RESOURCES - The requested context is already in use.
2123****************************************************************************/
2124BERR_Code BXPT_Rave_AllocCx(
2125    BXPT_Rave_Handle hRave,         /* [in] Handle for this RAVE channel */
2126    const BXPT_Rave_AllocCxSettings *pSettings, /* [in] settings for this RAVE channel allocation */
2127    BXPT_RaveCx_Handle *Context     /* [out] The allocated context */
2128    );
2129
2130
2131/***************************************************************************
2132Summary:
2133Create new ITB entries in the given soft RAVE context.
2134
2135Description:
2136Using data from the src context (specified at _AllocSoftContext()), create
2137entries in the soft context's ITB.
2138
2139Returns:
2140    void.
2141****************************************************************************/
2142void BXPT_Rave_AdvanceSoftContext(
2143        BXPT_RaveCx_Handle DestContext /* [in] The destination (soft) context */
2144        );
2145
2146/***************************************************************************
2147Summary:
2148Reset the soft RAVE context.
2149
2150Description:
2151Change the soft context's operating mode and resets the internal state
2152variables. Does not perform a context flush.
2153
2154Returns:
2155    void.
2156****************************************************************************/
2157BERR_Code BXPT_Rave_ResetSoftContext( 
2158    BXPT_RaveCx_Handle hCtx,
2159    BXPT_RaveSoftMode Mode
2160    );
2161
2162BERR_Code BXPT_Rave_StopPTS( 
2163    BXPT_RaveCx_Handle hCtx,
2164    uint32_t StopPTS,
2165    uint32_t tolerance, 
2166     void (* CallBack)(void *, uint32_t pts), 
2167     void *param
2168    );
2169BERR_Code BXPT_Rave_StartPTS( 
2170    BXPT_RaveCx_Handle hCtx,
2171    uint32_t StopPTS,  uint32_t tolerance,   
2172    void  StartPTSCb(void *,uint32_t pts),
2173    void * param   
2174    );
2175BERR_Code BXPT_Rave_Monitor_PTS( 
2176    BXPT_RaveCx_Handle hCtx,
2177    uint32_t PTS, uint32_t tolerance, 
2178    void (* CallBack)(void *, uint32_t pts),
2179    void * param   
2180    );
2181BERR_Code BXPT_Rave_Cancel_PTS(   BXPT_RaveCx_Handle hCtx  );
2182BERR_Code BXPT_Rave_SetPCROffset(BXPT_RaveCx_Handle hCtx  , uint32_t pcr_offset);
2183
2184#ifdef BXPT_VCT_SUPPORT
2185/***************************************************************************
2186Summary:
2187Enumeration of the different types of table Id's. To be used for VCT nullification
2188implementation.
2189****************************************************************************/
2190typedef enum BXPT_RaveVct
2191{
2192        BXPT_RaveVct_Tvct,
2193        BXPT_RaveVct_Cvct
2194}
2195BXPT_RaveVct;
2196
2197/***************************************************************************
2198Summary:
2199Nullify VCT.
2200
2201Description:
2202Nullify VCT.
2203
2204Returns:
2205    BERR_SUCCESS                    - Configuration written successfully.
2206    BERR_INVALID_PARAMETER          - Bad parameter
2207****************************************************************************/
2208BERR_Code BXPT_Rave_NullifyVCT(
2209        BXPT_RaveCx_Handle Context,            /*[in] Context Handle */
2210        bool ProcessPid,                       /*[in] True(Process PID 0x1ffb) */
2211        BXPT_RaveVct TableId                   /*[in] Table ID T-VCT C-VCT or non */
2212        );
2213#endif
2214
2215/***************************************************************************
2216Summary:
2217Adjust the CDB length.
2218
2219Description:
2220Adjust the CDB length to make the CDB size smaller for certain conditions.
2221
2222Returns:
2223    void.
2224****************************************************************************/
2225BERR_Code BXPT_Rave_AdjustCdbLength(
2226    BXPT_RaveCx_Handle hCtx,
2227    size_t CdbLength
2228    );
2229
2230/* Private APIs. Must NOT be called from outside the BXPT PI. */
2231BERR_Code BXPT_P_RaveRamInit( BXPT_Rave_Handle hRave );
2232
2233#if BXPT_SW7425_1323_WORKAROUND
2234BERR_Code BXPT_Rave_P_FlowControl( BXPT_Rave_Handle hRave );
2235#endif
2236
2237
2238#ifdef __cplusplus
2239}
2240#endif
2241
2242#endif /* BXPT_RAVE_H__ */
2243
2244/* end of file */
2245
2246
Note: See TracBrowser for help on using the repository browser.