#ifndef _DVRS_HW_SDK_H_
#define _DVRS_HW_SDK_H_

#ifndef  DVRS_HW_EXPORT
#define HW_API __declspec(dllexport)
#endif DVRS_HW_EXPORT

#define MAX_VIDEO_CHANNEL 64
#define MAX_VIDEO_RESSIZE 64
typedef struct tagRes
{
	int width;  // w
	int height;  // h
	int fps;
}VideoRes, *LPVideoRes;

typedef struct {
	//-------------------
	int m_Max_Video_Channels;
	int m_Max_Audio_Channels;
	int m_VideoIndex[MAX_VIDEO_CHANNEL];
	int m_AudioIndex[MAX_VIDEO_CHANNEL];
	int m_VideoResIndex[MAX_VIDEO_CHANNEL];
	char m_VideoName[MAX_VIDEO_CHANNEL][MAX_PATH]; 
	char m_AudioName[MAX_VIDEO_CHANNEL][MAX_PATH]; 
	VideoRes m_VideoRes[MAX_VIDEO_CHANNEL][MAX_VIDEO_RESSIZE];
	int m_Max_ResSize[MAX_VIDEO_CHANNEL];
	int m_Slider_BR[MAX_VIDEO_CHANNEL];
	int m_Slider_CO[MAX_VIDEO_CHANNEL];
	int m_Slider_SA[MAX_VIDEO_CHANNEL];
	int m_Slider_HU[MAX_VIDEO_CHANNEL];
	int m_Slider_SH[MAX_VIDEO_CHANNEL];

}Video_Parame;

# ifdef __cplusplus
extern "C"
{
# endif 
typedef int (*RAWSTREAM_DIRECT_CALLBACK)(ULONG channelNumber,void *DataBuf,int FrameType,int width,int height,void *context);
typedef int (*RAWAUDIO_DIRECT_CALLBACK)(ULONG channelNumber,void *DataBuf,int FrameType,int size,void *context);
typedef int (*VIDEOSTATUS_CALLBACK)(ULONG channelNumber,int FrameType,void *context);
HW_API  int __stdcall InitHwDSPs();
HW_API  int __stdcall DeInitHwDSPs();
HW_API  int __stdcall GetVideoTotalChannels();
HW_API  int __stdcall GetAudioTotalChannels();
HW_API  int __stdcall GetCurrSystemDevice();
HW_API  int __stdcall GetVideoNameByIndex(int videoIndex,char *strname);
HW_API  int __stdcall GetAudioNameByIndex(int audioIndex,char *strname);
HW_API  int __stdcall GetVideoMaxResIndex(int videoIndex );
HW_API  int __stdcall GetVideoMaxResSizeByIndex(int videoIndex,int resIndex,int *width,int *height,int *fps);
HW_API  int __stdcall GetVideoMaxResWidthByIndex(int videoIndex,int index);
HW_API  int __stdcall GetVideoMaxResHeightByIndex(int videoIndex,int index);
HW_API  int __stdcall GetVideoMaxResFpsByIndex(int videoIndex,int index);
HW_API  int __stdcall VideoChannelOpen(int nChannel,int videoIndex,int w,int h,int fps);
HW_API  int __stdcall StartVideoPreview(int nChannel,HWND WndHandle, RECT *rect);
HW_API  int __stdcall StopVideoCapture(int nChannel);
HW_API  int __stdcall RegisterRAWDirectCallback(int nChannel,RAWSTREAM_DIRECT_CALLBACK  RawStreamDirectReadCallback, void* Context);
HW_API  int __stdcall RegisterVideoStatusCallback(int nChannel,VIDEOSTATUS_CALLBACK  VideoStatusCallback, void* Context);
HW_API  int __stdcall SaveCaptureImage(int index,char *path);
HW_API  void __stdcall ChangeYUVToRGB(BYTE *yuvdata,BYTE *rgbdata,int width,int height);
HW_API  void __stdcall ChangeYUVToGrayRGB(BYTE *yuvdata,BYTE *rgbdata,int width,int height);
HW_API  void __stdcall SetMax_VideoSize(int width,int height);
HW_API  int __stdcall OpenVideoColorSetting(int hChannel);
HW_API  int __stdcall SetVideoPara(int nChannel,int Brightness, int Contrast, int Saturation, int Hue);
//---Audio
HW_API  int __stdcall StopAudioCapture(int nChannel);
HW_API  int __stdcall AudioChannelOpen(int nChannel,int audioIndex,int buffsize);
HW_API  int __stdcall RegisterAudioDirectCallback(int nChannel,RAWAUDIO_DIRECT_CALLBACK  RawAudioDirectReadCallback, void* Context);
;
HW_API  int __stdcall AudioOutOpen(int nChannel,HWND WndHandle);
HW_API  int __stdcall AudioOutPlay(int nChannel);
HW_API  int __stdcall AudioOutPause(int nChannel);
# ifdef __cplusplus
}
# endif
#endif