sipsi.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:11k
- #if !defined(SIPSI_H)
- #define SIPSI_H
- #include <time.h>
- #include "osp.h"
- enum
- {
- KB_SI_MSG_PAT_DONE,
- KB_SI_MSG_PAT_TIMEOUT,
- KB_SI_MSG_PAT_CHANGE,
- KB_SI_MSG_NIT_DONE,
- KB_SI_MSG_NIT_TIMEOUT,
- KB_SI_MSG_NIT_CHANGE,
- KB_SI_MSG_PMT_DONE,
- KB_SI_MSG_PMT_TIMEOUT,
- KB_SI_MSG_PMT_CHANGE,
- KB_SI_MSG_SDT_DONE,
- KB_SI_MSG_SDT_TIMEOUT,
- KB_SI_MSG_SDT_CHANGE,
- KB_SI_MSG_EIT_PF_DONE,
- KB_SI_MSG_EIT_PF_TIMEOUT,
- KB_SI_MSG_EIT_PF_CHANGE,
- KB_SI_MSG_EIT_SCHEDULE_DONE,
- KB_SI_MSG_EIT_SCHEDULE_EVENT_DONE,
- KB_SI_MSG_EIT_SCHEDULE_SUNDAY_DONE,
- KB_SI_MSG_EIT_SCHEDULE_MONDAY_DONE,
- KB_SI_MSG_EIT_SCHEDULE_TUESDAY_DONE,
- KB_SI_MSG_EIT_SCHEDULE_WEDNESDAY_DONE,
- KB_SI_MSG_EIT_SCHEDULE_THURSDAY_DONE,
- KB_SI_MSG_EIT_SCHEDULE_FRIDAY_DONE,
- KB_SI_MSG_EIT_SCHEDULE_SATURDAY_DONE,
- KB_SI_MSG_EIT_SCHEDULE_TIMEOUT,
- KB_SI_MSG_TDT_DONE,
- KB_SI_MSG_TDT_TIMEOUT,
- KB_SI_MSG_CAT_DONE,
- KB_SI_MSG_CAT_TIMEOUT,
- KB_SI_MSG_CAT_CHANGE,
- KB_SI_MSG_RST_DONE,
- KB_SI_MSG_BAT_DONE,
- KB_SI_MSG_BAT_TIMEOUT,
- KB_SI_MSG_BAT_CHANGE,
- KB_SI_MSG_TOT_DONE,
- KB_SI_MSG_TOT_TIMEOUT,
- KB_SI_MSG_SYS_START_STOCK,
- KB_SI_MSG_SYS_START_BROWSER,
- KB_SI_MSG_SYS_START_LOGO_UPDATE
- }KB_SIMsgTable;
- #define KB_SI_MAX_EIT_SERVICE_NUM 15
- #define KB_SI_MAX_NVOD_EVENT_NUM 100
- #define KB_SI_MAX_TIMESHIFTED_NUM 42
- #define KB_SI_MAX_PAT_PROGRAM_NUM 253
- #define KB_SI_MAX_PMT_STREAM_NUM 9
- #define KB_SI_MAX_NIT_CHANNEL_NUM 100
- #define KB_SI_MAX_CHANNEL_SERVIC_NUM 10
- #define KB_SI_MAX_NETWORK_NAME_LEN 50
- #define KB_SI_MAX_SERVICE_PROVIDER_NAME_LEN 50
- #define KB_SI_MAX_SERVICE_NAME_LEN 50
- #define KB_SI_MAX_BOUQUET_NAME_LEN 50
- #define KB_SI_MAX_BAT_SERVICE_NUM_PER_TS 20
- #define KB_SI_MAX_EVENT_NUM_PER_DAY 100
- #define KB_SI_MAX_EVENT_NAME_LEN 20
- #define KB_SI_MAX_EVENT_TEXT_LEN 200
- #define KB_SI_MAX_CA_BUFFER_LEN 100
- #define KB_SI_RECEIVE_ONCE 0x0001
- #define KB_SI_RECEIVE_CHANGE 0x0002
- #define KB_SI_RECEIVE_DTV 0x0010
- #define KB_SI_ERR_UNDEFINED_TYPE -101
- #define KB_SI_ERR_INVALID_VERSION_NUMBER -102
- #define KB_SI_ERR_NULL_POINTER -103
- #define KB_SI_ERR_NOT_INITIALIZED -104
- #define KB_SI_ERR_SEND_MESSAGE -105
- #define KB_SI_ERR_INVALID_PROGRAM_NUMBER -110
- #define KB_SI_ERR_INVALID_SERVICE_ID -111
- #define KB_SI_ERR_INVALID_NIT_PID -112
- #define KB_SI_ERR_INVALID_PMT_PID -113
- #define KB_SI_ERR_TOO_MANY_PROGRAMS -114
- #define KB_SI_ERR_INVALID_BOUQUET_ID -115
- #define KB_SI_ERR_INVALID_SERVICE_NUM -121
- #define KB_SI_ERR_INVALID_EVENT_STATUS_NUM -122
- #define KB_SI_ERR_INVALID_DSI_PID -131
- #define KB_SI_ERR_INVALID_DII_PID -132
- #define KB_SI_ERR_INVALID_DII_TRANSACTION_ID -133
- #define KB_SI_ERR_INVALID_DDB_PID -134
- #define KB_SI_ERR_INVALID_DDB_MODULE_ID -135
- #define KB_SI_ERR_INVALID_DDB_BLOCK_SIZE -136
- #define KB_SI_MAX_TEXT_CHAR_LEN 250
- #define KB_SI_MAX_EXTENDED_EVENT_NUMBERS 1
- #define KB_SI_EIT_SCHEDULE_SERVICE_COUNT 10
- #define KB_SI_EIT_SCHEDULE_SOFT_FILTER_COUNT KB_SI_EIT_SCHEDULE_SERVICE_COUNT * 2
- #define KB_SI_EITSCH_TIMESHIFT 30
- #define KB_SI_EIT_SCHEDULE_TIME_SHIFT_SOFT_FILTER_COUNT KB_SI_EITSCH_TIMESHIFT
- #define KB_SI_STOP_ALL -1
- #define KB_SI_MAX_EVENT_NUM_PER_SERVICE 200//500
- #define KB_SI_MAX_SHIFT_EVENT_NUM_PER_SERVICE 400
- #define KB_SI_EIT_PF_MAX_NVOD_EVENT_NUMBER 6
- typedef enum
- {
- KB_SI_EIT_CURRENT_TS,
- KB_SI_EIT_CURRENT_TS_FOR_0x51_table, //增加一个枚举,便于EIT时间表存在0x51的处理
- KB_SI_EIT_OTHER_TS,
- KB_SI_EIT_OTHER_TS_FOR_0x61_table //增加一个枚举,便于EIT时间表存在0x61的处理
- }KB_SIEitTs;
- typedef struct _KB_SIPatStruct
- {
- UINT16 transport_stream_id;
- UINT8 version_number;
- UINT16 num;
- struct
- {
- UINT16 program_number;
- UINT16 program_map_PID;
- }program[KB_SI_MAX_PAT_PROGRAM_NUM];
- UINT32 CRC_32;
- }KB_SIPatStruct;
- typedef struct _KB_SINitStruct
- {
- UINT16 network_id;
- UINT8 version_number;
- UINT8 network_name[KB_SI_MAX_NETWORK_NAME_LEN + 1];
- UINT8 loader_flag;
- struct
- {
- UINT16 transport_stream_id;
- UINT16 original_network_id;
- UINT16 service_id;
- UINT8 stbVersion;
- }loader;
- UINT16 num;
- struct
- {
- UINT16 transport_stream_id;
- UINT16 original_network_id;
- UINT32 frequency;
- UINT8 FEC_outer;
- UINT8 modulation;
- UINT32 symbol_rate;
- UINT8 FEC_inner;
- UINT8 service_num;
- struct
- {
- UINT16 service_id;
- UINT8 service_type;
- }service_list[KB_SI_MAX_CHANNEL_SERVIC_NUM];
- }network[KB_SI_MAX_NIT_CHANNEL_NUM];
- UINT32 CRC_32;
- }KB_SINitStruct;
- typedef struct _KB_SIPmtStruct
- {
- UINT16 program_number;
- UINT8 version_number;
- UINT16 PCR_PID;
- UINT16 CA_descriptor_buffer_len;
- UINT8 CA_descriptor[KB_SI_MAX_CA_BUFFER_LEN];
- UINT16 num;
- UINT8* pcSectionData;
- struct
- {
- UINT8 stream_type;
- UINT16 elementary_PID;
- UINT8 component_tag;
- UINT16 CA_descriptor_buffer_len;
- UINT8 CA_descriptor[KB_SI_MAX_CA_BUFFER_LEN];
- }stream[KB_SI_MAX_PMT_STREAM_NUM];
- }KB_SIPmtStruct;
- typedef struct _KB_SIService
- {
- UINT8 service_provider_name[KB_SI_MAX_SERVICE_PROVIDER_NAME_LEN + 1];
- UINT8 service_name[KB_SI_MAX_SERVICE_NAME_LEN + 1];
- }KB_SIService;
- typedef struct _KB_SINVODRefDes
- {
- UINT16 TS_ID;
- UINT16 OrgnetID;
- UINT16 ServiceID;
- }KB_SINVODRefDes;
- typedef struct _KB_SISdtStruct
- {
- UINT16 OrgNetID;
- UINT16 TSID;
- UINT16 service_id;
- UINT8 version_number;
- UINT8 EIT_schedule_flag;
- UINT8 EIT_present_following_flag;
- UINT8 running_status;
- UINT8 free_CA_mode;
- UINT8 service_type;
- UINT8 component_tag;
- KB_SIService chinese;
- KB_SIService english;
- UINT16 reference_service_id;
- UINT8 TimeShiftedNum;
- KB_SINVODRefDes TimeShift[KB_SI_MAX_TIMESHIFTED_NUM];
- }KB_SISdtStruct;
- typedef struct _KB_SIBatStruct
- {
- UINT16 bouquet_id;
- UINT8 version_number;
- UINT8 bouquet_name[KB_SI_MAX_BOUQUET_NAME_LEN + 1];
- UINT8 english_bouquet_name[KB_SI_MAX_BOUQUET_NAME_LEN + 1];
- UINT16 num;
- struct
- {
- UINT16 transport_stream_id;
- UINT16 original_network_id;
- UINT16 num;
- struct
- {
- UINT16 service_id;
- UINT8 service_type;
- }service[KB_SI_MAX_BAT_SERVICE_NUM_PER_TS];
- }transport_stream[KB_SI_MAX_NIT_CHANNEL_NUM];
- }KB_SIBatStruct;
- typedef struct _KB_SIPFShortEvent
- {
- UINT8 event_name[KB_SI_MAX_EVENT_NAME_LEN + 1];
- UINT8 text[KB_SI_MAX_EVENT_TEXT_LEN + 1];
- }KB_SIPFShortEvent;
- typedef struct _KB_SISchShortEvent
- {
- UINT8 event_name[KB_SI_MAX_EVENT_NAME_LEN + 1];
- UINT8 *text;
- }KB_SISchShortEvent;
- typedef struct _KB_SINVODEitPF
- {
- UINT16 service_id;
- UINT8 version_number;
- UINT16 event_id;
- time_t start_time;
- UINT32 duration;
- UINT8 running_status;
- UINT8 free_CA_mode;
- KB_SIPFShortEvent chinese;
- }KB_SINVODEitPF;
- typedef struct _KB_SIEitExtendEvent
- {
- UINT8 text_char[KB_SI_MAX_TEXT_CHAR_LEN + 1];
- }KB_SIEitExtendEvent;
- typedef struct _KB_SIEitPF
- {
- UINT16 service_id;
- UINT8 version_number;
- UINT16 event_id;
- time_t start_time;
- UINT32 duration;
- UINT8 running_status;
- UINT8 free_CA_mode;
- KB_SIPFShortEvent chinese;
- KB_SIEitExtendEvent extended_event;
- #ifndef UNUSED_SHORT_EVENT
- KB_SIPFShortEvent english;
- #endif
- UINT8 NVODEventNum;
- KB_SINVODEitPF * NVODEvent;
- UINT16 timer;
- }KB_SIEitPF;
- typedef struct _KB_SIEitSchEvent
- {
- UINT16 event_id; // 2
- time_t start_time; // 8
- UINT32 duration; // 12
- UINT8 running_status; // 13
- UINT8 free_CA_mode; // 14
- KB_SISchShortEvent chinese; // 40
- //KB_SISchShortEvent english;
- //added by whale 07/03/01
- UINT8 content_level1;//节目内容标识符的第一级 41
- UINT16 reference_service_id; //48
- UINT16 reference_event_id; //52
- }KB_SIEitSchEvent;
- typedef struct _KB_SIEitSch
- {
- UINT16 service_id;
- UINT16 num;
- KB_SIEitSchEvent *ptEvent;
- }KB_SIEitSch;
- typedef struct _KB_SIMultiEitScheduleEvent
- {
- UINT16 event_id;
- time_t start_time;
- UINT32 duration;
- UINT16 reference_service_id;
- UINT16 reference_event_id;
- }KB_SIMultiEitScheduleEvent;
- typedef struct _KB_SIMultiEitSchedule
- {
- UINT16 service_id;
- struct
- {
- UINT16 num;
- UINT8 isnvod;
- KB_SIMultiEitScheduleEvent event[KB_SI_MAX_EVENT_NUM_PER_DAY - 20];
- }day[4];
- }KB_SIMultiEitSchedule;
- typedef struct _KB_SIProgram
- {
- UINT16 transport_stream_id;
- UINT16 original_network_id;
- KB_SIPmtStruct pmt;
- KB_SISdtStruct sdt;
- KB_SIEitPF eitPresent;
- KB_SIEitPF eitFollow;
- }KB_SIProgram;
- typedef struct _KB_SIEitSchTimeShiftNode
- {
- UINT16 event_id;
- time_t start_time;
- UINT16 reference_service_id;
- UINT16 reference_event_id;
- }KB_SIEitSchTimeShiftNode;
- typedef struct _KB_SIEitSchTimeShift
- {
- UINT16 service_id;
- UINT16 num;
- KB_SIEitSchTimeShiftNode *ptTimeShift;
- }KB_SIEitSchTimeShift;
- typedef struct _KB_SICatStruct
- {
- UINT8 version_number;
- UINT16 CA_descriptor_buffer_len;
- UINT8 CA_descriptor[KB_SI_MAX_CA_BUFFER_LEN];
- }KB_SICatStruct;
- typedef struct _KB_SIRstStruct
- {
- UINT16 transport_stream_id;
- UINT16 original_network_id;
- UINT16 service_id;
- UINT16 event_id;
- UINT8 running_status;
- }KB_SIRstStruct;
- //modified by whale 07/07/16
- //#define KB_SI_MAX_REF_SVC_NUMS 20
- #define KB_SI_MAX_REF_SVC_NUMS 30
- #define KB_SI_MAX_SHIFT_SVC_NUMS 42
- typedef struct _KB_SIRefSvcCell
- {
- UINT16 refScvId;
- UINT16 freq, symb, qam;
- UINT16 shiftSvcNum;
- UINT16 TsID;
- UINT8 refScvName[20];
- struct
- {
- UINT16 tsId;
- UINT16 netId;
- UINT16 svcId;
- }shiftSvc[KB_SI_MAX_SHIFT_SVC_NUMS];
- }KB_SIRefSvcCell;
- #define KB_SI_MAX_TOT_SECTION 10
- typedef struct _KB_SITot
- {
- UINT8 country_code[3];
- UINT8 country_region_id;
- UINT8 polarity;
- UINT16 local_time_offset;
- } KB_SITot;
- typedef void (*KB_SICallbackFunc)(KB_OSPMsgNode *pInMsg);
- KB_SICallbackFunc KB_SICallback(KB_SICallbackFunc callback);
- KB_SICallbackFunc KB_SIRegisterEitCallBack(KB_SICallbackFunc callback);
- INT32 KB_SIInit(void);
- INT32 KB_SIDestroy(void);
- INT32 KB_SIStopAllSection(void);
- INT32 KB_SIGetPat(const KB_SIPatStruct* i_pstPat, INT32 nType, INT32 i_nVersionNumber);
- INT32 KB_SIStopPat(void);
- INT32 KB_SIGetNit(UINT32 i_nNitPid, const KB_SINitStruct* i_pstNit, INT32 nType, INT32 i_nVersionNumber);
- INT32 KB_SIStopNit(void);
- INT32 KB_SIGetPmt(INT32 i_nProgramMapPid, INT32 nSvcID, const KB_SIPmtStruct* i_pstPmt, INT32 nType, INT32 i_nVersionNumber);
- INT32 KB_SIStopPmt(INT32 nSvcID);
- INT32 KB_SIGetSdt(INT32 nSvcID, INT32 i_nMaxServiceNum, const KB_SISdtStruct* i_pstSdt, INT32 nType, INT32 i_nVersionNumber);
- INT32 KB_SIStopSdt(void);
- INT32 KB_SIGetBat(INT32 nbatID, const KB_SIBatStruct* i_pstBat, INT32 nType, INT32 i_nVersionNumber);
- INT32 KB_SIStopBat(void);
- INT32 KB_SIGetEitPF(INT32 nSvcID, KB_SIEitTs eTs, const KB_SIEitPF* i_pstEitPresent, const KB_SIEitPF* i_pstEitFollow, INT32 nType, INT32 i_nVersionNumber);
- INT32 KB_SIStopEitPF(INT32 nSvcID, KB_SIEitTs eTs);
- INT32 KB_SIGetEitSCH(INT32 nSvcID, const KB_SIEitSch* i_pstEinSchInfo);
- INT32 KB_SIStopEitSCH(INT32 nSvcID);
- INT32 KB_SIGetTime(time_t* pTimeNode);
- INT32 KB_SIStopTDT(void);
- INT32 KB_SIGetCat(const KB_SICatStruct* pCatNode, INT32 nType, INT32 i_nVersionNumber);
- INT32 KB_SIStopCat(void);
- INT32 KB_SIGetRst(INT32 nMaxEvent, const KB_SIRstStruct* i_pstRst);
- INT32 KB_SIStopRst(void);
- INT32 KB_SIGetTOT(KB_SITot* pTot);
- INT32 KB_SIStopTOT(void);
- INT32 KB_SIGetEITSCHShift(INT32 nSvcID,KB_SIEitTs eTs,KB_SIEitSchTimeShift *ptSchShift);
- INT32 KB_SIStopEitSCHShift(INT32 nSvcID, KB_SIEitTs eTs);
- #endif