⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 epg.h

📁 用于解析ts流中的各种业务信息表可以用于dvb中嘛流分析
💻 H
字号:
// epg.h: interface for the PSI and SI information.
//
//Title:			PSI and SI Information

//Author:			zhusenguang
//Description:		this file defines some objects about program including:
//					Network, TS, Service, Event, Component(Elementary Stream),
//					Delivery System, Cable System, Satellite System, Terrestrial
//					system CA etc.
//////////////////////////////////////////////////////////////////////
#ifndef _STB_H_
#define _STB_H_

//#include "stddefs.h"

#include "stbtype.h"
#include "../common/list.h"
#include "linkpti.h"//为了pid_t和slot_t
#include "../src/fhtca/fhtca.h"
#include "stbdebug.h"

#define CABLE_TYPE			0
#define SATELLITE_TYPE      1
#define TERRESTRIAL_TYPE    2
#define INVALID_DELIVERY_TYPE 3

//#define MAX_SERVICE_NAME_LEN		20
//#define MAX_PROVIDER_NAME_LEN		20
#define MAX_SERVICE_NAME_LEN		20
#define MAX_PROVIDER_NAME_LEN		100//modify by zqj on 2001/4/10
/*#define MAX_NET_WORK_NAME_LEN		20
#define MAX_CAPROVIDER_NAME			20
#define MAX_EVENT_NAME_LEN			20
#define	MAX_ES_DESCRIPTION_LEN			50*///modify by zqj on 2001/4/10
#define MAX_NET_WORK_NAME_LEN		20
#define MAX_CAPROVIDER_NAME			20
#define MAX_EVENT_NAME_LEN			82
#define	MAX_ES_DESCRIPTION_LEN			20
//modify by zqj on 2001/4/10
//#define MAX_EVENT_DESCRIPTION_LEN	100
#define MAX_EVENT_DESCRIPTION_LEN	256 //modify by zqj on 2001/4/4
#define MAX_TIME_LEN				3

#define MAX_BOUQUET_NAME_LEN    20
#define MAX_DATA_BROADCAST_TEXT_LEN     20
//////////////////////////////////////////////////////////////////////
// Delivery  Struct
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// Cable  Struct
//////////////////////////////////////////////////////////////////////

struct DvbService ;


//add for EPG receive by lilihui 2002\11\13
typedef struct DvbEPGSectionSegment
{
	S8                                      scSegmentNo;
	S16			                     ssSegmentLastSectionNo;
	S8                                       SectionReceived[8];
} DvbEPGSectionSegment_t;
typedef struct DvbEPGSubTable
{
	U8                                      ucSubTableId;
	S16			                     ssLastSectionNo;
	list_t				EPGSectionSegmentList;
} DvbEPGSubTable_t;
typedef struct DvbEPGIndex
{
	S16                                      scTimeOut;
	S32                                    siReceivingStartTime;
	S16			                     ssLastTableId;
	list_t				EPGSubTableList;
} DvbEPGIndex_t;
//add for EPG receive by lilihui 2002\11\13


//add for BAT by lilihui 2002\12\9

typedef struct DvbBouquet
{
	U8		szBouquetName[MAX_BOUQUET_NAME_LEN];  
	U8          ucBATVersionNo;
	U16        uiBouquetID; 
	list_t                  BouquetServiceIndexList;
			
} DvbBouquet_t;


typedef struct DvbBouquetService
{
		
	U16			uiOriginalNetworkID;//original network ID
	
	U16			uiTsID;				//TS ID
	
	U16		       uiServiceID; 
	
	U16		       uiServiceType; 
	S16                uiChnlIndexNo;
    /* 2004-03-30 li xuelei 添加音量调节数据域 */
	S8                  scChnlVolumeCompensating;
}DvbBouquetService_t ;

//add for BAT by lilihui 2002\12\9
//add for BAT by lilihui 2002\12\10

typedef struct DvbDataBroadcast
{

	U16		usDataBroadcastID; 
	U8		ucComponentTag;
	void        *pPData;
       U8          Text[MAX_DATA_BROADCAST_TEXT_LEN];
	
} DvbDataBroadcast_t ;

