| 1 | /****************************************************************************** |
|---|
| 2 | * (c)2008-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * Except as expressly set forth in the Authorized License, |
|---|
| 15 | * |
|---|
| 16 | * 1. This program, including its structure, sequence and organization, constitutes the valuable trade |
|---|
| 17 | * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, |
|---|
| 18 | * and to use this information only in connection with your use of Broadcom integrated circuit products. |
|---|
| 19 | * |
|---|
| 20 | * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
|---|
| 21 | * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
|---|
| 22 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
|---|
| 23 | * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES |
|---|
| 24 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, |
|---|
| 25 | * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION |
|---|
| 26 | * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF |
|---|
| 27 | * USE OR PERFORMANCE OF THE SOFTWARE. |
|---|
| 28 | * |
|---|
| 29 | * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS |
|---|
| 30 | * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR |
|---|
| 31 | * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR |
|---|
| 32 | * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF |
|---|
| 33 | * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT |
|---|
| 34 | * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE |
|---|
| 35 | * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF |
|---|
| 36 | * ANY LIMITED REMEDY. |
|---|
| 37 | * |
|---|
| 38 | * $brcm_Workfile: nexus_remux.h $ |
|---|
| 39 | * $brcm_Revision: 11 $ |
|---|
| 40 | * $brcm_Date: 1/20/11 2:35p $ |
|---|
| 41 | * |
|---|
| 42 | * Module Description: |
|---|
| 43 | * |
|---|
| 44 | * Revision History: |
|---|
| 45 | * |
|---|
| 46 | * $brcm_Log: /nexus/modules/transport/7400/include/nexus_remux.h $ |
|---|
| 47 | * |
|---|
| 48 | * 11 1/20/11 2:35p erickson |
|---|
| 49 | * SW7420-1237: support live and playback input to remux, allow per-parser |
|---|
| 50 | * band input maxDataRate |
|---|
| 51 | * |
|---|
| 52 | * 10 7/23/10 4:44p jgarrett |
|---|
| 53 | * SW7420-902: Adding NULL packet insertion and SetSettings on-the-fly. |
|---|
| 54 | * |
|---|
| 55 | * 9 2/23/10 5:42p erickson |
|---|
| 56 | * SW3548-2790: added NEXUS_RemuxSettings.enablePcrJitterAdjust and |
|---|
| 57 | * .playback |
|---|
| 58 | * |
|---|
| 59 | * 8 4/17/09 12:31p erickson |
|---|
| 60 | * PR53728: added NEXUS_RemuxSettings.maxDataRate |
|---|
| 61 | * |
|---|
| 62 | * 7 3/28/09 10:03a erickson |
|---|
| 63 | * PR53417: added BXPT_Remux_AddPcrOffset for new remux systems. added |
|---|
| 64 | * remux pacing support. |
|---|
| 65 | * |
|---|
| 66 | * 6 3/23/09 2:46p erickson |
|---|
| 67 | * PR53417: add NEXUS_RemuxSettings.bypass. Swap bypass and allPass. |
|---|
| 68 | * Clarify usage comments. add NEXUS_RemuxSettings.pcrCorrectionEnabled |
|---|
| 69 | * and pcrCorrectionOffset. |
|---|
| 70 | * |
|---|
| 71 | * 5 9/2/08 11:45a erickson |
|---|
| 72 | * PR46315: added NEXUS_RemuxSettings.allPass |
|---|
| 73 | * |
|---|
| 74 | * 4 2/25/08 9:17a jgarrett |
|---|
| 75 | * PR 39435: Backing out change |
|---|
| 76 | * |
|---|
| 77 | * 2 2/22/08 7:03p shyam |
|---|
| 78 | * PR39435 : Add remux capability to Nexus |
|---|
| 79 | * |
|---|
| 80 | *****************************************************************************/ |
|---|
| 81 | |
|---|
| 82 | #ifndef NEXUS_REMUX_H__ |
|---|
| 83 | #define NEXUS_REMUX_H__ |
|---|
| 84 | |
|---|
| 85 | #include "nexus_types.h" |
|---|
| 86 | #include "nexus_pid_channel.h" |
|---|
| 87 | #include "nexus_playpump.h" |
|---|
| 88 | #ifdef __cplusplus |
|---|
| 89 | extern "C" { |
|---|
| 90 | #endif |
|---|
| 91 | |
|---|
| 92 | /*=************************ |
|---|
| 93 | The Remux block outputs data transport data to an external transport receiver. |
|---|
| 94 | |
|---|
| 95 | Please note that the remux API does not follow nexus conventions regarding Open/Close. |
|---|
| 96 | You must Open and Close the remux handle for every session in order to reconfigure |
|---|
| 97 | its NEXUS_RemuxSettings. This may be changed in the future. |
|---|
| 98 | **************************/ |
|---|
| 99 | |
|---|
| 100 | /* |
|---|
| 101 | Summary: |
|---|
| 102 | Handle which represents a remux channel. |
|---|
| 103 | */ |
|---|
| 104 | typedef struct NEXUS_Remux *NEXUS_RemuxHandle; |
|---|
| 105 | |
|---|
| 106 | /* |
|---|
| 107 | Summary: |
|---|
| 108 | Selects the clock source for the remux channel |
|---|
| 109 | */ |
|---|
| 110 | typedef enum NEXUS_RemuxClock |
|---|
| 111 | { |
|---|
| 112 | NEXUS_RemuxClock_e81Mhz, /* 81 MHz */ |
|---|
| 113 | NEXUS_RemuxClock_e54Mhz, /* 54 MHz */ |
|---|
| 114 | NEXUS_RemuxClock_e40_5Mhz, /* 40.5 MHz */ |
|---|
| 115 | NEXUS_RemuxClock_e20_25Mhz, /* 20.25 MHz */ |
|---|
| 116 | NEXUS_RemuxClock_e27Mhz_VCXO_A, /* 27 MHz, from VCXO A */ |
|---|
| 117 | NEXUS_RemuxClock_eInputBand, /* Input band to clock. */ |
|---|
| 118 | NEXUS_RemuxClock_eMax |
|---|
| 119 | } NEXUS_RemuxClock; |
|---|
| 120 | |
|---|
| 121 | /* |
|---|
| 122 | Summary: |
|---|
| 123 | Settings needed for opening a remux channel. |
|---|
| 124 | */ |
|---|
| 125 | typedef struct NEXUS_RemuxSettings |
|---|
| 126 | { |
|---|
| 127 | NEXUS_RemuxClock outputClock; /* Select the output clock source */ |
|---|
| 128 | NEXUS_InputBand remuxClockIBSrc; /* If outputClock == NEXUS_RemuxClock_eInputBand, then use this to specify the input band */ |
|---|
| 129 | |
|---|
| 130 | bool parallelOutput; /* If true, parallel output will be requested. If false, serial output will be enabled */ |
|---|
| 131 | bool invertClock; /* If true, data will be output on the falling edge. */ |
|---|
| 132 | bool invertSync; /* If true, sync will be active low */ |
|---|
| 133 | bool byteSync; /* If true, sync will be active for the entire packet. |
|---|
| 134 | If false, sync will be active for the first byte (serial only). */ |
|---|
| 135 | bool allPass; /* allPass mode passes all transport packets through remux. |
|---|
| 136 | If you set NEXUS_ParserBandSettings.allPass or NEXUS_PlaypumpSettings.allPass and want all packets to also be passed through remux, you must |
|---|
| 137 | also set this allPass boolean. |
|---|
| 138 | Unlike bypass, allPass allows for NULL packet insertion to hit a constant output bitrate. */ |
|---|
| 139 | bool bypass; /* bypass mode passes all data through remux without regard for packetization. |
|---|
| 140 | This can be used for sending non-transport data. */ |
|---|
| 141 | |
|---|
| 142 | bool pcrCorrectionEnabled; |
|---|
| 143 | uint32_t pcrCorrectionOffset; /* Only used if pcrCorrectionOffset is true. */ |
|---|
| 144 | |
|---|
| 145 | bool pacing; /* If true, pace this stream using embedded timestamp information. */ |
|---|
| 146 | unsigned pacingMaxError; /* Set the maximum allowable timestamp error (TS_RANGE_ERROR) used during playback pacing. */ |
|---|
| 147 | unsigned maxDataRate; /* Maximum data rate for this remux in units of bits per second. Default is typically 25000000 (i.e. 25 Mbps). |
|---|
| 148 | If you increase this, you need to analyze total transport bandwidth and overall system bandwidth. */ |
|---|
| 149 | |
|---|
| 150 | bool enablePcrJitterAdjust; |
|---|
| 151 | bool insertNullPackets; /* If true, enable the insertion of null packets. Otherwise, insertion is disabled. */ |
|---|
| 152 | } NEXUS_RemuxSettings; |
|---|
| 153 | |
|---|
| 154 | /** |
|---|
| 155 | Summary: |
|---|
| 156 | Settings for an parser band added to a remux channel. |
|---|
| 157 | **/ |
|---|
| 158 | typedef struct NEXUS_RemuxParserBandwidth |
|---|
| 159 | { |
|---|
| 160 | NEXUS_PlaypumpHandle playpump; /* playpump parser band. for live, set this to NULL. */ |
|---|
| 161 | NEXUS_ParserBand parserBand; /* live parser band. only used if playpump == NULL. */ |
|---|
| 162 | unsigned maxDataRate; /* Maximum data rate for this parser band input to remux in units of bits per second. |
|---|
| 163 | Default is typically 25000000 (i.e. 25 Mbps). If you increase this, you need to analyze total |
|---|
| 164 | transport bandwidth and overall system bandwidth. */ |
|---|
| 165 | }NEXUS_RemuxParserBandwidth; |
|---|
| 166 | |
|---|
| 167 | /* |
|---|
| 168 | Summary: |
|---|
| 169 | Get default settings for the structure. |
|---|
| 170 | |
|---|
| 171 | Description: |
|---|
| 172 | This is required in order to make application code resilient to the |
|---|
| 173 | addition of new strucutre members in the future. |
|---|
| 174 | */ |
|---|
| 175 | void NEXUS_Remux_GetDefaultSettings( |
|---|
| 176 | NEXUS_RemuxSettings *pSettings /* [out] */ |
|---|
| 177 | ); |
|---|
| 178 | |
|---|
| 179 | /* |
|---|
| 180 | Summary: |
|---|
| 181 | Open a remux channel |
|---|
| 182 | */ |
|---|
| 183 | NEXUS_RemuxHandle NEXUS_Remux_Open( /* attr{destructor=NEXUS_Remux_Close} */ |
|---|
| 184 | unsigned index, |
|---|
| 185 | const NEXUS_RemuxSettings *pSettings |
|---|
| 186 | ); |
|---|
| 187 | |
|---|
| 188 | /* |
|---|
| 189 | Summary: |
|---|
| 190 | Close the remux channel |
|---|
| 191 | */ |
|---|
| 192 | void NEXUS_Remux_Close( |
|---|
| 193 | NEXUS_RemuxHandle handle |
|---|
| 194 | ); |
|---|
| 195 | |
|---|
| 196 | |
|---|
| 197 | /* |
|---|
| 198 | Summary: |
|---|
| 199 | Get default settings for NEXUS_RemuxParserBand. |
|---|
| 200 | */ |
|---|
| 201 | void NEXUS_Remux_GetDefaultParserBandwidth( |
|---|
| 202 | NEXUS_RemuxParserBandwidth *pSettings /* [out] */ |
|---|
| 203 | ); |
|---|
| 204 | |
|---|
| 205 | /* |
|---|
| 206 | Summary: |
|---|
| 207 | Set the bit rate for a parser band that needs to be added |
|---|
| 208 | to a remux channel. |
|---|
| 209 | */ |
|---|
| 210 | NEXUS_Error NEXUS_Remux_SetParserBandwidth( |
|---|
| 211 | NEXUS_RemuxHandle handle, |
|---|
| 212 | const NEXUS_RemuxParserBandwidth *pSettings |
|---|
| 213 | ); |
|---|
| 214 | |
|---|
| 215 | /* |
|---|
| 216 | Summary: |
|---|
| 217 | Add a pid channel to the remux channel |
|---|
| 218 | */ |
|---|
| 219 | NEXUS_Error NEXUS_Remux_AddPidChannel( |
|---|
| 220 | NEXUS_RemuxHandle handle, |
|---|
| 221 | NEXUS_PidChannelHandle pidChannel |
|---|
| 222 | ); |
|---|
| 223 | |
|---|
| 224 | |
|---|
| 225 | /* |
|---|
| 226 | Summary: |
|---|
| 227 | Remove a pid channel from the remux channel |
|---|
| 228 | */ |
|---|
| 229 | NEXUS_Error NEXUS_Remux_RemovePidChannel( |
|---|
| 230 | NEXUS_RemuxHandle handle, |
|---|
| 231 | NEXUS_PidChannelHandle pidChannel |
|---|
| 232 | ); |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | /* |
|---|
| 236 | Summary: |
|---|
| 237 | Remove all pid channels from the remux channel |
|---|
| 238 | */ |
|---|
| 239 | void NEXUS_Remux_RemoveAllPidChannels( |
|---|
| 240 | NEXUS_RemuxHandle handle |
|---|
| 241 | ); |
|---|
| 242 | |
|---|
| 243 | /* |
|---|
| 244 | Summary: |
|---|
| 245 | Start the remux channel |
|---|
| 246 | */ |
|---|
| 247 | NEXUS_Error NEXUS_Remux_Start( |
|---|
| 248 | NEXUS_RemuxHandle handle |
|---|
| 249 | ); |
|---|
| 250 | |
|---|
| 251 | /* |
|---|
| 252 | Summary: |
|---|
| 253 | Stop the remux channel |
|---|
| 254 | */ |
|---|
| 255 | void NEXUS_Remux_Stop( |
|---|
| 256 | NEXUS_RemuxHandle handle |
|---|
| 257 | ); |
|---|
| 258 | |
|---|
| 259 | /* |
|---|
| 260 | Summary: |
|---|
| 261 | Set the new settings for a remux channel |
|---|
| 262 | */ |
|---|
| 263 | NEXUS_Error NEXUS_Remux_SetSettings( |
|---|
| 264 | NEXUS_RemuxHandle handle, |
|---|
| 265 | const NEXUS_RemuxSettings *pSettings |
|---|
| 266 | ); |
|---|
| 267 | |
|---|
| 268 | /* |
|---|
| 269 | Summary: |
|---|
| 270 | Get the current settings for a remux channel |
|---|
| 271 | */ |
|---|
| 272 | void NEXUS_Remux_GetSettings( |
|---|
| 273 | NEXUS_RemuxHandle handle, |
|---|
| 274 | NEXUS_RemuxSettings *pSettings /* [out] */ |
|---|
| 275 | ); |
|---|
| 276 | |
|---|
| 277 | |
|---|
| 278 | #ifdef __cplusplus |
|---|
| 279 | } |
|---|
| 280 | #endif |
|---|
| 281 | |
|---|
| 282 | #endif /* NEXUS_REMUX_H__ */ |
|---|
| 283 | |
|---|