| 1 | /*************************************************************** |
|---|
| 2 | ** |
|---|
| 3 | ** Broadcom Corp. Confidential |
|---|
| 4 | ** Copyright 2003-2008 Broadcom Corp. All Rights Reserved. |
|---|
| 5 | ** |
|---|
| 6 | ** THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED |
|---|
| 7 | ** SOFTWARE LICENSE AGREEMENT BETWEEN THE USER AND BROADCOM. |
|---|
| 8 | ** YOU HAVE NO RIGHT TO USE OR EXPLOIT THIS MATERIAL EXCEPT |
|---|
| 9 | ** SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 10 | ** |
|---|
| 11 | ** File: si_api_chanmap.h |
|---|
| 12 | ** Description: defines and headers for channel map functions. |
|---|
| 13 | ** |
|---|
| 14 | ** Created: 03/08/2001 |
|---|
| 15 | ** |
|---|
| 16 | ** REVISION: |
|---|
| 17 | ** |
|---|
| 18 | ** $Log: $ |
|---|
| 19 | ** |
|---|
| 20 | ** |
|---|
| 21 | ****************************************************************/ |
|---|
| 22 | |
|---|
| 23 | /*= Module Overview ********************************************************* |
|---|
| 24 | <verbatim> |
|---|
| 25 | |
|---|
| 26 | Overview |
|---|
| 27 | In a POD base open cable DTV or STB system, all the channel map information |
|---|
| 28 | comes from either an OOB channel through POD or a DSG tunnel through host to |
|---|
| 29 | POD. The channel map can be parsed from a combination of NIT, NTT and SVCT or |
|---|
| 30 | LVCT as defined in ANSI/SCTE65 (DVS234). Information about the channel number, |
|---|
| 31 | physical channel frequency, modulation mode, symbol rate,program number and etc |
|---|
| 32 | is all included in the channel map defined in this API. The upper level |
|---|
| 33 | application can use this information to acquire the physical channel and lock |
|---|
| 34 | on the transport stream. |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | Design |
|---|
| 38 | Currently the Channel Map API only support one API function call for the upper |
|---|
| 39 | level applications to get the current channel map. |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | Usage |
|---|
| 43 | The usage of Channel Map API involves the upper level application periodically |
|---|
| 44 | calling the get channel map API functions to get complete up to date channel map. |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | Interrupt Requirements |
|---|
| 48 | None. |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | Sample Code |
|---|
| 52 | None. |
|---|
| 53 | |
|---|
| 54 | </verbatim> |
|---|
| 55 | ***************************************************************************/ |
|---|
| 56 | |
|---|
| 57 | #ifndef SI_API_CHANMAP_H |
|---|
| 58 | #define SI_API_CHANMAP_H |
|---|
| 59 | |
|---|
| 60 | /*************************************************************************** |
|---|
| 61 | Summary: |
|---|
| 62 | Enumeration for channel type, analog or digital |
|---|
| 63 | |
|---|
| 64 | Description: |
|---|
| 65 | This enumeration defines the valid channel types. |
|---|
| 66 | |
|---|
| 67 | See Also: |
|---|
| 68 | |
|---|
| 69 | ****************************************************************************/ |
|---|
| 70 | typedef enum SI_API_CHAN_TYPE |
|---|
| 71 | { |
|---|
| 72 | SI_API_CHAN_MPEG, /* Digital channel. */ |
|---|
| 73 | SI_API_CHAN_ANALOG, /* Analog channel. */ |
|---|
| 74 | SI_API_CHAN_UNKNOWN /* Not Valid. */ |
|---|
| 75 | } SI_API_CHAN_TYPE; |
|---|
| 76 | |
|---|
| 77 | /*************************************************************************** |
|---|
| 78 | Summary: |
|---|
| 79 | Enumeration for digital channel transmission standard |
|---|
| 80 | |
|---|
| 81 | Description: |
|---|
| 82 | This enumeration defines the valid digital transmission standard. |
|---|
| 83 | |
|---|
| 84 | See Also: |
|---|
| 85 | |
|---|
| 86 | ****************************************************************************/ |
|---|
| 87 | typedef enum SI_API_TRANS_STANDARD |
|---|
| 88 | { |
|---|
| 89 | SI_API_ANNEX_B, /* North American QAM standard. */ |
|---|
| 90 | SI_API_ATSC, /* North American off air digital TV. */ |
|---|
| 91 | SI_API_TRANS_STANDARD_UNKNOWN /* Not Valid. */ |
|---|
| 92 | } SI_API_TRANS_STANDARD; |
|---|
| 93 | |
|---|
| 94 | /*************************************************************************** |
|---|
| 95 | Summary: |
|---|
| 96 | Enumeration for digital channel modulation format |
|---|
| 97 | |
|---|
| 98 | Description: |
|---|
| 99 | This enumeration defines the valid digital modulation format. |
|---|
| 100 | |
|---|
| 101 | See Also: |
|---|
| 102 | |
|---|
| 103 | ****************************************************************************/ |
|---|
| 104 | typedef enum SI_API_DIG_FORMAT |
|---|
| 105 | { |
|---|
| 106 | SI_API_QAM64, /* QAM 64 */ |
|---|
| 107 | SI_API_QAM256, /* QAM 256 */ |
|---|
| 108 | SI_API_QAM1024, /* QAM 1024 */ |
|---|
| 109 | SI_API_VSB8, /* VSB 8 */ |
|---|
| 110 | SI_API_VSB16, /* VSB 16 */ |
|---|
| 111 | SI_API_DIG_FORMAT_UNKNOWN /* Not Valid. */ |
|---|
| 112 | } SI_API_DIG_FORMAT; |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | /* it is VERY important to keep the following the same as the define in si_nit_mms.h. */ |
|---|
| 116 | |
|---|
| 117 | /*************************************************************************** |
|---|
| 118 | Summary: |
|---|
| 119 | Enumeration for analog channel TV format |
|---|
| 120 | |
|---|
| 121 | Description: |
|---|
| 122 | This enumeration defines the valid analog TV format. |
|---|
| 123 | |
|---|
| 124 | See Also: |
|---|
| 125 | |
|---|
| 126 | ****************************************************************************/ |
|---|
| 127 | typedef enum SI_API_ANA_STANDARD |
|---|
| 128 | { |
|---|
| 129 | SI_API_NTSC, |
|---|
| 130 | SI_API_PAL625, |
|---|
| 131 | SI_API_PAL525, |
|---|
| 132 | SI_API_SECAM, |
|---|
| 133 | SI_API_MAC, |
|---|
| 134 | SI_API_ANA_STANDARD_UNKNOWN |
|---|
| 135 | } SI_API_ANA_STANDARD; |
|---|
| 136 | |
|---|
| 137 | /*************************************************************************** |
|---|
| 138 | Summary: |
|---|
| 139 | Enumeration for virtual channel number format |
|---|
| 140 | |
|---|
| 141 | Description: |
|---|
| 142 | This enumeration defines the valid channel number format. |
|---|
| 143 | |
|---|
| 144 | See Also: |
|---|
| 145 | |
|---|
| 146 | ****************************************************************************/ |
|---|
| 147 | typedef enum SI_API_CHANNUM_MODE |
|---|
| 148 | { |
|---|
| 149 | SI_API_ONE_PART, /* one part format, used mostly in CATV. */ |
|---|
| 150 | SI_API_TWO_PART /* two part format, used mostly in off air DTV. */ |
|---|
| 151 | } SI_API_CHANNUM_MODE; |
|---|
| 152 | |
|---|
| 153 | /*************************************************************************** |
|---|
| 154 | Summary: |
|---|
| 155 | Structure for digital channel parameters |
|---|
| 156 | |
|---|
| 157 | Description: |
|---|
| 158 | This structure defines the digital channel parameters. |
|---|
| 159 | |
|---|
| 160 | See Also: |
|---|
| 161 | |
|---|
| 162 | ****************************************************************************/ |
|---|
| 163 | typedef struct SI_API_DIG_CHAN |
|---|
| 164 | { |
|---|
| 165 | unsigned short prog_num; /* program number within transport stream. */ |
|---|
| 166 | SI_API_TRANS_STANDARD mode; /* transmission standard. */ |
|---|
| 167 | SI_API_DIG_FORMAT format; /* modulation format. */ |
|---|
| 168 | unsigned long symrate; /* symbol rate. */ |
|---|
| 169 | } SI_API_DIG_CHAN; |
|---|
| 170 | |
|---|
| 171 | /*************************************************************************** |
|---|
| 172 | Summary: |
|---|
| 173 | Structure for analog channel parameters |
|---|
| 174 | |
|---|
| 175 | Description: |
|---|
| 176 | This structure defines the analog channel parameters. |
|---|
| 177 | |
|---|
| 178 | See Also: |
|---|
| 179 | |
|---|
| 180 | ****************************************************************************/ |
|---|
| 181 | typedef struct SI_API_ANA_CHAN |
|---|
| 182 | { |
|---|
| 183 | SI_API_ANA_STANDARD standard; /* analog TV standard. */ |
|---|
| 184 | } SI_API_ANA_CHAN; |
|---|
| 185 | |
|---|
| 186 | /*************************************************************************** |
|---|
| 187 | Summary: |
|---|
| 188 | Structure for virtual channel descriptor within channel map. |
|---|
| 189 | |
|---|
| 190 | Description: |
|---|
| 191 | This structure defines the data associated with a channel. |
|---|
| 192 | |
|---|
| 193 | See Also: |
|---|
| 194 | |
|---|
| 195 | ****************************************************************************/ |
|---|
| 196 | #define SI_API_CHAN_MAP_NAME_LEN 128 |
|---|
| 197 | typedef struct SI_API_CHAN_MAP |
|---|
| 198 | { |
|---|
| 199 | SI_API_CHANNUM_MODE num_mode; /* virtual channel number scheme. 0 onpart, 1 twopart. */ |
|---|
| 200 | unsigned short channum1; /* for one part mode, this is the virtual channel number. for two part, this will be the major part. */ |
|---|
| 201 | unsigned short channum2; /* for one part mode, this is not used. for two part, this is the minor part. */ |
|---|
| 202 | unsigned short source_id; /* source ID for this channel. */ |
|---|
| 203 | unsigned long freq; /* in Hz */ |
|---|
| 204 | SI_API_CHAN_TYPE chan_type; /* channel type. */ |
|---|
| 205 | union |
|---|
| 206 | { |
|---|
| 207 | SI_API_DIG_CHAN dig_parm; |
|---|
| 208 | SI_API_ANA_CHAN ana_parm; |
|---|
| 209 | } chan_parm; /* channel parameters. */ |
|---|
| 210 | unsigned char name[SI_API_CHAN_MAP_NAME_LEN]; |
|---|
| 211 | } SI_API_CHAN_MAP; |
|---|
| 212 | |
|---|
| 213 | |
|---|
| 214 | #ifdef __cplusplus |
|---|
| 215 | extern "C" { |
|---|
| 216 | #endif |
|---|
| 217 | |
|---|
| 218 | /*************************************************************************** |
|---|
| 219 | Summary: |
|---|
| 220 | This function tries to get the channel map from SI data received from |
|---|
| 221 | either OOB channel or DSG tunnel. |
|---|
| 222 | |
|---|
| 223 | Description: |
|---|
| 224 | This function is responsible for trying to get the channel map from POD |
|---|
| 225 | SW stack. Since per specified by ANSI/SCTE 65, it may take some time before |
|---|
| 226 | all the channel map information can arrive and it can change without notice |
|---|
| 227 | the upper level application is responsible for calling this function |
|---|
| 228 | periodically to keep the channel map complete and up to date. |
|---|
| 229 | |
|---|
| 230 | Returns: |
|---|
| 231 | 0: when the function returns successfully. |
|---|
| 232 | -1: when the function fails. |
|---|
| 233 | |
|---|
| 234 | See Also: |
|---|
| 235 | |
|---|
| 236 | |
|---|
| 237 | ****************************************************************************/ |
|---|
| 238 | int SI_Api_Get_Chan_Map(SI_API_CHAN_MAP **chan, /* [out] pointer that points to the channel map array */ |
|---|
| 239 | unsigned long *len /* [out] pointer that points the channel map array size */); |
|---|
| 240 | |
|---|
| 241 | #ifdef __cplusplus |
|---|
| 242 | } |
|---|
| 243 | #endif |
|---|
| 244 | |
|---|
| 245 | |
|---|
| 246 | #endif |
|---|