Z
zhaoyong1977
Unregistered / Unconfirmed
GUEST, unregistred user!
#ifndef CLIENTTRANS_H
#define CLIENTTRANS_H
#define CLIHEADER_API __declspec(dllimport)
#ifdef VBCALL
#define MYSTDCALL _cdecl
#else
#define MYSTDCALL _stdcall
#endif
#define CLIENT_CONNECT 0X101 //Request the remote data
#define CLIENT_DISCONNECT 0X102 //Refuse the remote data
#define SERVER_OK 0x103 //connect ok
#define SERVER_REFUSED 0x104 //refused
#define USER_DATA 0x105 //user message
#define REQUEST_KEYFRAME 0x106 //client request key frame
#define E_RECVDATA 0x201 //recv data exception
#define E_PLAYER 0x202 //player exception
#define E_REFUSED 0x203 //server refuse connect
#define E_SRVCLOSED 0x204 //server is closed
#define E_SENDTHRED 0x205 //send data exception
#define E_RECORD 0x206 //write to file exception
enum DirectXMode{primarySurface,singleOverlay,multipleOverlay};
enum NetMode
{
broadcast=0,
multicast,
udp,
tcp,
dynamic,
rtp,
CustomCtrl
};
enum TKPLAYERTYPE
{
AVE1000_P,
AVE2000_P,
AVE3000_P,
AVE4000_P,
AVE5000_P,
AVE6000_P,
AVE7000_P,
AVE8000_P,
AVE9000_P,
AVENET=100,
AVENONE=200
};
typedef void (_stdcall *GetMPGData)(int idNo,char * data,int length,void * pUsrParam);
typedef void (_stdcall *ClientConnectedCallBack)(unsigned lPlayer, unsigned nChannel);
extern "C"
{
CLIHEADER_API int MYSTDCALL TKLNETCLIENT_CreatePlayer(TKPLAYERTYPE PlayerType, void * pParams);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_ReleasePlayer(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_Connect(
unsigned lPlayer,
char *strIPAddress,
unsigned nPort,
unsigned nChannel,
char *strUserName,
char *strUserPassword,
unsigned dwBufSize);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetConnectedCallBack(unsigned lPlayer, ClientConnectedCallBack ConnectedFunction);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetConnectWait(DWORD dwWaitTime, int nTrynum);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetTTL(unsigned lPlayer, unsigned char cTTLVal);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetVideoWindow(unsigned lPlayer, HWND hWnd, RECT* pRect = NULL);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetDisplayMode(unsigned PlayerId, DirectXMode mode, void *pParams);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_ThrownFrames(unsigned lPlayer, int nFrame);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_RefreshWindow(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetPostFilter(unsigned lPlayer, int nFilter);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_Play(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_Stop(unsigned lPlayer);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_EnableAudio(unsigned lPlayer, BOOL bEnable);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_SetVolume(unsigned lPlayer, unsigned lVolume);
CLIHEADER_API ULONG MYSTDCALL TKLNETCLIENT_GetVolume(unsigned lPlayer);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_EnableDataDriven(unsigned lPlayer, BOOL bEnable);
CLIHEADER_API DWORD MYSTDCALL TKLNETCLIENT_GetSdkVersion();
CLIHEADER_API int MYSTDCALL TKLNETCLIENT_GetPlayerStatus(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetErrorNotify(
unsigned lPlayer,
HWND hWnd,
unsigned nErrorMsgID,
HANDLE hEndEvent);
CLIHEADER_API int MYSTDCALL TKLNETCLIENT_GetLastError(unsigned lPlayer);
CLIHEADER_API char* MYSTDCALL TKLNETCLIENT_GetErrorString(int nErrno);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_Reset(unsigned lPlayer);
CLIHEADER_API DWORD MYSTDCALL TKLNETCLIENT_GetBMPSize(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_CaptureBitmap(unsigned lPlayer, char *strFilename, BYTE *pBitmap );
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_StartRecord(unsigned lPlayer, char *strFilename);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_StopRecord(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetDataArriveNotify(
unsigned lPlayer,
HWND hWnd,
unsigned nEndMsgID,
HANDLE hEndEvent);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_GetHeader(unsigned lPlayer, void *pheadBuffer, int &nheadLength);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_GetData(
unsigned lPlayer,
void *pDataBuffer,
int &nDataLength,
DWORD &nNumber,
int &nFrameType);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_MessageToServer(unsigned lPlayer, void *pDataBuffer, int nDataLength);
CLIHEADER_API int MYSTDCALL TKLNETCLIENT_SetMessageNotify(unsigned lPlayer, HWND hWnd, unsigned nMsgID, HANDLE hEndEvent);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_GetServerMessage(unsigned lPlayer, void *pDataBuffer, int &nDataLength);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_GetServerInfo(unsigned lPlayer, int &Channel, int &StreamID, char *param);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_GetPlayingInfo(unsigned lPlayer, int&
CurrentFrame, int&
WaitingFrames);
}
#endif
将以上得vc转换成delphi
#define CLIENTTRANS_H
#define CLIHEADER_API __declspec(dllimport)
#ifdef VBCALL
#define MYSTDCALL _cdecl
#else
#define MYSTDCALL _stdcall
#endif
#define CLIENT_CONNECT 0X101 //Request the remote data
#define CLIENT_DISCONNECT 0X102 //Refuse the remote data
#define SERVER_OK 0x103 //connect ok
#define SERVER_REFUSED 0x104 //refused
#define USER_DATA 0x105 //user message
#define REQUEST_KEYFRAME 0x106 //client request key frame
#define E_RECVDATA 0x201 //recv data exception
#define E_PLAYER 0x202 //player exception
#define E_REFUSED 0x203 //server refuse connect
#define E_SRVCLOSED 0x204 //server is closed
#define E_SENDTHRED 0x205 //send data exception
#define E_RECORD 0x206 //write to file exception
enum DirectXMode{primarySurface,singleOverlay,multipleOverlay};
enum NetMode
{
broadcast=0,
multicast,
udp,
tcp,
dynamic,
rtp,
CustomCtrl
};
enum TKPLAYERTYPE
{
AVE1000_P,
AVE2000_P,
AVE3000_P,
AVE4000_P,
AVE5000_P,
AVE6000_P,
AVE7000_P,
AVE8000_P,
AVE9000_P,
AVENET=100,
AVENONE=200
};
typedef void (_stdcall *GetMPGData)(int idNo,char * data,int length,void * pUsrParam);
typedef void (_stdcall *ClientConnectedCallBack)(unsigned lPlayer, unsigned nChannel);
extern "C"
{
CLIHEADER_API int MYSTDCALL TKLNETCLIENT_CreatePlayer(TKPLAYERTYPE PlayerType, void * pParams);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_ReleasePlayer(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_Connect(
unsigned lPlayer,
char *strIPAddress,
unsigned nPort,
unsigned nChannel,
char *strUserName,
char *strUserPassword,
unsigned dwBufSize);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetConnectedCallBack(unsigned lPlayer, ClientConnectedCallBack ConnectedFunction);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetConnectWait(DWORD dwWaitTime, int nTrynum);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetTTL(unsigned lPlayer, unsigned char cTTLVal);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetVideoWindow(unsigned lPlayer, HWND hWnd, RECT* pRect = NULL);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetDisplayMode(unsigned PlayerId, DirectXMode mode, void *pParams);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_ThrownFrames(unsigned lPlayer, int nFrame);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_RefreshWindow(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetPostFilter(unsigned lPlayer, int nFilter);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_Play(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_Stop(unsigned lPlayer);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_EnableAudio(unsigned lPlayer, BOOL bEnable);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_SetVolume(unsigned lPlayer, unsigned lVolume);
CLIHEADER_API ULONG MYSTDCALL TKLNETCLIENT_GetVolume(unsigned lPlayer);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_EnableDataDriven(unsigned lPlayer, BOOL bEnable);
CLIHEADER_API DWORD MYSTDCALL TKLNETCLIENT_GetSdkVersion();
CLIHEADER_API int MYSTDCALL TKLNETCLIENT_GetPlayerStatus(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetErrorNotify(
unsigned lPlayer,
HWND hWnd,
unsigned nErrorMsgID,
HANDLE hEndEvent);
CLIHEADER_API int MYSTDCALL TKLNETCLIENT_GetLastError(unsigned lPlayer);
CLIHEADER_API char* MYSTDCALL TKLNETCLIENT_GetErrorString(int nErrno);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_Reset(unsigned lPlayer);
CLIHEADER_API DWORD MYSTDCALL TKLNETCLIENT_GetBMPSize(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_CaptureBitmap(unsigned lPlayer, char *strFilename, BYTE *pBitmap );
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_StartRecord(unsigned lPlayer, char *strFilename);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_StopRecord(unsigned lPlayer);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_SetDataArriveNotify(
unsigned lPlayer,
HWND hWnd,
unsigned nEndMsgID,
HANDLE hEndEvent);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_GetHeader(unsigned lPlayer, void *pheadBuffer, int &nheadLength);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_GetData(
unsigned lPlayer,
void *pDataBuffer,
int &nDataLength,
DWORD &nNumber,
int &nFrameType);
CLIHEADER_API BOOL MYSTDCALL TKLNETCLIENT_MessageToServer(unsigned lPlayer, void *pDataBuffer, int nDataLength);
CLIHEADER_API int MYSTDCALL TKLNETCLIENT_SetMessageNotify(unsigned lPlayer, HWND hWnd, unsigned nMsgID, HANDLE hEndEvent);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_GetServerMessage(unsigned lPlayer, void *pDataBuffer, int &nDataLength);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_GetServerInfo(unsigned lPlayer, int &Channel, int &StreamID, char *param);
CLIHEADER_API void MYSTDCALL TKLNETCLIENT_GetPlayingInfo(unsigned lPlayer, int&
CurrentFrame, int&
WaitingFrames);
}
#endif
将以上得vc转换成delphi