summaryrefslogtreecommitdiff
path: root/camera/CameraHal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'camera/CameraHal.cpp')
-rw-r--r--camera/CameraHal.cpp68
1 files changed, 63 insertions, 5 deletions
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index 7a43cd0..0be515a 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -3159,7 +3159,7 @@ status_t CameraHal::takePicture(const char *params)
@todo Define error codes if unable to switch to image capture
*/
-status_t CameraHal::__takePicture(const char *params)
+status_t CameraHal::__takePicture(const char *params, struct timeval *captureStart)
{
// cancel AF state if needed (before any operation and mutex lock)
if (mCameraAdapter->getState() == CameraAdapter::AF_STATE) {
@@ -3180,7 +3180,11 @@ status_t CameraHal::__takePicture(const char *params)
#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
- gettimeofday(&mStartCapture, NULL);
+ if ( NULL == captureStart ) {
+ gettimeofday(&mStartCapture, NULL);
+ } else {
+ memcpy(&mStartCapture, captureStart, sizeof(struct timeval));
+ }
#endif
@@ -3288,6 +3292,12 @@ status_t CameraHal::__takePicture(const char *params)
// when we remove legacy TI parameters implementation
}
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ CameraHal::PPM("Takepicture parameters set: ", &mStartCapture);
+
+#endif
+
// if we are already in the middle of a capture and using the same
// tapout ST...then we just need setParameters and start image
// capture to queue more shots
@@ -3384,6 +3394,12 @@ status_t CameraHal::__takePicture(const char *params)
}
}
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ CameraHal::PPM("Takepicture buffer size queried: ", &mStartCapture);
+
+#endif
+
if (outAdapter.get()) {
// Avoid locking the tapout again when reusing it
if (!reuseTapout) {
@@ -3417,7 +3433,14 @@ status_t CameraHal::__takePicture(const char *params)
}
}
- if ( (NO_ERROR == ret) && ( NULL != mCameraAdapter ) )
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ CameraHal::PPM("Takepicture buffers allocated: ", &mStartCapture);
+ memcpy(&mImageBuffers->ppmStamp, &mStartCapture, sizeof(struct timeval));
+
+#endif
+
+ if ( (NO_ERROR == ret) && ( NULL != mCameraAdapter ) )
{
desc.mBuffers = mImageBuffers;
desc.mOffsets = mImageOffsets;
@@ -3456,6 +3479,12 @@ status_t CameraHal::__takePicture(const char *params)
}
}
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ CameraHal::PPM("Takepicture buffers registered: ", &mStartCapture);
+
+#endif
+
if ((ret == NO_ERROR) && mBufferSourceAdapter_Out.get()) {
mBufferSourceAdapter_Out->enableDisplay(0, 0, NULL);
}
@@ -3467,6 +3496,8 @@ status_t CameraHal::__takePicture(const char *params)
//pass capture timestamp along with the camera adapter command
ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_START_IMAGE_CAPTURE, (int) &mStartCapture);
+ CameraHal::PPM("Takepicture capture started: ", &mStartCapture);
+
#else
ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_START_IMAGE_CAPTURE);
@@ -3582,11 +3613,18 @@ status_t CameraHal::reprocess(const char *params)
CameraBuffer *reprocBuffers = NULL;
android::ShotParameters shotParams;
const char *valStr = NULL;
+ struct timeval startReprocess;
android::AutoMutex lock(mLock);
LOG_FUNCTION_NAME;
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ gettimeofday(&startReprocess, NULL);
+
+#endif
+
// 0. Get tap in surface
if (strlen(params) > 0) {
android::String8 shotParams8(params);
@@ -3623,11 +3661,24 @@ status_t CameraHal::reprocess(const char *params)
goto exit;
}
+
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ CameraHal::PPM("Got reprocess buffers: ", &startReprocess);
+
+#endif
+
// 2. Get buffer information and parse parameters
{
shotParams.setBurst(bufferCount);
}
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ memcpy(&reprocBuffers->ppmStamp, &startReprocess, sizeof(struct timeval));
+
+#endif
+
// 3. Give buffer to camera adapter
desc.mBuffers = reprocBuffers;
desc.mOffsets = 0;
@@ -3635,12 +3686,19 @@ status_t CameraHal::reprocess(const char *params)
desc.mLength = 0;
desc.mCount = (size_t) bufferCount;
desc.mMaxQueueable = (size_t) bufferCount;
+
ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_USE_BUFFERS_REPROCESS, (int) &desc);
if (ret != NO_ERROR) {
CAMHAL_LOGE("Error calling camera use buffers");
goto exit;
}
+#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
+
+ CameraHal::PPM("Reprocess buffers registered: ", &startReprocess);
+
+#endif
+
// 4. Start reprocessing
ret = mBufferSourceAdapter_In->enableDisplay(0, 0, NULL);
if (ret != NO_ERROR) {
@@ -3649,9 +3707,9 @@ status_t CameraHal::reprocess(const char *params)
}
// 5. Start capturing
- ret = __takePicture(shotParams.flatten().string());
+ ret = __takePicture(shotParams.flatten().string(), &startReprocess);
- exit:
+exit:
return ret;
}