diff options
author | Ruchit Sharma <ruchits@nvidia.com> | 2014-09-26 00:24:16 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-26 00:24:16 +0000 |
commit | cd8ff071e90aaedc5507b63e73f0fed39b8057ae (patch) | |
tree | f4de92f904c1378d05d5a5c79aa22f209dbe1cf9 | |
parent | 3529b78d2b430aac5b8f1e48bd37c0201fb1d0f7 (diff) | |
parent | e0711f2651121754a10c784e3b149024d17fa4d5 (diff) | |
download | frameworks_av-cd8ff071e90aaedc5507b63e73f0fed39b8057ae.zip frameworks_av-cd8ff071e90aaedc5507b63e73f0fed39b8057ae.tar.gz frameworks_av-cd8ff071e90aaedc5507b63e73f0fed39b8057ae.tar.bz2 |
am e0711f26: camera: add traces for KPI measurement
* commit 'e0711f2651121754a10c784e3b149024d17fa4d5':
camera: add traces for KPI measurement
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3OutputStream.cpp | 16 | ||||
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3OutputStream.h | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp index 169eb82..77ad503 100644 --- a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp +++ b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp @@ -37,7 +37,8 @@ Camera3OutputStream::Camera3OutputStream(int id, Camera3IOStreamBase(id, CAMERA3_STREAM_OUTPUT, width, height, /*maxSize*/0, format), mConsumer(consumer), - mTransform(0) { + mTransform(0), + mTraceFirstBuffer(true) { if (mConsumer == NULL) { ALOGE("%s: Consumer is NULL!", __FUNCTION__); @@ -51,7 +52,8 @@ Camera3OutputStream::Camera3OutputStream(int id, Camera3IOStreamBase(id, CAMERA3_STREAM_OUTPUT, width, height, maxSize, format), mConsumer(consumer), - mTransform(0) { + mTransform(0), + mTraceFirstBuffer(true) { if (format != HAL_PIXEL_FORMAT_BLOB) { ALOGE("%s: Bad format for size-only stream: %d", __FUNCTION__, @@ -202,6 +204,15 @@ status_t Camera3OutputStream::returnBufferCheckedLocked( " %s (%d)", __FUNCTION__, mId, strerror(-res), res); } } else { + if (mTraceFirstBuffer && (stream_type == CAMERA3_STREAM_OUTPUT)) { + { + char traceLog[48]; + snprintf(traceLog, sizeof(traceLog), "Stream %d: first full buffer\n", mId); + ATRACE_NAME(traceLog); + } + mTraceFirstBuffer = false; + } + res = currentConsumer->queueBuffer(currentConsumer.get(), container_of(buffer.buffer, ANativeWindowBuffer, handle), anwReleaseFence); @@ -257,6 +268,7 @@ status_t Camera3OutputStream::setTransformLocked(int transform) { status_t Camera3OutputStream::configureQueueLocked() { status_t res; + mTraceFirstBuffer = true; if ((res = Camera3IOStreamBase::configureQueueLocked()) != OK) { return res; } diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.h b/services/camera/libcameraservice/device3/Camera3OutputStream.h index f963326..be278c5 100644 --- a/services/camera/libcameraservice/device3/Camera3OutputStream.h +++ b/services/camera/libcameraservice/device3/Camera3OutputStream.h @@ -84,6 +84,8 @@ class Camera3OutputStream : virtual status_t setTransformLocked(int transform); + bool mTraceFirstBuffer; + /** * Internal Camera3Stream interface */ |