Matthew 6 months ago
commit 30d69e378a

@ -5,7 +5,7 @@ plugins {
// 10,00,000 major-minor-build
def AppMajorVersion = 1
def AppMinorVersion = 1
def AppBuildNumber = 20
def AppBuildNumber = 22
def AppVersionName = AppMajorVersion + "." + AppMinorVersion + "." + AppBuildNumber
def AppVersionCode = AppMajorVersion * 100000 + AppMinorVersion * 1000 + AppBuildNumber

@ -1770,26 +1770,48 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
IDevice::PHOTO_INFO localPhotoInfo = mPhotoInfo;
IDevice::SerialsPhotoParam param = { "", 0, 0 };
GetPhotoSerialsParamCb(param);
vector<IDevice::OSD_INFO> osds;
osds.swap(mOsds);
std::thread t([localPhotoInfo, param, pThis,wid_serial]() mutable
{
if (localPhotoInfo.preset != 0 && localPhotoInfo.preset != 0xFF)
{
CameraPhotoCmd(time(NULL), localPhotoInfo.channel, MOVE_PRESETNO, 0, localPhotoInfo.preset, param.serfile, param.baud, param.addr);
std::this_thread::sleep_for(std::chrono::seconds(3));
}
time_t ts = time(NULL);
if(!pThis->GetPTZSensorsStatus() && !pThis->GetCameraStatus())
{
pThis->OpenPTZSensors(localPhotoInfo.selfTestingTime);
}
CameraPhotoCmd(ts, localPhotoInfo.channel, 0, localPhotoInfo.resolution, 0, param.serfile, param.baud, param.addr);
XYLOG(XYLOG_SEVERITY_INFO, "Taking photo over");
pThis->TakePTZPhotoCb(3, localPhotoInfo);
pThis->ClosePTZSensors(localPhotoInfo.closeDelayTime);
GpioControl::setCam3V3Enable(false, localPhotoInfo.closeDelayTime);
pThis->ReleaseWakelock(wid_serial);
});
std::thread t([localPhotoInfo, param, pThis, osds, wid_serial]() mutable
{
if (localPhotoInfo.preset != 0 && localPhotoInfo.preset != 0xFF)
{
CameraPhotoCmd(time(NULL), localPhotoInfo.channel, MOVE_PRESETNO, 0, localPhotoInfo.preset, param.serfile, param.baud, param.addr);
std::this_thread::sleep_for(std::chrono::seconds(3));
}
time_t ts = time(NULL);
if(!pThis->GetPTZSensorsStatus() && !pThis->GetCameraStatus())
{
pThis->OpenPTZSensors(localPhotoInfo.selfTestingTime);
}
CameraPhotoCmd(ts, localPhotoInfo.channel, 0, localPhotoInfo.resolution, 0, param.serfile, param.baud, param.addr);
XYLOG(XYLOG_SEVERITY_INFO, "Taking photo over");
IMAGE_DEF photo = { 0 };
std::vector<IDevice::RECOG_OBJECT> objects;
GetImage(0, &photo);
if(photo.state == 5){
XYLOG(XYLOG_SEVERITY_INFO,"Get Serials Photo, PhotoID = %s", photo.photoname);
cv::Mat img = cv::imread(photo.photoname, cv::IMREAD_COLOR);
if (!img.empty())
{
int result = std::remove(photo.photoname);
pThis->TakePhotoCb(1, localPhotoInfo, "", photo.phototime - 28800, objects);
pThis->PostProcessPhoto(localPhotoInfo, osds, photo.photoname, "", img);
}
}else
{
XYLOG(XYLOG_SEVERITY_WARNING,"Get Serials Photo Failed");
pThis->TakePhotoCb(0, localPhotoInfo, photo.photoname, photo.phototime - 28800, objects);
}
// pThis->TakePTZPhotoCb(3, localPhotoInfo);
pThis->ClosePTZSensors(localPhotoInfo.closeDelayTime);
GpioControl::setCam3V3Enable(false, localPhotoInfo.closeDelayTime);
pThis->ReleaseWakelock(wid_serial);
});
t.detach();
}

Loading…
Cancel
Save