diff options
author | Andreas Huber <andih@google.com> | 2010-02-17 15:06:44 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-02-17 15:06:44 -0800 |
commit | 1f13ceb6d241ca9cebebfa6c6b5853291c2c17d6 (patch) | |
tree | 5fba46123d798507522c6c069ccd5918ec3efdd6 /cmds | |
parent | 2b95c2413838c2e2b127ebab8fb4fead7d52e460 (diff) | |
parent | 6c9bf1c1de7360d96c16c7ba27b600348737a08f (diff) | |
download | frameworks_base-1f13ceb6d241ca9cebebfa6c6b5853291c2c17d6.zip frameworks_base-1f13ceb6d241ca9cebebfa6c6b5853291c2c17d6.tar.gz frameworks_base-1f13ceb6d241ca9cebebfa6c6b5853291c2c17d6.tar.bz2 |
Merge "Better diagnostics for the stagefright tool and codec performance."
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/stagefright/stagefright.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index f7cb227..942a303 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -157,13 +157,18 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { long numIterationsLeft = gNumRepetitions; MediaSource::ReadOptions options; + int64_t sumDecodeUs = 0; + while (numIterationsLeft-- > 0) { long numFrames = 0; MediaBuffer *buffer; for (;;) { + int64_t startDecodeUs = getNowUs(); status_t err = rawSource->read(&buffer, &options); + int64_t delayDecodeUs = getNowUs() - startDecodeUs; + options.clearSeekTo(); if (err != OK) { @@ -182,6 +187,8 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { fflush(stdout); } + sumDecodeUs += delayDecodeUs; + buffer->release(); buffer = NULL; @@ -210,6 +217,8 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { int64_t delay = getNowUs() - startTime; printf("avg. %.2f fps\n", n * 1E6 / delay); + printf("avg. time to decode one buffer %.2f usecs\n", + (double)sumDecodeUs / n); printf("decoded a total of %d frame(s).\n", n); } |