summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice
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
commite468ac57f6e8afc6078c76d4eb1ac327112a3de0 (patch)
treeb6f657aa11261327f5f4743dd54f796e73ec328b /services/camera/libcameraservice
parent8e0e1979f0f41487b0f18aa5b9c8c52a39ca27f4 (diff)
downloadframeworks_av-e468ac57f6e8afc6078c76d4eb1ac327112a3de0.zip
frameworks_av-e468ac57f6e8afc6078c76d4eb1ac327112a3de0.tar.gz
frameworks_av-e468ac57f6e8afc6078c76d4eb1ac327112a3de0.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.cpp25
-rw-r--r--services/camera/libcameraservice/CameraService.h2
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);