|
|
|
@ -1589,18 +1589,28 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "NetCapture %d NetHandle=%lld PHOTOID=%u", idx, netHandle, localPhotoInfo.photoId);
|
|
|
|
|
|
|
|
|
|
img.clear();
|
|
|
|
|
netCaptureResult = requestCapture(localPhotoInfo.channel, localPhotoInfo.preset, netPhotoInfo, img);
|
|
|
|
|
if (netCaptureResult)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "NetCapture Succeeded PHOTOID=%u Img Size=%u", localPhotoInfo.photoId, (uint32_t)img.size());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (netCaptureResult)
|
|
|
|
|
cv::Mat rgb;
|
|
|
|
|
if (netCaptureResult && !img.empty())
|
|
|
|
|
{
|
|
|
|
|
rgb = cv::imdecode(cv::Mat(img), cv::IMREAD_COLOR);
|
|
|
|
|
}
|
|
|
|
|
if (!rgb.empty())
|
|
|
|
|
{
|
|
|
|
|
time_t takingTime = ts;
|
|
|
|
|
if(localPhotoInfo.scheduleTime != 0)
|
|
|
|
|
{
|
|
|
|
|
takingTime = localPhotoInfo.scheduleTime;
|
|
|
|
|
}
|
|
|
|
|
if (localPhotoInfo.remedy != 0)
|
|
|
|
|
{
|
|
|
|
|
if ((takingTime - localPhotoInfo.scheduleTime) > 30)
|
|
|
|
@ -1614,7 +1624,6 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
|
|
|
|
|
// Notify to take next photo
|
|
|
|
|
TakePhotoCb(1, localPhotoInfo, "", takingTime);
|
|
|
|
|
|
|
|
|
|
cv::Mat rgb = cv::imdecode(cv::Mat(img), cv::IMREAD_COLOR);
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
// cv::imwrite("/sdcard/com.xypower.mpapp/tmp/netimg2.jpg", rgb);
|
|
|
|
|
#endif
|
|
|
|
|