diff options
author | Apurva Rajguru <arajguru@codeaurora.org> | 2012-07-12 11:34:12 -0700 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-02-03 18:13:39 +0000 |
commit | 4b47852b1b4de2f87ec1c1d7b44b41821a19eb35 (patch) | |
tree | 52769a8e83c51934b743f94353d971a6bb856ce4 /services/camera | |
parent | 69d8d46c5985ed76947f875ee3b7d32febfcf201 (diff) | |
download | frameworks_av-4b47852b1b4de2f87ec1c1d7b44b41821a19eb35.zip frameworks_av-4b47852b1b4de2f87ec1c1d7b44b41821a19eb35.tar.gz frameworks_av-4b47852b1b4de2f87ec1c1d7b44b41821a19eb35.tar.bz2 |
Camera: Enable QC Camera feature set.
Change-Id: Ie52b6207293abe5a57d3bbe9d9c43e8c5b070af5
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/CameraClient.cpp | 24 | ||||
-rw-r--r-- | services/camera/libcameraservice/CameraHardwareInterface.h | 6 | ||||
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 15 |
3 files changed, 41 insertions, 4 deletions
diff --git a/services/camera/libcameraservice/CameraClient.cpp b/services/camera/libcameraservice/CameraClient.cpp index 6be7403..1cdb938 100644 --- a/services/camera/libcameraservice/CameraClient.cpp +++ b/services/camera/libcameraservice/CameraClient.cpp @@ -83,8 +83,10 @@ status_t CameraClient::initialize(camera_module_t *module) { (void *)mCameraId); // Enable zoom, error, focus, and metadata messages by default - enableMsgType(CAMERA_MSG_ERROR | CAMERA_MSG_ZOOM | CAMERA_MSG_FOCUS | - CAMERA_MSG_PREVIEW_METADATA + enableMsgType(CAMERA_MSG_ERROR | CAMERA_MSG_ZOOM | CAMERA_MSG_FOCUS +#ifndef QCOM_HARDWARE + | CAMERA_MSG_PREVIEW_METADATA +#endif #ifndef OMAP_ICS_CAMERA | CAMERA_MSG_FOCUS_MOVE #endif @@ -248,9 +250,14 @@ void CameraClient::disconnect() { // Release the held ANativeWindow resources. if (mPreviewWindow != 0) { +#ifdef QCOM_HARDWARE + mHardware->setPreviewWindow(0); +#endif disconnectWindow(mPreviewWindow); mPreviewWindow = 0; +#ifndef QCOM_HARDWARE mHardware->setPreviewWindow(mPreviewWindow); +#endif } mHardware.clear(); @@ -289,6 +296,10 @@ status_t CameraClient::setPreviewWindow(const sp<IBinder>& binder, native_window_set_buffers_transform(window.get(), mOrientation); result = mHardware->setPreviewWindow(window); } +#ifdef QCOM_HARDWARE + } else { + result = mHardware->setPreviewWindow(window); +#endif } if (result == NO_ERROR) { @@ -348,6 +359,9 @@ void CameraClient::setPreviewCallbackFlag(int callback_flag) { // start preview mode status_t CameraClient::startPreview() { LOG1("startPreview (pid %d)", getCallingPid()); +#ifdef QCOM_HARDWARE + enableMsgType(CAMERA_MSG_PREVIEW_METADATA); +#endif return startCameraMode(CAMERA_PREVIEW_MODE); } @@ -438,6 +452,9 @@ status_t CameraClient::startRecordingMode() { // stop preview mode void CameraClient::stopPreview() { LOG1("stopPreview (pid %d)", getCallingPid()); +#ifdef QCOM_HARDWARE + disableMsgType(CAMERA_MSG_PREVIEW_METADATA); +#endif Mutex::Autolock lock(mLock); if (checkPidAndHardware() != NO_ERROR) return; @@ -555,6 +572,9 @@ status_t CameraClient::takePicture(int msgType) { picMsgType |= CAMERA_MSG_COMPRESSED_BURST_IMAGE; #endif +#ifdef QCOM_HARDWARE + disableMsgType(CAMERA_MSG_PREVIEW_METADATA); +#endif enableMsgType(picMsgType); return mHardware->takePicture(); diff --git a/services/camera/libcameraservice/CameraHardwareInterface.h b/services/camera/libcameraservice/CameraHardwareInterface.h index 9f529a0..d67996e 100644 --- a/services/camera/libcameraservice/CameraHardwareInterface.h +++ b/services/camera/libcameraservice/CameraHardwareInterface.h @@ -113,6 +113,12 @@ public: ALOGV("%s(%s) buf %p", __FUNCTION__, mName.string(), buf.get()); if (mDevice->ops->set_preview_window) { +#ifdef QCOM_HARDWARE + ALOGV("%s buf %p mPreviewWindow %p", __FUNCTION__, buf.get(), mPreviewWindow.get()); + if (mPreviewWindow.get() && (buf.get() != mPreviewWindow.get())) { + mDevice->ops->set_preview_window(mDevice, 0); + } +#endif mPreviewWindow = buf; mHalPreviewWindow.user = this; ALOGV("%s &mHalPreviewWindow %p mHalPreviewWindow.user %p", __FUNCTION__, diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 124d24d..d8365eb 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -37,6 +37,7 @@ #include <utils/Log.h> #include <utils/String16.h> +#include <system/camera.h> #include "CameraService.h" #include "CameraClient.h" #include "Camera2Client.h" @@ -358,8 +359,18 @@ void CameraService::loadSound() { LOG1("CameraService::loadSound ref=%d", mSoundRef); if (mSoundRef++) return; - mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg"); - mSoundPlayer[SOUND_RECORDING] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg"); + char value[PROPERTY_VALUE_MAX]; + property_get("persist.camera.shutter.disable", value, "0"); + int disableSound = atoi(value); + + if(!disableSound) { + mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg"); + mSoundPlayer[SOUND_RECORDING] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg"); + } + else { + mSoundPlayer[SOUND_SHUTTER] = NULL; + mSoundPlayer[SOUND_RECORDING] = NULL; + } } void CameraService::releaseSound() { |