⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hikvisionsdk.h

📁 QEMU是一套由Fabrice Bellard所编写的模拟操作系统的自由软件。它与Bochs
💻 H
📖 第 1 页 / 共 2 页
字号:
///////////////////////////////////////////////////////////////////////////
// HIKVISION DS-40xxHC/HF BOARD SYSTEM SDK								 //	
// Copyright (c) 2002-2008 Hangzhou Hikvision digtial technology co,. ltd//
/////////////////////////////////////////////////////////////////////////// 

#ifndef HIKVISION_SDK_H
#define HIKVISION_SDK_H

#include "datatype.h"

#define DLLEXPORT_API  extern "C"__declspec(dllexport) 
#define ERR_WAIT_TIMEOUT					0xc0000001
#define ERR_INVALID_HANDLE					0xc0000002
#define ERR_INVALID_ARGUMENT				0xc0000003
#define ERR_DDRAW_CREATE_FAILED				0xc0000004
#define ERR_DDRAW_CAPS_FAULT				0xc0000005
#define ERR_SET_COOPERATIVELEVEL_FAILED		0xc0000006
#define ERR_PRIMARY_SURFACE_CREATE_FAILED	0xc0000007
#define ERR_GET_OVERLAY_ADDRESS_FAILED		0xc0000008
#define ERR_OVERLAY_SURFACE_CREATE_FAILED	0xc0000009
#define ERR_OVERLAY_UPDATE_FAILED			0xc000000a
#define ERR_TMMAN_FAILURE					0xc000000b
#define ERR_CHANNELMAGIC_MISMATCH			0xc000000c
#define ERR_CALLBACK_REGISTERED				0xc000000d
#define ERR_QUEUE_OVERFLOW					0xc000000e
#define ERR_STREAM_THREAD_FAILURE			0xc000000f
#define ERR_THREAD_STOP_ERROR				0xc0000010
#define ERR_NOT_SUPPORT						0xc0000011
#define ERR_OUTOF_MEMORY					0xc0000012
#define ERR_DSP_BUSY						0xc0000013
#define ERR_DATA_ERROR						0xc0000014
#define ERR_KERNEL							0xc0000016
#define ERR_OFFSCREEN_CREATE_FAILED			0xc0000017
#define ERR_MULTICLOCK_FAILURE				0xc0000018
#define ERR_INVALID_DEVICE					0xc0000019
#define ERR_INVALID_DRIVER					0xc000001a
//error code for MD card
#define HWERR_SUCCESS							0
#define HWERR_ALLOCATE_MEMORY					0xc1000001
#define HWERR_INVALID_HANDLE					0xc1000002
#define HWERR_DDRAW_CREATE_FAILED				0xc1000003
#define HWERR_DDRAW_CAPS_FAULT					0xc1000004
#define HWERR_SET_COOPERATIVELEVEL_FAILED		0xc1000005
#define HWERR_PRIMARY_SURFACE_CREATE_FAILED		0xc1000006
#define HWERR_OVERLAY_CREATE_FAILED				0xc1000007
#define HWERR_GET_OVERLAY_ADDRESS_FAILED		0xc1000008
#define HWERR_OVERLAY_UPDATE_FAILED				0xc1000009
#define HWERR_SURFACE_NULL						0xc100000a
#define HWERR_FILEHEADER_UNKNOWN				0xc100000b
#define HWERR_CREATE_FILE_FAILED				0xc100000c
#define HWERR_FILE_SIZE_ZERO					0xc100000d
#define HWERR_FILE_SIZE_INVALID					0xc100000d
#define HWERR_CREATE_OBJ_FAILED					0xc100000e
#define HWERR_CHANNELMAGIC_MISMATCH				0xc100000f
#define HWERR_PARA_OVER							0xc1000010
#define HWERR_ORDER								0xc1000011
#define HWERR_COMMAND							0xc1000012
#define HWERR_UNSUPPORTED						0xc1000013
#define HWERR_DSPOPEN							0xc1000014
#define HWERR_DSPLOAD							0xc1000015
#define HWERR_ALLOCATE_DSPMEMORY				0xc1000016
#define HWERR_DSPCHECHER						0xc1000017
#define HWERR_IMGFILE_UNKNOWN					0xc1000018
#define HWERR_INVALID_FILE						0xc1000019
//standart
#define HW_PAL									2
#define HW_NTSC									1
//jump direction
#define HW_JUMP_FORWARD							309 
#define HW_JUMP_BACKWARD						310


typedef enum  {
   vdfRGB8A_233              = 0x00000001,
   vdfRGB8R_332              = 0x00000002,
   vdfRGB15Alpha             = 0x00000004,
   vdfRGB16                  = 0x00000008,
   vdfRGB24                  = 0x00000010,
   vdfRGB24Alpha             = 0x00000020,
   
   vdfYUV420Planar           = 0x00000040,
   vdfYUV422Planar           = 0x00000080,
   vdfYUV411Planar           = 0x00000100,
   vdfYUV420Interspersed     = 0x00000200,
   vdfYUV422Interspersed     = 0x00000400,
   vdfYUV411Interspersed     = 0x00000800,
   vdfYUV422Sequence         = 0x00001000,   /* U0, Y0, V0, Y1:  For VO overlay */
   vdfYUV422SequenceAlpha    = 0x00002000,   
   /* U0, Y0, V0, Y1:  For VO overlay, with low bit for alpha blending */
   vdfMono                   = 0x00004000,  /* 8 bit monochrome */

   vdfYUV444Planar           = 0x00008000,
}TypeVideoFormat;


