From d1571fad005793a7f954c9bc870e920b8b4921b4 Mon Sep 17 00:00:00 2001 From: "XI.CHEN" Date: Thu, 28 Nov 2024 14:39:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B2=E5=8F=A3=E6=8B=8D=E7=85=A7=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=A4=84=E7=90=86=EF=BC=9B=E9=87=8D=E6=96=B0=E6=8B=8D?= =?UTF-8?q?=E7=85=A7=E5=89=8D=E6=9C=AA=E5=BC=80=E5=90=AF=E7=94=B5=E6=BA=90?= =?UTF-8?q?=E5=88=99=E5=BC=80=E7=94=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 1b85e0be..2848e3be 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1697,9 +1697,12 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector< std::this_thread::sleep_for(std::chrono::seconds(2)); } time_t ts = time(NULL); + if(!GetPTZSensorsStatus() && !GetCameraStatus()) + { + OpenPTZSensors(120); + } CameraPhotoCmd(ts, photoInfo.channel, 0, 6, 0); - TakePTZPhotoCb(3, photoInfo); - res = true; + res = TakePTZPhotoCb(3, photoInfo); } else if (mPhotoInfo.usingSysCamera == 1) { @@ -1837,7 +1840,7 @@ bool CPhoneDevice::ClosePTZSensors() { m_shouldStopWaiting.store(true); } - else + else if(m_sensorsStatus && m_cameraStatus) { std::lock_guard lock(m_cameraLocker); // std::unique_lock lock(m_cameraLocker);