| 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: ts_psi.h $ |
|---|
| 11 | * $brcm_Revision: 9 $ |
|---|
| 12 | * $brcm_Date: 12/14/10 1:31p $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /BSEAV/lib/mpeg2_ts_parse/ts_psi.h $ |
|---|
| 19 | * |
|---|
| 20 | * 9 12/14/10 1:31p gmohile |
|---|
| 21 | * SW7422-134 : Add SVC/MVC probe |
|---|
| 22 | * |
|---|
| 23 | * 8 11/15/10 2:52p gmohile |
|---|
| 24 | * SW35230-2181 : Add DTS Hi-Res profile |
|---|
| 25 | * |
|---|
| 26 | * 7 3/3/10 12:01p vsilyaev |
|---|
| 27 | * SW7405-3990: Added stream_type for DTS audio |
|---|
| 28 | * |
|---|
| 29 | * 6 11/23/09 5:51p katrep |
|---|
| 30 | * SW7405-3457:Add DRA support |
|---|
| 31 | * |
|---|
| 32 | * 5 5/14/09 3:16p haisongw |
|---|
| 33 | * PR55058: Add more ATSC Descriptors |
|---|
| 34 | * |
|---|
| 35 | * 4 1/20/08 10:59p katrep |
|---|
| 36 | * PR38591: Added support for AVS streams. |
|---|
| 37 | * |
|---|
| 38 | * 3 7/10/07 3:01p erickson |
|---|
| 39 | * PR31916: update tspsimgr for wider range of specs and codecs. |
|---|
| 40 | * consolidated duplicate code. |
|---|
| 41 | * |
|---|
| 42 | * 2 1/25/06 5:05p arbisman |
|---|
| 43 | * PR19269: Add support for ISO 14496-3 audio type |
|---|
| 44 | * |
|---|
| 45 | * 1 2/7/05 11:31p dlwin |
|---|
| 46 | * Merge down for release 2005_REFSW_MERGETOMAIN: |
|---|
| 47 | * |
|---|
| 48 | * Irvine_BSEAVSW_Devel/3 12/29/04 7:24p marcusk |
|---|
| 49 | * PR13701: Updated with support for H.264 Stream Type (0xB1) |
|---|
| 50 | * |
|---|
| 51 | * Irvine_BSEAVSW_Devel/2 9/10/03 4:21p marcusk |
|---|
| 52 | * Updated to work with linux get pids. |
|---|
| 53 | * |
|---|
| 54 | * Irvine_BSEAVSW_Devel/1 8/29/03 5:06p marcusk |
|---|
| 55 | * Initial Version. |
|---|
| 56 | * |
|---|
| 57 | ***************************************************************************/ |
|---|
| 58 | #ifndef TS_PSI_H__ |
|---|
| 59 | #define TS_PSI_H__ |
|---|
| 60 | |
|---|
| 61 | #ifdef __cplusplus |
|---|
| 62 | extern "C" { |
|---|
| 63 | #endif |
|---|
| 64 | |
|---|
| 65 | #define TS_PSI_MAX_PSI_TABLE_SIZE 1024 |
|---|
| 66 | #define TS_PSI_MAX_PRIVATE_PSI_SIZE 4096 |
|---|
| 67 | #define TS_PSI_TS_CRC_32_SIZE 4 |
|---|
| 68 | #define TS_PSI_TS_HEADER_SIZE 3 |
|---|
| 69 | |
|---|
| 70 | /* Table ID assignment values */ |
|---|
| 71 | #define TS_PSI_TID_PAS 0 |
|---|
| 72 | #define TS_PSI_TID_CAS 1 |
|---|
| 73 | #define TS_PSI_TID_PMS 2 |
|---|
| 74 | #define TS_PSI_TID_forbidden 0xFF |
|---|
| 75 | |
|---|
| 76 | /* Adaptation Field Control Values */ |
|---|
| 77 | #define TS_PSI_AFC_payload_only 1 |
|---|
| 78 | #define TS_PSI_AFC_adaptation_only 2 |
|---|
| 79 | #define TS_PSI_AFC_adaptation_and_payload 3 |
|---|
| 80 | |
|---|
| 81 | /* Stream ID Assignments */ |
|---|
| 82 | #define TS_PSI_SID_PM 0xBC |
|---|
| 83 | #define TS_PSI_SID_private_1 0xBD |
|---|
| 84 | #define TS_PSI_SID_padding 0xBE |
|---|
| 85 | #define TS_PSI_SID_private_2 0xBF |
|---|
| 86 | /* Audio Streams are numbered from 0xC0 - 0xDF */ |
|---|
| 87 | /* Video Streams are numbered from 0xE0 - 0xEF */ |
|---|
| 88 | #define TS_PSI_SID_ECM 0xF0 |
|---|
| 89 | #define TS_PSI_SID_EMM 0xF1 |
|---|
| 90 | #define TS_PSI_SID_DSMCC 0xF2 |
|---|
| 91 | #define TS_PSI_SID_13522 0xF3 |
|---|
| 92 | #define TS_PSI_SID_type_A 0xF4 |
|---|
| 93 | #define TS_PSI_SID_type_B 0xF5 |
|---|
| 94 | #define TS_PSI_SID_type_C 0xF6 |
|---|
| 95 | #define TS_PSI_SID_type_D 0xF7 |
|---|
| 96 | #define TS_PSI_SID_type_E 0xF8 |
|---|
| 97 | #define TS_PSI_SID_ancillary 0xF9 |
|---|
| 98 | /* Reserved streams are numbered from 0xFA - 0xFE */ |
|---|
| 99 | #define TS_PSI_SID_PSD 0xFF |
|---|
| 100 | |
|---|
| 101 | /* Stream Type Assignments */ |
|---|
| 102 | /* 0x00 Reserved */ |
|---|
| 103 | /* MPEG Stream Type Definitions 0x00-0x7F */ |
|---|
| 104 | #define TS_PSI_ST_11172_2_Video 0x01 |
|---|
| 105 | #define TS_PSI_ST_13818_2_Video 0x02 |
|---|
| 106 | #define TS_PSI_ST_11172_3_Audio 0x03 |
|---|
| 107 | #define TS_PSI_ST_13818_3_Audio 0x04 |
|---|
| 108 | #define TS_PSI_ST_13818_1_PrivateSection 0x05 |
|---|
| 109 | #define TS_PSI_ST_13818_1_PrivatePES 0x06 |
|---|
| 110 | #define TS_PSI_ST_13522_MHEG 0x07 |
|---|
| 111 | #define TS_PSI_ST_13818_1_DSMCC 0x08 |
|---|
| 112 | #define TS_PSI_ST_ITU_H222_1 0x09 |
|---|
| 113 | #define TS_PSI_ST_13818_6_TypeA 0x0A |
|---|
| 114 | #define TS_PSI_ST_13818_6_TypeB 0x0B |
|---|
| 115 | #define TS_PSI_ST_13818_6_TypeC 0x0C |
|---|
| 116 | #define TS_PSI_ST_13818_6_TypeD 0x0D |
|---|
| 117 | #define TS_PSI_ST_13818_1_Aux 0x0E |
|---|
| 118 | #define TS_PSI_ST_13818_7_AAC 0x0F |
|---|
| 119 | #define TS_PSI_ST_14496_2_Video 0x10 |
|---|
| 120 | #define TS_PSI_ST_14496_3_Audio 0x11 |
|---|
| 121 | #define TS_PSI_ST_14496_1_FlexMuxPES 0x12 |
|---|
| 122 | #define TS_PSI_ST_14496_1_FlexMuxSection 0x13 |
|---|
| 123 | #define TS_PSI_ST_13818_6_SyncDownload 0x14 |
|---|
| 124 | #define TS_PSI_ST_MetadataPES 0x15 |
|---|
| 125 | #define TS_PSI_ST_MetadataSection 0x16 |
|---|
| 126 | #define TS_PSI_ST_MetadataDataCarousel 0x17 |
|---|
| 127 | #define TS_PSI_ST_MetadataObjectCarousel 0x18 |
|---|
| 128 | #define TS_PSI_ST_MetadataSyncDownload 0x19 |
|---|
| 129 | #define TS_PSI_ST_13818_11_IPMP 0x1A |
|---|
| 130 | #define TS_PSI_ST_14496_10_Video 0x1B |
|---|
| 131 | #define TS_PSI_ST_14496_10_AnnexG_Video 0x1F |
|---|
| 132 | #define TS_PSI_ST_14496_10_AnnexH_Video 0x20 |
|---|
| 133 | |
|---|
| 134 | #define TS_PSI_ST_AVS_Video 0x42 |
|---|
| 135 | #define TS_PSI_ST_AVS_Audio 0x43 |
|---|
| 136 | #define TS_PSI_ST_DRA_Audio 0xDA |
|---|
| 137 | /* Other Stream Type Definitions */ |
|---|
| 138 | /* 0x80-0xFF used by non-MPEG standards */ |
|---|
| 139 | #define TS_PSI_ST_ATSC_Video 0x80 |
|---|
| 140 | #define TS_PSI_ST_ATSC_AC3 0x81 |
|---|
| 141 | #define TS_PSI_ST_ATSC_DTS_HiRes 0x85 |
|---|
| 142 | #define TS_PSI_ST_ATSC_DTS 0x86 |
|---|
| 143 | #define TS_PSI_ST_ATSC_EAC3 0x87 |
|---|
| 144 | #define TS_PSI_ST_SMPTE_VC1 0xEA |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | /* Descriptor Tag Assignments */ |
|---|
| 148 | /* MPEG Descriptor Tag Definitions 0x00-0x3F */ |
|---|
| 149 | /* 0x00 Reserved */ |
|---|
| 150 | /* 0x01 Reserved */ |
|---|
| 151 | #define TS_PSI_DT_VideoStream 0x02 |
|---|
| 152 | #define TS_PSI_DT_AudioStream 0x03 |
|---|
| 153 | #define TS_PSI_DT_Hierarchy 0x04 |
|---|
| 154 | #define TS_PSI_DT_Registration 0x05 |
|---|
| 155 | #define TS_PSI_DT_DataStreamAlign 0x06 |
|---|
| 156 | #define TS_PSI_DT_TargetBgGrid 0x07 |
|---|
| 157 | #define TS_PSI_DT_VideoWindow 0x08 |
|---|
| 158 | #define TS_PSI_DT_CA 0x09 |
|---|
| 159 | #define TS_PSI_DT_ISO_639_Language 0x0A |
|---|
| 160 | #define TS_PSI_DT_SystemClock 0x0B |
|---|
| 161 | #define TS_PSI_DT_MultiplexBufferUtilization 0x0C |
|---|
| 162 | #define TS_PSI_DT_Copyright 0x0D |
|---|
| 163 | #define TS_PSI_DT_MaximumBitrate 0x0E |
|---|
| 164 | #define TS_PSI_DT_PrivateDataIndicator 0x0F |
|---|
| 165 | #define TS_PSI_DT_SmoothingBuffer 0x10 |
|---|
| 166 | #define TS_PSI_DT_STD 0x11 |
|---|
| 167 | #define TS_PSI_DT_IBP 0x12 |
|---|
| 168 | #define TS_PSI_DT_13818_6_DSMCC_1 0x13 |
|---|
| 169 | #define TS_PSI_DT_13818_6_DSMCC_2 0x14 |
|---|
| 170 | #define TS_PSI_DT_13818_6_DSMCC_3 0x15 |
|---|
| 171 | #define TS_PSI_DT_13818_6_DSMCC_4 0x16 |
|---|
| 172 | #define TS_PSI_DT_13818_6_DSMCC_5 0x17 |
|---|
| 173 | #define TS_PSI_DT_13818_6_DSMCC_6 0x18 |
|---|
| 174 | #define TS_PSI_DT_13818_6_DSMCC_7 0x19 |
|---|
| 175 | #define TS_PSI_DT_13818_6_DSMCC_8 0x1A |
|---|
| 176 | #define TS_PSI_DT_MPEG4_Video 0x1B |
|---|
| 177 | #define TS_PSI_DT_MPEG4_Audio 0x1C |
|---|
| 178 | #define TS_PSI_DT_IOD 0x1D |
|---|
| 179 | #define TS_PSI_DT_SL 0x1E |
|---|
| 180 | #define TS_PSI_DT_FMC 0x1F |
|---|
| 181 | #define TS_PSI_DT_External_ES_ID 0x20 |
|---|
| 182 | #define TS_PSI_DT_MuxCode 0x21 |
|---|
| 183 | #define TS_PSI_DT_FmxBufferSize 0x22 |
|---|
| 184 | #define TS_PSI_DT_MultiplexBuffer 0x23 |
|---|
| 185 | #define TS_PSI_DT_ContentLabeling 0x24 |
|---|
| 186 | #define TS_PSI_DT_MetadataPointer 0x25 |
|---|
| 187 | #define TS_PSI_DT_Metadata 0x26 |
|---|
| 188 | #define TS_PSI_DT_MetadataSTD 0x27 |
|---|
| 189 | #define TS_PSI_DT_AVC 0x28 |
|---|
| 190 | #define TS_PSI_DT_13818_11_IPMP 0x29 |
|---|
| 191 | #define TS_PSI_DT_AVCTimingHRD 0x2A |
|---|
| 192 | #define TS_PSI_DT_MPEG2_AAC 0x2B |
|---|
| 193 | #define TS_PSI_DT_FlexMuxTiming 0x2C |
|---|
| 194 | #define TS_PSI_DT_SVC 0x30 |
|---|
| 195 | #define TS_PSI_DT_MVC 0x31 |
|---|
| 196 | |
|---|
| 197 | /* AVS video,can be assigned stream_type of 0x06(private pes) |
|---|
| 198 | in that case AVS video is identfied by unique descriptor tag. |
|---|
| 199 | AVS Audio is not supported with private pes */ |
|---|
| 200 | #define TS_PSI_DT_AVS_Video 0x3F |
|---|
| 201 | |
|---|
| 202 | /* Other Stream Type Definitions */ |
|---|
| 203 | /* 0x40-0x7F used by DVB */ |
|---|
| 204 | #define TS_PSI_DT_DVB_NetworkName 0x40 |
|---|
| 205 | #define TS_PSI_DT_DVB_ServiceList 0x41 |
|---|
| 206 | #define TS_PSI_DT_DVB_Stuffing 0x42 |
|---|
| 207 | #define TS_PSI_DT_DVB_SatelliteDelivery 0x43 |
|---|
| 208 | #define TS_PSI_DT_DVB_CableDelivery 0x44 |
|---|
| 209 | #define TS_PSI_DT_DVB_VBI_Data 0x45 |
|---|
| 210 | #define TS_PSI_DT_DVB_VBI_Teletext 0x46 |
|---|
| 211 | #define TS_PSI_DT_DVB_BouquetName 0x47 |
|---|
| 212 | #define TS_PSI_DT_DVB_Service 0x48 |
|---|
| 213 | #define TS_PSI_DT_DVB_CountryAvailablity 0x49 |
|---|
| 214 | #define TS_PSI_DT_DVB_Linkage 0x4A |
|---|
| 215 | #define TS_PSI_DT_DVB_NVOD_Reference 0x4B |
|---|
| 216 | #define TS_PSI_DT_DVB_TimeShiftedService 0x4C |
|---|
| 217 | #define TS_PSI_DT_DVB_ShortEvent 0x4D |
|---|
| 218 | #define TS_PSI_DT_DVB_ExtendedEvent 0x4E |
|---|
| 219 | #define TS_PSI_DT_DVB_TimeShiftedEvent 0x4F |
|---|
| 220 | #define TS_PSI_DT_DVB_Component 0x50 |
|---|
| 221 | #define TS_PSI_DT_DVB_Mosaic 0x51 |
|---|
| 222 | #define TS_PSI_DT_DVB_StreamIdentifier 0x52 |
|---|
| 223 | #define TS_PSI_DT_DVB_CA_Indentifier 0x53 |
|---|
| 224 | #define TS_PSI_DT_DVB_Content 0x54 |
|---|
| 225 | #define TS_PSI_DT_DVB_ParentalRating 0x55 |
|---|
| 226 | #define TS_PSI_DT_DVB_Teletext 0x56 |
|---|
| 227 | #define TS_PSI_DT_DVB_Telephone 0x57 |
|---|
| 228 | #define TS_PSI_DT_DVB_LocalTimeOffset 0x58 |
|---|
| 229 | #define TS_PSI_DT_DVB_Subtitling 0x59 |
|---|
| 230 | #define TS_PSI_DT_DVB_TerrestrialDeliverySystem 0x5A |
|---|
| 231 | #define TS_PSI_DT_DVB_MultilingualNetworkName 0x5B |
|---|
| 232 | #define TS_PSI_DT_DVB_MultilingualBouquetName 0x5C |
|---|
| 233 | #define TS_PSI_DT_DVB_MultilingualServiceName 0x5D |
|---|
| 234 | #define TS_PSI_DT_DVB_MultilingualComponent 0x5E |
|---|
| 235 | #define TS_PSI_DT_DVB_PrivateDataSpecifier 0x5F |
|---|
| 236 | #define TS_PSI_DT_DVB_ServiceMove 0x60 |
|---|
| 237 | #define TS_PSI_DT_DVB_ShortSmoothingBuffer 0x61 |
|---|
| 238 | #define TS_PSI_DT_DVB_FrequencyList 0x62 |
|---|
| 239 | #define TS_PSI_DT_DVB_PartialTransportStream 0x63 |
|---|
| 240 | #define TS_PSI_DT_DVB_DataBroadcast 0x64 |
|---|
| 241 | #define TS_PSI_DT_DVB_Scrambling 0x65 |
|---|
| 242 | #define TS_PSI_DT_DVB_DataBroadcastID 0x66 |
|---|
| 243 | #define TS_PSI_DT_DVB_TransportStream 0x67 |
|---|
| 244 | #define TS_PSI_DT_DVB_DSNG 0x68 |
|---|
| 245 | #define TS_PSI_DT_DVB_PDC 0x69 |
|---|
| 246 | #define TS_PSI_DT_DVB_AC3 0x6A |
|---|
| 247 | #define TS_PSI_DT_DVB_AncillaryData 0x6B |
|---|
| 248 | #define TS_PSI_DT_DVB_CellList 0x6C |
|---|
| 249 | #define TS_PSI_DT_DVB_CellFrequencyLink 0x6D |
|---|
| 250 | #define TS_PSI_DT_DVB_AnnouncementSupport 0x6E |
|---|
| 251 | #define TS_PSI_DT_DVB_ApplicationSignalling 0x6F |
|---|
| 252 | #define TS_PSI_DT_DVB_AdaptationFieldData 0x70 |
|---|
| 253 | #define TS_PSI_DT_DVB_ServiceIdentifier 0x71 |
|---|
| 254 | #define TS_PSI_DT_DVB_ServiceAvailability 0x72 |
|---|
| 255 | #define TS_PSI_DT_DVB_DefaultAuthority 0x73 |
|---|
| 256 | #define TS_PSI_DT_DVB_RelatedContent 0x74 |
|---|
| 257 | #define TS_PSI_DT_DVB_TVA_ID 0x75 |
|---|
| 258 | #define TS_PSI_DT_DVB_ContentIdentifier 0x76 |
|---|
| 259 | #define TS_PSI_DT_DVB_TimeSliceFEC 0x77 |
|---|
| 260 | #define TS_PSI_DT_DVB_ECMRepetitionRate 0x78 |
|---|
| 261 | #define TS_PSI_DT_DVB_S2SatelliteDeliverySystem 0x79 |
|---|
| 262 | #define TS_PSI_DT_DVB_EnhancedAC3 0x7A |
|---|
| 263 | #define TS_PSI_DT_DVB_DTS 0x7B |
|---|
| 264 | #define TS_PSI_DT_DVB_AAC 0x7C |
|---|
| 265 | #define TS_PSI_DT_DVB_DRA 0xA0 |
|---|
| 266 | /* 0x80-0x8F used by ATSC */ |
|---|
| 267 | #define TS_PSI_DT_ATSC_Stuffing 0x80 |
|---|
| 268 | #define TS_PSI_DT_ATSC_AC3_Audio 0x81 |
|---|
| 269 | #define TS_PSI_DT_ATSC_SCTE_FrameRate 0x82 |
|---|
| 270 | #define TS_PSI_DT_ATSC_SCTE_ExtendedVideo 0x83 |
|---|
| 271 | #define TS_PSI_DT_ATSC_SCTE_ComponentName 0x84 |
|---|
| 272 | #define TS_PSI_DT_ATSC_Program 0x85 |
|---|
| 273 | #define TS_PSI_DT_ATSC_CaptionService 0x86 |
|---|
| 274 | #define TS_PSI_DT_ATSC_ContentAdvisory 0x87 |
|---|
| 275 | #define TS_PSI_DT_ATSC_CA 0x88 |
|---|
| 276 | #define TS_PSI_DT_ATSC_Descriptor 0x89 |
|---|
| 277 | #define TS_PSI_DT_ATSC_SCTE_35_CueIdentifier 0x8A |
|---|
| 278 | /* 0x8B Reserved */ |
|---|
| 279 | #define TS_PSI_DT_ATSC_TimeStamp 0x8C |
|---|
| 280 | #define TS_PSI_DT_ATSC_ComponentName 0xA3 |
|---|
| 281 | #define TS_PSI_DT_ATSC_RedistributionControl 0xAA |
|---|
| 282 | #define TS_PSI_DT_ATSC_PrivateInfomation 0xAD |
|---|
| 283 | #define TS_PSI_DT_ATSC_ContenIdentifier 0xB6 |
|---|
| 284 | |
|---|
| 285 | |
|---|
| 286 | /* PES Scrambling Control Values */ |
|---|
| 287 | #define TS_PSI_PES_SCV_not_scrambled 0x0 |
|---|
| 288 | #define TS_PSI_PES_SCV_even_key 0x2 |
|---|
| 289 | #define TS_PSI_PES_SCV_odd_key 0x3 |
|---|
| 290 | |
|---|
| 291 | typedef const uint8_t * TS_PSI_descriptor; |
|---|
| 292 | |
|---|
| 293 | typedef struct |
|---|
| 294 | { |
|---|
| 295 | uint8_t table_id; |
|---|
| 296 | bool section_syntax_indicator; |
|---|
| 297 | bool private_indicator; |
|---|
| 298 | uint16_t section_length; |
|---|
| 299 | uint16_t table_id_extension; |
|---|
| 300 | uint8_t version_number; |
|---|
| 301 | bool current_next_indicator; |
|---|
| 302 | uint8_t section_number; |
|---|
| 303 | uint8_t last_section_number; |
|---|
| 304 | uint32_t CRC_32; |
|---|
| 305 | } TS_PSI_header; |
|---|
| 306 | |
|---|
| 307 | void TS_PSI_getSectionHeader( const uint8_t *buf, TS_PSI_header *p_header ); |
|---|
| 308 | |
|---|
| 309 | #ifdef __cplusplus |
|---|
| 310 | } |
|---|
| 311 | #endif |
|---|
| 312 | #endif |
|---|
| 313 | /* End of File */ |
|---|