netctrl_video_flow_ctrl.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. #ifndef __NETCTRL_VIDEO_FLOW_H__
  2. #define __NETCTRL_VIDEO_FLOW_H__
  3. #include "runav.h"
  4. //#include <sisap/subparser.h>
  5. #include "types.h"
  6. //#include "medialib_controller.h"
  7. //#include "net_util.h"
  8. //typedef long long INT64;
  9. #define MAX_PROGRAM_COUNT 32
  10. #define MAX_AUDIO_COUNT 20
  11. #define MAX_FF_FR_SPEED 5
  12. #define MAX_BUFFER_COUNT 12
  13. #define NP_URL_MAX_LEN (2048)
  14. typedef struct _sDataSource
  15. {
  16. char src;
  17. char *pFullPath;
  18. int format;
  19. int index;
  20. }sDataSource;
  21. typedef struct _AUDIO_INFO
  22. {
  23. short nIndex;
  24. short nId;
  25. short nTrack;
  26. char strLang[4];
  27. } AudioInfo, *pAudioInfo;
  28. typedef struct _AV_STREAM_INFO
  29. {
  30. int nProId;
  31. unsigned char nType;
  32. unsigned char nAudioCount;
  33. AudioInfo AudioInfo[MAX_AUDIO_COUNT];
  34. } AvStreamInfo, *pAvStreamInfo;
  35. typedef struct _NET_CTRL_HANDLE {
  36. short nMediaStatus;
  37. short nMediaMode;
  38. pthread_mutex_t MediaCmd_Mutex;
  39. pthread_mutex_t MediaSubtitle_Mutex;
  40. pthread_mutex_t MediaEvent_Mutex;
  41. pthread_cond_t CondEvent_Thread;
  42. pthread_t MediaEvent_Thread;
  43. unsigned char bMutexThread;
  44. char strFilePath[300];
  45. short nEventBuffer[MAX_BUFFER_COUNT];
  46. unsigned char nEnqIdx;
  47. unsigned char nDeqIdx;
  48. int nEvent;
  49. unsigned char nSpeed_FF;
  50. unsigned char nSpeed_FR;
  51. unsigned long nRunavOpt;
  52. unsigned char bPlay;
  53. unsigned char bAudioOn;
  54. unsigned char bSubtitleOn;
  55. long long nTotalTime;
  56. int nCurrentProId;
  57. unsigned char nTotalProgram;
  58. unsigned char nCurrentSubtitleIdx;
  59. unsigned char nSubtitleCount;
  60. unsigned char bVideoNotSupport;
  61. unsigned char bAudioNotSupport;
  62. AvStreamInfo AvStreamInfo[MAX_PROGRAM_COUNT];
  63. runav_stream_info_t *pRunavStreamInfo;
  64. media_info_t MediaFileInfo;
  65. } NetCtrlHandle, *pNetCtrlHandle;
  66. typedef enum
  67. {
  68. MEDIA_IDLE = 0,
  69. MEDIA_INIT ,
  70. MEDIA_PLAY,
  71. MEDIA_STOP,
  72. MEDIA_PAUSE,
  73. MEDIA_FF,
  74. MEDIA_FR,
  75. MEDIA_UNSUPPORT,
  76. MEDIA_ERROR,
  77. } MediaStatus;
  78. typedef enum
  79. {
  80. MEDIA_MOVIE = 0,
  81. MEDIA_MUSIC,
  82. } MediaMode;
  83. typedef enum
  84. {
  85. NET_PLAYER_AV_EVENT_DECODE_START = 0X0001000F, /*!< Audio/Video Decode Start evnet*/
  86. NET_PLAYER_AV_EVENT_INIT_FAILED = 0X0001000C,
  87. NET_PLAYER_AV_EVENT_INITOK = 0X0001000D,
  88. NET_PLAYER_AV_EVENT_PLAY_DONE = 0X0001000E,
  89. NET_PLAYER_EVENT_END = 0X000FFFFF,
  90. } AL_NET_PLAYER_Event_t;
  91. typedef enum
  92. {
  93. AL_NET_PLAYER_SUCCESS = 0, /*!< successful*/
  94. AL_NET_PLAYER_ERR_FAILURE = 1, /*!< operation failed*/
  95. } AL_NET_PLAYER_t;
  96. void NetCtrl_IsDebugON();
  97. int NetCtrl_Initialize();
  98. int NetCtrl_Finalize();
  99. int NetCtrl_SetMediaInfo(char *pszFileName);
  100. void* NetCtrl_GetNetCtrlHandle();
  101. void NetCtrl_UpdateStreamInfo(void *Arg);
  102. void NetCtrl_EventHandler(int nEventID, void *arg);
  103. void NetCtrl_SetNotificationFunc(void *pData);
  104. void NetCtrl_SetMediaMode(int nMode);
  105. int NetCtrl_GetMediaStatus();
  106. unsigned char NetCtrl_IsPlay();
  107. void NetCtrl_VideoAudioSupport(unsigned char *bVideoNotSupport, unsigned char *bAudioNotSupport);
  108. unsigned char NetCtrl_InitMutex();
  109. void NetCtrl_DestroyMutex();
  110. int NetCtrl_Init();
  111. void NetCtrl_Exit();
  112. int NetCtrl_SetDataSource(sDataSource *pData, unsigned long nLowTime, unsigned long nHighTime);
  113. int NetCtrl_GetFilmInfo(void *pFilmInfo);
  114. void NetCtrl_Play();
  115. void NetCtrl_Pause();
  116. void NetCtrl_Stop();
  117. int NetCtrl_FastForward();
  118. int NetCtrl_FastRewind();
  119. int NetCtrl_GetSubtitleCount();
  120. void NetCtrl_SetSubtitleOff();
  121. void NetCtrl_SetSubtitleIndex(int nIndex, int nType);
  122. int NetCtrl_GetAudioCount();
  123. int NetCtrl_GetCurrentAudioIndex(char *pLang);
  124. void NetCtrl_SetAudioVideoFlag(BOOL bEnableAudio, BOOL bEnableVideo);
  125. //int MediaCtrl_SetAudioIndex(int nIndex, char *pLang);
  126. //void MediaCtrl_ChannelUpDown(int nUpDown);
  127. unsigned long NetCtrl_GetCurrentTime();
  128. long long NetCtrl_GetTotalTime();
  129. int NetCtrl_SeekTime(unsigned long nAbsSeconds); // milliSecond
  130. void NetCtrl_GetPosition(unsigned long *nLow, unsigned long *nHigh);
  131. void NetCtrl_NET_Player_RegisterMsgRouteway(BOOL (*SendMsg_Func)(AL_NET_PLAYER_Event_t));
  132. AL_NET_PLAYER_t NetCtrl_NET_Get_Play_State(void);
  133. //void MediaCtrl_Next();
  134. //static void * _MediaCtrl_Next();
  135. //void MediaCtrl_Prev();
  136. //static void * _MediaCtrl_Prev();
  137. //int MediaCtrl_Set(Net_Player_Set_e eSet, UINT32 dParam);
  138. //int MediaCtrl_Get(Net_Player_Get_e eGet, UINT32 *dParam);
  139. /*
  140. typedef struct _sDataSource
  141. {
  142. char src;
  143. char *pFullPath;
  144. int format;
  145. }sDataSource;
  146. typedef int (*iFunc_SetNotificationCBFunc)(void *);
  147. typedef void (*iFunc_SetMediaMode)(int);
  148. typedef int (*iFunc_QueryStatus)();
  149. typedef int (*iFunc_Init)();
  150. typedef int (*iFunc_Exit)();
  151. typedef int (*iFunc_SetDataSource)(sDataSource*, unsigned long, unsigned long);
  152. typedef int (*iFunc_GetFilmInfo)(void*);
  153. typedef void (*iFunc_Play)();
  154. typedef void (*iFunc_Pause)();
  155. typedef void (*iFunc_Stop)();
  156. typedef int (*iFunc_FastForward)(void *);
  157. typedef int (*iFunc_FastRewind)(void *);
  158. typedef void (*iFunc_SetSubbtitleOff)();
  159. typedef void (*iFunc_SetSubtitleIndex)(int);
  160. typedef void (*iFunc_SetAudioVideoFlag)(BOOL, BOOL);
  161. typedef void (*iFunc_SetAudioIndex)(int);
  162. typedef void (*iFunc_ChannelUpDown)(int);
  163. typedef unsigned long (*iFunc_GetCurrentTime)();
  164. typedef int (*iFunc_SeekTime)(unsigned long);
  165. typedef void (*iFunc_GetPosition)(unsigned long*, unsigned long*);
  166. typedef struct _imedia_controller
  167. {
  168. iFunc_SetNotificationCBFunc pFunc_SetNotificationCBFunc;
  169. iFunc_SetMediaMode pFunc_SetMediaMode;
  170. iFunc_QueryStatus pFunc_QueryStatus;
  171. iFunc_Init pFunc_Init;
  172. iFunc_Exit pFunc_Exit;
  173. iFunc_SetDataSource pFunc_SetDataSource;
  174. iFunc_GetFilmInfo pFunc_GetFilmInfo;
  175. iFunc_Play pFunc_Play;
  176. iFunc_Pause pFunc_Pause;
  177. iFunc_Stop pFunc_Stop;
  178. iFunc_FastForward pFunc_FastForward;
  179. iFunc_FastRewind pFunc_FastRewind;
  180. iFunc_SetSubbtitleOff pFunc_SetSubbtitleOff;
  181. iFunc_SetSubtitleIndex pFunc_SetSubtitleIndex;
  182. iFunc_SetAudioVideoFlag pFunc_SetAudioVideoFlag;
  183. iFunc_SetAudioIndex pFunc_SetAudioIndex;
  184. iFunc_ChannelUpDown pFunc_ChannelUpDown;
  185. iFunc_GetCurrentTime pFunc_GetCurrentTime;
  186. iFunc_SeekTime pFunc_SeekTime;
  187. iFunc_GetPosition piFunc_GetPosition;
  188. } iMedia_Controller;
  189. */
  190. #endif