123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- #ifndef __NETCTRL_VIDEO_FLOW_H__
- #define __NETCTRL_VIDEO_FLOW_H__
- #include "runav.h"
- //#include <sisap/subparser.h>
- #include "types.h"
- //#include "medialib_controller.h"
- //#include "net_util.h"
- //typedef long long INT64;
- #define MAX_PROGRAM_COUNT 32
- #define MAX_AUDIO_COUNT 20
- #define MAX_FF_FR_SPEED 5
- #define MAX_BUFFER_COUNT 12
- #define NP_URL_MAX_LEN (2048)
- typedef struct _sDataSource
- {
- char src;
- char *pFullPath;
- int format;
- int index;
- }sDataSource;
- typedef struct _AUDIO_INFO
- {
- short nIndex;
- short nId;
- short nTrack;
- char strLang[4];
- } AudioInfo, *pAudioInfo;
- typedef struct _AV_STREAM_INFO
- {
- int nProId;
- unsigned char nType;
- unsigned char nAudioCount;
- AudioInfo AudioInfo[MAX_AUDIO_COUNT];
- } AvStreamInfo, *pAvStreamInfo;
- typedef struct _NET_CTRL_HANDLE {
- short nMediaStatus;
- short nMediaMode;
- pthread_mutex_t MediaCmd_Mutex;
- pthread_mutex_t MediaSubtitle_Mutex;
- pthread_mutex_t MediaEvent_Mutex;
- pthread_cond_t CondEvent_Thread;
- pthread_t MediaEvent_Thread;
- unsigned char bMutexThread;
- char strFilePath[300];
- short nEventBuffer[MAX_BUFFER_COUNT];
- unsigned char nEnqIdx;
- unsigned char nDeqIdx;
-
- int nEvent;
- unsigned char nSpeed_FF;
- unsigned char nSpeed_FR;
- unsigned long nRunavOpt;
- unsigned char bPlay;
- unsigned char bAudioOn;
- unsigned char bSubtitleOn;
- long long nTotalTime;
-
- int nCurrentProId;
- unsigned char nTotalProgram;
- unsigned char nCurrentSubtitleIdx;
- unsigned char nSubtitleCount;
- unsigned char bVideoNotSupport;
- unsigned char bAudioNotSupport;
- AvStreamInfo AvStreamInfo[MAX_PROGRAM_COUNT];
- runav_stream_info_t *pRunavStreamInfo;
- media_info_t MediaFileInfo;
- } NetCtrlHandle, *pNetCtrlHandle;
- typedef enum
- {
- MEDIA_IDLE = 0,
- MEDIA_INIT ,
- MEDIA_PLAY,
- MEDIA_STOP,
- MEDIA_PAUSE,
- MEDIA_FF,
- MEDIA_FR,
- MEDIA_UNSUPPORT,
- MEDIA_ERROR,
- } MediaStatus;
- typedef enum
- {
- MEDIA_MOVIE = 0,
- MEDIA_MUSIC,
- } MediaMode;
- typedef enum
- {
- NET_PLAYER_AV_EVENT_DECODE_START = 0X0001000F, /*!< Audio/Video Decode Start evnet*/
- NET_PLAYER_AV_EVENT_INIT_FAILED = 0X0001000C,
- NET_PLAYER_AV_EVENT_INITOK = 0X0001000D,
- NET_PLAYER_AV_EVENT_PLAY_DONE = 0X0001000E,
- NET_PLAYER_EVENT_END = 0X000FFFFF,
- } AL_NET_PLAYER_Event_t;
- typedef enum
- {
- AL_NET_PLAYER_SUCCESS = 0, /*!< successful*/
- AL_NET_PLAYER_ERR_FAILURE = 1, /*!< operation failed*/
- } AL_NET_PLAYER_t;
- void NetCtrl_IsDebugON();
-
- int NetCtrl_Initialize();
- int NetCtrl_Finalize();
- int NetCtrl_SetMediaInfo(char *pszFileName);
- void* NetCtrl_GetNetCtrlHandle();
- void NetCtrl_UpdateStreamInfo(void *Arg);
- void NetCtrl_EventHandler(int nEventID, void *arg);
- void NetCtrl_SetNotificationFunc(void *pData);
- void NetCtrl_SetMediaMode(int nMode);
- int NetCtrl_GetMediaStatus();
- unsigned char NetCtrl_IsPlay();
- void NetCtrl_VideoAudioSupport(unsigned char *bVideoNotSupport, unsigned char *bAudioNotSupport);
- unsigned char NetCtrl_InitMutex();
- void NetCtrl_DestroyMutex();
- int NetCtrl_Init();
- void NetCtrl_Exit();
- int NetCtrl_SetDataSource(sDataSource *pData, unsigned long nLowTime, unsigned long nHighTime);
- int NetCtrl_GetFilmInfo(void *pFilmInfo);
- void NetCtrl_Play();
- void NetCtrl_Pause();
- void NetCtrl_Stop();
- int NetCtrl_FastForward();
- int NetCtrl_FastRewind();
- int NetCtrl_GetSubtitleCount();
- void NetCtrl_SetSubtitleOff();
- void NetCtrl_SetSubtitleIndex(int nIndex, int nType);
- int NetCtrl_GetAudioCount();
- int NetCtrl_GetCurrentAudioIndex(char *pLang);
- void NetCtrl_SetAudioVideoFlag(BOOL bEnableAudio, BOOL bEnableVideo);
- //int MediaCtrl_SetAudioIndex(int nIndex, char *pLang);
- //void MediaCtrl_ChannelUpDown(int nUpDown);
- unsigned long NetCtrl_GetCurrentTime();
- long long NetCtrl_GetTotalTime();
- int NetCtrl_SeekTime(unsigned long nAbsSeconds); // milliSecond
- void NetCtrl_GetPosition(unsigned long *nLow, unsigned long *nHigh);
- void NetCtrl_NET_Player_RegisterMsgRouteway(BOOL (*SendMsg_Func)(AL_NET_PLAYER_Event_t));
- AL_NET_PLAYER_t NetCtrl_NET_Get_Play_State(void);
- //void MediaCtrl_Next();
- //static void * _MediaCtrl_Next();
- //void MediaCtrl_Prev();
- //static void * _MediaCtrl_Prev();
- //int MediaCtrl_Set(Net_Player_Set_e eSet, UINT32 dParam);
- //int MediaCtrl_Get(Net_Player_Get_e eGet, UINT32 *dParam);
- /*
- typedef struct _sDataSource
- {
- char src;
- char *pFullPath;
- int format;
- }sDataSource;
- typedef int (*iFunc_SetNotificationCBFunc)(void *);
- typedef void (*iFunc_SetMediaMode)(int);
- typedef int (*iFunc_QueryStatus)();
- typedef int (*iFunc_Init)();
- typedef int (*iFunc_Exit)();
- typedef int (*iFunc_SetDataSource)(sDataSource*, unsigned long, unsigned long);
- typedef int (*iFunc_GetFilmInfo)(void*);
- typedef void (*iFunc_Play)();
- typedef void (*iFunc_Pause)();
- typedef void (*iFunc_Stop)();
- typedef int (*iFunc_FastForward)(void *);
- typedef int (*iFunc_FastRewind)(void *);
- typedef void (*iFunc_SetSubbtitleOff)();
- typedef void (*iFunc_SetSubtitleIndex)(int);
- typedef void (*iFunc_SetAudioVideoFlag)(BOOL, BOOL);
- typedef void (*iFunc_SetAudioIndex)(int);
- typedef void (*iFunc_ChannelUpDown)(int);
- typedef unsigned long (*iFunc_GetCurrentTime)();
- typedef int (*iFunc_SeekTime)(unsigned long);
- typedef void (*iFunc_GetPosition)(unsigned long*, unsigned long*);
- typedef struct _imedia_controller
- {
- iFunc_SetNotificationCBFunc pFunc_SetNotificationCBFunc;
- iFunc_SetMediaMode pFunc_SetMediaMode;
- iFunc_QueryStatus pFunc_QueryStatus;
- iFunc_Init pFunc_Init;
- iFunc_Exit pFunc_Exit;
- iFunc_SetDataSource pFunc_SetDataSource;
- iFunc_GetFilmInfo pFunc_GetFilmInfo;
- iFunc_Play pFunc_Play;
- iFunc_Pause pFunc_Pause;
- iFunc_Stop pFunc_Stop;
- iFunc_FastForward pFunc_FastForward;
- iFunc_FastRewind pFunc_FastRewind;
- iFunc_SetSubbtitleOff pFunc_SetSubbtitleOff;
- iFunc_SetSubtitleIndex pFunc_SetSubtitleIndex;
- iFunc_SetAudioVideoFlag pFunc_SetAudioVideoFlag;
- iFunc_SetAudioIndex pFunc_SetAudioIndex;
- iFunc_ChannelUpDown pFunc_ChannelUpDown;
- iFunc_GetCurrentTime pFunc_GetCurrentTime;
- iFunc_SeekTime pFunc_SeekTime;
- iFunc_GetPosition piFunc_GetPosition;
- } iMedia_Controller;
- */
- #endif
|