diff options
author | Wu-cheng Li <wuchengli@google.com> | 2010-09-03 16:40:32 -0700 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2010-09-09 16:23:35 -0700 |
commit | d02c812a212e5675d862ce0564cd3dfe016cdf14 (patch) | |
tree | 1c1c2d2efb628954a74c3509e8958bedd0d054e9 /services/camera/libcameraservice/CameraService.cpp | |
parent | de6386b8a66eade182ffb0eee8124c0814de960c (diff) | |
download | frameworks_base-d02c812a212e5675d862ce0564cd3dfe016cdf14.zip frameworks_base-d02c812a212e5675d862ce0564cd3dfe016cdf14.tar.gz frameworks_base-d02c812a212e5675d862ce0564cd3dfe016cdf14.tar.bz2 |
Only enable CAMERA_MSG_PREVIEW_FRAME when necessary.
Now camera driver uses ANativeWindow for display.
CameraService should not request preview callback from
camera hardware if applications have not requested it.
bug:2951018
Change-Id: I85f74ea4a61104feca018867bc9d6dfe3a9479f5
Diffstat (limited to 'services/camera/libcameraservice/CameraService.cpp')
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index d1fbf17..e5889bf 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -567,16 +567,10 @@ void CameraService::Client::setPreviewCallbackFlag(int callback_flag) { if (checkPidAndHardware() != NO_ERROR) return; mPreviewCallbackFlag = callback_flag; - - // If we don't use overlay, we always need the preview frame for display. - // If we do use overlay, we only need the preview frame if the user - // wants the data. - if (mUseOverlay) { - if(mPreviewCallbackFlag & FRAME_CALLBACK_FLAG_ENABLE_MASK) { - enableMsgType(CAMERA_MSG_PREVIEW_FRAME); - } else { - disableMsgType(CAMERA_MSG_PREVIEW_FRAME); - } + if (mPreviewCallbackFlag & FRAME_CALLBACK_FLAG_ENABLE_MASK) { + enableMsgType(CAMERA_MSG_PREVIEW_FRAME); + } else { + disableMsgType(CAMERA_MSG_PREVIEW_FRAME); } } @@ -636,7 +630,6 @@ status_t CameraService::Client::startPreviewMode() { } else { // XXX: Set the orientation of the ANativeWindow. mHardware->setPreviewWindow(mPreviewWindow); - enableMsgType(CAMERA_MSG_PREVIEW_FRAME); result = mHardware->startPreview(); } return result; @@ -1025,9 +1018,7 @@ void CameraService::Client::handlePreviewData(const sp<IMemory>& mem) { mPreviewCallbackFlag &= ~(FRAME_CALLBACK_FLAG_ONE_SHOT_MASK | FRAME_CALLBACK_FLAG_COPY_OUT_MASK | FRAME_CALLBACK_FLAG_ENABLE_MASK); - if (mUseOverlay) { - disableMsgType(CAMERA_MSG_PREVIEW_FRAME); - } + disableMsgType(CAMERA_MSG_PREVIEW_FRAME); } if (c != 0) { |