PatParse.h
资源名称:PSParse.rar [点击查看]
上传用户:thjx518
上传日期:2022-03-16
资源大小:179k
文件大小:3k
源码类别:
mpeg/mp3
开发平台:
Visual C++
- // PatParse.h: interface for the CPatParse class.
- //
- //////////////////////////////////////////////////////////////////////
- #ifndef __PATPARSE_H__
- #define __PATPARSE_H__
- #include"PrivateSection.h"
- #define PSI_MAX_PROGRAMS 32
- #define PSI_MAX_DESCRIPTORS 32
- #define PSI_MAX_SI_STREAMS 32
- #define PSI_MAX_DESCRIPTORS 32
- #define PSI_MAX_SERVICES 32
- #define PSI_MAX_EVENTS 32 //perhaps must be large than 32 events
- #define PSI_MAX_NIT_STREAM_DESCRIPTORS 1
- #define PSI_MAX_TRANSPORT_STREAMS 255
- #define MAX_DESCRIPTOR_LENGTH 256
- typedef struct
- {
- USHORT programNumber;
- USHORT programMapPID;
- } ProgramType;
- typedef struct
- {
- UCHAR tableId;
- USHORT sectionLength;
- USHORT streamId;
- UCHAR versionNo;
- UCHAR currentNext;
- UCHAR sectionNo;
- UCHAR lastSectionNo;
- UCHAR numProgs;
- ProgramType programs[PSI_MAX_PROGRAMS];
- } PATType;
- typedef struct
- {
- UCHAR tag;
- UCHAR length;
- UCHAR data[MAX_DESCRIPTOR_LENGTH];
- } DescriptorType;
- typedef struct
- {
- UCHAR typeOfStream;
- USHORT pid;
- UCHAR numDescriptors;
- DescriptorType descriptor[PSI_MAX_DESCRIPTORS];
- } SIStreamType;
- typedef struct
- {
- UCHAR tableId;
- USHORT sectionLength;
- USHORT programNumber;
- UCHAR versionNo;
- USHORT pcrPid;
- UCHAR numDescriptors;
- UCHAR numStreams;
- DescriptorType descriptor[PSI_MAX_DESCRIPTORS];
- SIStreamType stream[PSI_MAX_SI_STREAMS];
- } PMTType;
- typedef struct
- {
- USHORT streamId;
- USHORT networkId;
- UCHAR numDescriptors;
- DescriptorType descriptor[PSI_MAX_NIT_STREAM_DESCRIPTORS];
- } NITStreamType;
- typedef struct
- {
- UCHAR tableId;
- USHORT sectionLength;
- UCHAR sectionNo;
- UCHAR lastSectionNo;
- USHORT networkId;
- UCHAR versionNo;
- UCHAR numDescriptors;
- UCHAR numStreams;
- DescriptorType descriptor[PSI_MAX_DESCRIPTORS];
- NITStreamType stream[PSI_MAX_TRANSPORT_STREAMS];
- } NITType;
- /* Service description structures */
- typedef struct
- {
- USHORT serviceId;
- UCHAR eitSchedule;
- UCHAR eitPresent;
- UCHAR runningStatus;
- UCHAR freeCAMode;
- UCHAR numDescriptors;
- DescriptorType descriptor[PSI_MAX_DESCRIPTORS];
- } ServiceType;
- typedef struct
- {
- UCHAR tableId;
- USHORT sectionLength;
- USHORT streamId;
- UCHAR versionNo;
- UCHAR sectionNo;
- UCHAR lastSectionNo;
- USHORT origNetId;
- USHORT numServices;
- ServiceType service[PSI_MAX_SERVICES];
- } SDTType;
- /* Event information structures */
- typedef enum
- {
- UNDEFINED,
- NOT_RUNNING,
- START_IN_FEW_SECS,
- PAUSING,
- RUNNING
- } RunStatusType;
- typedef enum
- {
- UNSCRAMBLED,
- SCRAMBLED
- } CAModeType;
- typedef struct
- {
- USHORT eventId;
- UINT startTimeHi;
- UCHAR startTimeLo;
- UINT duration;
- RunStatusType runningStatus;
- CAModeType caMode;
- UCHAR numDescriptors;
- DescriptorType descriptor[PSI_MAX_DESCRIPTORS];
- } EventType;
- typedef struct
- {
- UCHAR tableId;
- USHORT sectionLength;
- USHORT serviceId;
- UCHAR versionNo;
- USHORT streamId;
- USHORT numEvents;
- EventType event[PSI_MAX_EVENTS];
- } EITType;
- extern void GetDateTimeFromMJD(__int64 mjd,char*tmstr);
- extern int ParsePat(CTSParse*ts,PATType*pat);
- extern int ParsePmt(CTSParse*ts,PMTType*pmt,USHORT pmtpid);
- extern int ParseNit(CTSParse*ts,NITType*nit,bool actual);
- extern int ParseSdt(CTSParse*ts,SDTType*sdt,bool actual);
- extern int ParseEit(CTSParse*ts,EITType*eit,UCHAR tableid,USHORT serviceid);
- #endif