串口拍照启用线程

hdrplus
XI.CHEN 6 months ago
parent ceb89a0c70
commit 98c99e016c

@ -1694,20 +1694,27 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
} }
else if (mPhotoInfo.mediaType == 0 && (mPhotoInfo.cameraType == CAM_TYPE_SERIAL)) else if (mPhotoInfo.mediaType == 0 && (mPhotoInfo.cameraType == CAM_TYPE_SERIAL))
{ {
if (photoInfo.preset != 0 && photoInfo.preset != 0xFF) CPhoneDevice* pThis = this;
IDevice::PHOTO_INFO localPhotoInfo = mPhotoInfo;
std::thread t([localPhotoInfo, path, pThis]() mutable
{
if (localPhotoInfo.preset != 0 && localPhotoInfo.preset != 0xFF)
{ {
CameraPhotoCmd(time(NULL), photoInfo.channel, MOVE_PRESETNO, 0, photoInfo.preset); CameraPhotoCmd(time(NULL), localPhotoInfo.channel, MOVE_PRESETNO, 0, localPhotoInfo.preset);
std::this_thread::sleep_for(std::chrono::seconds(3)); std::this_thread::sleep_for(std::chrono::seconds(3));
} }
time_t ts = time(NULL); time_t ts = time(NULL);
if(!GetPTZSensorsStatus() && !GetCameraStatus()) if(!pThis->GetPTZSensorsStatus() && !pThis->GetCameraStatus())
{ {
XYLOG(XYLOG_SEVERITY_INFO, "Camera is SeltTesting, selfTestingtime = %d", photoInfo.selfTestingTime); XYLOG(XYLOG_SEVERITY_INFO, "Camera is SeltTesting, selfTestingtime = %d", localPhotoInfo.selfTestingTime);
OpenPTZSensors(photoInfo.selfTestingTime); pThis->OpenPTZSensors(localPhotoInfo.selfTestingTime);
} }
CameraPhotoCmd(ts, photoInfo.channel, 0, photoInfo.resolution, 0); CameraPhotoCmd(ts, localPhotoInfo.channel, 0, localPhotoInfo.resolution, 0);
XYLOG(XYLOG_SEVERITY_INFO, "Taking photo over"); XYLOG(XYLOG_SEVERITY_INFO, "Taking photo over");
res = TakePTZPhotoCb(3, photoInfo); pThis->TakePTZPhotoCb(3, localPhotoInfo);
});
t.detach();
} }
else if (mPhotoInfo.usingSysCamera == 1) else if (mPhotoInfo.usingSysCamera == 1)
{ {

Loading…
Cancel
Save