summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-11-19 11:45:16 -0800
committerJames Dong <jdong@google.com>2010-11-19 18:39:16 -0800
commit482a1b16cb805920b427f0b1adca300571fda92d (patch)
tree34bdcd1986621aa5f4265e0ca7d76e13ab267a74 /cmds
parent86e735375eb4f681ec8501e12df4730397b4331c (diff)
downloadframeworks_base-482a1b16cb805920b427f0b1adca300571fda92d.zip
frameworks_base-482a1b16cb805920b427f0b1adca300571fda92d.tar.gz
frameworks_base-482a1b16cb805920b427f0b1adca300571fda92d.tar.bz2
Display AVC video sample profile and level for "stagefright" util
Change-Id: I04b3f67d162cf3827bc74ad98cd1e1a0f5f14172
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/stagefright.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index f0758fd..579d8c3 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -107,6 +107,20 @@ static void displayDecodeHistogram(Vector<int64_t> *decodeTimesUs) {
}
}
+static void displayAVCProfileLevelIfPossible(const sp<MetaData>& meta) {
+ uint32_t type;
+ const void *data;
+ size_t size;
+ if (meta->findData(kKeyAVCC, &type, &data, &size)) {
+ const uint8_t *ptr = (const uint8_t *)data;
+ CHECK(size >= 7);
+ CHECK(ptr[0] == 1); // configurationVersion == 1
+ uint8_t profile = ptr[1];
+ uint8_t level = ptr[3];
+ fprintf(stderr, "AVC video profile %d and level %d\n", profile, level);
+ }
+}
+
static void playSource(OMXClient *client, sp<MediaSource> &source) {
sp<MetaData> meta = source->getFormat();
@@ -126,6 +140,7 @@ static void playSource(OMXClient *client, sp<MediaSource> &source) {
fprintf(stderr, "Failed to instantiate decoder for '%s'.\n", mime);
return;
}
+ displayAVCProfileLevelIfPossible(meta);
}
source.clear();