typedef enum {
	brCBR = 0,
	brVBR = 1,
}BitrateControlType_t;
typedef enum {
	DS400XM 			=0,		//M卡
	DS400XH				=1,		//H卡
	DS4004HC			=2,		//4004HC
	DS4008HC			=3,		//4008HC
	DS4016HC			=4,		//4016HC
	DS4001HF			=5,		//4001HF
	DS4004HF			=6,		//4004HF
	DS4002MD			=7,		//4002MD
	DS4004MD			=8,		//4004MD
	DS4016HCS			=9,		//4016HCS
	DS4002HT			=10,	//4002HT
	DS4004HT			=11,	//4004HT
	DS4008HT			=12,	//4008HT
	DS4004HC_PLUS		=13,	//4004HC+
	DS4008HC_PLUS		=14,	//4008HC+
	DS4016HC_PLUS		=15,	//4016HC+
	DS4008HF			=16,	//4008HF
	DS4008MD			=17,	//4008MD
	DS4008HS			=18,	//4008HS
	DS4016HS			=19,	//4016HS
	INVALID_BOARD_TYPE	=0xffffffff,
}BOARD_TYPE_DS;

#define STREAM_TYPE_VIDEO	1
#define STREAM_TYPE_AUDIO	2
#define STREAM_TYPE_AVSYNC	3
#define DRAWFUN(x)				void  (CALLBACK* x)(long nPort,HDC hDc,LONG nUser)


typedef void (*LOGRECORD_CALLBACK)(char *str, void *context);
typedef int (*STREAM_READ_CALLBACK)(ULONG channelNumber, void *context);
typedef int (*STREAM_DIRECT_READ_CALLBACK)(ULONG channelNumber,void *DataBuf,DWORD Length,int FrameType,void *context);

typedef struct tagChannelCapability{
	UCHAR bAudioPreview;
	UCHAR bAlarmIO;
	UCHAR bWatchDog;
}CHANNEL_CAPABILITY, *PCHANNEL_CAPABILITY;

typedef struct tagFramsStatistics{
	ULONG VideoFrames;
	ULONG AudioFrames;
	ULONG FramesLost;
	ULONG QueueOverflow;
	ULONG CurBps;
}FRAMES_STATISTICS, *PFRAMES_STATISTICS;

