summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
Diffstat (limited to 'libcamera')
-rwxr-xr-xlibcamera/SecCameraHWInterface.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index e37a247..4615de0 100755
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -305,6 +305,14 @@ CameraHardwareSec::~CameraHardwareSec()
if(mRecordHeap != NULL)
mRecordHeap.clear();
+#if defined(BOARD_USES_OVERLAY)
+ if(mUseOverlay) {
+ mOverlay->destroy();
+ mUseOverlay = false;
+ mOverlay = NULL;
+ }
+#endif
+
mSecCamera = NULL;
singleton.clear();
@@ -405,7 +413,10 @@ int CameraHardwareSec::previewThread()
overlay_buffer_t overlay_buffer;
ret = mOverlay->dequeueBuffer(&overlay_buffer);
- if (ret == -1) {
+
+ if (ret == ALL_BUFFERS_FLUSHED) {
+ goto OverlayEnd;
+ } else if (ret == -1) {
LOGE("ERR(%s):overlay dequeueBuffer fail", __func__);
goto OverlayEnd;
}
@@ -674,14 +685,6 @@ void CameraHardwareSec::stopPreview()
mPreviewRunning = false;
-#if defined(BOARD_USES_OVERLAY)
- if(mUseOverlay) {
- mOverlay->destroy();
- mUseOverlay = false;
- mOverlay = NULL;
- }
-#endif
-
}
bool CameraHardwareSec::previewEnabled() {