资源简介
JAVA ,C++ C# Delphi都可以使用。方便二次开发,SDK函数说明为中文,方便理解使用,加快二次开发速度。
代码片段和文件信息
// Alarm.cpp : implementation file
//
#include “stdafx.h“
#include “DemoIVSb.h“
#include “Alarm.h“
#include “DemoIVSbDlg.h“
#include “Preview.h“
#include
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/************************************************************************/
/*WM_USER_ALAMR_COME的消息函数 */
/************************************************************************/
LRESULT CAlarm::OnAlarmCome(WPARAM wParam LPARAM lParam)
{
if (!wParam)
{
return 0;
}
EventPara* ep = (EventPara*)wParam;
LONG lAnalyzerHandle = ep->lAnalyzerHandle;
DWORD dwAlarmType = ep->dwAlarmType;
void* pAlarmInfo = ep->pAlarmInfo;
DWORD dwBufSize = ep->dwBufSize;
BYTE* pBuffer = ep->pBuffer;
int nSequence = ep->nSequence;
AlarmInfoNode* pNode = new AlarmInfoNode;
if (!pNode || !ep->pAlarmInfo || !ep->pBuffer)
{
if (ep)
{
if (ep->pBuffer)
{
delete []ep->pBuffer;
ep->pBuffer = NULL;
}
if (ep->pAlarmInfo)
{
delete []ep->pAlarmInfo;
ep->pAlarmInfo = NULL;
}
delete ep;
ep = NULL;
}
return 0;
}
//所有的结构体的前面的5个成员都是一样的,可以统一的获取时间
DEV_EVENT_CROSSLINE_INFO* pInfo = (DEV_EVENT_CROSSLINE_INFO*)ep->pAlarmInfo;
//1 获取该事件来自的通道号
pNode->nChnNum = pInfo->nChannelID;
//获取事件名称
strncpy(pNode->szAlarmName pInfo->szName _countof(pInfo->szName));
//2 获取事件类型
pNode->dwRuleType = dwAlarmType;
//3 获取事件触发时间
memcpy(&pNode->Time &pInfo->UTC sizeof(pNode->Time));
//4 存储图片到本地,将目录存在节点中
TCHAR szModule[MAX_PATH] = {0};
::GetCurrentDirectory(MAX_PATH szModule);
_sntprintf(szModule
MAX_PATH
_T(“%s\\Snap“)
szModule);
::CreateDirectory(szModule NULL);
_sntprintf(pNode->szFile
_countof(pNode->szFile)
_T(“%s\\Chn%02d %04d%02d%02d%02d%02d%02d.jpg“)
szModule
pInfo->nChannelID + 1
pNode->Time.dwYear
pNode->Time.dwMonth
pNode->Time.dwDay
pNode->Time.dwHour
pNode->Time.dwMinute
pNode->Time.dwSecond);
TCHAR szDebug[128] = {0};
_sntprintf(szDebug _countof(szDebug) _T(“Alarm Come: Chn%02d Type%d\n“) pNode->nChnNum + 1 pNode->dwRuleType);
::OutputDebugString(szDebug);
FILE* pFile = fopen(pNode->szFile “wb“);
if (pFile)
{
fwrite(pBuffer dwBufSize 1 pFile);
fclose(pFile);
}
else
{
OutputDebugString(_T(“Can‘t save file!\n“));
delete pNode;
if (ep)
{
if (ep->pBuffer)
{
delete []ep->pBuffer;
ep->pBuffer = NULL;
}
if (ep->pAlarmInfo)
{
delete []ep->pAlarmInfo;
ep->pAlarmInfo = NULL;
}
delete ep;
ep = NULL;
}
return 0;
}
//将节点存入链表
CDemoIVSbDlg* pMainDlg = (CDemoIVSbDlg*)AfxGetMainWnd();
if (pMainDlg)
{
lsAlarmInfo* plsAlarmInfo = pMainDlg->getAlarmInfoList();
if (plsAlarmInfo)
{
plsAlarmInfo->push_back(pNode);
}
相关资源
- dahua_camera.rar
- Android集成百度定位SDK的demo
- android SDK extras
- UtoVR视频播放sdk
- 大华Android云台SDK含demo
- Unity 接入Android SDK demo
- 海康威视摄像头自动校时功能
- 海康威视摄像头移动侦测和遮挡告警
- 浙江大华硬盘录像机二次开发包,由
- android 课程表SDK Demo
- AndroidUSB摄像头源码,androidstudio编译,
- 中控指纹仪Live20R开发包SDK文档和C#等
- Android下切换多路USB摄像头
- 百度地图SDK5_2_1
- 在android studio下用gstreamer sdk构建多媒
- Android SDK build-tools 23.0.2
- 海康网络摄像头android版本的demo
- android wifi网络摄像头源代码
- Android SDK build-tools 25.0.0
- NFC reader SDK_1
- Unity3D高德地图SDK演示apk
- javafx 2.0 SDK
- 大华摄像头通用SDK,官方Demo,多语言
- LED Demo(BX_05_06_SDK)
- 支付宝手机网站支付SDKDemo(官方)
- 支付宝电脑网站支付 SDK Demo(官方)
- 支付宝当面付SDK Demo(官方)-JAVA版
- SAP SDK 中文教材
- 微博社会化 sdk demo
- sdk的简介 - android入门视频06
评论
共有 条评论