#pragma once

#define CALL_TYPE  __stdcall
#define SEEKFIT_API extern "C" __declspec(dllexport)
#pragma comment (lib, "By5000asiplay.lib")

#include "TypeDefine.h"

#define		SEEKFIT_CARD_TYPE_By5000ASIPLAY		0x5100
#define     SEEKFIT_CARD_TYPE_By5000ASIPROPLAY  0x5110

#define		By5000ASIPLAY_MODE_MEDIA_CG			0
#define		By5000ASIPLAY_MODE_MEDIA			1
#define		By5000ASIPLAY_MODE_CG				2

#define		By5000ASIPLAY_OPTION_CONTROL_RELAY		0x4000

#define		By5000ASIPLAY_SYNC_SOURCE_INTERNAL				0x80
#define		BY5000ASIPLAY_VIDEO_SOURCE_GENLOCK		        0x20//作为外同步输入源,不可以作为视频源,By5000asiPro才有外同步
#define		By5000ASIPLAY_VIDEO_SOURCE_CVBS				0
#define		By5000ASIPLAY_VIDEO_SOURCE_SVIDEO			1
#define		By5000ASIPLAY_VIDEO_SOURCE_YUV				2
#define		By5000ASIPLAY_VIDEO_SOURCE_ASI				5

#define		By5000ASIPLAY_AUDIO_SOURCE_RCA				1
#define		BY5000ASIPLAY_AUDIO_SOURCE_XLR				2//卡农，By5000AsiPro才有卡农输入
#define		By5000ASIPLAY_AUDIO_SOURCE_ASI				3

//继电器定义
#define	    BY5000ASIPLAY_RELAY_AUDIO_RCA					0//非平衡音频
#define	    BY5000ASIPLAY_RELAY_AUDIO_XLR					1//非平衡音频
#define	    BY5000ASIPLAY_RELAY_VIDEO_CVBS					10//CVBS
#define	    BY5000ASIPLAY_RELAY_VIDEO_ASI					11//ASI

//By5000II卡 需要调节两个通道来调整饱和度
#define		BY5000ASIPLAY_VIDEO_SATURATION_CB_ID			0
#define		BY5000ASIPLAY_VIDEO_SATURATION_CR_ID			1
////////////////////////////////////////////////////////////////////////////
// System Functions
////////////////////////////////////////////////////////////////////////////

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetTotalCardNumber(UINT & uiTotalCardNumber);

