summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-02-17 16:38:06 -0800
committerJames Dong <jdong@google.com>2011-02-22 20:48:15 -0800
commite00cab707dcaf6f05adb5ccb9c80fdf25c483427 (patch)
tree1e69fd3c108e675a5a68b598f31882df58b602fb /services/camera/libcameraservice/CameraService.cpp
parent16dc3073a2f06a77d9873e536f633a4adf575fce (diff)
downloadframeworks_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/CameraService.cpp')
-rw-r--r--services/camera/libcameraservice/CameraService.cpp25
1 files changed, 19 insertions, 6 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();
}