summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-07-11 05:42:20 +0800
committerWu-cheng Li <wuchengli@google.com>2011-07-11 07:39:45 +0800
commit4626825c2f52c2875735b34e84301cf759c2d571 (patch)
tree85d5a3678c354b5c4a7dd2747ab85390cbd1b6f0 /libcamera
parentc7b08ce83e0fc255ca785788e2cac827ef88dbda (diff)
downloaddevice_samsung_crespo-4626825c2f52c2875735b34e84301cf759c2d571.zip
device_samsung_crespo-4626825c2f52c2875735b34e84301cf759c2d571.tar.gz
device_samsung_crespo-4626825c2f52c2875735b34e84301cf759c2d571.tar.bz2
Fix black preview in Goggles.
Goggles uses the following call sequence and that should be valid. 1. setPreviewCallback 2. startPreview 3. setPreviewDisplay The problem is preview was stopped in setPreviewWindow. No matter CAMERA_MSG_PREVIEW_FRAME or CAMERA_MSG_VIDEO_FRAME is enabled or not, defer the startPreview if preview window is not set. Change-Id: I332a6393f9923a9a1910e53e8da3b2783bfabff7
Diffstat (limited to 'libcamera')
-rw-r--r--libcamera/SecCameraHWInterface.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index c736e8b..495fe88 100644
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -484,17 +484,6 @@ void CameraHardwareSec::enableMsgType(int32_t msgType)
__func__, msgType, mMsgEnabled);
mMsgEnabled |= msgType;
- mPreviewLock.lock();
- if ((msgType & (CAMERA_MSG_PREVIEW_FRAME | CAMERA_MSG_VIDEO_FRAME)) &&
- mPreviewRunning && mPreviewStartDeferred) {
- LOGV("%s: starting deferred preview", __func__);
- if (startPreviewInternal() == OK) {
- mPreviewStartDeferred = false;
- mPreviewCondition.signal();
- }
- }
- mPreviewLock.unlock();
-
LOGV("%s : mMsgEnabled = 0x%x", __func__, mMsgEnabled);
}
@@ -749,9 +738,7 @@ status_t CameraHardwareSec::startPreview()
mPreviewRunning = true;
mPreviewStartDeferred = false;
- if (!mPreviewWindow &&
- !(mMsgEnabled & CAMERA_MSG_PREVIEW_FRAME) &&
- !(mMsgEnabled & CAMERA_MSG_VIDEO_FRAME)) {
+ if (!mPreviewWindow) {
LOGI("%s : deferring", __func__);
mPreviewStartDeferred = true;
mPreviewLock.unlock();