icast.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. #ifndef _LIBS_ICAST_H
  2. #define _LIBS_ICAST_H
  3. #include <types.h>
  4. //---------------------------------------------------------------------
  5. #define TESTH264_FEED 0
  6. #define ICAST_ERR_RESET 1
  7. #define MCAPACITY_DEBUG 0
  8. #define ISAVE_264_ENABLE 0
  9. #define ISAVE_AUD_ENABLE 0
  10. #define ICAST_XPR_ENABLE 0
  11. #define COUNT_TIME_PER_30_FRAMES 0
  12. //---------------------------------------------------------------------
  13. #define INTERFACE_TESTH264 1
  14. #define INTERFACE_TESTDLLSO 2
  15. #define INTERFACE_IPHONE 3
  16. #define INTERFACE_ANDROID 4
  17. #define INTERFACE_DYNBIN 5
  18. #define ZYCAST_VERSION 20190315
  19. //---------------------------------------------------------------------
  20. #ifndef BIT0
  21. #define BIT0 (1<<0)
  22. #endif
  23. #ifndef BIT1
  24. #define BIT1 (1<<1)
  25. #endif
  26. #ifndef BIT2
  27. #define BIT2 (1<<2)
  28. #endif
  29. #ifndef BIT3
  30. #define BIT3 (1<<3)
  31. #endif
  32. #ifndef BIT4
  33. #define BIT4 (1<<4)
  34. #endif
  35. #ifndef BIT5
  36. #define BIT5 (1<<5)
  37. #endif
  38. #ifndef BIT6
  39. #define BIT6 (1<<6)
  40. #endif
  41. #ifndef BIT7
  42. #define BIT7 (1<<7)
  43. #endif
  44. #ifndef BIT8
  45. #define BIT8 (1<<8)
  46. #endif
  47. #ifndef BIT9
  48. #define BIT9 (1<<9)
  49. #endif
  50. #ifndef BIT10
  51. #define BIT10 (1<<10)
  52. #endif
  53. #ifndef BIT11
  54. #define BIT11 (1<<11)
  55. #endif
  56. #ifndef BIT12
  57. #define BIT12 (1<<12)
  58. #endif
  59. #ifndef BIT13
  60. #define BIT13 (1<<13)
  61. #endif
  62. #ifndef BIT14
  63. #define BIT14 (1<<14)
  64. #endif
  65. #ifndef BIT15
  66. #define BIT15 (1<<15)
  67. #endif
  68. #ifndef BIT16
  69. #define BIT16 (1<<16)
  70. #endif
  71. //MCAST STATUS
  72. #define MCAST_STA_NONE BIT0 //4:Please INSERT Android Phone
  73. #define MCAST_PHE_INSERT BIT1 //1:Phone Inserted
  74. #define MCAST_USB_INSERT BIT2 //1:Unsupported Phone
  75. #define MCAST_ADB_RUNNING BIT3 //2:Debug mode Opened
  76. #define MCAST_ADB_FAIL BIT4 //2:Debug mode Error
  77. #define MCAST_ANR_VERSION BIT5 //3:Android Ver 8:4
  78. #define MCAST_AUT_START BIT6 //4:Authentication Start
  79. #define MCAST_AUT_FINISH BIT7 //4:Authentication OK
  80. #define MCAST_ANR_VEROTHER BIT8 //3:Android Ver Other
  81. #define MCAST_ANR_VERFAIL BIT9 //3:Android Ver Error
  82. #define MCAST_SCR_UPDATE BIT10 //4:Update SCR
  83. #define MCAST_SCR_UPSUCC BIT11 //4:SCR Update Success
  84. #define MCAST_SCR_UPFAIL BIT12 //4:SCR Update Fail
  85. #define MCAST_ERR_SOCKET1 BIT13 //4:Socket Err1
  86. #define MCAST_ERR_SOCKET2 BIT14 //4:Socket Err2
  87. #define MCAST_EXIT_THREAD BIT15 //4:Thread Exit
  88. #define MCAST_MSG_PLUG BIT16 //4:please plug the cable
  89. //------------------------- --------------------------------------------
  90. #define CUSTOMER_ZY "ZY.001"
  91. #define CUSTOMER_DW "DW.001"
  92. #define CUSTOMER_RG "RG.001"
  93. #define CUSTOMER_WT "WT.001"
  94. #define CUSTOMER_WJ "WJ.001"
  95. #define CUSTOMER_SW "SW.001"
  96. #if defined(CONFIG_BOARD_SIWEI_V1__S2TEK__S2TEK__S2TEK)
  97. #define CUSTOMER_NM CUSTOMER_SW
  98. #elif defined(CONFIG_BOARD_VANJIANG_V1__S2TEK__S2TEK__S2TEK) || defined(CONFIG_BOARD_VANJIANG_V2__S2TEK__S2TEK__S2TEK)
  99. #define CUSTOMER_NM CUSTOMER_WJ
  100. #elif defined(CONFIG_BOARD_VANTOP_V1__S2TEK__S2TEK__S2TEK)
  101. #define CUSTOMER_NM CUSTOMER_WT
  102. #elif defined(CONFIG_BOARD_RIGAL_V1__S2TEK__S2TEK__S2TEK)
  103. #define CUSTOMER_NM CUSTOMER_RG
  104. #elif defined(CONFIG_BOARD_RDA_8503__S2TEK__S2TEK__S2TEK)
  105. #define CUSTOMER_NM CUSTOMER_ZY
  106. #else
  107. #define CUSTOMER_NM CUSTOMER_ZY
  108. #endif
  109. //---------------------------------------------------------------------
  110. #define CMD_AUTH 0x16
  111. #define CMD_CTRL 0x18
  112. #define CMD_EXIT 0xf8
  113. //---------------------------------------------------------------------
  114. #define ADB_CLASS 0xff
  115. #define ADB_SUBCLASS 0x42
  116. #define ADB_PROTOCOL 0x01
  117. #define USB_DT_DEVICE_SIZE 18
  118. #define USB_DT_CONFIG_SIZE 9
  119. #define USB_DT_INTERFACE_SIZE 9
  120. #define USB_DT_DEVICE 0x01
  121. #define USB_DT_CONFIG 0x02
  122. #define USB_DT_STRING 0x03
  123. #define USB_DT_INTERFACE 0x04
  124. #define USB_DT_ENDPOINT 0x05
  125. #define USB_DT_DEVICE_QUALIFIER 0x06
  126. #define USB_DT_OTHER_SPEED_CONFIG 0x07
  127. #define USB_DT_INTERFACE_POWER 0x08
  128. #define ADB_MSG(_fmt, _args...) //
  129. //---------------------------------------------------------------------
  130. #define MCAST_ADBSCR_MARK 0x40000
  131. #define MCAST_SERVER_MARK 0x80000
  132. #define MCAST_RESULT_AUTH_SUCC 0x88
  133. #define MCAST_RESULT_AUTH_FAIL 0x77
  134. #define MCAST_PANEL_WIDTH 800
  135. #define MCAST_PANEL_HIGHT 480
  136. //---------------------------------------------------------------------
  137. #define ONE_MILLON_BYTE (1024*1024)
  138. #define TWE_MILLON_BYTE (1024*12)
  139. #define RESTART_INTERVAL (3)
  140. //---------------------------------------------------------------------
  141. extern UINT8 nCastResetFlag;
  142. extern int mCastSocket;
  143. extern int gmRevByte;
  144. extern int gmRevMByte;
  145. extern UINT8 *g_payloadbuf;
  146. extern INT16 g_payloadlen ;
  147. extern UINT8 g_payloadflag;
  148. #if ISAVE_264_ENABLE
  149. extern FILE *mOutputFile;
  150. #endif
  151. extern int gPanelWidth;
  152. extern int gPanelHeight;
  153. typedef enum
  154. {
  155. ICAST_EVENT_DECODE_START = 0X0001000F, /*!< Audio/Video Decode Start evnet*/
  156. ICAST_EVENT_DECODE_FINISH = 0X00010001,
  157. ICAST_EVENT_INITOK = 0X0001000D,
  158. ICAST_EVENT_PLAY_DONE = 0X0001000E,
  159. ICAST_EVENT_END = 0X000FFFFF,
  160. } ICast_Event_t;
  161. //---------------------------------------------------------------------
  162. void ICast_Register_MsgRouteway(BOOL (*SendMsg_Func)(ICast_Event_t));
  163. void ICastServiceInit(int ninterface);
  164. void ICastServiceStart(int nflag);
  165. void ICastServiceStop();
  166. int _IOSUSBCastServiceStart(void);
  167. void ICastRunAVStart();
  168. void ICastRunAVStop();
  169. void iCastStopPlayer();
  170. int ICastPlayer_PushVedioPayload(const void *buffer,int buflen,UINT8 bCheck);
  171. void ICastSetSystemTime(void);
  172. void ICastSetSystemTime2(void);
  173. int ICastGetInterface();
  174. int mPipeFileRead(unsigned char * buf,int size);
  175. void MCastStopStatus();
  176. void MCastUIHandle();
  177. void MICast_UICtrl(bool bstatus);
  178. void MCastLoadBinX(short version);
  179. char*MCastGetAndroidVer();
  180. void exitMcastServer();
  181. int isTargetVendorDevice(int nidVendor);
  182. void mSetExitLoopValue(UINT8 mvalue);
  183. int MCastGetfreeRam();
  184. UINT8 ICastPlayer_Payloading();
  185. void ICastPlayer_PlayerReset();
  186. int GetSysMs();
  187. //-----------------------------------------------------------------------
  188. void checkPushStatus();
  189. void ICast_DispatchEvent(unsigned int u32Event);
  190. void ICastSetDispAspectNative(int nflag);
  191. void MCastCloseSocket();
  192. int MCastAuthHandler();
  193. //-----------------------------------------------------------------------
  194. #endif