|
|
@ -598,7 +598,7 @@ int NdkCamera::open(const std::string& cameraId) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// setup imagereader and its surface
|
|
|
|
// setup imagereader and its surface
|
|
|
|
media_status_t mstatus = AImageReader_new(foundRes.org_width(), foundRes.org_height(), AIMAGE_FORMAT_YUV_420_888, 5, &mPreviewImageReader);
|
|
|
|
media_status_t mstatus = AImageReader_new(foundRes.org_width(), foundRes.org_height(), AIMAGE_FORMAT_YUV_420_888, 4, &mPreviewImageReader);
|
|
|
|
if (mstatus == AMEDIA_OK)
|
|
|
|
if (mstatus == AMEDIA_OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AImageReader_ImageListener listener;
|
|
|
|
AImageReader_ImageListener listener;
|
|
|
@ -613,7 +613,7 @@ int NdkCamera::open(const std::string& cameraId) {
|
|
|
|
status = ACaptureSessionOutput_create(mPreviewImageWindow, &mPreviewSessionOutput);
|
|
|
|
status = ACaptureSessionOutput_create(mPreviewImageWindow, &mPreviewSessionOutput);
|
|
|
|
status = ACaptureSessionOutputContainer_add(capture_session_output_container, mPreviewSessionOutput);
|
|
|
|
status = ACaptureSessionOutputContainer_add(capture_session_output_container, mPreviewSessionOutput);
|
|
|
|
|
|
|
|
|
|
|
|
mstatus = AImageReader_new(foundRes.org_width(), foundRes.org_height(), getOutputFormat(), burstCaptures, &mImageReader);
|
|
|
|
mstatus = AImageReader_new(foundRes.org_width(), foundRes.org_height(), getOutputFormat(), burstCaptures + 1, &mImageReader);
|
|
|
|
if (mstatus == AMEDIA_OK)
|
|
|
|
if (mstatus == AMEDIA_OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AImageReader_ImageListener listener;
|
|
|
|
AImageReader_ImageListener listener;
|
|
|
@ -1242,7 +1242,7 @@ void NdkCamera::onImageAvailable(AImageReader* reader)
|
|
|
|
// https://stackoverflow.com/questions/67063562
|
|
|
|
// https://stackoverflow.com/questions/67063562
|
|
|
|
if (mstatus != AMEDIA_IMGREADER_NO_BUFFER_AVAILABLE)
|
|
|
|
if (mstatus != AMEDIA_IMGREADER_NO_BUFFER_AVAILABLE)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "AImageReader_acquireLatestImage error: %d", mstatus);
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "Preview AImageReader_acquireLatestImage error: %d", mstatus);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1284,7 +1284,7 @@ void NdkCamera::onImageAvailable(AImageReader* reader)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (mCaptureFrames.size() < burstCaptures)
|
|
|
|
if (mCaptureFrames.size() < burstCaptures)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "AImageReader_acquireNextImage error: %d", mstatus);
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "Capture AImageReader_acquireNextImage error: %d", mstatus);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|