/** @file DLIB_PSI.h @brief DLIB_PSI_Parser, DLIB_PSI_Monitor¿¡¼­ »ç¿ëµÇ´Â ÀÚ·áÇü Á¤ÀÇ. API¼±¾ð¿¡ »ç¿ëµÇ´Â °Í°ú ±¸ÇöºÎ¿¡¼­¸¸ »ç¿ëµÇ´Â °ÍÀÌ È¥ÀçµÇ¾î ÀÖÀ½. */ #ifndef __DLIB_PSI_H__ #define __DLIB_PSI_H__ #include "DHL_OSAL.h" #include "DHL_MPEGTypes.h" #ifdef __cplusplus extern "C" { #endif #if COMMENT ____Overview____(){} #endif #if COMMENT ____Config____(){} #endif #define MAX_SI_MPEG_DATA 1024 #define MAX_SI_PRIVATE_DATA 4096 #define MAX_SI_SECTIONS 256 #if COMMENT ____Types____(){} #endif #if COMMENT ____Defines____(){} #endif /******************************************************************************* * MPEG_SI.h - MPEG System Information (SI) parsing definitions * * Copyright (c) 2004 Zoran, Corporation. All Rights Reserved Worldwide. * * THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO ZORAN, CORP. AND * CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use, * reproduction, modification, or disclosure of this program is strictly * prohibited. Any use of this program by an authorized licensee is * strictly subject to the terms and conditions, including * confidentiality obligations, set forth in the applicable Software * License Agreement between Zoran, Corp. and the licensee. * * $Id: //suprahd/releases/suprahd_239/suprahd_zTVApp660_239/include/MPEG_SI.h#1 $ * $Revision: #1 $ * $DateTime: 2006/06/05 14:53:58 $ * $Change: 45890 $ * $Author: catherine.lee $ * ******************************************************************************/ #define checkMemoryError(p) if (p == NULL) {err = DHL_FAIL_OUT_OF_MEMORY; goto ParseExit;} /**@name Assigned PID's @{ */ #define PAT_PID 0x0000 #define EIT_PID 0x0012 #define DIT_PID 0x001E #define SIT_PID 0x001F /** @} */ /** @name Table ID's @{ */ #define PROGRAM_ASSOCIATION_SECTION 0 #define CA_SECTION 1 #define TS_PROGRAM_MAP_SECTION 2 #define DIT_SECTION 0x7E #define SIT_SECTION 0x7F /** @} */ /***************************** PAT ********************************/ /** @name MPEG descriptor types (Table 2-39) @{ */ #define video_stream_tag 0x02 #define audio_stream_tag 0x03 #define hierarchy_tag 0x04 #define registration_tag 0x05 #define data_stream_alignment_tag 0x06 #define target_background_grid_tag 0x07 #define video_window_tag 0x08 #define CA_tag 0x09 #define ISO_639_language_tag 0x0A #define system_clock_tag 0x0B #define multiplex_buffer_utilization_tag 0x0C #define copyright_tag 0x0D #define maximum_bitrate_tag 0x0E #define private_data_indicator_tag 0x0F #define smoothing_buffer_tag 0x10 #define STD_tag 0x11 #define IBP_tag 0x12 /** @} */ /** @name MPEG stream types in the PMT (Table 2-29) @{ NOT to be confused with stream ID's found in PES headers */ #define StreamType_MPEG1Video 1 #define StreamType_MPEG2Video 2 #define StreamType_MPEG1Audio 3 #define StreamType_MPEG2Audio 4 #define StreamType_MPEG2PrivateSection 5 #define StreamType_MPEG2PESPrivateData 6 #define StreamType_MHEG 7 #define StreamType_AnnexADSMCC 8 #define StreamType_H222_1 9 #define StreamType_DSMCCTypeA 10 #define StreamType_DSMCCTypeB 11 #define StreamType_DSMCCTypeC 12 #define StreamType_DSMCCTypeD 13 #define StreamType_MPEG2Auxiliary 14 #define StreamType_AACAudioADTS 15 /* 0x0F: AAC with ADTS transport syntax */ #define StreamType_AACAudioLATM 17 /* 0x11: AAC with LATM/LOAS syntax */ #define StreamType_H264 27 /* 0x1B */ #define StreamType_DC2Video 0x80 #define StreamType_AC3Audio 0x81 #define StreamType_A97SDDS 11 /* 0x0B, DSMCC Carousel. */ //BKTODO: AC3+(DolbyDigitalPlus) 0x84 /** @} */ /** This represents one program within the Program Association Table */ typedef struct MPEG_PAT_program { UINT16 program_number; UINT16 program_map_PID; } MPEG_PAT_program; /** This contains all interesting fieldsin a Program Association Table. All sections in a multi-section PAT are included in this one structure. */ typedef struct MPEG_PAT { UINT16 transport_stream_id; UINT8 version_number; BOOLEAN current_next_indicator; UINT8 section_number; UINT8 last_section_number; BOOLEAN isWholePAT; ///< FALSE if only a singe section of a PAT UINT16 numPrograms; BOOLEAN networkPIDPresent; ///< TRUE if network_pid is valid UINT16 network_PID; MPEG_PAT_program *programs; } MPEG_PAT; /***************************** PMT ********************************/ /** video_stream_descriptor */ typedef struct VideoStreamDescriptor { BOOLEAN multiple_frame_rate_flag; MPEG_FRAME_RATE frame_rate_code; BOOLEAN MPEG_1_only_flag; BOOLEAN constrained_parameter_flag; BOOLEAN still_picture_flag; UINT8 profile_and_level_indication; MPEG_CHROMA_FORMAT chroma_format; BOOLEAN frame_rate_extension_flag; } VideoStreamDescriptor; /** Video Decode Control Descriptor (ARIB only) */ typedef struct VideoDecodeControlDescriptor { BOOLEAN valid; ///< TRUE if this descriptor exists in PMT BOOLEAN still_picture_flag; BOOLEAN sequence_end_code_flag; UINT8 video_decode_format; } VideoDecodeControlDescriptor; /** PMT stream */ typedef struct MPEG_PMT_stream { UINT8 stream_type; UINT16 elementary_PID; UINT16 descriptor_length; UINT8 *descriptors; VideoStreamDescriptor *videoStreamDescriptor; ///< NULL if not present VideoDecodeControlDescriptor videoDecodeControlDescriptor; ///< Not a pointer. Check valid flag } MPEG_PMT_stream; /* This contains all interesting fields in a Program Mapping Table */ #define DYNARRAY_PMTStream 32 /* Debugger thinks there's this many streams - Does not specify actual length of structure */ /** MPEG PMT object */ typedef struct MPEG_PMT { UINT16 PID; UINT16 program_number; UINT8 version_number; BOOLEAN current_next_indicator; UINT16 PCR_PID; UINT16 descriptor_length; UINT8 *descriptors; ///< program descriptors int numStreams; MPEG_PMT_stream streams[DYNARRAY_PMTStream]; } MPEG_PMT; #define MPEG_PMTSize(nelem) (sizeof(MPEG_PMT) + \ ((nelem)-DYNARRAY_PMTStream)*sizeof(MPEG_PMT_stream)) #if COMMENT ____API____(){} #endif #if COMMENT ____DEBUG____(){} #endif #define DLIB_PSI_API_DEBUG 1 #if DLIB_PSI_API_DEBUG /** PrintPAT prints out a PAT to standard output */ void PrintPAT(const MPEG_PAT *pat); #endif #if DLIB_PSI_API_DEBUG /** PrintPMT prints out a PMT to standard output */ void PrintPMT(const MPEG_PMT *pmt); #endif #ifdef __cplusplus } /* extern "C" */ #endif #endif /* __DLIB_PSI_H__ */