DLLEXPORT_API int __stdcall InitDSPs();
DLLEXPORT_API int __stdcall DeInitDSPs();
DLLEXPORT_API HANDLE __stdcall ChannelOpen(int ChannelNum);
DLLEXPORT_API int __stdcall ChannelClose(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall GetTotalChannels();
DLLEXPORT_API int __stdcall GetTotalDSPs();
DLLEXPORT_API int __stdcall StartVideoPreview(HANDLE hChannelHandle,HWND WndHandle, RECT *rect, BOOLEAN bOverlay, int VideoFormat, int FrameRate);
DLLEXPORT_API int __stdcall StopVideoPreview(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall SetVideoPara(HANDLE hChannelHandle, int Brightness, int Contrast, int Saturation, int Hue);
DLLEXPORT_API int __stdcall GetVideoPara(HANDLE hChannelHandle, VideoStandard_t *VideoStandard, int *Brightness, int *Contrast, int *Saturation, int *Hue);
DLLEXPORT_API int __stdcall GetVideoSignal(HANDLE  hChannelHandle);
DLLEXPORT_API int __stdcall GetSDKVersion(PVERSION_INFO VersionInfo);
DLLEXPORT_API int __stdcall GetCapability(HANDLE hChannelHandle, CHANNEL_CAPABILITY *Capability);
DLLEXPORT_API int __stdcall GetLastErrorNum(HANDLE hChannelHandle, ULONG *DspError, ULONG *SdkError);
DLLEXPORT_API int __stdcall SetStreamType(HANDLE hChannelHandle, USHORT Type);
DLLEXPORT_API int __stdcall GetStreamType(HANDLE hChannelHandle, USHORT *StreamType);
DLLEXPORT_API int __stdcall GetFramesStatistics(HANDLE hChannelHandle, 	PFRAMES_STATISTICS framesStatistics);
DLLEXPORT_API int __stdcall StartMotionDetection(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall GetBoardInfo(HANDLE hChannelHandle, ULONG *BoardType, UCHAR *SerialNo);
DLLEXPORT_API int __stdcall StopMotionDetection(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall GetOriginalImage(HANDLE hChannelHandle, UCHAR *ImageBuf, ULONG *Size);
DLLEXPORT_API int __stdcall RegisterLogRecordCallback(LOGRECORD_CALLBACK LogRecordFunc, void *Context);
DLLEXPORT_API int __stdcall SetAudioPreview(HANDLE hChannelHandle, BOOL bEnable);
DLLEXPORT_API int __stdcall ReadStreamData(HANDLE hChannelHandle, void *DataBuf, DWORD *Length, int *FrameType);
DLLEXPORT_API int __stdcall RegisterMessageNotifyHandle(HWND hWnd, UINT MessageId);
DLLEXPORT_API int __stdcall StartVideoCapture(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall StopVideoCapture(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall SetIBPMode(HANDLE hChannelHandle, int KeyFrameIntervals, int BFrames, int PFrames, int FrameRate);
DLLEXPORT_API int __stdcall SetDefaultQuant(HANDLE hChannelHandle, int IQuantVal, int PQuantVal, int BQuantVal);
DLLEXPORT_API int __stdcall SetOsd(HANDLE hChannelHandle, BOOL Enable);

DLLEXPORT_API int __stdcall SetLogo(HANDLE hChannelHandle, int x, int y, int w, int h, unsigned char *yuv);
DLLEXPORT_API int __stdcall StopLogo(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall SetupMotionDetection(HANDLE hChannelHandle, RECT *RectList, int iAreas);
DLLEXPORT_API int __stdcall MotionAnalyzer(HANDLE hChannelHandle, char *MotionData, int iThreshold, int *iResult);
DLLEXPORT_API int __stdcall LoadYUVFromBmpFile(char *FileName, unsigned char *yuv, int BufLen, int *Width, int *Height);
DLLEXPORT_API int __stdcall SaveYUVToBmpFile(char *FileName, unsigned char *yuv, int Width, int Height);
DLLEXPORT_API int __stdcall CaptureIFrame(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall RegisterStreamReadCallback(STREAM_READ_CALLBACK StreamReadCallback, void *Context);
DLLEXPORT_API int __stdcall AdjustMotionDetectPrecision(HANDLE hChannelHandle, 
										   int iGrade, int iFastMotionDetectFps, 
										   int iSlowMotionDetectFps);
DLLEXPORT_API int __stdcall SetupBitrateControl(HANDLE hChannelHandle, ULONG MaxBps);
DLLEXPORT_API int __stdcall SetOverlayColorKey(COLORREF DestColorKey);
DLLEXPORT_API int __stdcall SetOsdDisplayMode(HANDLE hChannelHandle, int Brightness, BOOL Translucent, int parameter, USHORT *Format1, USHORT *Format2);
DLLEXPORT_API int __stdcall SetLogoDisplayMode(HANDLE hChannelHandle, COLORREF ColorKey, BOOL Translucent, int TwinkleInterval);
DLLEXPORT_API int __stdcall SetEncoderPictureFormat(HANDLE hChannelHandle, PictureFormat_t PictureFormat);
DLLEXPORT_API int __stdcall SetVideoStandard(HANDLE hChannelHandle, VideoStandard_t VideoStandard);
DLLEXPORT_API int __stdcall RestoreOverlay();
DLLEXPORT_API int __stdcall ResetDSP(int DspNumber);
DLLEXPORT_API int __stdcall GetSoundLevel(HANDLE hChannelHandle);


DLLEXPORT_API int __stdcall SetBitrateControlMode(HANDLE hChannelHandle, BitrateControlType_t brc);
DLLEXPORT_API int __stdcall SetupNotifyThreshold(HANDLE hChannelHandle, int iFramesThreshold);

DLLEXPORT_API int __stdcall SetupSubChannel(HANDLE hChannelHandle, int iSubChannel);
DLLEXPORT_API int __stdcall GetSubChannelStreamType(void  *DataBuf, int FrameType);
//add for HC/HF 
DLLEXPORT_API int __stdcall RegisterStreamDirectReadCallback(STREAM_DIRECT_READ_CALLBACK StreamDirectReadCallback,void *Context);
DLLEXPORT_API int __stdcall RegisterDrawFun(DWORD nport, DRAWFUN(DrawFun),LONG nUser);
DLLEXPORT_API int __stdcall SetupMask(HANDLE hChannelHandle, RECT *RectList, int iAreas);
DLLEXPORT_API int __stdcall StopMask(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall SetSubEncoderPictureFormat(HANDLE hChannelHandle, PictureFormat_t PictureFormat);
DLLEXPORT_API int __stdcall StartSubVideoCapture(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall StopSubVideoCapture(HANDLE hChannelHandle);
DLLEXPORT_API int __stdcall SetupDateTime(HANDLE hChannelHandle, SYSTEMTIME *now);
//原始图像流设置
typedef void (*IMAGE_STREAM_CALLBACK)(UINT channelNumber,void *context);
DLLEXPORT_API int __stdcall SetImageStream(HANDLE hChannel,BOOL bStart,UINT fps,UINT width,UINT height,unsigned char *imageBuffer);
DLLEXPORT_API int __stdcall RegisterImageStreamCallback(IMAGE_STREAM_CALLBACK ImageStreamCallback,void *context);
/*

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -