diff options
author | Andreas Huber <andih@google.com> | 2010-04-02 12:49:54 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-04-02 12:55:31 -0700 |
commit | 7f498b90a4300ef9badf14d202b0a67c26e20931 (patch) | |
tree | d8a6e393474ba981bf4a577585c9cfcfcddec250 /cmds/stagefright | |
parent | a17a1347ffe281fc70633ba8dc98f6cf49ac06ff (diff) | |
download | frameworks_av-7f498b90a4300ef9badf14d202b0a67c26e20931.zip frameworks_av-7f498b90a4300ef9badf14d202b0a67c26e20931.tar.gz frameworks_av-7f498b90a4300ef9badf14d202b0a67c26e20931.tar.bz2 |
Coalesce multiple encoded AAC frames into a single input buffer on this particular OMX codec to increase throughput significantly.
Change-Id: I90c7db6656a53339c5d454336548c4f00d0d9064
related-to-bug: 2548426
Diffstat (limited to 'cmds/stagefright')
-rw-r--r-- | cmds/stagefright/stagefright.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 55bb581..fec9e1a 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -158,6 +158,7 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { MediaSource::ReadOptions options; int64_t sumDecodeUs = 0; + int64_t totalBytes = 0; while (numIterationsLeft-- > 0) { long numFrames = 0; @@ -188,6 +189,7 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { } sumDecodeUs += delayDecodeUs; + totalBytes += buffer->range_length(); buffer->release(); buffer = NULL; @@ -216,11 +218,20 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { printf("\n"); 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); + if (!strncasecmp("video/", mime, 6)) { + printf("avg. %.2f fps\n", n * 1E6 / delay); - printf("decoded a total of %d frame(s).\n", n); + printf("avg. time to decode one buffer %.2f usecs\n", + (double)sumDecodeUs / n); + + printf("decoded a total of %d frame(s).\n", n); + } else if (!strncasecmp("audio/", mime, 6)) { + // Frame count makes less sense for audio, as the output buffer + // sizes may be different across decoders. + printf("avg. %.2f KB/sec\n", totalBytes / 1024 * 1E6 / delay); + + printf("decoded a total of %lld bytes\n", totalBytes); + } } static void usage(const char *me) { |