diff options
author | Ruchit Sharma <ruchits@nvidia.com> | 2014-08-18 13:48:24 -0400 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2014-09-25 10:55:22 -0700 |
commit | e0711f2651121754a10c784e3b149024d17fa4d5 (patch) | |
tree | 37cd914aa9883605036edc0ab493c539c6b14e96 /services/camera | |
parent | c0d17e349901c3ccf6d15b7dcdf7fa30139c9750 (diff) | |
download | frameworks_av-e0711f2651121754a10c784e3b149024d17fa4d5.zip frameworks_av-e0711f2651121754a10c784e3b149024d17fa4d5.tar.gz frameworks_av-e0711f2651121754a10c784e3b149024d17fa4d5.tar.bz2 |
camera: add traces for KPI measurement
Bug: 17658101
Change-Id: I1d8035c4a8fba7b88a87f205ce57c13d812e9df5
Diffstat (limited to 'services/camera')
-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 */ |