|
|
|
@ -754,6 +754,11 @@ IDevice::timer_uid_t CPhoneDevice::RegisterHeartbeat(unsigned int timerType, uns
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<OSD_INFO>& osds, const std::string& path)
|
|
|
|
|
{
|
|
|
|
|
if (m_threadClose.joinable())
|
|
|
|
|
{
|
|
|
|
|
m_threadClose.join();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mCamera != NULL)
|
|
|
|
|
{
|
|
|
|
|
delete mCamera;
|
|
|
|
@ -1071,7 +1076,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
|
|
|
|
|
|
|
|
|
|
bool turnOffOtg = (mPhotoInfo.usbCamera != 0);
|
|
|
|
|
std::thread closeThread(&CPhoneDevice::CloseCamera2, this, pCamera, mPhotoInfo.photoId, turnOffOtg);
|
|
|
|
|
closeThread.detach();
|
|
|
|
|
m_threadClose.swap(closeThread);
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
@ -1091,7 +1096,7 @@ bool CPhoneDevice::OnVideoReady(bool result, const char* path, unsigned int phot
|
|
|
|
|
|
|
|
|
|
bool turnOffOtg = (mPhotoInfo.usbCamera != 0);
|
|
|
|
|
std::thread closeThread(&CPhoneDevice::CloseCamera2, this, pCamera, mPhotoInfo.photoId, turnOffOtg);
|
|
|
|
|
closeThread.detach();
|
|
|
|
|
m_threadClose.swap(closeThread);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|