diff options
author | Priya Komarlingam <knspriya@codeaurora.org> | 2010-06-23 19:37:21 -0700 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2010-07-18 08:21:06 -0400 |
commit | e3f019874c4e6f7ee9d6d4f7ef1b8e514e57d0b3 (patch) | |
tree | 1af81e3561c2fc52837b0d19913555fb283d676b /camera | |
parent | 8edf4f8e4047dafa8e1f3dad4e21cdd48ca4081d (diff) | |
download | frameworks_base-e3f019874c4e6f7ee9d6d4f7ef1b8e514e57d0b3.zip frameworks_base-e3f019874c4e6f7ee9d6d4f7ef1b8e514e57d0b3.tar.gz frameworks_base-e3f019874c4e6f7ee9d6d4f7ef1b8e514e57d0b3.tar.bz2 |
frameworks/base: compilation changes
camera changes and audio changes for compilation
Change-Id: Ic1ed590eed00e2c7093e6b2f9dc5188b6aee4926
Diffstat (limited to 'camera')
-rw-r--r-- | camera/libcameraservice/CameraService.cpp | 36 | ||||
-rw-r--r-- | camera/libcameraservice/CameraService.h | 2 |
2 files changed, 23 insertions, 15 deletions
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp index 12f6c08..c475414 100644 --- a/camera/libcameraservice/CameraService.cpp +++ b/camera/libcameraservice/CameraService.cpp @@ -911,32 +911,39 @@ status_t CameraService::Client::takePicture() // snapshot taken void CameraService::Client::handleShutter( - image_rect_type *size // The width and height of yuv picture for + image_rect_type *size, // The width and height of yuv picture for // registerBuffer. If this is NULL, use the picture // size from parameters. + bool playShutterSoundOnly ) { // Play shutter sound. - if (mMediaPlayerClick.get() != NULL) { - // do not play shutter sound if stream volume is 0 - // (typically because ringer mode is silent). - int index; - AudioSystem::getStreamVolumeIndex(AudioSystem::ENFORCED_AUDIBLE, &index); - if (index != 0) { - mMediaPlayerClick->seekTo(0); - mMediaPlayerClick->start(); + + if(playShutterSoundOnly) { + + if (mMediaPlayerClick.get() != NULL) { + // do not play shutter sound if stream volume is 0 + // (typically because ringer mode is silent). + int index; + AudioSystem::getStreamVolumeIndex(AudioSystem::ENFORCED_AUDIBLE, &index); + if (index != 0) { + mMediaPlayerClick->seekTo(0); + mMediaPlayerClick->start(); + } } + sp<ICameraClient> c = mCameraClient; + if (c != NULL) { + c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0); + } + return ; } + // Screen goes black after the buffer is unregistered. if (mSurface != 0 && !mUseOverlay) { mSurface->unregisterBuffers(); } - sp<ICameraClient> c = mCameraClient; - if (c != NULL) { - c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0); - } mHardware->disableMsgType(CAMERA_MSG_SHUTTER); // It takes some time before yuvPicture callback to be called. @@ -953,6 +960,7 @@ void CameraService::Client::handleShutter( h &= ~1; LOGV("Snapshot image width=%d, height=%d", w, h); } + // FIXME: don't use hardcoded format constants here ISurface::BufferHeap buffers(w, h, w, h, HAL_PIXEL_FORMAT_YCrCb_420_SP, mOrientation, 0, @@ -1109,7 +1117,7 @@ void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1, int32_ switch (msgType) { case CAMERA_MSG_SHUTTER: // ext1 is the dimension of the yuv picture. - client->handleShutter((image_rect_type *)ext1); + client->handleShutter((image_rect_type *)ext1, (bool)ext2); break; default: sp<ICameraClient> c = client->mCameraClient; diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h index bc49b1d..81c10b0 100644 --- a/camera/libcameraservice/CameraService.h +++ b/camera/libcameraservice/CameraService.h @@ -145,7 +145,7 @@ private: static sp<Client> getClientFromCookie(void* user); void handlePreviewData(const sp<IMemory>&); - void handleShutter(image_rect_type *image); + void handleShutter(image_rect_type *image, bool playShutterSoundOnly); void handlePostview(const sp<IMemory>&); void handleRawPicture(const sp<IMemory>&); void handleCompressedPicture(const sp<IMemory>&); |