typedef struct DvbDataCarousel
{

	U8		ucCarouselTypeID; 
	U32		uiTransactionID;
	U32        uiDSITimeOut;
       U32        uiDIITimeOut;
	U32        uiLeakRate;
	
} DvbDataCarousel_t ;


//add for BAT by lilihui 2002\12\10


typedef struct DvbCable
{
	unsigned int			uiFrequency;
	unsigned short			uiFECOuter;
	unsigned short			uiFECInner;
	unsigned short			uiModulation;
	unsigned int			uiSymbolRate;
} DvbCable_t;

//////////////////////////////////////////////////////////////////////
// Satellite  Struct
//////////////////////////////////////////////////////////////////////
typedef struct DvbSatellite
{
	unsigned int			uiFrequency;
	unsigned short			uiOrbitalPosition;
	BOOL					bWestEastFlag; //"0" : western position; "1": eastern position
	unsigned short			uiPolarization;//specifying the polarisation of the transmitted signal.
	unsigned short			uiModulation;
	unsigned int			uiSymbolRate;
	unsigned short			uiFECInner;
} DvbSatellite_t;

//////////////////////////////////////////////////////////////////////
// Terrestrial  Struct
//////////////////////////////////////////////////////////////////////
typedef struct DvbTerrestrial
{
	unsigned int			uiCentreFrequency;
	unsigned short			uiBandWidth; //the value is "8" or "7"
	unsigned short			uiConstellation;//specifies the constellation pattern used on a terrestrial delivery system
	unsigned short			uiHierarchyInfo;//specifies whether the transmission is 
	unsigned short			uiCodeRateHPStream;
	unsigned short			uiCodeRateLPStream;
	unsigned short			uiGuardInterval;
	unsigned short			uiTransmissionMode;                  
	BOOL					bOtherFrequencyFlag;
} DvbTerrestrial_t;


typedef struct DvbDelivery
{
	unsigned short			uiDeliveryType;			//delivery type
	union {
		DvbCable_t			stCable;
		DvbSatellite_t		stSate;
		DvbTerrestrial_t	stTerr;
	} Content;
} DvbDelivery_t;


//////////////////////////////////////////////////////////////////////
// Rating  Struct
//////////////////////////////////////////////////////////////////////
typedef struct DvbRating
{
	char					szCountryName[3];	
	unsigned short			rating;
} DvbRating_t;

//////////////////////////////////////////////////////////////////////
// CCa  Struct
//////////////////////////////////////////////////////////////////////

typedef struct DvbCa 
{
	unsigned short			uiPID;				//ECM PID
	unsigned short			uiCaSID;			//CAS_ID
	char					szCaProviderName[MAX_CAPROVIDER_NAME];	//the ca's name
} DvbCa_t;
/*hanjian:2001/3/17:start*/
typedef struct DvbCaAlloc
{
	pid_t					pidEs;
	pid_t					pidEcm;
	slot_t					slot;
} DvbCaAlloc_t;
/*hanjian:2001/3/17:end*/
//////////////////////////////////////////////////////////////////////
// Network Class
//////////////////////////////////////////////////////////////////////
typedef struct DvbNetwork
{
	unsigned short		uiNetworkID;	//network id
	char				szNetworkName[MAX_NET_WORK_NAME_LEN];
	unsigned char		uchVersion;
	
	list_t				TsList;
	
	unsigned short		nStatus;
} DvbNetwork_t;

//////////////////////////////////////////////////////////////////////
// Ts  Struct
//////////////////////////////////////////////////////////////////////
typedef struct DvbTs
{
	unsigned short			uiTsID;				//TS ID
	unsigned short			uiOriginalNetworkID;//original network ID
	unsigned short			uiNetworkID;		//network ID

	DvbDelivery_t			      Delivery;

	list_t					EmmList;
	list_t					ServiceList;

	U8                                   ucSDTVersionNo;
	U8                                   ucPATVersionNo;

	U16                                 usEMMPID;

	unsigned short			nStatus;
	bool                                    bSDTReceived;
	bool                                    bPATReceived;
	DvbNetwork_t*			pDvbNetwork;		//add by zqj on 2001/1/11
} DvbTs_t;

