summaryrefslogtreecommitdiffstats
path: root/libcamera/SecCameraHWInterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcamera/SecCameraHWInterface.h')
-rw-r--r--libcamera/SecCameraHWInterface.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/libcamera/SecCameraHWInterface.h b/libcamera/SecCameraHWInterface.h
index 5c1a78b..150de62 100644
--- a/libcamera/SecCameraHWInterface.h
+++ b/libcamera/SecCameraHWInterface.h
@@ -83,13 +83,12 @@ private:
PreviewThread(CameraHardwareSec *hw):
Thread(false),
mHardware(hw) { }
+ virtual void onFirstRef() {
+ run("CameraPreviewThread", PRIORITY_URGENT_DISPLAY);
+ }
virtual bool threadLoop() {
- int ret = mHardware->previewThread();
- // loop until we need to quit
- if(ret == NO_ERROR)
- return true;
- else
- return false;
+ mHardware->previewThreadWrapper();
+ return false;
}
};
@@ -101,6 +100,7 @@ private:
mHardware(hw) { }
virtual bool threadLoop() {
mHardware->pictureThread();
+ mHardware->mSecCamera->endSnapshot();
return false;
}
};
@@ -123,7 +123,7 @@ private:
sp<PreviewThread> mPreviewThread;
int previewThread();
- bool mPreviewRunning;
+ int previewThreadWrapper();
sp<AutoFocusThread> mAutoFocusThread;
int autoFocusThread();
@@ -159,9 +159,16 @@ private:
void setSkipFrame(int frame);
/* used by auto focus thread to block until it's told to run */
mutable Mutex mFocusLock;
- mutable Condition mCondition;
+ mutable Condition mFocusCondition;
bool mExitAutoFocusThread;
+ /* used by preview thread to block until it's told to run */
+ mutable Mutex mPreviewLock;
+ mutable Condition mPreviewCondition;
+ mutable Condition mPreviewStoppedCondition;
+ bool mPreviewRunning;
+ bool mExitPreviewThread;
+
/* used to guard threading state */
mutable Mutex mStateLock;