@ -1595,7 +1595,7 @@ IDevice::timer_uid_t CPhoneDevice::RegisterHeartbeat(unsigned int timerType, uns
return uid ;
return uid ;
}
}
bool CPhoneDevice : : TakePhotoWithNetCamera ( IDevice : : PHOTO_INFO & localPhotoInfo , const std : : string & path , std : : vector < IDevice : : OSD_INFO > & osds , std : : shared_ptr < PowerControl > powerCtrlPtr )
bool CPhoneDevice : : TakePhotoWithNetCamera ( const IDevice : : PHOTO_INFO & localPhotoInfo , const std : : string & path , const std : : vector < IDevice : : OSD_INFO > & osds , std : : shared_ptr < PowerControl > powerCtrlPtr )
{
{
// AutoEnv autoEnv(pThis->m_vm);
// AutoEnv autoEnv(pThis->m_vm);
time_t ts = time ( NULL ) ;
time_t ts = time ( NULL ) ;
@ -1721,15 +1721,13 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
}
}
}
}
localPhotoInfo . photoTime = takingTime ;
// Notify to take next photo
// Notify to take next photo
TakePhotoCb ( 1 , localPhotoInfo , " " , takingTime ) ;
TakePhotoCb ( 1 , localPhotoInfo , " " , takingTime ) ;
# ifdef _DEBUG
# ifdef _DEBUG
// cv::imwrite("/sdcard/com.xypower.mpapp/tmp/netimg2.jpg", rgb);
// cv::imwrite("/sdcard/com.xypower.mpapp/tmp/netimg2.jpg", rgb);
# endif
# endif
netCaptureResult = PostProcessPhoto ( localPhotoInfo , osds , path , " " , rgb );
netCaptureResult = PostProcessPhoto ( localPhotoInfo , osds , path , " " , rgb , takingTime );
}
}
else
else
{
{
@ -1742,7 +1740,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
}
}
bool CPhoneDevice : : TakeVideoWithNetCamera ( IDevice : : PHOTO_INFO & localPhotoInfo , const std : : string & path , std : : vector < IDevice : : OSD_INFO > & osds , std : : shared_ptr < PowerControl > powerCtrlPtr )
bool CPhoneDevice : : TakeVideoWithNetCamera ( const IDevice : : PHOTO_INFO & localPhotoInfo , const std : : string & path , const std : : vector < IDevice : : OSD_INFO > & osds , std : : shared_ptr < PowerControl > powerCtrlPtr )
{
{
// AutoEnv autoEnv(pThis->m_vm);
// AutoEnv autoEnv(pThis->m_vm);
time_t ts = time ( NULL ) ;
time_t ts = time ( NULL ) ;
@ -1794,7 +1792,7 @@ bool CPhoneDevice::TakeVideoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
// strcpy(netPhotoInfo.interface, "eth0");
// strcpy(netPhotoInfo.interface, "eth0");
localPhotoInfo. photoTime = time ( NULL ) ;
time_t photoTime = time ( NULL ) ;
std : : string tmpFile = m_appPath + ( APP_PATH_TMP DIR_SEP_STR ) + std : : to_string ( localPhotoInfo . photoId ) + " .mp4 " ;
std : : string tmpFile = m_appPath + ( APP_PATH_TMP DIR_SEP_STR ) + std : : to_string ( localPhotoInfo . photoId ) + " .mp4 " ;
// RTSPToMP4 dumper(netPhotoInfo.url, tmpFile.c_str(), localPhotoInfo.duration * 1000);
// RTSPToMP4 dumper(netPhotoInfo.url, tmpFile.c_str(), localPhotoInfo.duration * 1000);
// dumper.start();
// dumper.start();
@ -1814,12 +1812,12 @@ bool CPhoneDevice::TakeVideoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
ethernetPowerCtrl . reset ( ) ;
ethernetPowerCtrl . reset ( ) ;
XYLOG ( XYLOG_SEVERITY_DEBUG , " Ethernet Power OFF " ) ;
XYLOG ( XYLOG_SEVERITY_DEBUG , " Ethernet Power OFF " ) ;
std : : string fullPath = endsWith ( mPath , " .mp4 " ) ? mPath : ( mPath + CTerminal : : BuildPhotoFileName ( mPhotoInfo )) ;
std : : string fullPath = endsWith ( mPath , " .mp4 " ) ? mPath : ( mPath + CTerminal : : BuildPhotoFileName ( mPhotoInfo , photoTime )) ;
if ( existsFile ( tmpFile ) )
if ( existsFile ( tmpFile ) )
{
{
std : : rename ( tmpFile . c_str ( ) , fullPath . c_str ( ) ) ;
std : : rename ( tmpFile . c_str ( ) , fullPath . c_str ( ) ) ;
TakePhotoCb ( 3 , localPhotoInfo , fullPath , localPhotoInfo. photoTime) ;
TakePhotoCb ( 3 , localPhotoInfo , fullPath , photoTime) ;
}
}
else
else
{
{
@ -1837,7 +1835,7 @@ bool CPhoneDevice::TakeVideoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
return true ;
return true ;
}
}
bool CPhoneDevice : : StartPushStreaming ( IDevice : : PHOTO_INFO & photoInfo , const std : : string & url , std : : vector < IDevice : : OSD_INFO > & osds , std : : shared_ptr < PowerControl > powerCtrlPtr )
bool CPhoneDevice : : StartPushStreaming ( const IDevice : : PHOTO_INFO & photoInfo , const std : : string & url , const std : : vector < IDevice : : OSD_INFO > & osds , std : : shared_ptr < PowerControl > powerCtrlPtr )
{
{
if ( photoInfo . mediaType = = XY_MEDIA_TYPE_STREAM )
if ( photoInfo . mediaType = = XY_MEDIA_TYPE_STREAM )
{
{
@ -2122,7 +2120,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
osds . swap ( mOsds ) ;
osds . swap ( mOsds ) ;
IDevice : : PHOTO_INFO localPhotoInfo = mPhotoInfo ;
IDevice : : PHOTO_INFO localPhotoInfo = mPhotoInfo ;
std : : thread t ( [ localPhotoInfo , path , pThis , osds , powerCtrlPtr ] ( ) mutable
std : : thread t ( [ localPhotoInfo , path , pThis , osds , powerCtrlPtr ] ( )
{
{
uint32_t waitTime = localPhotoInfo . selfTestingTime ;
uint32_t waitTime = localPhotoInfo . selfTestingTime ;
XYLOG ( XYLOG_SEVERITY_INFO , " Camera is SelfTesting Time=%u s " , waitTime ) ;
XYLOG ( XYLOG_SEVERITY_INFO , " Camera is SelfTesting Time=%u s " , waitTime ) ;
@ -2148,7 +2146,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
vector < IDevice : : OSD_INFO > osds ;
vector < IDevice : : OSD_INFO > osds ;
osds . swap ( mOsds ) ;
osds . swap ( mOsds ) ;
std : : thread t ( [ localPhotoInfo , param , pThis , path , osds , wid_serial ] ( ) mutable
std : : thread t ( [ localPhotoInfo , param , pThis , path , osds , wid_serial ] ( )
{
{
time_t ts = time ( NULL ) ;
time_t ts = time ( NULL ) ;
if ( localPhotoInfo . scheduleTime ! = 0 )
if ( localPhotoInfo . scheduleTime ! = 0 )
@ -2192,13 +2190,12 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
if ( photo . state = = 5 )
if ( photo . state = = 5 )
{
{
XYLOG ( XYLOG_SEVERITY_INFO , " Get Serials Photo, PhotoID = %s " , photo . photoname ) ;
XYLOG ( XYLOG_SEVERITY_INFO , " Get Serials Photo, PhotoID = %s " , photo . photoname ) ;
localPhotoInfo . photoTime = takingTime ;
cv : : Mat img = cv : : imread ( photo . photoname , cv : : IMREAD_COLOR ) ;
cv : : Mat img = cv : : imread ( photo . photoname , cv : : IMREAD_COLOR ) ;
if ( ! img . empty ( ) )
if ( ! img . empty ( ) )
{
{
int result = std : : remove ( photo . photoname ) ;
int result = std : : remove ( photo . photoname ) ;
pThis - > TakePhotoCb ( 1 , localPhotoInfo , " " , takingTime , objects ) ;
pThis - > TakePhotoCb ( 1 , localPhotoInfo , " " , takingTime , objects ) ;
pThis - > PostProcessPhoto ( localPhotoInfo , osds , path , " " , img );
pThis - > PostProcessPhoto ( localPhotoInfo , osds , path , " " , img , takingTime );
}
}
} else
} else
@ -2224,7 +2221,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
vector < IDevice : : OSD_INFO > osds ;
vector < IDevice : : OSD_INFO > osds ;
osds . swap ( mOsds ) ;
osds . swap ( mOsds ) ;
std : : thread t ( [ localPhotoInfo , param , pThis , path , osds , wid_serial , powerCtrlPtr ] ( ) mutable
std : : thread t ( [ localPhotoInfo , param , pThis , path , osds , wid_serial , powerCtrlPtr ] ( )
{
{
uint32_t waitTime = localPhotoInfo . selfTestingTime ;
uint32_t waitTime = localPhotoInfo . selfTestingTime ;
if ( ! GpioControl : : GetSelftestStatus ( waitTime ) )
if ( ! GpioControl : : GetSelftestStatus ( waitTime ) )
@ -2269,7 +2266,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
m_ptzController - > AddPhotoCommand ( localPhotoInfo , path , osds ) ;
m_ptzController - > AddPhotoCommand ( localPhotoInfo , path , osds ) ;
} else
} else
{
{
std : : thread t ( [ localPhotoInfo , path , pThis , osds , powerCtrlPtr ] ( ) mutable
std : : thread t ( [ localPhotoInfo , path , pThis , osds , powerCtrlPtr ] ( )
{
{
pThis - > TakePhotoCb ( 1 , localPhotoInfo , " " , 0 ) ;
pThis - > TakePhotoCb ( 1 , localPhotoInfo , " " , 0 ) ;
pThis - > StartPushStreaming ( localPhotoInfo , path , osds , powerCtrlPtr ) ;
pThis - > StartPushStreaming ( localPhotoInfo , path , osds , powerCtrlPtr ) ;
@ -2289,7 +2286,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
GetPhotoSerialsParamCb ( param ) ;
GetPhotoSerialsParamCb ( param ) ;
vector < IDevice : : OSD_INFO > osds ;
vector < IDevice : : OSD_INFO > osds ;
osds . swap ( mOsds ) ;
osds . swap ( mOsds ) ;
std : : thread t ( [ localPhotoInfo , param , pThis , path , osds , wid_serial , powerCtrlPtr ] ( ) mutable
std : : thread t ( [ localPhotoInfo , param , pThis , path , osds , wid_serial , powerCtrlPtr ] ( )
{
{
uint32_t waitTime = localPhotoInfo . selfTestingTime ;
uint32_t waitTime = localPhotoInfo . selfTestingTime ;
if ( ! GpioControl : : GetSelftestStatus ( waitTime ) )
if ( ! GpioControl : : GetSelftestStatus ( waitTime ) )
@ -2325,7 +2322,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
vector < IDevice : : OSD_INFO > osds ;
vector < IDevice : : OSD_INFO > osds ;
osds . swap ( mOsds ) ;
osds . swap ( mOsds ) ;
std : : thread t ( [ localPhotoInfo , pThis , path , osds , wid_serial , powerCtrlPtr ] ( ) mutable
std : : thread t ( [ localPhotoInfo , pThis , path , osds , wid_serial , powerCtrlPtr ] ( )
{
{
uint32_t waitTime = localPhotoInfo . selfTestingTime ;
uint32_t waitTime = localPhotoInfo . selfTestingTime ;
if ( ! GpioControl : : GetSelftestStatus ( waitTime ) )
if ( ! GpioControl : : GetSelftestStatus ( waitTime ) )
@ -2573,7 +2570,6 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics
takingTime = scheduleTime + mPhotoInfo . channel * 2 ;
takingTime = scheduleTime + mPhotoInfo . channel * 2 ;
}
}
}
}
mPhotoInfo . photoTime = takingTime ;
vector < IDevice : : OSD_INFO > osds ;
vector < IDevice : : OSD_INFO > osds ;
osds . swap ( mOsds ) ;
osds . swap ( mOsds ) ;
@ -2675,11 +2671,14 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics
XYLOG ( XYLOG_SEVERITY_INFO , " TP: Notofy to Take Next CUR Info: CH=%u PR=%u IMGID=%u " , ( uint32_t ) photoInfo . channel , ( uint32_t ) photoInfo . preset , ( uint32_t ) photoInfo . photoId ) ;
XYLOG ( XYLOG_SEVERITY_INFO , " TP: Notofy to Take Next CUR Info: CH=%u PR=%u IMGID=%u " , ( uint32_t ) photoInfo . channel , ( uint32_t ) photoInfo . preset , ( uint32_t ) photoInfo . photoId ) ;
pThis - > TakePhotoCb ( 1 , photoInfo , " " , takingTime ) ;
pThis - > TakePhotoCb ( 1 , photoInfo , " " , takingTime ) ;
bool res = pThis - > PostProcessPhoto ( photoInfo , osds , path , cameraInfo , rgb );
bool res = pThis - > PostProcessPhoto ( photoInfo , osds , path , cameraInfo , rgb , takingTime );
if ( res )
if ( res )
{
{
// TakePhotoCb(2, photoInfo, path, takingTime);
// TakePhotoCb(2, photoInfo, path, takingTime);
ALOGW ( " Current allocated matrices %u " , ( uint32_t ) rgb . total ( ) ) ;
}
}
} ) ;
} ) ;
th . detach ( ) ;
th . detach ( ) ;
@ -2729,7 +2728,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
}
}
CPhoneDevice * pThis = this ;
CPhoneDevice * pThis = this ;
std : : thread th ( [ pThis , characteristics , results , photoInfo , osds , path , pByteArrays , ldr , duration , takingTime ] ( ) mutable
std : : thread th ( [ pThis , characteristics , results , photoInfo , osds , path , pByteArrays , ldr , duration , takingTime ] ( )
{
{
cv : : Mat rgb ;
cv : : Mat rgb ;
std : : string cameraInfo ;
std : : string cameraInfo ;
@ -3047,7 +3046,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
}
}
else
else
{
{
bool res = pThis - > PostProcessPhoto ( photoInfo , osds , path , cameraInfo , rgb );
bool res = pThis - > PostProcessPhoto ( photoInfo , osds , path , cameraInfo , rgb , takingTime );
if ( res )
if ( res )
{
{
// TakePhotoCb(2, photoInfo, path, takingTime);
// TakePhotoCb(2, photoInfo, path, takingTime);
@ -3098,7 +3097,6 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
takingTime = scheduleTime + mPhotoInfo . channel * 2 ;
takingTime = scheduleTime + mPhotoInfo . channel * 2 ;
}
}
}
}
mPhotoInfo . photoTime = takingTime ;
vector < IDevice : : OSD_INFO > osds ;
vector < IDevice : : OSD_INFO > osds ;
osds . swap ( mOsds ) ;
osds . swap ( mOsds ) ;
@ -3376,7 +3374,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
}
}
else
else
{
{
bool res = pThis - > PostProcessPhoto ( photoInfo , osds , path , cameraInfo , rgb );
bool res = pThis - > PostProcessPhoto ( photoInfo , osds , path , cameraInfo , rgb , takingTime );
if ( res )
if ( res )
{
{
// TakePhotoCb(2, photoInfo, path, takingTime);
// TakePhotoCb(2, photoInfo, path, takingTime);
@ -3437,7 +3435,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat)
takingTime = scheduleTime + mPhotoInfo . channel * 2 ;
takingTime = scheduleTime + mPhotoInfo . channel * 2 ;
}
}
}
}
mPhotoInfo . photoTime = takingTime ;
// mPhotoInfo.photoTime = takingTime;
int baseline = 0 ;
int baseline = 0 ;
cv : : Size textSize ;
cv : : Size textSize ;
double height = mat . size ( ) . height ;
double height = mat . size ( ) . height ;
@ -3664,7 +3662,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat)
params . push_back ( ( int ) ( ( uint32_t ) mPhotoInfo . quality ) ) ;
params . push_back ( ( int ) ( ( uint32_t ) mPhotoInfo . quality ) ) ;
bool res = false ;
bool res = false ;
std : : string fullPath = endsWith ( mPath , " .jpg " ) ? mPath : ( mPath + CTerminal : : BuildPhotoFileName ( mPhotoInfo )) ;
std : : string fullPath = endsWith ( mPath , " .jpg " ) ? mPath : ( mPath + CTerminal : : BuildPhotoFileName ( mPhotoInfo , takingTime )) ;
# ifdef OUTPUT_DBG_INFO
# ifdef OUTPUT_DBG_INFO
@ -3749,7 +3747,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat)
return res ;
return res ;
}
}
bool CPhoneDevice : : PostProcessPhoto ( const PHOTO_INFO & photoInfo , const vector < IDevice : : OSD_INFO > & osds , const std : : string & path , const std : : string & cameraInfo , cv : : Mat mat )
bool CPhoneDevice : : PostProcessPhoto ( const PHOTO_INFO & photoInfo , const vector < IDevice : : OSD_INFO > & osds , const std : : string & path , const std : : string & cameraInfo , cv : : Mat mat , time_t takingTime )
{
{
int baseline = 0 ;
int baseline = 0 ;
cv : : Size textSize ;
cv : : Size textSize ;
@ -3894,7 +3892,6 @@ bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector<ID
cv : : Point rb ( 0 + textSize . width + 2 * ratio , lt2 . y + textSize . height + 8 * ratio ) ;
cv : : Point rb ( 0 + textSize . width + 2 * ratio , lt2 . y + textSize . height + 8 * ratio ) ;
cv : : Point rt ( 0 + textSize . width + 2 * ratio , mat . rows - fs - 20 * ratio ) ;
cv : : Point rt ( 0 + textSize . width + 2 * ratio , mat . rows - fs - 20 * ratio ) ;
if ( rb . x > ( int ) width - 1 )
if ( rb . x > ( int ) width - 1 )
{
{
rb . x = ( int ) width - 1 ;
rb . x = ( int ) width - 1 ;
@ -3974,7 +3971,7 @@ bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector<ID
params . push_back ( ( int ) ( ( uint32_t ) photoInfo . quality ) ) ;
params . push_back ( ( int ) ( ( uint32_t ) photoInfo . quality ) ) ;
bool res = false ;
bool res = false ;
std : : string fullPath = endsWith ( path , " .jpg " ) ? path : ( path + CTerminal : : BuildPhotoFileName ( photoInfo )) ;
std : : string fullPath = endsWith ( path , " .jpg " ) ? path : ( path + CTerminal : : BuildPhotoFileName ( photoInfo , takingTime )) ;
bool imgExisted = std : : filesystem : : exists ( std : : filesystem : : path ( fullPath ) ) ;
bool imgExisted = std : : filesystem : : exists ( std : : filesystem : : path ( fullPath ) ) ;
if ( imgExisted )
if ( imgExisted )
@ -4058,7 +4055,7 @@ bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector<ID
XYLOG ( XYLOG_SEVERITY_INFO , " Succeeded to Write File: %s, FileSize=%u " , fullPath . c_str ( ) + m_appPath . size ( ) , ( uint32_t ) imgFileSize ) ;
XYLOG ( XYLOG_SEVERITY_INFO , " Succeeded to Write File: %s, FileSize=%u " , fullPath . c_str ( ) + m_appPath . size ( ) , ( uint32_t ) imgFileSize ) ;
}
}
std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 1000 ) ) ;
std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 1000 ) ) ;
TakePhotoCb ( res ? 2 : 0 , photoInfo , fullPath , photoInfo. photo Time, objs ) ;
TakePhotoCb ( res ? 2 : 0 , photoInfo , fullPath , taking Time, objs ) ;
}
}
else
else
{
{
@ -4102,16 +4099,16 @@ bool CPhoneDevice::OnVideoReady(bool photoOrVideo, bool result, const char* path
{
{
if ( photoOrVideo )
if ( photoOrVideo )
{
{
mPhotoInfo. photoTime = time ( NULL ) ;
time_t photoTime = time ( NULL ) ;
CPhoneCamera * pCamera = NULL ;
CPhoneCamera * pCamera = NULL ;
std : : vector < IDevice : : RECOG_OBJECT > objs ;
std : : vector < IDevice : : RECOG_OBJECT > objs ;
std : : string fullPath = mPath + CTerminal : : BuildPhotoFileName ( mPhotoInfo );
std : : string fullPath = mPath + CTerminal : : BuildPhotoFileName ( mPhotoInfo , photoTime );
if ( result )
if ( result )
{
{
std : : rename ( path , fullPath . c_str ( ) ) ;
std : : rename ( path , fullPath . c_str ( ) ) ;
}
}
TakePhotoCb ( result ? 3 : 0 , mPhotoInfo , fullPath , time( NULL ) , objs ) ;
TakePhotoCb ( result ? 3 : 0 , mPhotoInfo , fullPath , pho toT ime, objs ) ;
bool turnOffOtg = ( mPhotoInfo . usbCamera ! = 0 ) ;
bool turnOffOtg = ( mPhotoInfo . usbCamera ! = 0 ) ;
std : : thread closeThread ( & CPhoneDevice : : CloseCamera2 , this , pCamera , mPhotoInfo . photoId , mPhotoInfo . cameraType ) ;
std : : thread closeThread ( & CPhoneDevice : : CloseCamera2 , this , pCamera , mPhotoInfo . photoId , mPhotoInfo . cameraType ) ;
@ -4119,16 +4116,16 @@ bool CPhoneDevice::OnVideoReady(bool photoOrVideo, bool result, const char* path
}
}
else
else
{
{
mPhotoInfo. photoTime = time ( NULL ) ;
time_t photoTime = time ( NULL ) ;
CPhoneCamera * pCamera = NULL ;
CPhoneCamera * pCamera = NULL ;
std : : vector < IDevice : : RECOG_OBJECT > objs ;
std : : vector < IDevice : : RECOG_OBJECT > objs ;
std : : string fullPath = mPath + CTerminal : : BuildPhotoFileName ( mPhotoInfo );
std : : string fullPath = mPath + CTerminal : : BuildPhotoFileName ( mPhotoInfo , photoTime );
if ( result )
if ( result )
{
{
std : : rename ( path , fullPath . c_str ( ) ) ;
std : : rename ( path , fullPath . c_str ( ) ) ;
}
}
TakePhotoCb ( result ? 3 : 0 , mPhotoInfo , fullPath , time( NULL ) , objs ) ;
TakePhotoCb ( result ? 3 : 0 , mPhotoInfo , fullPath , pho toT ime, objs ) ;
bool turnOffOtg = ( mPhotoInfo . usbCamera ! = 0 ) ;
bool turnOffOtg = ( mPhotoInfo . usbCamera ! = 0 ) ;
std : : thread closeThread ( & CPhoneDevice : : CloseCamera2 , this , pCamera , mPhotoInfo . photoId , mPhotoInfo . cameraType ) ;
std : : thread closeThread ( & CPhoneDevice : : CloseCamera2 , this , pCamera , mPhotoInfo . photoId , mPhotoInfo . cameraType ) ;
@ -4373,7 +4370,7 @@ void CPhoneDevice::CameraCtrl(unsigned short waitTime, unsigned short delayTime,
CPhoneDevice * pThis = this ;
CPhoneDevice * pThis = this ;
string serfileStr ( serfile ) ;
string serfileStr ( serfile ) ;
std : : thread ctrlThread ( [ pThis , waitTime , delayTime , cmdidx , channel , preset , serfileStr , baud ,
std : : thread ctrlThread ( [ pThis , waitTime , delayTime , cmdidx , channel , preset , serfileStr , baud ,
addr ] ( ) mutable {
addr ] ( ) {
uint64_t wid = pThis - > RequestWakelock ( 0 ) ;
uint64_t wid = pThis - > RequestWakelock ( 0 ) ;
XYLOG ( XYLOG_SEVERITY_INFO , " CameraCtrl Command= %d, preset = %u " , cmdidx , preset ) ;
XYLOG ( XYLOG_SEVERITY_INFO , " CameraCtrl Command= %d, preset = %u " , cmdidx , preset ) ;
pThis - > OpenPTZSensors ( waitTime ) ;
pThis - > OpenPTZSensors ( waitTime ) ;