DataType.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef DATA_TYPE_H
  2. #define DATA_TYPE_H
  3. #define FRAME_HEAD_MAGIC 0x03211546
  4. #define SYSTEM_SYNC_ID 2
  5. #ifdef __LINUX__
  6. typedef unsigned char UCHAR;
  7. typedef unsigned char* PBYTE;
  8. typedef char* LPTSTR;
  9. typedef unsigned short USHORT;
  10. typedef int HANDLE;
  11. typedef unsigned long ULONG;
  12. typedef unsigned long DWORD;
  13. #endif //#ifdef __LINUX__
  14. typedef struct tagFrameInfo{
  15. ULONG SyncId; /* 00000000000000000000000000010b */
  16. ULONG Magic;
  17. USHORT FrameType; /* I frames , P frames or BBP frames Audio frames or dsp status etc */
  18. ULONG Length; /*lenth include this header */
  19. ULONG FrameNumber; /* serial number of this frame */
  20. UCHAR Breakable; /* indicate if stream breakable, you could restart new file(with PktSysHeader) if true */
  21. /*ULONG Ack;*/
  22. ULONG PTS; /* system clock when this frames is processed */
  23. }TMFRAME_HEADER, *PTMFRAME_HEADER;
  24. typedef enum {
  25. StandardNone = 0x80000000,
  26. StandardNTSC = 0x00000001,
  27. StandardPAL = 0x00000002,
  28. StandardSECAM = 0x00000004,
  29. } VideoStandard_t;
  30. typedef enum {
  31. PktError = 0,
  32. PktIFrames = 0x0001,
  33. PktPFrames = 0x0002,
  34. PktBBPFrames = 0x0004,
  35. PktAudioFrames = 0x0008,
  36. PktMotionDetection = 0x00010,
  37. PktDspStatus = 0x00020,
  38. PktOrigImage = 0x00040,
  39. PktSysHeader = 0x00080,
  40. PktBPFrames = 0x00100,
  41. PktSFrames = 0x00200,
  42. PktSubIFrames = 0x00400,
  43. PktSubPFrames = 0x00800,
  44. PktSubBBPFrames = 0x01000,
  45. PktSubSysHeader = 0x02000
  46. }FrameType_t;
  47. typedef struct tagVersion{
  48. ULONG DspVersion, DspBuildNum;
  49. ULONG DriverVersion, DriverBuildNum;
  50. ULONG SDKVersion, SDKBuildNum;
  51. }VERSION_INFO, *PVERSION_INFO;
  52. typedef enum {
  53. ENC_CIF_FORMAT = 0,
  54. ENC_QCIF_FORMAT = 1,
  55. ENC_2CIF_FORMAT = 2,
  56. ENC_4CIF_FORMAT = 3,
  57. ENC_QQCIF_FORMAT = 4,
  58. ENC_CIFQCIF_FORMAT =5,
  59. ENC_CIFQQCIF_FORMAT =6,
  60. ENC_DCIF_FORMAT =7,
  61. ENC_VGA_FORMAT=8
  62. }PictureFormat_t;
  63. typedef struct tagMotionData{
  64. PictureFormat_t PicFormat;
  65. ULONG HorizeBlocks;
  66. ULONG VerticalBlocks;
  67. ULONG BlockSize;
  68. }MOTION_DATA_HEADER, *PMOTION_DATA_HEADER;
  69. #define _OSD_BASE 0x9000 /*base address of special character*/
  70. #define _OSD_YEAR4 (_OSD_BASE+0) /*show year time by length of 4 , for example: 2005*/
  71. #define _OSD_YEAR2 (_OSD_BASE+1) /*show year time by length of 2, for example: 05 */
  72. #define _OSD_MONTH3 (_OSD_BASE+2) /*show month time in English, for example: Jan*/
  73. #define _OSD_MONTH2 (_OSD_BASE+3) /*show month time by two Arabic numerals, for example: 07*/
  74. #define _OSD_DAY (_OSD_BASE+4) /*show day time by two Arabic numerals, for example: 31*/
  75. #define _OSD_WEEK3 (_OSD_BASE+5) /*show week time in English: MON~SUN*/
  76. #define _OSD_CWEEK1 (_OSD_BASE+6) /*show week time in Chinese GB code*/
  77. #define _OSD_HOUR24 (_OSD_BASE+7) /*show 24 hours clock: 00~23 */
  78. #define _OSD_HOUR12 (_OSD_BASE+8) /*show 12 hours clock: 00~12*/
  79. #define _OSD_MINUTE (_OSD_BASE+9) /*show minute time by length of 2: 00~59*/
  80. #define _OSD_SECOND (_OSD_BASE+10) /*show second time by length of 2: 00~59*/
  81. #define _OSD_MILISECOND (_OSD_BASE+11) /*show millisecond time by length of 3: 000~999*/
  82. #define _OSD_APM (_OSD_BASE+14) /*show a.m. or p.m. by length of 2 bit, AM or PM*/
  83. //For new added APIs to set OSD: SetEncoderOsdDisplayMode, SetDecoderOsdDisplayMode and SetDisplayOsdDisplayMode in v6.0 SDK, we use new basic address of special character.
  84. #define _OSD_BASE_EX 0x90000 /*base address of special character*/
  85. #define _OSD_YEAR4_EX (_OSD_BASE_EX+0) /*the same as _OSD_YEAR4*/
  86. #define _OSD_YEAR2_EX (_OSD_BASE_EX+1) /*the same as _OSD_YEAR2*/
  87. #define _OSD_MONTH3_EX (_OSD_BASE_EX+2) /*the same as _OSD_MONTH3*/
  88. #define _OSD_MONTH2_EX (_OSD_BASE_EX+3) /*the same as _OSD_MONTH2*/
  89. #define _OSD_DAY_EX (_OSD_BASE_EX+4) /*the same as _OSD_DAY*/
  90. #define _OSD_WEEK3_EX (_OSD_BASE_EX+5) /*the same as _OSD_WEEK3*/
  91. #define _OSD_CWEEK1_EX (_OSD_BASE_EX+6) /*the same as _OSD_CWEEK1*/
  92. #define _OSD_HOUR24_EX (_OSD_BASE_EX+7) /*the same as _OSD_HOUR24*/
  93. #define _OSD_HOUR12_EX (_OSD_BASE_EX+8) /*the same as _OSD_HOUR12*/
  94. #define _OSD_MINUTE_EX (_OSD_BASE_EX+9) /*the same as _OSD_MINUTE*/
  95. #define _OSD_SECOND_EX (_OSD_BASE_EX+10) /*the same as _OSD_SECOND*/
  96. #define _OSD_MILISECOND_EX (_OSD_BASE_EX+11) /*the same as _OSD_MILISECOND*/
  97. #define _OSD_APM_EX (_OSD_BASE_EX+14) /*the same as _OSD_APM*/
  98. #endif