|
|
|
@ -1008,6 +1008,7 @@ void NdkCamera::close()
|
|
|
|
|
if (capture_session)
|
|
|
|
|
{
|
|
|
|
|
// res = ACameraCaptureSession_stopRepeating(capture_session);
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "free capture_session");
|
|
|
|
|
ACameraCaptureSession_close(capture_session);
|
|
|
|
|
capture_session = 0;
|
|
|
|
|
}
|
|
|
|
@ -1021,6 +1022,7 @@ void NdkCamera::close()
|
|
|
|
|
res = ACaptureRequest_removeTarget(request->request, request->imageTarget);
|
|
|
|
|
ACaptureRequest_free(request->request);
|
|
|
|
|
request->request = 0;
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "free request");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -1033,22 +1035,26 @@ void NdkCamera::close()
|
|
|
|
|
|
|
|
|
|
delete request;
|
|
|
|
|
}
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "free mCaptureRequests");
|
|
|
|
|
mCaptureRequests.clear();
|
|
|
|
|
|
|
|
|
|
if (mPreviewOutputTarget != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mPreviewOutputTarget");
|
|
|
|
|
ACameraOutputTarget_free(mPreviewOutputTarget);
|
|
|
|
|
mPreviewOutputTarget = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mPreviewImageWindow != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mPreviewImageWindow");
|
|
|
|
|
ANativeWindow_release(mPreviewImageWindow);
|
|
|
|
|
mPreviewImageWindow = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mPreviewImageReader != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mPreviewImageReader");
|
|
|
|
|
AImageReader_setImageListener(mPreviewImageReader, NULL);
|
|
|
|
|
//XYLOG(XYLOG_SEVERITY_DEBUG, "CameraStatus::AImageReader_delete %s", mCameraId.c_str());
|
|
|
|
|
AImageReader_delete(mPreviewImageReader);
|
|
|
|
@ -1059,18 +1065,21 @@ void NdkCamera::close()
|
|
|
|
|
|
|
|
|
|
if (mOutputTarget != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mOutputTarget");
|
|
|
|
|
ACameraOutputTarget_free(mOutputTarget);
|
|
|
|
|
mOutputTarget = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mImageWindow != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mImageWindow");
|
|
|
|
|
ANativeWindow_release(mImageWindow);
|
|
|
|
|
mImageWindow = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mImageReader != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mImageReader");
|
|
|
|
|
AImageReader_setImageListener(mImageReader, NULL);
|
|
|
|
|
//XYLOG(XYLOG_SEVERITY_DEBUG, "CameraStatus::AImageReader_delete %s", mCameraId.c_str());
|
|
|
|
|
AImageReader_delete(mImageReader);
|
|
|
|
@ -1078,21 +1087,24 @@ void NdkCamera::close()
|
|
|
|
|
|
|
|
|
|
mImageReader = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"OutputTarget2");
|
|
|
|
|
if (mOutputTarget2 != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free OutputTarget2");
|
|
|
|
|
ACameraOutputTarget_free(mOutputTarget2);
|
|
|
|
|
mOutputTarget2 = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"mImageWindow2");
|
|
|
|
|
if (mImageWindow2 != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mImageWindow2");
|
|
|
|
|
ANativeWindow_release(mImageWindow2);
|
|
|
|
|
mImageWindow2 = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"mImageReader2");
|
|
|
|
|
if (mImageReader2 != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mImageReader2");
|
|
|
|
|
AImageReader_setImageListener(mImageReader2, NULL);
|
|
|
|
|
//XYLOG(XYLOG_SEVERITY_DEBUG, "CameraStatus::AImageReader_delete %s", mCameraId.c_str());
|
|
|
|
|
AImageReader_delete(mImageReader2);
|
|
|
|
@ -1100,9 +1112,10 @@ void NdkCamera::close()
|
|
|
|
|
|
|
|
|
|
mImageReader2 = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"mPreviewSessionOutput");
|
|
|
|
|
if (mPreviewSessionOutput != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mPreviewSessionOutput");
|
|
|
|
|
if (capture_session_output_container)
|
|
|
|
|
{
|
|
|
|
|
ACaptureSessionOutputContainer_remove(capture_session_output_container, mPreviewSessionOutput);
|
|
|
|
@ -1113,6 +1126,7 @@ void NdkCamera::close()
|
|
|
|
|
|
|
|
|
|
if (mSessionOutput != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mSessionOutput");
|
|
|
|
|
if (capture_session_output_container)
|
|
|
|
|
{
|
|
|
|
|
ACaptureSessionOutputContainer_remove(capture_session_output_container, mSessionOutput);
|
|
|
|
@ -1122,6 +1136,7 @@ void NdkCamera::close()
|
|
|
|
|
}
|
|
|
|
|
if (mSessionOutput2 != NULL)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free mSessionOutput2");
|
|
|
|
|
if (capture_session_output_container)
|
|
|
|
|
{
|
|
|
|
|
ACaptureSessionOutputContainer_remove(capture_session_output_container, mSessionOutput2);
|
|
|
|
@ -1132,12 +1147,14 @@ void NdkCamera::close()
|
|
|
|
|
|
|
|
|
|
if (capture_session_output_container)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free capture_session_output_container");
|
|
|
|
|
ACaptureSessionOutputContainer_free(capture_session_output_container);
|
|
|
|
|
capture_session_output_container = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (camera_device)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"free camera_device");
|
|
|
|
|
//XYLOG(XYLOG_SEVERITY_DEBUG, "CameraStatus::close device %s, %p", mCameraId.c_str(), camera_device);
|
|
|
|
|
ACameraDevice_close(camera_device);
|
|
|
|
|
//XYLOG(XYLOG_SEVERITY_DEBUG, "CameraStatus::closed device %s, %p", mCameraId.c_str(), camera_device);
|
|
|
|
|