//////////////////////////////////////////////////////////////////////
// Component  Struct
//////////////////////////////////////////////////////////////////////
typedef struct DvbComponent
{
	unsigned short			uiStreamType;		//  used in pmt  "added by junm"
	unsigned short          uiStreamContent;	//Stream content got from component descriptor
	unsigned short			uiEsPID;			// ES PID
	unsigned short          uiEsTag;			//used in stream_identifier_descriptor  "added by junm"

	char					szLanguageCode[3];	//the 3-charactors language code
	char					szDescription[MAX_ES_DESCRIPTION_LEN];	//ES descriptor
	BOOL					bScrambled; // 1: scrambled 
	//modified by junn:2001-03-17
	//list_t					EcmList;
	DvbCa_t					EcmInfo;
	//ended by junm:2001-03-17
	unsigned short			nStatus;
} DvbComponent_t;



//////////////////////////////////////////////////////////////////////
// DvbEvent  struct
//////////////////////////////////////////////////////////////////////
typedef struct DvbEvent
{
/*	unsigned short			uiEventSID;

	unsigned short			uiServiceSID;*/
	unsigned short          uiEventID;
/*	UINT					StartDate;
	char					szStartTime[MAX_TIME_LEN];		//3 bytes
	UINT					EndDate;
	char					szEndTime[MAX_TIME_LEN];		//3 bytes
*/
	DWORD					dwStartTime;  //added by junm
	DWORD					dwEndTime;	//added by junm
	char					szEventName[MAX_EVENT_NAME_LEN];				//event name
	char					*szEventDescription;	//event descriptor
#ifdef DZ_VOD
	char					*szExtendedEventDescription;//add by zqj on 2002/3/6
#endif
	S16                               ssDescriptionLength;
	unsigned char			uiRunningStatus;
	unsigned short			uiEventType;		//event type

	TFCAIPPVInfo_t              *pEventIPPV;

	list_t					RatingList;
	
	list_t					ComponentList;

	BOOL					bPreOrder;			//TRUE: PreOrder
	BOOL					bFreeCA;			//TRUE: scrambled

	BOOL                                  bInteractive;
// add by lilihui
      BOOL                                bPreRecord;
	unsigned short			nStatus;
	S16             				  ssChnlEPGNo;
	struct DvbService			*pDvbService;		//add by zqj on 2001/1/11
}DvbEvent_t;





//////////////////////////////////////////////////////////////////////
// Service  struct
//////////////////////////////////////////////////////////////////////
typedef struct DvbService
{
	unsigned short		uiApplicationID;  //identifier of application
	unsigned short		uiServiceType; 
	unsigned short		uiServiceID; 
	bool				bMultilingual;	//added by pxg on 2002/3/6
	char				szServiceName[MAX_SERVICE_NAME_LEN];
	char				szProviderName[MAX_PROVIDER_NAME_LEN];
	
//	list_t				LinkServiceList;
	
	char				sDuration[MAX_TIME_LEN];
	BOOL				bEitS;					//eit_schedule_flag used in SDT 
	BOOL				bEitPF;					//eit_prsent_following_flag used in SDT
	unsigned char		ucRunStatus;			//running_status used in SDT
	unsigned short		uiPcrPid;
	unsigned short		PmtPID;
	BOOL				bScrambled;				// 1: scrambled; if true it means all component 

	U8                             ucPMTVersionNo;
	U8                             ucEITSDVersionNo;
	U8                             ucEITPFVersionNo;
	
	
	//modified by junm:2001-03-17
	//list_t			EcmList;			//belonging to this service being scrambled by the following CA provider
	DvbCa_t				EcmInfo;			//the pid of Ecm this service being scrambled by the following CA provider
	//ended by junm:2001-03-17

	DvbEvent_t                 *pPresentEvent;
	DvbEvent_t                 *pFollowingEvent;

	DvbEPGIndex_t             *pEPGIndex;
	S32                      siLastEventSDReceivedTime;
	bool                      EventReceiveComplete;
	bool                      bEventIntegrity;
	list_t				EventList;				//all events belonging to this service

	list_t				ComponentList;			//all component belonging to this service 

	list_t				DataBroadcastList;
	BOOL				bFavorite;				//TRUE: favorite channel
	BOOL				bFreeCA;				//TRUE: Scrambled
	BOOL                           bPMTReceived;                  //add by lilihui 03-08-06
	unsigned short		uiCtrlChannelPid;		//control channel

	unsigned short		nStatus;				//the status of the table item, both for running and building
	DvbTs_t				*pDvbTs;				//add by zqj on 2001/1/11
}DvbService_t ;


