nvod.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:6k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef _NVOD_H_
  2. #define _NVOD_H_
  3. #include "gendef.h"
  4. #include "osp.h"
  5. #include "sipsi.h"
  6. #include "dmd.h"
  7. #include "db.h"
  8. #include "db.h"
  9. #define KB_NVOD_MAX_TS_NUM  5
  10. #define KB_NVOD_MAX_RefEvent_One_Ts 20
  11. #define KB_NVOD_MAX_ShiftSrv_One_Ts 40
  12. #define KB_NVOD_MAX_REF  30
  13. #define KB_NVOD_MAX_SVC  30
  14. #define KB_NVOD_MAX_REFERENCE_NUM 20
  15. #define KB_NVOD_MAX_NVOD_SERVICES   15
  16. #define KB_NVOD_SCHEDULE_DAY_NUM 4
  17. typedef enum
  18. {
  19.     KB_NVOD_ALLOCATE_FAIL = 0xFF,
  20.     KB_NVOD_ALLOCATE_REPEAT = 0xFE,
  21.     KB_NVOD_ALLOCATE_SUCCESS
  22. }KB_NVOD_gatNODE_ALLOCATE_RET;
  23. typedef struct _KB_NVODRefDes
  24. {
  25. UINT16 TS_ID;
  26. UINT16 OrgnetID;
  27. UINT16 ServiceID;
  28. }KB_NVODRefDes;
  29. typedef struct _KB_NVODServiceInfo
  30. {
  31. UINT16 reference_service_num;
  32. struct 
  33. {
  34. UINT16 reference_service_id;
  35. UINT8 TimeShiftedNum;
  36. UINT16 tsID;
  37. KB_NVODRefDes  TimeShift[KB_SI_MAX_TIMESHIFTED_NUM];
  38. }service[KB_NVOD_MAX_REFERENCE_NUM];
  39. }KB_NVODServiceInfo;
  40. typedef enum
  41. {
  42.     KB_NVOD_EMPTY,
  43.     KB_NVOD_RECEIVING,
  44.     KB_NVOD_RECEIVED,
  45.     KB_NVOD_RECEIVE_TIMEOUT
  46. }KB_NVODReceiveState;
  47. typedef struct _KB_NVODPfInfo
  48. {
  49.     UINT32 nTsId;
  50.     UINT32 nSvcID;
  51.     UINT32 nState;
  52.     UINT32 nEnable;
  53.     KB_SIEitPF *pPresent;
  54. }KB_NVODPfInfo;
  55. typedef struct _KB_NVODSch
  56. {
  57.     UINT32 nTsId;
  58.     UINT32 nSvcID;
  59.     UINT32 nState;
  60.     UINT32 nEnable;
  61.     KB_SIEitSchTimeShift nSchInfo;
  62. }KB_NVODSch;
  63. typedef struct _KB_NVODTime
  64. {
  65. unsigned short  tsID;
  66. unsigned short  EvtID;
  67. unsigned short  SerID;
  68. time_t startTime;
  69. }KB_NVODTime;
  70. typedef struct _KB_NVODDay
  71. {
  72.     INT32 nEventCount;
  73.     KB_SIEitSchTimeShiftNode *ptEvent;
  74. }KB_NVODDay;
  75. typedef struct  _KB_NVODStruct
  76. {
  77. unsigned short  refEvtID;
  78. unsigned short  refSerID;
  79. char  PrgName[30];
  80. char PrgTxt[400];
  81. UINT16  durTime;
  82. UINT16 TimeNum;
  83. KB_NVODTime  TimeNode[500];
  84. }KB_NVODStruct;
  85. //add by zhengyang 2007-06-05 for multi-ts data
  86. typedef struct  _KB_NVOD_Info
  87. {
  88. KB_DMDTunerParameters  TsPara;         //注意它的fre是gPrgAllInfo.gChnnlInfo.ChannelList[i].Freq的100倍
  89. BOOL                   CurrentTsFlag;  //当前流标志, 初始为FALSE
  90.     BOOL                   SearchStartFlag; //搜索起始标识,初始为FALSE,搜索开始后置位TRUE
  91. BOOL                   SearchCompleteFlag; //搜索完成标识,初始为FALSE,搜索完成后置位TRUE
  92.     UINT8                  RefSrvNum;           //当前流的总参考业务数目
  93.     UINT8                  RefEventNum;         //当前流的总参考事件数目
  94. KB_NVODStruct          RefEventData[KB_NVOD_MAX_RefEvent_One_Ts];
  95. }KB_NVOD_Info;
  96. typedef struct  _KB_NVODReceive
  97. {
  98. UINT16 refScvId;
  99. UINT16 shiftSvcNum; 
  100. UINT16 recvSvcNum;
  101. }KB_NVODReceive;
  102. typedef struct _KB_NVODVariables
  103. {
  104. int State;
  105. int PgmSerialNo;
  106. int TimeSerialNo;
  107. int PgmPageNo;
  108. int DatePageNo;
  109. int OldPos;
  110. }KB_NVODVariables;
  111. typedef struct _KB_NVODTsInfo
  112. {
  113. UINT16 netID;
  114. UINT16 tsID;
  115. UINT16 freq, symb, qamStyle;
  116. }KB_NVODTsInfo;
  117. typedef struct _KB_NVODSchedulePara
  118. {
  119. UINT8  TSNum;
  120. struct 
  121. {
  122. UINT16 TSID;
  123. UINT16 ServiceNum;
  124. UINT16 ServiceID[KB_SI_MAX_TIMESHIFTED_NUM * KB_NVOD_MAX_REFERENCE_NUM];
  125. }info[KB_NVOD_MAX_NVOD_SERVICES];
  126. }KB_NVODSchedulePara; 
  127. typedef enum
  128. {
  129.     KB_NVOD_PF_OVER,
  130.     KB_NVOD_PF_TIMEOUT,
  131.     KB_NVOD_PF_CHANGE,
  132.     KB_NVOD_SCH_OVER,     
  133.     KB_NVOD_SCH_TIMEOUT,
  134.     KB_NVOD_OVER,
  135.     KB_NVOD_STATE_MAX
  136. }KB_NVODState;
  137. //EIT时间表当前流表ID范围是0x50---0x5f
  138. typedef enum
  139. {
  140.     KB_EIT_SCHEDULE_CURRENT_TS_TABLE_DEFAULT = 0x50,
  141.     KB_EIT_SCHEDULE_CURRENT_TS_TABLE_0X51
  142. }KB_NvodEitCurTsSchTable;
  143.     
  144. //EIT时间表其他流表ID范围是0x60---0x6f
  145. typedef enum
  146. {
  147.     KB_EIT_SCHEDULE_OTHER_TS_TABLE_DEFAULT = 0x60,
  148.     KB_EIT_SCHEDULE_OTHER_TS_TABLE_0X61
  149. }KB_NvodEitOtherTsSchTable;
  150. INT32 KB_NVODInit(void);
  151. INT32 KB_NVODCreate(void);
  152. INT32 KB_NVODDestroy(void);
  153. int KB_NVODInit2(void);
  154. void KB_NVODAddTS(UINT16 netId,UINT16 tsId,UINT16 freq, UINT16 symb,UINT16 qam);
  155. int KB_NVODAddTime(UINT16 SerID,UINT16 refSerID,UINT16 evtID,UINT16 refEvtID,time_t start_time);
  156. int KB_NVODFindEveInd(UINT32 TsSequence, UINT16 refSerID,UINT16 refEvtID);
  157. int KB_NVODAddRefSvc(unsigned short tsID,unsigned short refEvtID,unsigned short refSerID,
  158. char *PrgName,char *PrgTxt,UINT16 durTime);
  159. INT32 KB_NVODHandleMsg(KB_OSPMsgNode *pInMsg);
  160. INT32 KB_NVODGetPrgNum(UINT32 TsSequence);
  161. char *KB_NVODGetPrgName(UINT32 TsSequence, INT32 RefEventIndex);
  162. char *KB_NVODGetPrgContent(UINT32 TsSequence, INT32 RefEventIndex);
  163. INT32 KB_NVODGetPrgDuring(UINT32 TsSequence, INT32 RefEventIndex);
  164. INT32 KB_NVODGetPrgTimeNum(UINT32 TsSequence, INT32 RefEventIndex);
  165. time_t KB_NVODGetPrgStartTime(UINT32 TsSequence, INT32 RefEventIndex, INT32 ShiftEventIndex);
  166. BOOL KB_NVODGetTimeInfo(UINT32 TsSequence, 
  167.                             INT32 RefEventIndex, 
  168.                             INT32 ShiftEventIndex,
  169. INT32 *nTsId, 
  170. INT32 *nSvcID);
  171. INT32 KB_NVODGetClassNum(void);
  172. char *KB_NVODGetClassName(INT32 index);
  173. UINT16 KB_NVODGetClassRefSvc(INT32 index);
  174. BOOL KB_NVODGetPrgRefSvcFlag(UINT32 TsSequence, INT32 RefEventIndex, UINT16 nRefSvcID);
  175. void KB_NVODSetNewFlag(BOOL bFlag);
  176. BOOL KB_NVODGetNewFlag(void);
  177. void KB_NVODSetPrgEnd(time_t tTime);
  178. time_t KB_NVODGetPrgEnd(void);
  179. //UINT16 KB_NvodGetTsIdFromRefsrvIdSrvId(UINT16 refSerID,UINT16 SerID);
  180. INT32 KB_NvodGetRefEventNum(UINT32 TsSequence);
  181. KB_NVOD_Info *KB_NvodGetRefNodeHead(void);
  182. KB_DMDTunerParameters *KB_NVOD_GetTsParaFromTsSequence(UINT32  TsSequence);
  183. KB_NVODStruct *KB_NVOD_GetTsIndexFromCur(int CursorIndex);
  184. void KB_NVOD_GetValidFreInfo(UINT8 *pNum, KB_NVOD_Info *Address[]);
  185. BOOL KB_NVOD_PlayForGrap(int nPrgCurRow, int nSchCurRow);
  186. const KB_NVODStruct *KB_NVOD_GetCurRefEventInfoForGrap(int nPrgCurRow);
  187. BOOL KB_NVOD_RefreshSchEvent(void);
  188. time_t KB_NVOD_GetNvodTime(void);
  189. INT32 KD_NVODStopAllPF(void);
  190. INT32 KD_NVODStopAllSch(void);
  191. UINT32 KB_NVOD_GetCurrentTsNum(void);
  192. void KD_NVODHandleMsg2(KB_OSPMsgNode *pInMsg);
  193. #endif