| [2] | 1 | /******************************************************************** |
|---|
| 2 | * |
|---|
| 3 | * PSI_MpegSi.h - MPEG System Information (SI) parsing definitions |
|---|
| 4 | * |
|---|
| 5 | * Copyright 2004~ DigitalSTREAMTechnology, Inc. |
|---|
| 6 | * All Rights Reserved |
|---|
| 7 | * |
|---|
| 8 | * _Id: PSI_MpegSi.h ,v 1.0 2004/015/28 jina Exp |
|---|
| 9 | ********************************************************************/ |
|---|
| 10 | #ifndef DST_PSI_MPEG_SI_ |
|---|
| 11 | #define DST_PSI_MPEG_SI_ |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #ifdef __cplusplus |
|---|
| 15 | extern "C" { |
|---|
| 16 | #endif |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #ifndef DST_PSI_PROCESS_H |
|---|
| 21 | #include "dsthalPsiProcess.h" |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | #ifndef _DSTHALERROR_H_ |
|---|
| 26 | #include "dsthalerror.h" |
|---|
| 27 | #endif |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | /* macros */ |
|---|
| 31 | #if 0 |
|---|
| 32 | ___Definitions___() |
|---|
| 33 | #endif |
|---|
| 34 | |
|---|
| 35 | #define MAX_PSI_MPEG_DATA 4096 |
|---|
| 36 | #define MAX_PSI_SECTIONS 256 |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | #define get_table_id(p) (p[0]) |
|---|
| 40 | #define get_section_syntax_indicator(p) (p[1] >> 7) |
|---|
| 41 | #define get_private_indicator(p) ((p[1] >> 6) & 0x1) |
|---|
| 42 | #define get_section_length(p) (((p[1] & 0x0F) << 8) | p[2]) |
|---|
| 43 | #define get_section_number(p) (p[6]) |
|---|
| 44 | #define get_last_section_number(p) (p[7]) |
|---|
| 45 | |
|---|
| 46 | /* |
|---|
| 47 | * Assigned PID's |
|---|
| 48 | */ |
|---|
| 49 | #define PAT_PID 0x0000 |
|---|
| 50 | #define EIT_PID 0x0012 |
|---|
| 51 | #define DIT_PID 0x001E |
|---|
| 52 | #define SIT_PID 0x001F |
|---|
| 53 | |
|---|
| 54 | /* |
|---|
| 55 | * Table ID's |
|---|
| 56 | */ |
|---|
| 57 | #define PROGRAM_ASSOCIATION_SECTION 0 |
|---|
| 58 | #define CA_SECTION 1 |
|---|
| 59 | #define TS_PROGRAM_MAP_SECTION 2 |
|---|
| 60 | #define DIT_SECTION 0x7E |
|---|
| 61 | #define SIT_SECTION 0x7F |
|---|
| 62 | |
|---|
| 63 | #define MAX_ECM_SECTION_SIZE 4096 |
|---|
| 64 | #define TS_ECM_SECTION_ID 0x82 |
|---|
| 65 | #define TS_EMM_SECTION_ID 0x84 |
|---|
| 66 | |
|---|
| 67 | #define COMMON_EMM_TABLE_EXTENSION_ID 0x0000 |
|---|
| 68 | |
|---|
| 69 | /***************************** PAT ********************************/ |
|---|
| 70 | |
|---|
| 71 | /* |
|---|
| 72 | * MPEG descriptor types (Table 2-39) |
|---|
| 73 | */ |
|---|
| 74 | #define video_stream_tag 0x02 |
|---|
| 75 | #define audio_stream_tag 0x03 |
|---|
| 76 | #define hierarchy_tag 0x04 |
|---|
| 77 | #define registration_tag 0x05 |
|---|
| 78 | #define data_stream_alignment_tag 0x06 |
|---|
| 79 | #define target_background_grid_tag 0x07 |
|---|
| 80 | #define video_window_tag 0x08 |
|---|
| 81 | #define CA_tag 0x09 |
|---|
| 82 | #define ISO_639_language_tag 0x0A |
|---|
| 83 | #define system_clock_tag 0x0B |
|---|
| 84 | #define multiplex_buffer_utilization_tag 0x0C |
|---|
| 85 | #define copyright_tag 0x0D |
|---|
| 86 | #define maximum_bitrate_tag 0x0E |
|---|
| 87 | #define private_data_indicator_tag 0x0F |
|---|
| 88 | #define smoothing_buffer_tag 0x10 |
|---|
| 89 | #define STD_tag 0x11 |
|---|
| 90 | #define IBP_tag 0x12 |
|---|
| 91 | |
|---|
| 92 | /* |
|---|
| 93 | * DVB/ARIB descriptor types |
|---|
| 94 | */ |
|---|
| 95 | #define network_name_tag 0x40 |
|---|
| 96 | #define service_list_tag 0x41 |
|---|
| 97 | #define DVB_ARIB_stuffing_tag 0x42 |
|---|
| 98 | #define satellite_delivery_system_tag 0x43 |
|---|
| 99 | #define cable_delivery_system_tag 0x44 |
|---|
| 100 | #define buquet_name_tag 0x47 |
|---|
| 101 | #define service_tag 0x48 |
|---|
| 102 | #define country_availability_tag 0x49 |
|---|
| 103 | #define linkage_tag 0x4A |
|---|
| 104 | #define nvod_reference_tag 0x4B |
|---|
| 105 | #define DVB_time_shifted_service_tag 0x4C |
|---|
| 106 | #define short_event_tag 0x4D |
|---|
| 107 | #define extended_event_tag 0x4E |
|---|
| 108 | #define time_shifted_event_tag 0x4F |
|---|
| 109 | #define component__tag 0x50 |
|---|
| 110 | #define mosaic_tag 0x51 |
|---|
| 111 | #define stream_identifier_tag 0x52 |
|---|
| 112 | #define ca_identifier_tag 0x53 |
|---|
| 113 | #define content_tag 0x54 |
|---|
| 114 | #define parental_rating_tag 0x55 |
|---|
| 115 | #define local_time_offset_tag 0x58 |
|---|
| 116 | #define partial_transport_stream_tag 0x63 |
|---|
| 117 | |
|---|
| 118 | /* |
|---|
| 119 | * ATSC descriptor types |
|---|
| 120 | */ |
|---|
| 121 | #define ATSC_stuffing_tag 0x80 |
|---|
| 122 | #define AC3_audio_stream_tag 0x81 |
|---|
| 123 | #define program_identifier_tag 0x85 |
|---|
| 124 | #define caption_service_tag 0x86 |
|---|
| 125 | #define content_advisory_tag 0x87 |
|---|
| 126 | #define extended_channel_name_tag 0xA0 |
|---|
| 127 | #define service_location_tag 0xA1 |
|---|
| 128 | #define ATSC_time_shifted_service_tag 0xA2 |
|---|
| 129 | #define component_name_tag 0xA3 |
|---|
| 130 | #define dcc_departing_request_tag 0xA8 |
|---|
| 131 | #define dcc_arriving_request_tag 0xA9 |
|---|
| 132 | #define redistribution_control_tag 0xAA |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | /* |
|---|
| 136 | * ARIB descriptor types |
|---|
| 137 | */ |
|---|
| 138 | #define heirarchical_transmission_tag 0xC0 |
|---|
| 139 | #define digital_copy_control_tag 0xC1 |
|---|
| 140 | #define netowkr_identification_tag 0xC2 |
|---|
| 141 | #define partial_ts_time_tag 0xC3 |
|---|
| 142 | #define audio_component_tag 0xC4 |
|---|
| 143 | #define hyperlink_tag 0xC5 |
|---|
| 144 | #define target_area_tag 0xC6 |
|---|
| 145 | #define data_control_tag 0xC7 |
|---|
| 146 | #define video_decode_control_tag 0xC8 |
|---|
| 147 | #define download_control_tag 0xC9 |
|---|
| 148 | #define ca_emm_ts_tag 0xCA |
|---|
| 149 | #define ca_contrat_information_tag 0xCB |
|---|
| 150 | #define ca_service_tag 0xCC |
|---|
| 151 | #define basic_local_even_tag 0xD0 |
|---|
| 152 | #define reference_tag 0xD1 |
|---|
| 153 | #define node_relation_tag 0xD2 |
|---|
| 154 | #define shore_node_tag 0xD3 |
|---|
| 155 | #define stc_reference_tag 0xD4 |
|---|
| 156 | #define emergency_information_tag 0xFC |
|---|
| 157 | #define data_component_tag 0xFD |
|---|
| 158 | #define system_management_tag 0xFE |
|---|
| 159 | |
|---|
| 160 | |
|---|
| 161 | /* |
|---|
| 162 | * MPEG stream types in the PMT (Table 2-29) |
|---|
| 163 | * NOT to be confused with stream ID's found in PES headers |
|---|
| 164 | */ |
|---|
| 165 | #define StreamType_MPEG1Video 1 |
|---|
| 166 | #define StreamType_MPEG2Video 2 |
|---|
| 167 | #define StreamType_MPEG1Audio 3 |
|---|
| 168 | #define StreamType_MPEG2Audio 4 |
|---|
| 169 | #define StreamType_MPEG2PrivateSection 5 |
|---|
| 170 | #define StreamType_MPEG2PESPrivateData 6 |
|---|
| 171 | #define StreamType_MHEG 7 |
|---|
| 172 | #define StreamType_AnnexADSMCC 8 |
|---|
| 173 | #define StreamType_H222_1 9 |
|---|
| 174 | #define StreamType_DSMCCTypeA 10 |
|---|
| 175 | #define StreamType_DSMCCTypeB 11 |
|---|
| 176 | #define StreamType_DSMCCTypeC 12 |
|---|
| 177 | #define StreamType_DSMCCTypeD 13 |
|---|
| 178 | #define StreamType_MPEG2Auxiliary 14 |
|---|
| 179 | #define StreamType_MPEG4Audio 0x11 |
|---|
| 180 | #define StreamType_MPEG4Video 0x1B |
|---|
| 181 | #define StreamType_AACAudio 15 |
|---|
| 182 | #define StreamType_DC2Video 0x80 |
|---|
| 183 | #define StreamType_AC3Audio 0x81 |
|---|
| 184 | |
|---|
| 185 | #if 0 |
|---|
| 186 | ___PAT___() |
|---|
| 187 | #endif |
|---|
| 188 | /* |
|---|
| 189 | * This represents one program within the Program Association Table |
|---|
| 190 | */ |
|---|
| 191 | typedef struct MPEG_PAT_program { |
|---|
| 192 | DS_U16 program_number; |
|---|
| 193 | DS_U16 program_map_PID; |
|---|
| 194 | } MPEG_PAT_program; |
|---|
| 195 | |
|---|
| 196 | /* |
|---|
| 197 | * This contains all interesting fieldsin a Program Association Table. |
|---|
| 198 | * All sections in a multi-section PAT are included in this |
|---|
| 199 | * one structure. |
|---|
| 200 | */ |
|---|
| 201 | typedef struct pat_t { |
|---|
| 202 | DS_U16 transport_stream_id; |
|---|
| 203 | DS_U8 version_number; |
|---|
| 204 | DS_BOOL current_next_indicator; |
|---|
| 205 | DS_U8 section_number; |
|---|
| 206 | DS_U8 last_section_number; |
|---|
| 207 | DS_BOOL isWholePAT; /* FALSE if only a singe section of a PAT */ |
|---|
| 208 | DS_U16 numPrograms; |
|---|
| 209 | DS_BOOL networkPIDPresent; /* TRUE if network_pid is valid */ |
|---|
| 210 | DS_U16 network_PID; |
|---|
| 211 | MPEG_PAT_program *programs; |
|---|
| 212 | } pat_t, *patPtr_t; |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | typedef struct pat_t MPEG_PAT; |
|---|
| 216 | |
|---|
| 217 | /* |
|---|
| 218 | * MonitorPAT will set up a PSI monitor waiting for PAT's |
|---|
| 219 | * current_next_indicator should be set to TRUE to get the current PAT |
|---|
| 220 | * or FALSE to get the next PAT. |
|---|
| 221 | * The eventProc will be called after the first PAT received, or after |
|---|
| 222 | * each section in the PAT is received if eager is TRUE., and |
|---|
| 223 | * then again depending on updateMode until CancelPSIPidMonitor |
|---|
| 224 | * is called. The eventProc should call ParsePAT |
|---|
| 225 | */ |
|---|
| 226 | DHL_RESULT DHL_PSI_MonitorPAT( DHL_PSI_HANDLE sysInfo, |
|---|
| 227 | DS_BOOL current_next_indicator, |
|---|
| 228 | DS_BOOL eager, |
|---|
| 229 | PSIUpdateMode updateMode, |
|---|
| 230 | PSIEventProc_f eventProc, |
|---|
| 231 | DS_U32 userParam, |
|---|
| 232 | DHL_TBL_HANDLE *returnPSICtl); |
|---|
| 233 | |
|---|
| 234 | /* |
|---|
| 235 | * ParsePAT will parse a PAT, given a PSI descriptor. It should |
|---|
| 236 | * be called in response to a psiDataReceived event. |
|---|
| 237 | */ |
|---|
| 238 | DHL_RESULT DHL_PSI_ParsePAT(DS_U8 **sectionArr , MPEG_PAT **returnPat); |
|---|
| 239 | |
|---|
| 240 | /* |
|---|
| 241 | * PrintPAT prints out a PAT to standard output |
|---|
| 242 | */ |
|---|
| 243 | void DHL_PSI_PrintPAT(const MPEG_PAT *pat); |
|---|
| 244 | |
|---|
| 245 | /* |
|---|
| 246 | * This is an alternative, synchronous function for receiving PAT's when on-going |
|---|
| 247 | * event monitoring is not desired. The timeout parameter specifies the number |
|---|
| 248 | * of ticks to wait for a PAT, or 0 to wait indefinitely. |
|---|
| 249 | */ |
|---|
| 250 | DHL_RESULT DHL_PSI_GetPAT(DHL_PSI_HANDLE sysInfo, MPEG_PAT **returnPat, int timeOut); |
|---|
| 251 | |
|---|
| 252 | |
|---|
| 253 | |
|---|
| 254 | |
|---|
| 255 | void DHL_PSI_FreeMpegSection (void *sectionPtr); |
|---|
| 256 | |
|---|
| 257 | |
|---|
| 258 | |
|---|
| 259 | |
|---|
| 260 | /* |
|---|
| 261 | * FreePAT will delete a PAT returned by ParsePAT or GetPAT |
|---|
| 262 | */ |
|---|
| 263 | |
|---|
| 264 | #define DHL_PSI_FreePAT(x) DHL_PSI_FreeMpegSection(x) |
|---|
| 265 | |
|---|
| 266 | |
|---|
| 267 | /* |
|---|
| 268 | * FreePMT will delete a PMT returned by ParsePMT or GetPMT |
|---|
| 269 | */ |
|---|
| 270 | #define DHL_PSI_FreePMT(x) DHL_PSI_FreeMpegSection(x) |
|---|
| 271 | |
|---|
| 272 | |
|---|
| 273 | |
|---|
| 274 | #if 0 |
|---|
| 275 | ___PMT___() |
|---|
| 276 | #endif |
|---|
| 277 | /***************************** PMT ********************************/ |
|---|
| 278 | |
|---|
| 279 | /* video_stream_descriptor */ |
|---|
| 280 | typedef struct VideoStreamDescriptor { |
|---|
| 281 | DS_BOOL multiple_frame_rate_flag; |
|---|
| 282 | MPEG_FRAME_RATE frame_rate_code; |
|---|
| 283 | DS_BOOL MPEG_1_only_flag; |
|---|
| 284 | DS_BOOL constrained_parameter_flag; |
|---|
| 285 | DS_BOOL still_picture_flag; |
|---|
| 286 | DS_U8 profile_and_level_indication; |
|---|
| 287 | MPEG_CHROMA_FORMAT chroma_format; |
|---|
| 288 | DS_BOOL frame_rate_extension_flag; |
|---|
| 289 | } VideoStreamDescriptor; |
|---|
| 290 | |
|---|
| 291 | /* Video Decode Control Descriptor (ARIB only) */ |
|---|
| 292 | typedef struct VideoDecodeControlDescriptor { |
|---|
| 293 | DS_BOOL valid; /* TRUE if this descriptor exists in PMT */ |
|---|
| 294 | DS_BOOL still_picture_flag; |
|---|
| 295 | DS_BOOL sequence_end_code_flag; |
|---|
| 296 | DS_U8 video_decode_format; |
|---|
| 297 | } VideoDecodeControlDescriptor; |
|---|
| 298 | |
|---|
| 299 | typedef struct tag_CA_descriptor { |
|---|
| 300 | DS_U16 CA_system_ID; |
|---|
| 301 | DS_U16 CA_PID; |
|---|
| 302 | DS_U8 private_data_length; |
|---|
| 303 | DS_U8 *p_private_data; |
|---|
| 304 | } CA_descriptor; |
|---|
| 305 | |
|---|
| 306 | typedef struct MPEG_PMT_stream { |
|---|
| 307 | DS_U8 stream_type; |
|---|
| 308 | DS_U16 elementary_PID; |
|---|
| 309 | DS_U16 descriptor_length; |
|---|
| 310 | DS_U8 *descriptors; |
|---|
| 311 | VideoStreamDescriptor *videoStreamDescriptor; /* NULL if not present */ |
|---|
| 312 | VideoDecodeControlDescriptor videoDecodeControlDescriptor; /* Not a pointer. Check valid flag */ |
|---|
| 313 | |
|---|
| 314 | DS_U8 component_tag; |
|---|
| 315 | DS_BOOL b_component_tag_valid; |
|---|
| 316 | } MPEG_PMT_stream; |
|---|
| 317 | |
|---|
| 318 | /* |
|---|
| 319 | * This contains all interesting fields in a Program Mapping Table |
|---|
| 320 | */ |
|---|
| 321 | #define DYNARRAY_PMTStream 32 /* Debugger thinks there's this many streams - Does not specify actual length of structure */ |
|---|
| 322 | typedef struct pmt_t { |
|---|
| 323 | // DS_U16 PID; |
|---|
| 324 | DS_U16 program_number; |
|---|
| 325 | DS_U8 version_number; |
|---|
| 326 | DS_BOOL current_next_indicator; |
|---|
| 327 | DS_U16 PCR_PID; |
|---|
| 328 | DS_U16 descriptor_length; |
|---|
| 329 | DS_U8 *descriptors; /* program descriptors */ |
|---|
| 330 | int numStreams; |
|---|
| 331 | MPEG_PMT_stream streams[DYNARRAY_PMTStream]; |
|---|
| 332 | } pmt_t , *pmtPtr_t; |
|---|
| 333 | |
|---|
| 334 | typedef struct pmt_t MPEG_PMT; |
|---|
| 335 | |
|---|
| 336 | #define MPEG_PMTSize(nelem) (sizeof(MPEG_PMT) + \ |
|---|
| 337 | ((nelem)-DYNARRAY_PMTStream)*sizeof(MPEG_PMT_stream)) |
|---|
| 338 | |
|---|
| 339 | |
|---|
| 340 | |
|---|
| 341 | /* |
|---|
| 342 | * MonitorPMT will set up a PSI monitor waiting for PMT's at the given PID |
|---|
| 343 | * and program_number. (The same PID can be used to carry program numbers |
|---|
| 344 | * for different programs acording to ISO/IEC 13818-1 Section C.8.2) |
|---|
| 345 | * current_next_indicator should be set to TRUE to get the current PMT |
|---|
| 346 | * or FALSE to get the next PMT. |
|---|
| 347 | * The eventProc will be called after the first PMT received, and |
|---|
| 348 | * then again depending on updateMode until CancelPSIPidMonitor |
|---|
| 349 | * is called. The eventProc should call ParsePMT |
|---|
| 350 | */ |
|---|
| 351 | DHL_RESULT DHL_PSI_MonitorPMT(DHL_PSI_HANDLE sysInfo, |
|---|
| 352 | DS_U16 pid, |
|---|
| 353 | DS_U16 program_number, |
|---|
| 354 | DS_BOOL current_next_indicator, |
|---|
| 355 | PSIUpdateMode updateMode, |
|---|
| 356 | PSIEventProc_f eventProc, |
|---|
| 357 | DS_U32 userParam, |
|---|
| 358 | DHL_TBL_HANDLE *returnPSICtl); |
|---|
| 359 | /* |
|---|
| 360 | * ParsePMT will parse a PMT, given a PSI descriptor. It should |
|---|
| 361 | * be called in response to a psiDataReceived event. |
|---|
| 362 | */ |
|---|
| 363 | DHL_RESULT DHL_PSI_ParsePMT( DS_U8 *section , MPEG_PMT **returnPmt); |
|---|
| 364 | |
|---|
| 365 | |
|---|
| 366 | |
|---|
| 367 | /* |
|---|
| 368 | * PrintPMT prints out a PMT to standard output |
|---|
| 369 | */ |
|---|
| 370 | void DHL_PSI_PrintPMT(const MPEG_PMT *pmt); |
|---|
| 371 | |
|---|
| 372 | /* |
|---|
| 373 | * This is an alternative, synchronous function for receiving the current PMT |
|---|
| 374 | * at the given PID and program_number when on-going event monitoring is not desired. |
|---|
| 375 | * The timeout parameter specifies the number of ticks to wait for a PMT, or 0 to wait |
|---|
| 376 | * indefinitely. |
|---|
| 377 | */ |
|---|
| 378 | |
|---|
| 379 | DHL_RESULT DHL_PSI_GetPMT(DHL_PSI_HANDLE sysInfo, |
|---|
| 380 | DS_U16 pid, |
|---|
| 381 | DS_U16 program_number, |
|---|
| 382 | MPEG_PMT **returnPmt, |
|---|
| 383 | int timeOut ); |
|---|
| 384 | |
|---|
| 385 | |
|---|
| 386 | |
|---|
| 387 | /* |
|---|
| 388 | * Given a PMT, GetElementaryPIDs will return the first available audio and |
|---|
| 389 | * video elementary streams, the PCR PID, an optional second (low bit rate) |
|---|
| 390 | * video stream, and the type of audio. |
|---|
| 391 | * Any return parameter may be NULL if the caller is not interested in |
|---|
| 392 | * it. ScrambledWarning is returned if anything in the PMT is protected by |
|---|
| 393 | * a CA system. |
|---|
| 394 | */ |
|---|
| 395 | DHL_RESULT DHL_PSI_GetElementaryPIDs( MPEG_PMT *pmt, |
|---|
| 396 | DS_U16 *returnVideoPID, |
|---|
| 397 | DS_U16 *returnAudioPID, |
|---|
| 398 | DS_U16 *returnPcrPID, |
|---|
| 399 | DS_U16 *returnLowBitrateVideoPID, |
|---|
| 400 | AudioType *returnAudioType, |
|---|
| 401 | VideoStreamDescriptor **returnVideoStreamDescriptor, |
|---|
| 402 | DS_U8 *returnVidType); |
|---|
| 403 | |
|---|
| 404 | DHL_RESULT DHL_PSI_CancelMonitor( DHL_TBL_HANDLE pSectCtl ); |
|---|
| 405 | DHL_RESULT DHL_PSI_CancelMonitor_TVGOS( DHL_TBL_HANDLE pSectCtl ); |
|---|
| 406 | |
|---|
| 407 | /*============================================================================== |
|---|
| 408 | ^DHL_RESULT GetMpegDescriptor (DS_U8 *descriptors, DS_U16 len, DS_U8 tag, |
|---|
| 409 | DS_U16 instance, DS_U8 **descriptor) |
|---|
| 410 | |
|---|
| 411 | *descriptors: Pointer to the un-parsed descriptors. |
|---|
| 412 | len: Length in bytes of the un-parsed descriptors. |
|---|
| 413 | tag: descriptor_tag to be searched for. |
|---|
| 414 | instance: The instance of the descriptor to be returned. |
|---|
| 415 | **descriptor Returned Pointer to the start of the descriptor. |
|---|
| 416 | |
|---|
| 417 | Attempts to retrieve a descriptor of the specified type from a list of un- |
|---|
| 418 | parsed descriptors. The instance parameter allows searching for more than |
|---|
| 419 | one descriptor instance of the same type. |
|---|
| 420 | ==============================================================================*/ |
|---|
| 421 | DHL_RESULT GetMpegDescriptor (DS_U8 *descriptors, DS_U16 len, DS_U8 tag, |
|---|
| 422 | DS_U16 instance, DS_U8 **descriptor); |
|---|
| 423 | |
|---|
| 424 | DHL_RESULT GetMpegDescriptorEx(DS_U8 *descriptors, DS_U16 len, DS_U8 tag, |
|---|
| 425 | DS_U8 offset, DS_U8 *pfilterBytes, DS_U8 filter_len, DS_U16 instance, DS_U8 **p_descriptor); |
|---|
| 426 | |
|---|
| 427 | /*============================================================================== |
|---|
| 428 | ^void FreeMpegDescriptor (void *descriptorPtr) |
|---|
| 429 | |
|---|
| 430 | descriptorPtr Pointer to a parsed descriptor. |
|---|
| 431 | |
|---|
| 432 | Frees the memory associated with a parsed descriptor. |
|---|
| 433 | ==============================================================================*/ |
|---|
| 434 | void FreeMpegDescriptor (void *descriptorPtr); |
|---|
| 435 | |
|---|
| 436 | /* |
|---|
| 437 | * MonitorDIT will set up a PSI monitor waiting for a Discontinuity |
|---|
| 438 | ^ * Indicator Table (DIT). |
|---|
| 439 | * The eventProc will be called after the first DIT received, and |
|---|
| 440 | * then again depending on updateMode until CancelPSIPidMonitor |
|---|
| 441 | * is called. |
|---|
| 442 | */ |
|---|
| 443 | |
|---|
| 444 | |
|---|
| 445 | #if 0 |
|---|
| 446 | ___CAT___() |
|---|
| 447 | #endif |
|---|
| 448 | |
|---|
| 449 | /* |
|---|
| 450 | * This contains all interesting fields in a Program Mapping Table |
|---|
| 451 | */ |
|---|
| 452 | typedef struct cat_t { |
|---|
| 453 | // DS_U16 PID; |
|---|
| 454 | DS_U8 version_number; |
|---|
| 455 | DS_BOOL current_next_indicator; |
|---|
| 456 | DS_U16 descriptor_length; |
|---|
| 457 | DS_U8 *descriptors; /* program descriptors */ |
|---|
| 458 | } cat_t , *catPtr_t; |
|---|
| 459 | |
|---|
| 460 | typedef struct cat_t MPEG_CAT; |
|---|
| 461 | |
|---|
| 462 | DHL_RESULT DHL_PSI_MonitorCAT(DHL_PSI_HANDLE sysInfo, |
|---|
| 463 | DS_BOOL current_next_indicator, |
|---|
| 464 | DS_BOOL eager, |
|---|
| 465 | PSIUpdateMode updateMode, |
|---|
| 466 | PSIEventProc_f eventProc, |
|---|
| 467 | DS_U32 userParam, |
|---|
| 468 | DHL_TBL_HANDLE *returnPSICtl); |
|---|
| 469 | |
|---|
| 470 | /* |
|---|
| 471 | * ParseCAT will parse a CAT, given a PSI descriptor. It should |
|---|
| 472 | * be called in response to a psiDataReceived event. |
|---|
| 473 | */ |
|---|
| 474 | DHL_RESULT DHL_PSI_ParseCAT( DS_U8 *section , MPEG_CAT **returnCat); |
|---|
| 475 | DHL_RESULT DHL_PSI_GetCAT( DHL_PSI_HANDLE sysInfo, MPEG_CAT **returnCat, int timeOut ); |
|---|
| 476 | |
|---|
| 477 | /* |
|---|
| 478 | * PrintCAT prints out a CAT to standard output |
|---|
| 479 | */ |
|---|
| 480 | void DHL_PSI_PrintCAT(const MPEG_CAT *cat); |
|---|
| 481 | |
|---|
| 482 | /* |
|---|
| 483 | * This is an alternative, synchronous function for receiving the current PMT |
|---|
| 484 | * at the given PID and program_number when on-going event monitoring is not desired. |
|---|
| 485 | * The timeout parameter specifies the number of ticks to wait for a PMT, or 0 to wait |
|---|
| 486 | * indefinitely. |
|---|
| 487 | */ |
|---|
| 488 | |
|---|
| 489 | DHL_RESULT DHL_PSI_GetCAT(DHL_PSI_HANDLE sysInfo, |
|---|
| 490 | MPEG_CAT **returnCat, |
|---|
| 491 | int timeOut ); |
|---|
| 492 | |
|---|
| 493 | DHL_RESULT DHL_PSI_ParseECMEMM( DS_U8 *section, DS_U8 **returnData); |
|---|
| 494 | |
|---|
| 495 | #ifdef __cplusplus |
|---|
| 496 | } |
|---|
| 497 | #endif |
|---|
| 498 | |
|---|
| 499 | #endif /* #ifndef DST_PSI_MPEG_SI_ */ |
|---|
| 500 | |
|---|