// By5000ASIplay card type No. : 0x2000
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetCardTypeNumber(UINT & uiCardTypeNo, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_OpenCard(UINT uiMode = By5000ASIPLAY_MODE_MEDIA_CG, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CloseCard(UINT uiCardNumber = 0);

// Restore board to factory status
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RestoreDefault(UINT uiCardNumber = 0);

// Events
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_InitialEndOfFilePlaybackEvent(LPCTSTR szEvent, HANDLE & hEvent, UINT uiCardNumber = 0);

// If szEvent is NULL, close all events
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CloseEndOfFilePlaybackEvent(HANDLE hEvent, UINT uiCardNumber = 0);

////////////////////////////////////////////////////////////////////////////
// Media Player Functions
////////////////////////////////////////////////////////////////////////////

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_EnableMediaFilePlayback(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_DisableMediaFilePlayback(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaEnableWindowRatioAutoAdjust(UINT uiCardNumber);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaDisableWindowRatioAutoAdjust(UINT uiCardNumber);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetAnalyzedMediaFileInformation(LPCTSTR szFileName, UINT uiAnalyzeLevel, BOOL & bError,
																   MEDIA_FILE_INFORMATION & mfiFileInformation, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextOpen(LPCTSTR szFileName, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSeek(ULONG ulInTime, ULONG ulOutTime, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextPeek(ULONG & ulInTime, ULONG & ulOutTime, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSetRate(DOUBLE dRate, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaEnableAutoSwitch(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaDisableAutoSwitch(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSwitch(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaPlay(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaPause(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaStop(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaEnableFirstFramePause(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaDisableFirstFramePause(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSeek(ULONG ulInTime, ULONG ulOutTime, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaPeek(ULONG & ulInTime, ULONG & ulOutTime, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetRate(DOUBLE dRate, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaGetStatus(UINT & uiStatus, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextGetStatus(UINT & uiStatus, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaEnablePlaybackDve(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaDisablePlaybackDve(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetBackgroundPicture(PULONG pulBuffer, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetDveSourceWindow(UINT uiXStart, UINT uiYStart, UINT uiWidth, UINT uiHeight, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetDveDestWindow(UINT uiXStart, UINT uiYStart, UINT uiWidth, UINT uiHeight, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSetDveSourceWindow(UINT uiXStart, UINT uiYStart, UINT uiWidth, UINT uiHeight, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSetDveDestWindow(UINT uiXStart, UINT uiYStart, UINT uiWidth, UINT uiHeight, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetAudioVolumn(UINT uiAudioVolumn, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetAudioChannel(UINT uiAudioChannel, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSetAudioVolumn(UINT uiAudioVolumn, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSetAudioChannel(UINT uiAudioChannel, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaEnableAudioMute(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaDisableAudioMute(UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaEnableAudioVolumnAutoAdjust(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaDisableAudioVolumnAutoAdjust(UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetDvdAudioIndex(UINT uiIndex, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetDvdSubPictureIndex(UINT uiIndex, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSetDvdAudioIndex(UINT uiIndex, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSetDvdSubPictureIndex(UINT uiIndex, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaGetTimeCode(ULONG & ulTime, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaGetFileInformation(MEDIA_FILE_INFORMATION & mfiFileInformation, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextGetFileInformation(MEDIA_FILE_INFORMATION & mfiFileInformation, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetMosaicRectangles(MOSAIC_RECTANGLE * pMosaicRectangle, UINT uiMosaicRectNumber, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetVolumnShowBarMode(UINT uiVolumnChannel, UINT uiShowMode, HWND hWindow, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaNextSetDemultiplexerNumber(UINT uiNumber, UINT uiCardNumber);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetBrightness(UINT uiBrightness, UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetContrast(UINT uiContrast, UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetHue(UINT uiHue, UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetSaturation(UINT uiSaturation, UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaSetDVDSubEnable(BOOL bDvdsub, UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_MediaGetAudioPlaybackVolumn(UINT &uiLeftVolumn,UINT &uiRightVolumn,UINT uiCardNumber =0);

////////////////////////////////////////////////////////////////////////////
// Capture Functions
////////////////////////////////////////////////////////////////////////////

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_EnableCapturedStreamPlayback(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_DisableCapturedStreamPlayback(UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamEnableDelay(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamDisableDelay(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetDelayTime(UINT uiSecond, UINT uiFrame, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamEnablePlaybackDve(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamDisablePlaybackDve(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetDveSourceWindow(UINT uiXStart, UINT uiYStart, UINT uiWidth, UINT uiHeight, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetDveDestWindow(UINT uiXStart, UINT uiYStart, UINT uiWidth, UINT uiHeight, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetAudioVolumn(UINT uiAudioVolumn, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetAudioChannel(UINT uiAudioChannel, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamEnableAudioMute(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamDisableAudioMute(UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamEnableAudioVolumnAutoAdjust(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamDisableAudioVolumnAutoAdjust(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetVolumnShowBarMode(UINT uiVolumnChannel, UINT uiShowMode, HWND hWindow, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetVideoBufferNumber(UINT uiBufferNum, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamGetVideoBufferNumber(UINT& uiBufferNum, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetAudioBufferNumber(UINT uiBufferNum, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamGetAudioBufferNumber(UINT& uiBufferNum, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamSetVideoMattingParam(VIDEO_MATTING_PARAM* pVideoMattingParam, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamEnableVideoMatting(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CapturedStreamDisableVideoMatting(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CaptureStreamGetAudioVolumn(UINT &uiLeftVolumn,UINT &uiRightVolumn,UINT uiCardNumber =0);


////////////////////////////////////////////////////////////////////////////
// Character Generator Functions
////////////////////////////////////////////////////////////////////////////
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_EnableCgOverlay(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_DisableCgOverlay(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CgGetBufferAddress(PVOID & pCgBufferAddress, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CgClearScreen(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CgSetOverlayMode(UINT uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CgGetOverlayMode(UINT & uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CgGetRectangle(UINT uiX, UINT uiY, UINT uiWidth, UINT uiHeight, PULONG pulValue, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CgSetRectangle(UINT uiX, UINT uiY, UINT uiWidth, UINT uiHeight, PULONG pulValue, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CgUpdateOneFrame(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_CgUpdateOneField(UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_EnableCGUpdateField(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_DisableCGUpdateField(UINT uiCardNumber = 0);
////////////////////////////////////////////////////////////////////////////
// Preview Windows Functions
//
// uiWindowNumber - 0 : Video output preview window, same as TV's display, enabled default
// uiWindowNumber - 1 : Video input preview window, disabled default
//
////////////////////////////////////////////////////////////////////////////
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_EnableVideoPreviewWindow(UINT uiWindowNumber, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_DisableVideoPreviewWindow(UINT uiWindowNumber, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_VideoPreviewWindowSet(UINT uiWindowNumber, HWND hWindow, 
														 UINT uiXOffset, UINT uiYOffset, UINT uiWidth, UINT uiHeight, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_EnableShowSafeMargins(UINT uiCardNumber);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_DisableShowSafeMargins(UINT uiCardNumber);

////////////////////////////////////////////////////////////////////////////
// Card Configuration Functions
////////////////////////////////////////////////////////////////////////////

// Relay Control
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoRelayMode(UINT uiRelayNumber,UINT uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoRelayMode(UINT uiRelayNumber,UINT & uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetAudioRelayMode(UINT uiRelayNumber,UINT uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetAudioRelayMode(UINT uiRelayNumber,UINT & uiMode, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoInputStatus(UINT & uiStatus, UINT uiCardNumber = 0);

// 0: NTSC
// 1: PAL
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoMode(UINT & uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoMode(UINT uiMode, UINT uiCardNumber = 0);

// blacklevel = 1: 7.5 IRE
// blacklevel = 0: 0.0 IRE
// Set black level. It is useful for NTSC video
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoBlackLevel(UINT uiBlackLevel, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoBlackLevel(UINT & uiBlackLevel, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetSyncSource(UINT & uiSource, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetSyncSource(UINT uiSource, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoSource(UINT & uiSource, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoSource(UINT uiSource, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetAudioSource(UINT & uiSource, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetAudioSource(UINT uiSource, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoInputLockMode(UINT & uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoInputLockMode(UINT uiMode, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoInputContrast(UINT & uiContrast, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoInputContrast(UINT uiContrast, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoInputBrightness(UINT & uiBrightness, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoInputBrightness(UINT uiBrightness, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoInputHue(UINT & uiHue, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoInputHue(UINT uiHue, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoInputSaturation(UINT & uiSaturation, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoInputSaturation(UINT uiSaturation, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoOverlayMode(UINT uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetAudioPlayBackMode(UINT uiMode, UINT uiSource, UINT uiCardNumber = 0);
//BY5000II 饱和度调整使用下面接口
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetVideoInputSubSaturation(UINT & uiSaturation, UINT uiSubId, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetVideoInputSubSaturation(UINT uiSaturation, UINT uiSubId, UINT uiCardNumber = 0);

// addr range is from 0x00 to 0x2f
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_VerifyUserData(UINT uiAddr, UINT uiLength, UCHAR * pucData, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetUserData(UINT uiAddr, UCHAR ucData, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Test(UINT * puiPara, UINT uiParaNumber, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetSerialNumber(ULONG & ulSerialNumber, UINT uiCardNumber = 0);
// Version Function
// Board version {BOARD_VERSION_MAJOR(16bits), BOARD_VERSION_MINOR(16bits)}
// FPGA design version {FPGA_VERSION_MAJOR(16bits), FPGA_VERSION_MINOR(16bits)}
// Board version	{	0x00,
//									BOARD_VERSION_MAJOR(8bits),
//									BOARD_VERSION_MINOR(8bits),
//									BOARD_VERSION_REVISION(8bits)
//								}
// FPGA version		{	0x00,
//									FPGA_VERSION_MAJOR(8bits),
//									FPGA_VERSION_MINOR(8bits),
//									FPGA_VERSION_REVISION(8bits)
//								}
// Driver version	{	0x00,
//									DRIVER_VERSION_MAJOR(8bits),
//									DRIVER_VERSION_MINOR(8bits),
//									DRIVER_VERSION_REVISION(8bits)
//								}
// SDK version		{	0x00,
//									SDK_VERSION_MAJOR(8bits),
//									SDK_VERSION_MINOR(8bits),
//									SDK_VERSION_REVISION(8bits)
//								}
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetBoardVersion(UINT * puiBuffer, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetFPGAVersion(UINT * puiBuffer, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetDriverVersion(UINT * puiBuffer, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetSdkVersion(UINT * puiBuffer);



/////////////////////////////////////
//									
//		EFFECT Functions	
//
//////////////////////////////////////
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_VideoStreamSetTransformEffect(UINT uiEffect, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_VideoStreamSetTransformMode(UINT uiMode, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_VideoStreamSetTransformEffectDuration(INT nDuration, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_VideoStreamTriggerTransform(UINT uiCardNumber = 0);

extern struct MediaFrame;

/////////////////////////////////////
//									
//		Recorder Functions	
//
//////////////////////////////////////
extern struct MediaFrame;
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderGetOneAudioFrame(MediaFrame & mfFrame, UINT uiSize,UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderGetOneVideoFrame(MediaFrame & mfFrame, UINT uiSize,UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderOpen(UINT uiRecordSource, RECORDER_PROGRAM_INFO rplProgramInfo, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderConfig(UINT uiRecordSource,RECORDER_PROGRAM_INFO rplProgramInfo, LPVOID lpParam, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderStart(UINT uiRecordSource, RECORDER_PROGRAM_INFO rplProgramInfo, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderStop(UINT uiRecordSource, RECORDER_PROGRAM_INFO rplProgramInfo, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderCgEnable(BOOL bEnable, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderPlaybackFrameToFile(LPCTSTR szFileName, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderGetCurrentFileLength(UINT uiRecordSource, RECORDER_PROGRAM_INFO rplProgramInfo,MEDIA_TIME_CODE& mtcTime, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetDirectShowTimer(LONGLONG & rtTimer, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Render0GetVideoFrameBuffer(MediaFrame & mfFrame, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Render1GetVideoFrameBuffer(MediaFrame & mfFrame, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Render0RenderOneVideoFrame(MediaFrame mfFrame, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Render1RenderOneVideoFrame(MediaFrame mfFrame, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Render0GetAudioFrameBuffer(MediaFrame & mfFrame, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Render1GetAudioFrameBuffer(MediaFrame & mfFrame, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Render0RenderOneAudioFrame(MediaFrame mfFrame, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_Render1RenderOneAudioFrame(MediaFrame mfFrame, UINT uiCardNumber = 0);

//SEEKFIT_API BOOL CALL_TYPE Seekfit_VerifyCard(UINT uiCardNumber = 0);
/*
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetCardRandomData(ULONG & ulRandomData, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_ValidateCard(ULONG ulEncryptResult, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_ValidateSoftware(ULONG ulRandomData, ULONG & ulEncryptResult, UINT uiCardNumber = 0);
*/
/////////////////////////////////////
//									
//		TransportStream Functions	
//
//////////////////////////////////////
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsCaptureEnable(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsCaptureDisable(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsCaptureGetFillBufferNum(UINT &uiBufferNum,UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsCaptureReadPacketsFromBuffer(PULONG pulBuffer, UINT uiPacketsNumber,UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsCaptureGetProgramInformation(TS_PROGRAM_INFO& tpiProgramInfo, INT& nStatus, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsCaptureSetFilteredProgram(int iFilteredProgramNum, TS_DEL_INFO* uiFilteredProgramList, UINT uiCardNumber = 0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsPlaybackEnable(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsPlaybackDisable(UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsPlaybackEncoderConfig(LPVOID lpParam, UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsPlaybackSwitchStreamMonitor(BOOL bSwitch/*0:off,1:on*/, UINT uiCardNumber = 0);

///------------------------------------------------------ASI
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RenderAsiCaptureGetVideoFrameBuffer(MediaFrame& mfFrame,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RenderAsiCaptureRenderOneVideoFrame(MediaFrame  mfFrame,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RenderAsiCaptureGetAudioFrameBuffer(MediaFrame&  mfFrame,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RenderAsiCaptureRenderOneAudioFrame(MediaFrame  mfFrame,UINT uiCardNumber=0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsSelectProgram(UINT id, UINT uiCardNumber);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderGetTsTransformStatus(UINT uiRecordSource,RECORDER_PROGRAM_INFO rplProgramInfo,TSTOPS_ETR_290_ERROR &ttStatus,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsSetBoardPacketLengh(UINT uiPacketLenghMode,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsGetBoardPacketLengh(UINT& uiPacketLenghMode,UINT uiCardNumber=0);
//////////////////////////////////////////////////////////////////////////
//     TS NIT  2012.2.29
//////////////////////////////////////////////////////////////////////////
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetTransportInformation(NIT_NETWORKINFO &TsInfo,INT &nStatus,UINT uiCardNumber=0);
//SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RequerySetTunerStatus(UINT uiTunerId,TunerStatus *tTunerStatus,UINT uiCardNumber=0);
//SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_ConnnectTuner(char* _IPAddr,UINT uiCardNumber=0);
//SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_ReleseConnectTuner(UINT uiCardNumber=0);
//SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetDescrProgsInfo(UINT uiTunerId,DescrambleModProgs *_DescrambleModProgs,UINT uiCardNumber=0);
//SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetDescrProgsInfo(UINT uiTunerId,DescrambleModProgs *_DescrambleModProgs,bool bScanFlag,UINT uiCardNumber=0);
//SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetTunerParam(UINT uiTunerId,TunerParams *tunerPaams,UINT uiCardNumber=0);
//////////////////////////////////////////////////////////////////////////
//     板卡验证接口  2012.6.5
//////////////////////////////////////////////////////////////////////////

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_GetCardRandomData(ULONG & ulRandomData,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_ValidateCard(ULONG ulEncryptResult,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_ValidateSoftware(ULONG ulRandomData, ULONG & ulEncryptResult,UINT uiCardNumber=0);

//////////////////////////////////////////////////////////////////////////
//      ts流录制
//////////////////////////////////////////////////////////////////////////
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderStartWriteTsFile(LPCTSTR strFileName,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_RecorderStopWriteTsFile(UINT uiCardNumber=0);
//////////////////////////////////////////////////////////////////////////
//         IP采集接口
//////////////////////////////////////////////////////////////////////////
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_UdpReceiveStop(UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_UdpReceiveRun(UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetReceiveParameter(TS_OVER_IP_MULTICAST_PARAM TsOverIpParam,UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_TsSetInputSource(UINT uiSource,UINT uiCardNumber=0);

//////////////////////////////////////////////////////////////////////////
//         IP发送接口
//////////////////////////////////////////////////////////////////////////
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_UdpSendStop(UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_UdpSendRun(UINT uiCardNumber=0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetSendParameter(TS_OVER_IP_MULTICAST_PARAM TsOverIpParam,UINT uiCardNumber=0);

SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetWriteFlag(BOOL bWriteFlag,UINT uiCardNumber = 0);
SEEKFIT_API BOOL CALL_TYPE Seekfit_By5000asiplay_SetWriteLogFileName(LPCTSTR strName,UINT uiCardNumber =0);