diff options
author | James Dong <jdong@google.com> | 2012-04-25 18:14:36 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2012-04-25 18:14:36 -0700 |
commit | 1ab12519ec3d4922d1980f975fc884908879e0f0 (patch) | |
tree | b744a596652177358d3f15c6992412c87bd98d46 /cmds | |
parent | e370bb62b89d2f2980f519392010ea08a24c558e (diff) | |
download | frameworks_av-1ab12519ec3d4922d1980f975fc884908879e0f0.zip frameworks_av-1ab12519ec3d4922d1980f975fc884908879e0f0.tar.gz frameworks_av-1ab12519ec3d4922d1980f975fc884908879e0f0.tar.bz2 |
Add profile/level dump for encoders in cmd stagefright
o related-to-bug: 6401068
Change-Id: I51e3eeb026aa75c4492d421f5f239dc9072a9c8b
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/stagefright/stagefright.cpp | 89 |
1 files changed, 49 insertions, 40 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 6a5b45f..3656fe3 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -610,6 +610,53 @@ static void usage(const char *me) { fprintf(stderr, " -d(ump) filename (raw stream data to a file)\n"); } +static void dumpCodecProfiles(const sp<IOMX>& omx, bool queryDecoders) { + const char *kMimeTypes[] = { + MEDIA_MIMETYPE_VIDEO_AVC, MEDIA_MIMETYPE_VIDEO_MPEG4, + MEDIA_MIMETYPE_VIDEO_H263, MEDIA_MIMETYPE_AUDIO_AAC, + MEDIA_MIMETYPE_AUDIO_AMR_NB, MEDIA_MIMETYPE_AUDIO_AMR_WB, + MEDIA_MIMETYPE_AUDIO_MPEG, MEDIA_MIMETYPE_AUDIO_G711_MLAW, + MEDIA_MIMETYPE_AUDIO_G711_ALAW, MEDIA_MIMETYPE_AUDIO_VORBIS, + MEDIA_MIMETYPE_VIDEO_VPX + }; + + if (queryDecoders) { + printf("decoder profiles:\n"); + } else { + printf("encoder profiles:\n"); + } + + for (size_t k = 0; k < sizeof(kMimeTypes) / sizeof(kMimeTypes[0]); ++k) { + printf("type '%s':\n", kMimeTypes[k]); + + Vector<CodecCapabilities> results; + // will retrieve hardware and software codecs + CHECK_EQ(QueryCodecs(omx, kMimeTypes[k], + queryDecoders, + &results), (status_t)OK); + + for (size_t i = 0; i < results.size(); ++i) { + printf(" decoder '%s' supports ", + results[i].mComponentName.string()); + + if (results[i].mProfileLevels.size() == 0) { + printf("NOTHING.\n"); + continue; + } + + for (size_t j = 0; j < results[i].mProfileLevels.size(); ++j) { + const CodecProfileLevel &profileLevel = + results[i].mProfileLevels[j]; + + printf("%s%ld/%ld", j > 0 ? ", " : "", + profileLevel.mProfile, profileLevel.mLevel); + } + + printf("\n"); + } + } +} + int main(int argc, char **argv) { android::ProcessState::self()->startThreadPool(); @@ -830,46 +877,8 @@ int main(int argc, char **argv) { sp<IOMX> omx = service->getOMX(); CHECK(omx.get() != NULL); - - const char *kMimeTypes[] = { - MEDIA_MIMETYPE_VIDEO_AVC, MEDIA_MIMETYPE_VIDEO_MPEG4, - MEDIA_MIMETYPE_VIDEO_H263, MEDIA_MIMETYPE_AUDIO_AAC, - MEDIA_MIMETYPE_AUDIO_AMR_NB, MEDIA_MIMETYPE_AUDIO_AMR_WB, - MEDIA_MIMETYPE_AUDIO_MPEG, MEDIA_MIMETYPE_AUDIO_G711_MLAW, - MEDIA_MIMETYPE_AUDIO_G711_ALAW, MEDIA_MIMETYPE_AUDIO_VORBIS, - MEDIA_MIMETYPE_VIDEO_VPX - }; - - for (size_t k = 0; k < sizeof(kMimeTypes) / sizeof(kMimeTypes[0]); - ++k) { - printf("type '%s':\n", kMimeTypes[k]); - - Vector<CodecCapabilities> results; - // will retrieve hardware and software codecs - CHECK_EQ(QueryCodecs(omx, kMimeTypes[k], - true, // queryDecoders - &results), (status_t)OK); - - for (size_t i = 0; i < results.size(); ++i) { - printf(" decoder '%s' supports ", - results[i].mComponentName.string()); - - if (results[i].mProfileLevels.size() == 0) { - printf("NOTHING.\n"); - continue; - } - - for (size_t j = 0; j < results[i].mProfileLevels.size(); ++j) { - const CodecProfileLevel &profileLevel = - results[i].mProfileLevels[j]; - - printf("%s%ld/%ld", j > 0 ? ", " : "", - profileLevel.mProfile, profileLevel.mLevel); - } - - printf("\n"); - } - } + dumpCodecProfiles(omx, true /* queryDecoders */); + dumpCodecProfiles(omx, false /* queryDecoders */); } if (listComponents) { |