From 17c9c998afed5ed9df7495eeed5822f3ed53ebec Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Mon, 2 Mar 2015 15:53:01 -0800 Subject: Initial implementation of fast capture dump Change-Id: I898d903e539f760ef7caa80f41ca21c223f67264 --- services/audioflinger/FastCaptureDumpState.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'services/audioflinger/FastCaptureDumpState.cpp') diff --git a/services/audioflinger/FastCaptureDumpState.cpp b/services/audioflinger/FastCaptureDumpState.cpp index 00f8da0..53eeba5 100644 --- a/services/audioflinger/FastCaptureDumpState.cpp +++ b/services/audioflinger/FastCaptureDumpState.cpp @@ -14,7 +14,13 @@ * limitations under the License. */ +#define LOG_TAG "FastCaptureDumpState" +//define LOG_NDEBUG 0 + +#include "Configuration.h" +#include #include "FastCaptureDumpState.h" +#include "FastCaptureState.h" namespace android { @@ -27,4 +33,21 @@ FastCaptureDumpState::~FastCaptureDumpState() { } +void FastCaptureDumpState::dump(int fd) const +{ + if (mCommand == FastCaptureState::INITIAL) { + dprintf(fd, " FastCapture not initialized\n"); + return; + } + double measuredWarmupMs = (mMeasuredWarmupTs.tv_sec * 1000.0) + + (mMeasuredWarmupTs.tv_nsec / 1000000.0); + double periodSec = (double) mFrameCount / mSampleRate; + dprintf(fd, " FastCapture command=%s readSequence=%u framesRead=%u\n" + " readErrors=%u sampleRate=%u frameCount=%zu\n" + " measuredWarmup=%.3g ms, warmupCycles=%u period=%.2f ms\n", + FastCaptureState::commandToString(mCommand), mReadSequence, mFramesRead, + mReadErrors, mSampleRate, mFrameCount, measuredWarmupMs, mWarmupCycles, + periodSec * 1e3); +} + } // android -- cgit v1.1