motiondetectiongetset.c

来自「一个在Linux下开发的IP摄像头的驱动程序及控制软件」· C语言 代码 · 共 60 行

C
60
字号
#include "Utility.h"
#include "SrvDepResource.h"

/*!
***************************************************************************
 * \brief
 *	get/set motion detection rectangle

 * \param tServerInfo 
	[in] server info
 * \param atMotionInfo[3] 
	[in/out] array to store the motion rectangle info
 * \param *piWndNumber 
	[out] the number of motion detection rectnagles when getting motion info
 * \param bGetMotionInfo 
	[in] true means to get motion detection info

 * \return 
 * \retval S_FAIL	atMotionInfo is NULL
 * \retval S_OK	operation success
**************************************************************************/
SCODE MotionGetSet(TSERVER_INFO tServerInfo, TSERVERUTL_MODETECT_INFO atMotionInfo[3], int *piWndNumber, BOOL bGetMotionInfo)
{
	HANDLE hServerUtl;
	HANDLE hDevice;
	char lpszModelName[64]; 
	SCODE scRet;
	
	if (atMotionInfo == NULL)
		return S_FAIL;

	scRet = ServerUtlInit(&hServerUtl, &hDevice, lpszModelName, tServerInfo);
	if (scRet != S_OK)
		return scRet;

	if (bGetMotionInfo)
	{
		scRet = ServerUtl_GetMotionDetectionInfo(hDevice, atMotionInfo, piWndNumber,
										 		 FALSE, FALSE);
		if (scRet != S_OK)
		{
			ServerUtlRelease(&hServerUtl, &hDevice);
			return scRet;
		}
	}
	else
	{
		scRet = ServerUtl_SetMotionDetectionInfo(hDevice, atMotionInfo, FALSE, FALSE);

		if (scRet != S_OK)
		{
			ServerUtlRelease(&hServerUtl, &hDevice);
			return scRet;
		}
	}

	ServerUtlRelease(&hServerUtl, &hDevice);

	return 0;
}

⌨️ 快捷键说明

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