You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.4 KiB
C++

/******************************************************************************
Copyright(C):2015~2018 hzleaper
FileName:tpCamera.cpp
Author:zhikun wu
Email:zk.wu@hzleaper.com
Tools:vs2010 pc on company
Created:2015/03/23
History:23:3:2015 16:31
*******************************************************************************/
#include "CameraPool.h"
#include "globalCamera.h"
#ifdef TPCAMERA_EXPORTS
#define TPCAMERA_API extern "C" __declspec(dllexport)
#else
#define TPCAMERA_API extern "C"
#endif
CGlobalCamera* gpGlobalCameraZZZ = NULL;
CCameraPool *gpCameraPool = NULL;
//don't change the names of these global functions
TPCAMERA_API void* Lib_Camera_Init(void* inParam)
{
CAMERA_IN_PARAM cinParam = {0};
if( NULL != inParam )
{
std::memcpy(&cinParam, inParam, sizeof(CAMERA_IN_PARAM));
}
if( NULL == gpGlobalCamera )
{
gpGlobalCamera = new CGlobalCamera(&cinParam);
}
//
if( NULL == gpCameraPool )
{
gpCameraPool = new CCameraPool();
}
if( NULL != gpCameraPool )
{
gpCameraPool->InitPool();
}
return gpCameraPool;
}
TPCAMERA_API void Lib_Camera_Free()
{
if( NULL != gpCameraPool )
{
gpCameraPool->FreePool();
delete gpCameraPool;
gpCameraPool = NULL;
}
if( NULL != gpGlobalCamera )
{
delete gpGlobalCamera;
gpGlobalCamera = NULL;
}
}