//////////////////////////////////////////////////////////////////////
// DvbStb
//////////////////////////////////////////////////////////////////////
/*	The structure for saving the generic preference information of the stb, user preference 
	information will be copied to the structure when needed*/
typedef struct StbPref
{
	unsigned int	uiTag;		//The tag for item
	char	strLangCode[3];		//Language code
	char	strCountryCode[3];	//country code
	int		nVol;				//volume level
	char	cVolLevel;			//Volume Level
	char	cVolBalance;		//Balance Level
	char	cStartup;			//box start up option
} StbPref_t;

#define DVB_STBPREF_VALID		0x0001
#define DVB_STBPREF_FORCESAVE	0x0002

//////////////////////////////////////////////////////////////////////
// UserInfo  Struct
//////////////////////////////////////////////////////////////////////
/*	The structure for describing the preference or disgust information of specific user to 
	service or event*/
typedef struct DvbSID 
{
	unsigned short	uiSID;			//the unique id of the item
	unsigned short	uiType;			//the type of the item
	unsigned short	uiTag;			//The tag for the item
} DvbSID_t;

#define		DVB_ITEM_FAVORATE		0x0001
#define		DVB_ITEM_FORCESAVE		0x0002


/*	The structure for specific user*/
typedef struct DvbUserInfo
{
	DWORD			dwUserCode;		//0: administrator
	DWORD			dwPassword;		//the user password
	unsigned short	uiRating;		//the rating for the item
} DvbUserInfo_t;

#define DVB_USERCODE_INVALID	0xFFFF
#define DVB_RATING_INVALID		0xFFFF

typedef unsigned short		DVB_USER_TAG;
/*The structure for combined user and preference information*/
typedef struct DvbUserPrefInfo
{
	DVB_USER_TAG	uiTag;			//The status of the user slot
	DvbUserInfo_t	UserInfo;		//The simple user info
	DvbSID_t		*pPrgPrefs;		//Pointer to the subs that the user has booked or cleared
	StbPref_t		*pStbPrefs;		//the user specific preference inforamtion
} DvbUserPrefInfo_t;

#define DVB_USER_VALID			0x0001
#define DVB_STB_VALID			0x0002
#define DVB_PREF_VALID			0x0004
#define DVB_ALL_VALID			0x0007

#define DVB_USER_INFO_FORCE		0x0100
#define DVB_USER_PREF_FORCE		0x0200
#define DVB_USER_STB_FORCE		0x0400
#define DVB_USER_ALL_FORCE		0x0700

#define DVB_USER_CURRENT		0x8000
//////////////////////////////////////////////////////////////////////
// DvbSI
//////////////////////////////////////////////////////////////////////
typedef struct DvbSI {
	list_t			NetworkList;	//the pointer to the list of network
	list_t              BouquetList;

	long			nIndexHead;		//the head index of the si information
	long			nIndexEnd;		//the end index of the si information
	U16				nStatus;		//the status of the si information
	U8                ucNITVersionNo;
	U8                ucNITOtherVersionNo;
	bool              bNITReceived;

} DvbSI_t;

//add by zqj on 2001/9/27
typedef struct ChannelInfo{
	CHAR 		cValidity;//added by pxg on 2002/4/30
	
	UI32		nNetID;
	UI32		nTsID;
	UI32		nServiceID;
	
	//add by zqj on 2001/12/21
	pid_t			pidVideo;
	pid_t			pidAudio;
	pid_t			pidPcr;
	pid_t			pidEcm;
	pid_t			pidEmm;
	unsigned short	uiCaSID;
	//add by zqj on 2001/12/21

	//added by pxg on 2002/2/8
	char		cVolLevel;	
	char		cVolBalance;
	//added by pxg on 2002/2/8
}DvbChannel_t;
//add by zqj on 2001/9/27

//add by zqj on 2001/12/28
typedef struct VodInfo{
	short int	nNetID;
	short int   nTsID;
	short int   nServiceID;
}VodInfo_t;
//add by zqj on 2001/12/28
#endif



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -