|
|
|
@ -153,6 +153,14 @@ void CPhoneDevice::CPhoneCamera::on_error(const std::string& msg)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CPhoneDevice::CPhoneCamera::onDisconnected(ACameraDevice* device)
|
|
|
|
|
{
|
|
|
|
|
if (m_dev != NULL)
|
|
|
|
|
{
|
|
|
|
|
m_dev->onDisconnected(device);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CPhoneDevice::CPhoneDevice(JavaVM* vm, jobject service, const std::string& appPath, unsigned int netId, unsigned int versionCode) : mCameraPowerCount(0), mOtgCount(0), mVersionCode(versionCode)
|
|
|
|
|
{
|
|
|
|
|
mCamera = NULL;
|
|
|
|
@ -1324,6 +1332,25 @@ void CPhoneDevice::onError(const std::string& msg)
|
|
|
|
|
m_threadClose.swap(closeThread);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CPhoneDevice::onDisconnected(ACameraDevice* device)
|
|
|
|
|
{
|
|
|
|
|
if (mCamera == NULL)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "Failed to Take Photo (IMGID=%u) as for Disconnection", mPhotoInfo.photoId);
|
|
|
|
|
|
|
|
|
|
CPhoneCamera* pCamera = mCamera;
|
|
|
|
|
mCamera = NULL;
|
|
|
|
|
|
|
|
|
|
TakePhotoCb(false, mPhotoInfo, mPath, 0);
|
|
|
|
|
|
|
|
|
|
bool turnOffOtg = (mPhotoInfo.usbCamera != 0);
|
|
|
|
|
std::thread closeThread(&CPhoneDevice::CloseCamera2, this, pCamera, mPhotoInfo.photoId, turnOffOtg);
|
|
|
|
|
// closeThread.detach();
|
|
|
|
|
m_threadClose.swap(closeThread);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CPhoneDevice::GetFileName() const
|
|
|
|
|
{
|
|
|
|
|
return mPath;
|
|
|
|
|