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

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

first commit

  • Property svn:executable set to *
File size: 15.7 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2010, 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_remux.h $
11 * $brcm_Revision: Hydra_Software_Devel/1 $
12 * $brcm_Date: 10/25/10 2:09p $
13 *
14 * Porting interface code for the packet remultiplexor section of the
15 * data transport core.
16 *
17 * Revision History:
18 *
19 * $brcm_Log: /magnum/portinginterface/xpt/base2/bxpt_remux.h $
20 *
21 * Hydra_Software_Devel/1   10/25/10 2:09p gmullen
22 * SW7425-15: Moved srcs to base2 folder
23 *
24 * Hydra_Software_Devel/2   10/25/10 9:12a gmullen
25 * SW7425-15: Updated headers and added stub versions of C files
26 *
27 * Hydra_Software_Devel/1   10/8/10 2:58p gmullen
28 * SW7425-15: Added header files
29 *
30 * Hydra_Software_Devel/18   7/29/10 1:59p gmullen
31 * SW7420-904: Added RMX_NULL_PKT_THRESHOLD
32 *
33 * Hydra_Software_Devel/17   4/23/10 8:54a gmullen
34 * SW3556-1102: Added param to control NULL packet insertion
35 *
36 * Hydra_Software_Devel/16   2/23/10 5:55p gmullen
37 * SW3548-2790: Corrected comments.
38 *
39 * Hydra_Software_Devel/15   2/18/10 9:35a gmullen
40 * SW3548-2790: Added API for controlling PCR jitter adjust
41 *
42 * Hydra_Software_Devel/14   6/17/09 6:46p gmullen
43 * PR56110: Added support.xpt/7550/uif_image/a0
44 *
45 * Hydra_Software_Devel/13   4/16/09 7:20p piyushg
46 * PR53728: Each of the XC buffer clients (Remux, RAVE, and the Mesg
47 * filters) would get a separate API to set
48 * their input bitrates. That API would take a client handle and the ID of
49 * the parser band. The XPT PI would
50 * then walk backwards through the pipeline, increasing only the bitrates
51 * for the XC and RS buffers that it
52 * needs to.
53 *
54 * Hydra_Software_Devel/12   4/7/09 5:26p piyushg
55 * PR52986: Add support for 7635
56 * Added directory element "7635".
57 *
58 * Hydra_Software_Devel/11   3/26/09 6:11p gmullen
59 * PR53579: Fixed BCHP mismatches between C and H files.
60 *
61 * Hydra_Software_Devel/10   1/27/09 1:10p gmullen
62 * PR51625: Added 7336 support
63 *
64 * Hydra_Software_Devel/9   6/30/08 10:13a gmullen
65 * PR44320: Enabled missing features in remux PI
66 *
67 * Hydra_Software_Devel/8   3/26/08 11:24a gmullen
68 * PR38954: Added 3548 support to XPT PI.
69 *
70 * Hydra_Software_Devel/7   11/28/07 12:12p gmullen
71 * PR36900: Added 7335 support
72 *
73 * Hydra_Software_Devel/6   10/30/07 3:45p gmullen
74 * PR35018: Fixed incorrect conditional compile directive in struct.
75 *
76 * Hydra_Software_Devel/5   10/30/07 3:12p gmullen
77 * PR35018: Added support for 7325
78 *
79 * Hydra_Software_Devel/4   6/2/06 4:23p gmullen
80 * PR21868: Added bitfields to BXPT_Remux_ChannelSettings struct.
81 *
82 * Hydra_Software_Devel/3   3/28/06 9:06a gmullen
83 * PR18998: Added SetAllPassMode
84 *
85 * Hydra_Software_Devel/2   3/16/06 5:10p gmullen
86 * PR18998: Added support for reading data from R-pipe (security related).
87 *
88 * Hydra_Software_Devel/3   12/2/05 3:24p gmullen
89 * PR15309: Saved updates for ccase server move
90 *
91 * Hydra_Software_Devel/2   11/8/05 10:22a gmullen
92 * PR15309: Updated.
93 *
94 * Hydra_Software_Devel/1   5/13/05 1:27p gmullen
95 * PR15309: First draft of XPT PI.
96 *
97 *
98 ***************************************************************************/
99
100/*= Module Overview *********************************************************
101***************************************************************************/
102
103#ifndef BXPT_REMUX_H__
104#define BXPT_REMUX_H__
105
106#include "bxpt.h"
107#include "bxpt_playback.h"
108
109#ifdef __cplusplus
110extern "C" {
111#endif
112
113/***************************************************************************
114Summary:
115Handle for accessing the remux API via a channel. Users should not directly
116access the contents of the structure.
117****************************************************************************/
118typedef struct BXPT_P_RemuxHandle *BXPT_Remux_Handle;
119
120/***************************************************************************
121Summary:
122Defines the two channels inside the remux block.
123****************************************************************************/
124typedef enum BXPT_RemuxInput
125{
126        BXPT_RemuxInput_eA,
127        BXPT_RemuxInput_eB
128}
129BXPT_RemuxInput;
130
131/***************************************************************************
132Summary:
133Selects the clock source for the remux channel.
134****************************************************************************/
135typedef enum BXPT_RemuxClock
136{
137        BXPT_RemuxClock_e81Mhz                  = 0,    /* 81 MHz */
138        BXPT_RemuxClock_e54Mhz                  = 1,    /* 54 MHz */
139        BXPT_RemuxClock_e40_5Mhz                = 2,    /* 40.5 MHz */ 
140        BXPT_RemuxClock_e20_25Mhz               = 3,    /* 20.25 MHz */         
141        BXPT_RemuxClock_e27Mhz_VCXO_A   = 4,    /* 27 MHz, from VCXO A */       
142        BXPT_RemuxClock_eIb0                    = 8,    /* Input band 0 clock. */
143        BXPT_RemuxClock_eIb1                    = 9,    /* Input band 1 clock. */
144        BXPT_RemuxClock_eIb2                    = 10,   /* Input band 2 clock. */
145        BXPT_RemuxClock_eIb3                    = 11,   /* Input band 3 clock. */
146        BXPT_RemuxClock_eIb4                    = 12    /* Input band 4 clock. */
147}
148BXPT_RemuxClock;
149
150/***************************************************************************
151Summary:
152Settings for the remux channels. These values can be passed in when the
153channel is opened, and will be used as the new default settings.
154****************************************************************************/
155typedef struct BXPT_Remux_ChannelSettings
156{
157        BXPT_RemuxClock OutputClock;            /* Clock to be used to output the RMX serial data. */
158         
159        /*
160        ** Programmable delay output packets. This value is specified in 108MHz
161        ** clock ticks. Programming this field to 0 specifies no gap between output packets
162        */     
163        unsigned int PacketDelayCount;
164       
165        /* Enable the remux Pause pin if present on the chip. */
166        bool PauseEn;                           
167
168        /*
169        ** Settings for the remux physical interface. From the Remux, it is possible
170        ** to have both serial and parallel output enabled simultaneously. Top-level
171        ** routing in the chip may not support that, however.
172        */     
173        bool ParallelEn;                        /* Enable parallel output. */
174       
175        /* These settings are only used when parallel output is enabled */
176        bool ParallelInvertClk;         /* Data will be output on falling edge if true */
177        bool ParallelInvertSync;        /* Active low sync when true */
178
179        /* Settings for serial output mode. */
180        bool InvertClk;         /* Data will be output on falling edge if true */
181        bool InvertSync;        /* Active low sync when true */
182        bool ByteSync;          /* Sync is active for entire byte of a packet when true */
183
184        /* Insert NULL packets in the output, when the selected output rate is
185        ** higher than the input rate. By default, this is enabled (true).
186        */
187        bool InsertNullPackets;
188
189    /*
190    ** When NULL packet insertion is enabled (above), the hardware will do so
191    ** after the number of clocks specified below have elapsed with further packets
192    ** from the input. This threshold is in 108MHz clock ticks. Default is 16 ticks.
193    */ 
194    unsigned NullPacketInsertionThreshold;
195}
196BXPT_Remux_ChannelSettings;
197
198/***************************************************************************
199Summary:
200Return the number of remux channels.
201
202Description:
203For the given transport core, return the number of remux channels that is
204supported.
205
206Returns:
207    BERR_SUCCESS                - Retrieved address from hardware.
208    BERR_INVALID_PARAMETER      - Bad input parameter
209****************************************************************************/
210BERR_Code BXPT_Remux_GetTotalChannels(
211        BXPT_Handle hXpt,                       /* [in] Handle for this transport */
212        unsigned int *TotalChannels             /* [out] The number of remux channels. */
213        );     
214
215/***************************************************************************
216Summary:
217Return the remux channel default settings.
218
219Description:
220Each remux channel has a set of default configuration values. This
221function retrieves these values and places them in a structure that can be
222used to change the defaults when the remux channel is opened.
223
224Returns:
225    BERR_SUCCESS                - Retrieved remux defaults.
226    BERR_INVALID_PARAMETER      - Bad input parameter
227****************************************************************************/
228BERR_Code BXPT_Remux_GetChannelDefaultSettings(
229        BXPT_Handle hXpt,                       /* [in] Handle for this transport */
230        unsigned int ChannelNo,                 /* [in] Which channel to get defaults from. */
231        BXPT_Remux_ChannelSettings *ChannelSettings /* [out] The defaults */
232        );     
233
234/***************************************************************************
235Summary:
236Open a given remux channel.
237
238Description:
239Reset the given remux channel, configure it using the given defaults, then
240return a handle to access that channel.
241
242Returns:
243    BERR_SUCCESS                - Remux channel opened.
244    BERR_INVALID_PARAMETER      - Bad input parameter
245****************************************************************************/
246BERR_Code BXPT_Remux_OpenChannel(
247        BXPT_Handle hXpt,                                               /* [in] Handle for this transport */
248        BXPT_Remux_Handle *RemuxHandle,                 /* [out] Handle for opened remux channel */
249        unsigned int ChannelNo,                                         /* [in] Which channel to open. */
250        BXPT_Remux_ChannelSettings *ChannelSettings /* [in] The defaults to use */
251        );     
252
253/***************************************************************************
254Summary:
255Close a given remux channel.
256
257Description:
258Shutdown a given remux channel, disable any interrupts from it.
259
260Returns:
261        void
262****************************************************************************/
263void BXPT_Remux_CloseChannel(
264        BXPT_Remux_Handle RemuxHandle   /* [in] Handle for the channel to close*/
265        );     
266
267/***************************************************************************
268Summary:
269Start or stop the remultiplexing function.
270
271Description:
272Enable or disables remuxing on the given channel. The channel should be
273configured before calling this function.
274
275Returns:
276    BERR_SUCCESS                - Remuxing started or stopped successfully.
277    BERR_INVALID_PARAMETER      - Bad input parameter
278****************************************************************************/
279BERR_Code BXPT_Remux_DoRemux( 
280        BXPT_Remux_Handle RemuxHandle,  /* [in] Handle for the remux channel */
281        bool Enable                             /* [in] Remux on if TRUE, or off if FALSE. */
282        );
283
284/***************************************************************************
285Summary:
286Include the given PID channel in the remux input.
287
288Description:
289Add a PID channel to the given remux.
290
291Returns:
292    BERR_SUCCESS                - PID channel added successfully.
293    BERR_INVALID_PARAMETER      - Bad input parameter
294****************************************************************************/
295BERR_Code BXPT_Remux_AddPidChannelToRemux( 
296        BXPT_Remux_Handle RemuxHandle,  /* [in] Handle for the remux channel */
297    BXPT_RemuxInput RemuxInput,                 /* [in] Which remux input */
298        unsigned int PidChannelNum                      /* [in] Which PID channel. */
299        );
300
301/***************************************************************************
302Summary:
303Include the given PID channel in the remux input, using the R-Pipe feed.
304
305Description:
306Add a PID channel to the given remux.
307
308Returns:
309    BERR_SUCCESS                - PID channel added successfully.
310    BERR_INVALID_PARAMETER      - Bad input parameter
311****************************************************************************/
312BERR_Code BXPT_Remux_AddRPipePidChannelToRemux( 
313        BXPT_Remux_Handle hRmx,                         /* [in] Handle for the remux channel */
314        BXPT_RemuxInput RemuxInput,             /* [in] Which remux input */
315        unsigned int PidChannelNum                      /* [in] Which PID channel. */
316        );
317
318/***************************************************************************
319Summary:
320Remove the given PID channel in the remux input.
321
322Description:
323Remove a PID channel from the given remux. The data carried on this PID
324channel will not be used in the remuxing.
325
326Returns:
327    BERR_SUCCESS                - PID channel removed successfully.
328    BERR_INVALID_PARAMETER      - Bad input parameter
329****************************************************************************/
330BERR_Code BXPT_Remux_RemovePidChannelFromRemux( 
331        BXPT_Remux_Handle RemuxHandle,  /* [in] Handle for the remux channel */
332        BXPT_RemuxInput RemuxInput,     /* [in] Which remux input */
333        unsigned int PidChannelNum                      /* [in] Which PID channel. */
334        );
335
336/***************************************************************************
337Summary:
338Is the given PID channel enabled for remuxing?
339
340Description:
341Determines if a given PID channel is enabled for remuxing or not.
342
343Returns:
344    BERR_SUCCESS                - Got PID channel's status successfully.
345    BERR_INVALID_PARAMETER      - Bad input parameter
346****************************************************************************/
347BERR_Code BXPT_Remux_GetPidChannel( 
348        BXPT_Remux_Handle RemuxHandle,  /* [in] Handle for the remux channel */
349        BXPT_RemuxInput RemuxInput,                     /* [in] Which remux input */
350        unsigned int PidChannelNum,                     /* [in] Which PID channel. */
351        bool *Enable                                            /* [out] Where to put channel status. */
352        );
353
354/***************************************************************************
355Summary:
356Removes all PID channels on the remux channel.
357
358Description:
359Removes all PID channels in the given block and remux channel from the
360remuxing session.
361
362Returns:
363    BERR_SUCCESS                - PID channels removed uccessfully.
364    BERR_INVALID_PARAMETER      - Bad input parameter
365****************************************************************************/
366BERR_Code BXPT_Remux_RemoveAllPidChannel( 
367        BXPT_Remux_Handle RemuxHandle,  /* [in] Handle for the remux channel */
368        BXPT_RemuxInput RemuxInput                      /* [in] Which remux input */
369        );
370
371/***************************************************************************
372Summary:
373Enable or disable the bypass mode for the remux.
374
375Description:
376Enables or disables the RMX bypass mode. In bypass mode, the selected data
377is output directly without any buffering, null packet insertion, pcr
378correction or packet substitution. Bypass mode must be used to output
379non-transport data such as PES or ES. In bypass mode, the output clock is
380gated off when there is no data to output.
381
382Returns:
383    BERR_SUCCESS                - All bypass mode successfully changed.
384    BERR_INVALID_PARAMETER      - Bad input parameter
385****************************************************************************/
386BERR_Code BXPT_Remux_SetBypassMode( 
387        BXPT_Remux_Handle hRmx,                 /* [in] Handle for the remux channel */
388        bool Enable
389        );
390
391/***************************************************************************
392Summary:
393Add a fixed offset to the PCR values output from remux.
394       
395Description:
396When enabled, FixedPcrOffset will be added to the PCR values in the output
397stream, after PCR jitter adjustment has been done.
398
399Returns:
400    BERR_SUCCESS                - Fixed offset has been set.
401    BERR_INVALID_PARAMETER      - Bad input parameter
402****************************************************************************/
403BERR_Code BXPT_Remux_AddPcrOffset( 
404        BXPT_Remux_Handle hRmx,         /* [in] Handle for the remux channel */
405    bool AddOffsetEn,               /* [in] Enable/disable the PCR correction */
406    uint32_t FixedPcrOffset                     /* [in] The PCR correction offset, if enabled */               
407        );
408
409/***************************************************************************
410Summary:
411Enable or disable PCR jitter adjustment in the remux.
412       
413Description:
414Controls PCR jitter adjustment for live or playback streams. The remux must
415not be in bypass mode to use jitter adjustment. Timestamps must also be
416enabled in the playback (for such streams).
417
418Returns:
419        void
420****************************************************************************/
421void BXPT_Remux_SetPcrJitterAdj( 
422        BXPT_Remux_Handle hRmx,         /* [in] Handle for the remux channel */
423        bool ForPlayback,               /* [in] true = control adjustment for playback, false = control for live */
424    bool EnableAdjust               /* [in] Enable/disable the PCR jitter adjust */
425        );
426
427#ifdef __cplusplus
428}
429#endif
430
431#endif /* #ifndef BXPT_REMUX_H__ */
432
433/* end of file */
434
435
Note: See TracBrowser for help on using the repository browser.