summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorx0118064 <saravanan.s@ti.com>2011-09-26 19:03:36 -0500
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-26 14:35:22 +0000
commitaa01a15ff23d0d7b33956a0bbbbf29ce5c53b0ec (patch)
tree6c67ced1e4b2ba82cbdc2523d06fb0489cc21e5f /services
parenta6c026ea48535a568173c6911fb413afa86db780 (diff)
downloadframeworks_av-aa01a15ff23d0d7b33956a0bbbbf29ce5c53b0ec.zip
frameworks_av-aa01a15ff23d0d7b33956a0bbbbf29ce5c53b0ec.tar.gz
frameworks_av-aa01a15ff23d0d7b33956a0bbbbf29ce5c53b0ec.tar.bz2
CameraService: Add compatibility for OMAP ICS blobs
Workaround the conflict created by usage of the 0x800 enum in JB (focus move) vs its OMAP usage in ICS (burst jpeg) Originally: CameraService: Adds support for burst compressed images Signed-off-by: Emilian Peev <epeev@mm-sol.com> Moved the changes under OMAP_ENHANCEMENT Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com> Change-Id: I1f17675b2854793de83c2b7cdecafc039c46f355 CameraService: Adds support for burst compressed images Depends on: - http://review.omapzoom.org/#/c/24537/ - http://review.omapzoom.org/#/c/24538/ Change-Id: I1f17675b2854793de83c2b7cdecafc039c46f355 Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Daniel Levin <dendy@ti.com> Add CAMERA_MSG_RAW_BURST handling to CameraService Change-Id: Id958836e726e9908f60311d5bfc6d26eb8298cea Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com> CameraService: Disable capture message types before stopping preview If we try to stopPreview in the middle of capture, these callbacks might occur. In this case, stopPreview will already be holding mLock while the message handler will try to grab mLock. Deadlock occurs if the stopPreview and message callback dependencies are in the same thread. Issue reproduced with Image Capture/Home Key scenario. Port from GB: Issue is still reproducible (although extremely rarely) in ICS. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Jean Johnson <jean-johnson@ti.com> Signed-off-by: Daniel Levin <dendy@ti.com> Change-Id: I222d00f8bd69c11302a35610095efe0ddc49f876
Diffstat (limited to 'services')
-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);