summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/camera/libcameraservice/CameraClient.cpp47
-rw-r--r--services/camera/libcameraservice/CameraClient.h3
2 files changed, 49 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/CameraClient.cpp b/services/camera/libcameraservice/CameraClient.cpp
index b930c02..669c3b5 100644
--- a/services/camera/libcameraservice/CameraClient.cpp
+++ b/services/camera/libcameraservice/CameraClient.cpp
@@ -84,7 +84,11 @@ status_t CameraClient::initialize(camera_module_t *module) {
// Enable zoom, error, focus, and metadata messages by default
enableMsgType(CAMERA_MSG_ERROR | CAMERA_MSG_ZOOM | CAMERA_MSG_FOCUS |
- CAMERA_MSG_PREVIEW_METADATA | CAMERA_MSG_FOCUS_MOVE);
+ CAMERA_MSG_PREVIEW_METADATA
+#ifndef OMAP_ICS_CAMERA
+ | CAMERA_MSG_FOCUS_MOVE
+#endif
+ );
LOG1("CameraClient::initialize X (pid %d, id %d)", callingPid, mCameraId);
return OK;
@@ -393,6 +397,11 @@ status_t CameraClient::startPreviewMode() {
native_window_set_buffers_transform(mPreviewWindow.get(),
mOrientation);
}
+
+#if defined(OMAP_ICS_CAMERA) || defined(OMAP_ENHANCEMENT_BURST_CAPTURE)
+ disableMsgType(CAMERA_MSG_COMPRESSED_BURST_IMAGE);
+#endif
+
mHardware->setPreviewWindow(mPreviewWindow);
result = mHardware->startPreview();
@@ -432,6 +441,16 @@ void CameraClient::stopPreview() {
Mutex::Autolock lock(mLock);
if (checkPidAndHardware() != NO_ERROR) return;
+#ifdef OMAP_ENHANCEMENT
+ // According to framework documentation, preview needs
+ // to be started for image capture. This will make sure
+ // that image capture related messages get disabled if
+ // not done already in their respective handlers.
+ // If these messages come when in the midddle of
+ // stopping preview we will deadlock the system in
+ // lockIfMessageWanted().
+ disableMsgType(CAMERA_MSG_POSTVIEW_FRAME);
+#endif
disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
mHardware->stopPreview();
@@ -527,8 +546,15 @@ status_t CameraClient::takePicture(int msgType) {
CAMERA_MSG_POSTVIEW_FRAME |
CAMERA_MSG_RAW_IMAGE |
CAMERA_MSG_RAW_IMAGE_NOTIFY |
+#if defined(OMAP_ICS_CAMERA) || defined(OMAP_ENHANCEMENT_BURST_CAPTURE)
+ CAMERA_MSG_RAW_BURST |
+#endif
CAMERA_MSG_COMPRESSED_IMAGE);
+#if defined(OMAP_ICS_CAMERA) || defined(OMAP_ENHANCEMENT_BURST_CAPTURE)
+ picMsgType |= CAMERA_MSG_COMPRESSED_BURST_IMAGE;
+#endif
+
enableMsgType(picMsgType);
return mHardware->takePicture();
@@ -740,6 +766,11 @@ void CameraClient::dataCallback(int32_t msgType,
case CAMERA_MSG_COMPRESSED_IMAGE:
client->handleCompressedPicture(dataPtr);
break;
+#if defined(OMAP_ICS_CAMERA) || defined(OMAP_ENHANCEMENT_BURST_CAPTURE)
+ case CAMERA_MSG_COMPRESSED_BURST_IMAGE:
+ client->handleCompressedBurstPicture(dataPtr);
+ break;
+#endif
default:
client->handleGenericData(msgType, dataPtr, metadata);
break;
@@ -869,6 +900,20 @@ void CameraClient::handleCompressedPicture(const sp<IMemory>& mem) {
}
}
+#if defined(OMAP_ICS_CAMERA) || defined(OMAP_ENHANCEMENT_BURST_CAPTURE)
+// burst picture callback - compressed picture ready
+void CameraClient::handleCompressedBurstPicture(const sp<IMemory>& mem) {
+ // Don't disable this message type yet. In this mode takePicture() will
+ // get called only once. When burst finishes this message will get automatically
+ // disabled in the respective call for restarting the preview.
+
+ sp<ICameraClient> c = mCameraClient;
+ mLock.unlock();
+ if (c != 0) {
+ c->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, mem, NULL);
+ }
+}
+#endif
void CameraClient::handleGenericNotify(int32_t msgType,
int32_t ext1, int32_t ext2) {
diff --git a/services/camera/libcameraservice/CameraClient.h b/services/camera/libcameraservice/CameraClient.h
index 2f31c4e..9b10706 100644
--- a/services/camera/libcameraservice/CameraClient.h
+++ b/services/camera/libcameraservice/CameraClient.h
@@ -97,6 +97,9 @@ private:
void handlePostview(const sp<IMemory>& mem);
void handleRawPicture(const sp<IMemory>& mem);
void handleCompressedPicture(const sp<IMemory>& mem);
+#if defined(OMAP_ICS_CAMERA) || defined(OMAP_ENHANCEMENT_BURST_CAPTURE)
+ void handleCompressedBurstPicture(const sp<IMemory>& mem);
+#endif
void handleGenericNotify(int32_t msgType, int32_t ext1, int32_t ext2);
void handleGenericData(int32_t msgType, const sp<IMemory>& dataPtr,
camera_frame_metadata_t *metadata);