|
|
|
@ -208,29 +208,29 @@ bool CPhoneDevice::CPhoneCamera::on_image(cv::Mat& rgb)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::CPhoneCamera::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics, std::shared_ptr<ACameraMetadata> result, uint32_t ldr, cv::Mat rgb)
|
|
|
|
|
bool CPhoneDevice::CPhoneCamera::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics, std::shared_ptr<ACameraMetadata> result, uint32_t ldr, uint32_t duration, cv::Mat rgb)
|
|
|
|
|
{
|
|
|
|
|
if (m_dev != NULL)
|
|
|
|
|
{
|
|
|
|
|
return m_dev->onOneCapture(characteristics, result, ldr, rgb);
|
|
|
|
|
return m_dev->onOneCapture(characteristics, result, ldr, duration, rgb);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::CPhoneCamera::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, std::vector<std::vector<uint8_t> >& frames)
|
|
|
|
|
bool CPhoneDevice::CPhoneCamera::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, uint32_t duration, std::vector<std::vector<uint8_t> >& frames)
|
|
|
|
|
{
|
|
|
|
|
if (m_dev != NULL)
|
|
|
|
|
{
|
|
|
|
|
return m_dev->onBurstCapture(characteristics, results, ldr, frames);
|
|
|
|
|
return m_dev->onBurstCapture(characteristics, results, ldr, duration, frames);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::CPhoneCamera::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, std::vector<std::shared_ptr<AImage> >& frames)
|
|
|
|
|
bool CPhoneDevice::CPhoneCamera::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, uint32_t duration, std::vector<std::shared_ptr<AImage> >& frames)
|
|
|
|
|
{
|
|
|
|
|
if (m_dev != NULL)
|
|
|
|
|
{
|
|
|
|
|
return m_dev->onBurstCapture(characteristics, results, ldr, frames);
|
|
|
|
|
return m_dev->onBurstCapture(characteristics, results, ldr, duration, frames);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -256,29 +256,29 @@ CPhoneDevice::CJpegCamera::CJpegCamera(CPhoneDevice* dev, int32_t width, int32_t
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::CJpegCamera::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics, std::shared_ptr<ACameraMetadata> result, uint32_t ldr, cv::Mat rgb)
|
|
|
|
|
bool CPhoneDevice::CJpegCamera::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics, std::shared_ptr<ACameraMetadata> result, uint32_t ldr, uint32_t duration, cv::Mat rgb)
|
|
|
|
|
{
|
|
|
|
|
if (m_dev != NULL)
|
|
|
|
|
{
|
|
|
|
|
return m_dev->onOneCapture(characteristics, result, ldr, rgb);
|
|
|
|
|
return m_dev->onOneCapture(characteristics, result, ldr, duration, rgb);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::CJpegCamera::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, std::vector<std::vector<uint8_t> >& frames)
|
|
|
|
|
bool CPhoneDevice::CJpegCamera::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, uint32_t duration, std::vector<std::vector<uint8_t> >& frames)
|
|
|
|
|
{
|
|
|
|
|
if (m_dev != NULL)
|
|
|
|
|
{
|
|
|
|
|
m_dev->onBurstCapture(characteristics, results, ldr, frames);
|
|
|
|
|
m_dev->onBurstCapture(characteristics, results, ldr, duration, frames);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::CJpegCamera::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, std::vector<std::shared_ptr<AImage> >& frames)
|
|
|
|
|
bool CPhoneDevice::CJpegCamera::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, uint32_t duration, std::vector<std::shared_ptr<AImage> >& frames)
|
|
|
|
|
{
|
|
|
|
|
if (m_dev != NULL)
|
|
|
|
|
{
|
|
|
|
|
m_dev->onBurstCapture(characteristics, results, ldr, frames);
|
|
|
|
|
m_dev->onBurstCapture(characteristics, results, ldr, duration, frames);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -1586,7 +1586,7 @@ void DrawOutlineText(cv::Ptr<cv::ft::FreeType2> ft2, cv::Mat& mat, const std::st
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics,
|
|
|
|
|
std::shared_ptr<ACameraMetadata> result,
|
|
|
|
|
uint32_t ldr, cv::Mat rgb)
|
|
|
|
|
uint32_t ldr, uint32_t duration, cv::Mat rgb)
|
|
|
|
|
{
|
|
|
|
|
time_t takingTime = time(NULL);
|
|
|
|
|
if (mPhotoInfo.remedy != 0)
|
|
|
|
@ -1638,7 +1638,7 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CPhoneDevice* pThis = this;
|
|
|
|
|
std::thread th([pThis, characteristics, result, photoInfo, osds, path, rgb, facing, sensorOrientation, ldr, takingTime]()mutable
|
|
|
|
|
std::thread th([pThis, characteristics, result, photoInfo, osds, path, rgb, facing, sensorOrientation, ldr, duration, takingTime]()mutable
|
|
|
|
|
{
|
|
|
|
|
std::string cameraInfo;
|
|
|
|
|
if (photoInfo.outputDbgInfo != 0)
|
|
|
|
@ -1656,7 +1656,7 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics
|
|
|
|
|
// isnan(captureResult.FocusDistance) ? 0 : captureResult.FocusDistance,
|
|
|
|
|
(unsigned int)captureResult.afState, (unsigned int)captureResult.aeState, captureResult.awbState,
|
|
|
|
|
captureResult.sceneMode, GpioControl::getLightAdc(), ldr, captureResult.zoomRatio,
|
|
|
|
|
(uint32_t)captureResult.duration, captureResult.frameDuration);
|
|
|
|
|
duration, captureResult.frameDuration);
|
|
|
|
|
cameraInfo = str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1716,7 +1716,7 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics,
|
|
|
|
|
std::vector<std::shared_ptr<ACameraMetadata> >& results,
|
|
|
|
|
uint32_t ldr, std::vector<std::vector<uint8_t> >& frames)
|
|
|
|
|
uint32_t ldr, uint32_t duration, std::vector<std::vector<uint8_t> >& frames)
|
|
|
|
|
{
|
|
|
|
|
time_t takingTime = time(NULL);
|
|
|
|
|
if (mPhotoInfo.remedy != 0)
|
|
|
|
@ -1750,7 +1750,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CPhoneDevice* pThis = this;
|
|
|
|
|
std::thread th([pThis, characteristics, results, photoInfo, osds, path, pByteArrays, ldr, takingTime]()mutable
|
|
|
|
|
std::thread th([pThis, characteristics, results, photoInfo, osds, path, pByteArrays, ldr, duration, takingTime]()mutable
|
|
|
|
|
{
|
|
|
|
|
cv::Mat rgb;
|
|
|
|
|
std::string cameraInfo;
|
|
|
|
@ -1785,13 +1785,13 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
unsigned int extime = (captureResult.exposureTime >= 1000000) ? ((unsigned int)(captureResult.exposureTime / 1000000)) : ((unsigned int)(captureResult.exposureTime / 1000));
|
|
|
|
|
strcpy(extimeunit, (captureResult.exposureTime >= 1000000) ? "ms" : "μs");
|
|
|
|
|
char str[128] = { 0 };
|
|
|
|
|
snprintf(str, sizeof(str), "AE=%u AF=%u EXPS=%u%s(%d) ISO=%d AFS=%u AES=%u AWBS=%u SCENE=%d LDR=%d(%u) %0.1fx T=%u FD=%lld",
|
|
|
|
|
snprintf(str, sizeof(str), "AE=%u AF=%u EXPS=%u%s(%d) ISO=%d AFS=%u AES=%u AWBS=%u SCENE=%d LDR=%d(%u) %0.1fx T=%u FD=%lld BURST",
|
|
|
|
|
captureResult.autoExposure, captureResult.autoFocus,
|
|
|
|
|
extime, extimeunit, captureResult.compensation, captureResult.sensitivity,
|
|
|
|
|
// isnan(captureResult.FocusDistance) ? 0 : captureResult.FocusDistance,
|
|
|
|
|
(unsigned int)captureResult.afState, (unsigned int)captureResult.aeState, captureResult.awbState,
|
|
|
|
|
captureResult.sceneMode, GpioControl::getLightAdc(), ldr, captureResult.zoomRatio,
|
|
|
|
|
(uint32_t)captureResult.duration, captureResult.frameDuration);
|
|
|
|
|
duration, captureResult.frameDuration);
|
|
|
|
|
cameraInfo = str;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1943,7 +1943,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics,
|
|
|
|
|
std::vector<std::shared_ptr<ACameraMetadata> >& results,
|
|
|
|
|
uint32_t ldr, std::vector<std::shared_ptr<AImage> >& frames)
|
|
|
|
|
uint32_t ldr, uint32_t duration, std::vector<std::shared_ptr<AImage> >& frames)
|
|
|
|
|
{
|
|
|
|
|
time_t takingTime = time(NULL);
|
|
|
|
|
if (mPhotoInfo.remedy != 0)
|
|
|
|
@ -2118,7 +2118,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CPhoneDevice* pThis = this;
|
|
|
|
|
std::thread th([pThis, characteristics, results, photoInfo, osds, path, rgb, rawFiles, facing, sensorOrientation, ldr, takingTime]()mutable
|
|
|
|
|
std::thread th([pThis, characteristics, results, photoInfo, osds, path, rgb, rawFiles, facing, sensorOrientation, ldr, duration, takingTime]()mutable
|
|
|
|
|
{
|
|
|
|
|
std::string cameraInfo;
|
|
|
|
|
if (photoInfo.outputDbgInfo != 0)
|
|
|
|
@ -2138,7 +2138,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
// isnan(captureResult.FocusDistance) ? 0 : captureResult.FocusDistance,
|
|
|
|
|
(unsigned int)captureResult.afState, (unsigned int)captureResult.aeState, captureResult.awbState,
|
|
|
|
|
captureResult.sceneMode, GpioControl::getLightAdc(), ldr, captureResult.zoomRatio,
|
|
|
|
|
(uint32_t)captureResult.duration, captureResult.frameDuration);
|
|
|
|
|
duration, captureResult.frameDuration);
|
|
|
|
|
cameraInfo = str;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|