diff options
| author | James Dong <jdong@google.com> | 2011-02-17 16:38:06 -0800 |
|---|---|---|
| committer | James Dong <jdong@google.com> | 2011-02-22 20:48:15 -0800 |
| commit | e00cab707dcaf6f05adb5ccb9c80fdf25c483427 (patch) | |
| tree | 1e69fd3c108e675a5a68b598f31882df58b602fb /services/camera/libcameraservice | |
| parent | 16dc3073a2f06a77d9873e536f633a4adf575fce (diff) | |
| download | frameworks_base-e00cab707dcaf6f05adb5ccb9c80fdf25c483427.zip frameworks_base-e00cab707dcaf6f05adb5ccb9c80fdf25c483427.tar.gz frameworks_base-e00cab707dcaf6f05adb5ccb9c80fdf25c483427.tar.bz2 | |
Application-managed callback buffer support for raw image
bug - 3292153
Change-Id: I9789f7c5cde3a3889d7375e881181e9152d95fc2
Diffstat (limited to 'services/camera/libcameraservice')
| -rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 25 | ||||
| -rw-r--r-- | services/camera/libcameraservice/CameraService.h | 2 |
2 files changed, 20 insertions, 7 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 3d8ca7a..a09e16b 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -727,17 +727,30 @@ status_t CameraService::Client::cancelAutoFocus() { } // take a picture - image is returned in callback -status_t CameraService::Client::takePicture() { - LOG1("takePicture (pid %d)", getCallingPid()); +status_t CameraService::Client::takePicture(int msgType) { + LOG1("takePicture (pid %d): 0x%x", getCallingPid(), msgType); Mutex::Autolock lock(mLock); status_t result = checkPidAndHardware(); if (result != NO_ERROR) return result; - enableMsgType(CAMERA_MSG_SHUTTER | - CAMERA_MSG_POSTVIEW_FRAME | - CAMERA_MSG_RAW_IMAGE | - CAMERA_MSG_COMPRESSED_IMAGE); + if ((msgType & CAMERA_MSG_RAW_IMAGE) && + (msgType & CAMERA_MSG_RAW_IMAGE_NOTIFY)) { + LOGE("CAMERA_MSG_RAW_IMAGE and CAMERA_MSG_RAW_IMAGE_NOTIFY" + " cannot be both enabled"); + return BAD_VALUE; + } + + // We only accept picture related message types + // and ignore other types of messages for takePicture(). + int picMsgType = msgType + & (CAMERA_MSG_SHUTTER | + CAMERA_MSG_POSTVIEW_FRAME | + CAMERA_MSG_RAW_IMAGE | + CAMERA_MSG_RAW_IMAGE_NOTIFY | + CAMERA_MSG_COMPRESSED_IMAGE); + + enableMsgType(picMsgType); return mHardware->takePicture(); } diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index ccb9cf7..1c43b00 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -108,7 +108,7 @@ private: virtual void releaseRecordingFrame(const sp<IMemory>& mem); virtual status_t autoFocus(); virtual status_t cancelAutoFocus(); - virtual status_t takePicture(); + virtual status_t takePicture(int msgType); virtual status_t setParameters(const String8& params); virtual String8 getParameters() const; virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2); |
