📄 hikclient32.pas
字号:
{*******************************************************}
{ }
{ 海康威视(DS4XXXHC) SDK-2 集成开发包 }
{ 客户端 Ver 9.0 }
{ 版权所有 (C) 2007 EMAIL:366733082@163.com }
{ }
{*******************************************************}
unit HikClient32;
interface
uses
Windows, SysUtils, MMSystem, Classes;
type
//工作状态回调(通道号;回调号;返回字符)
TCallBackFunc = procedure
(
Channels: Byte; //通道索引号
War_Style: Byte; //返回值索引
ReturnStr: string = '' //从SDK2返回的字符
); stdcall;
//多媒体设备类型
TDeviceName =
(
Master, //主音量
Microphone, //话筒音量
WaveOut, //波形输出
Synth //综合
);
//硬件信息
THardFlag = record
BiosInfo: PChar; //BIOS信息
BIOSName: PChar; //BIOS名称
BIOSCopyright: PChar; //BIOS版权
BIOSExtendedInfo: PChar; //BIOS扩展信息
BIOSDate: TDateTime; //BIOS日期
IDEDiskSerial: PChar; //IDE硬盘序列号
IDEDiskType: PChar; //IDE硬盘型号
IDEDiskVersion: PChar; //IDE硬盘硬件版本
IDEDiskTotalAddressableSectors: ULong; //扇区总数
IDEDiskSectorCapacity: ULong; //扇区容量
IDEDiskSectorsPerTrack: Word; //每扇区磁道数
IDEDiskCSerial: PChar; //C盘序列号
CPUSerial: PChar; //CPU序列号
CPUSpeed: PChar; //CPU频率
MACAddress: PChar; //网址地址
DisplayFrequency: Byte; //显示器当前刷新率
DisplayDevice: PChar; //显卡类型
TotalPhysMemory: DWORD; //物理内存总量
AvailPhysMemory: DWORD; //可用物理内存
TotalPageFileMemory: DWORD; //对换区总量
AvailPageFileMemory: DWORD; //可用的对换区
TotalVirtualMemory: DWORD; //虚拟内存总量
AvailVirtualMemory: DWORD; //可用虚拟内存
MemoryLoad: DWORD; //内存使用率
end;
//系统信息
TWindowsFlag = record
WindowsVersion: PChar; //Windows版本号
WindowsVersionEx: PChar; //Windows版本号(增强型)
WindowsName: PChar; //Windows操作系统名称
WindowsNameEx: PChar; //Windows操作系统名称(增强型,支持更多操作系统)
WindowsServicePackVersion: PChar; //Windows SP包版本号
OSIsWindows64: Boolean; //是否64位操作系统
Computername: PChar; //计算机名称
Username: PChar; //登录用户名
DomainName: PChar; //域名
RegisteredCompany: PChar; //注册单位
RegisteredOwner: PChar; //注册用户
ShellProcessName: PChar; //外壳程序名称
WindowsDirectory: PChar; //Windows 路径
SystemDirectory: PChar; //System32 路径
CommonFilesFolder: PChar; //Common 路径
CurrentFolder: PChar; //当前 路径
ProgramFilesFolder: PChar; //ProgramFiles 路径
DesktopFolder: PChar; //Desktop 路径
ProgramsFolder: PChar; //ProgramsFolder件夹
PersonalFolder: PChar; //PersonalFolder 路径
FavoritesFolder: PChar; //Favorites 路径
StartupFolder: PChar; //Startup 路径
RecentFolder: PChar; //Recent 路径
SendToFolder: PChar; //SendToFo 路径
StartmenuFolder: PChar; //Startmenu 路径
DesktopDirectoryFolder: PChar; //DesktopDirectory 路径
FontsFolder: PChar; //Fonts 路径
CommonStartupFolder: PChar; //CommonStartup 路径
CommonFavoritesFolder: PChar; //CommonFavorites 路径
TemplatesFolder: PChar; //Templates 路径
InternetCacheFolder: PChar; //InternetCache 路径
CookiesFolder: PChar; //Cookies 路径
HistoryFolder: PChar; //History 路径
end;
const
HikRunSDK = 'HikClient32.dll'; //SDK-2链接库文件名,请保存与文件实名同步修改
StateString : array[0..59] of string =
('', '正在打开', '音频信号丢失', '视频信号丢失', '有物体移动', //0-4
'自动分割录像', '开始录像', '停止录像', '启动声音监听', '停止声音监听', //5-9
'启动视频预览', '停止视频预览', '启动录像', '停止录像', '启动视频报警', //10-14
'关闭视频报警', '启动音频报警', '停止音频报警', '启动移动侦测', '停止移动侦测', //15-19
'启动视频遮挡', '关闭视频遮挡', '开始屏幕输出', '停止屏幕输出', '启动视频LOGO', //20-24
'停止视频LOGO', '开始视频OSD', '停止视频OSD', '切换为黑白视频', '切换为彩色视频', //25-29
'切换为黑屏显示', '切换为白屏显示', '视频色彩复位', '启动全屏显示', '采集卡已经加载...', //30-34
'采集卡已经卸截...', '视频服务启动成功...', '视频服务已停止...', '静音', '音量恢复', //35-39
'云台控制命令发送', '系统出现未知错误', '录像文件大小', '配置端口号成功...', '连接服务端成功...', //40-44
'正在连接...', '开始接收图象...', '异常退出...', '接收完毕,退出...', '无法联系服务端...', //45-49
'服务端拒绝访问...', '无效...', '停止客户端连接...', '图像抓取成功...', '初始化服务端网络连接成功...', //50-54
'视频服务启动失败...', '退出全屏预览...', '', '', '' //55-59
);
{-------------------------------------------------------------------------------
过程名: Set_CallBack_Func
功 能: 回调函数接口
开 发: SelonSoft
日 期: 2007.07.01
参 数: Func: TCallBackFunc
返回值: 无
备 注:
-------------------------------------------------------------------------------}
procedure Set_CallBack_Func
(
Func: TCallBackFunc //回调函数
); stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Set_Client_NetPort
功 能: 配置客户端网络参数
开 发: SelonSoft
日 期: 2007.07.01
参 数: AppHandle: THandle; ServerPort: Word; ClientPort: Word
返回值: Boolean
备 注:
-------------------------------------------------------------------------------}
function Set_Client_NetPort
(
AppHandle: THandle; //主进程句柄
ServerPort: Word; //服务器端口
ClientPort: Word //客户机端口
): Boolean; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Start_Client
功 能: 启动客户端并连接指定服务器
开 发: SelonSoft
日 期: 2007.07.01
参 数: ServerIP: Pchar; VideoHandel: THandle; RemoteChannel: Byte = 0; IsDecode: Boolean = True; IsNormalmode: Boolean = True
返回值: Integer
备 注:
-------------------------------------------------------------------------------}
function Start_Client
(
ServerIP: PChar; //服务器IP地址
VideoHandel: THandle; //显示视频控件句柄
UserID, PassWord: PChar; //用户名,密码
RemoteChannel: Byte = 0; //远程通道索引号
IsDecode: Boolean = True; //默认解码
IsNormalmode: Boolean = True //默认正常模式显示视频
): Integer; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Stop_Client
功 能: 停止客户端指定通道的连接
开 发: SelonSoft
日 期: 2007.07.01
参 数: RemoteChannel: Byte = 0
返回值: Boolean
备 注:
-------------------------------------------------------------------------------}
function Stop_Client
(
RemoteChannel: Byte = 0 //远程通道索引号
): Boolean; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Get_Client_State
功 能: 获取客户端指定通道工作状态
开 发: SelonSoft
日 期: 2007.07.01
参 数: RemoteChannel: Byte = 0
返回值: Pchar
备 注:
-------------------------------------------------------------------------------}
function Get_Client_State
(
RemoteChannel: Byte = 0 //远程通道索引号
): PChar; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Get_Server_ChanNum
功 能: 获取服务端的通道数
开 发: SelonSoft
日 期: 2007.07.01
参 数:
返回值: DWORD
备 注:
-------------------------------------------------------------------------------}
function Get_Server_ChanNum(): DWORD; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Start_Image_Capture
功 能: 抓取监控图像
开 发: SelonSoft
日 期: 2007.07.01
参 数: Filename: string = ''
返回值: Boolean
备 注: 抓图得到的图像数据保存成BMP文件
-------------------------------------------------------------------------------}
function Start_Image_Capture
(
Filename: string = '' //抓取图像文件名
): Boolean; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Start_Video_Capture
功 能: 开始指定通道的视频录像
开 发: SelonSoft
日 期: 2007.07.01
参 数: RemoteChannel: Byte = 0; Filename: string = ''; StopMinute: Word = 0; AutoSize: Word = 0
返回值: Boolean
备 注: 该函数可实现录制远程视频并保存为本地文件
-------------------------------------------------------------------------------}
function Start_Video_Capture
(
RemoteChannel: Byte = 0; //远程通道索引号
Filename: string = ''; //录像文件名(不指定名称则按默认格式命名)
StopMinute: Word = 0; //自动停止录像时间,值为0表示不自动停止,优先权低
AutoSize: Word = 600 //自动录像大小,值为0表示不自动分割文件,默认600M分割一次
): Boolean; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Stop_Video_Capture
功 能: 停止指定通道的视频录像
开 发: SelonSoft
日 期: 2007.07.01
参 数: RemoteChannel: Byte = 0
返回值: Boolean
备 注:
-------------------------------------------------------------------------------}
function Stop_Video_Capture
(
RemoteChannel: Byte = 0 //远程通道索引号
): Boolean; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Set_Winclock
功 能: 设置系统时间
开 发: SelonSoft
日 期: 2007.07.01
参 数: Datetime: TDateTime
返回值: 无
备 注:
-------------------------------------------------------------------------------}
procedure Set_Winclock
(
Datetime: TDateTime //日期时间
); stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Shut_Client
功 能: 网络连接初始化
开 发: SelonSoft
日 期: 2007.07.01
参 数:
返回值: Boolean
备 注: 结束当前所有用户对它的访问,主要针对服务端长时间运行的网络清理
-------------------------------------------------------------------------------}
function Shut_Client(): Boolean; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Start_Screen_Draw
功 能: 开始指定通道的屏幕输出
开 发: SelonSoft
日 期: 2007.08.12
参 数: RemoteChannel: Byte = 0; I_Text: string = ''; I_Left: Integer = 0; I_Top: Integer = 0; I_IsTransparence: Boolean = True; I_R: Byte = 255; I_G: Byte = 255; I_B: Byte = 255; I_IsDateTime: Boolean = False
返回值: Boolean
备 注: 叠加的文字不会被录制
-------------------------------------------------------------------------------}
function Start_Screen_Draw
(
RemoteChannel: Byte = 0; //远程通道索引号
I_Text: string = ''; //输出内容
I_Left: Integer = 0; //输出左上角座标位置
I_Top: Integer = 0; //输出左上角座标位置
I_IsTransparence: Boolean = True; //默认透明输出屏幕文字
Color_R: Byte = 255; //透明色值(RGB) 红值
Color_G: Byte = 255; //透明色值(RGB) 绿值
Color_B: Byte = 255; //透明色值(RGB) 蓝值
I_IsDateTime: Boolean = False //默认不出出时间文字(该参数优先权高)
): Boolean; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Stop_Screen_Draw
功 能: 停止在指定通道上输出屏幕文字
开 发: SelonSoft
日 期: 2007.08.12
参 数:
返回值: Integer
备 注:
-------------------------------------------------------------------------------}
function Stop_Screen_Draw(): Integer; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Start_Audio_Preview
功 能: 启动指定通道的声音监听
开 发: SelonSoft
日 期: 2007.08.12
参 数: RemoteChannel: Byte = 0
返回值: Boolean
备 注:
-------------------------------------------------------------------------------}
function Start_Audio_Preview
(
RemoteChannel: Byte = 0 //远程通道索引号
): Boolean; stdcall; external HikRunSDK;
{-------------------------------------------------------------------------------
过程名: Stop_Audio_Preview
功 能: 停止指定通道的声音监听
开 发: SelonSoft
日 期: 2007.08.12
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -