summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-04-02 14:14:24 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-04-02 14:14:24 -0700
commite47009aabd269176b8748a5308de89bafec25c16 (patch)
treefb1820a8bf0e6312db4a538fbd7c018714c80bfc /cmds
parent265bffa901049f55f28ae1dbb414cb66276f726b (diff)
parent0f7c543cc48d287591b5638a15bf8ca977e162a2 (diff)
downloadframeworks_base-e47009aabd269176b8748a5308de89bafec25c16.zip
frameworks_base-e47009aabd269176b8748a5308de89bafec25c16.tar.gz
frameworks_base-e47009aabd269176b8748a5308de89bafec25c16.tar.bz2
am 0f7c543c: am eb6e3edc: Merge "Coalesce multiple encoded AAC frames into a single input buffer on this particular OMX codec to increase throughput significantly." into froyo
Merge commit '0f7c543cc48d287591b5638a15bf8ca977e162a2' into kraken * commit '0f7c543cc48d287591b5638a15bf8ca977e162a2': Coalesce multiple encoded AAC frames into a single input buffer on this particular OMX codec to increase throughput significantly.
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/stagefright.cpp19
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) {