diff options
Diffstat (limited to 'libcamera/SecCameraHWInterface.h')
-rw-r--r-- | libcamera/SecCameraHWInterface.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/libcamera/SecCameraHWInterface.h b/libcamera/SecCameraHWInterface.h index f416d9f..724d1bc 100644 --- a/libcamera/SecCameraHWInterface.h +++ b/libcamera/SecCameraHWInterface.h @@ -82,13 +82,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; } }; @@ -100,6 +99,7 @@ private: mHardware(hw) { } virtual bool threadLoop() { mHardware->pictureThread(); + mHardware->mSecCamera->endSnapshot(); return false; } }; @@ -122,7 +122,7 @@ private: sp<PreviewThread> mPreviewThread; int previewThread(); - bool mPreviewRunning; + int previewThreadWrapper(); sp<AutoFocusThread> mAutoFocusThread; int autoFocusThread(); @@ -158,9 +158,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; |