diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2011-07-17 16:35:11 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2011-07-18 10:57:50 -0700 |
commit | df57a0d6d3b0609e69ff79afa63fe44dfa91f6f5 (patch) | |
tree | 03f9b598a4e9b41242f8a6fed36a2c5a0f994d03 /media/libstagefright/OMXCodec.cpp | |
parent | 350d9162155e1f3eab1821f5eeed762faa01f0cc (diff) | |
download | frameworks_av-df57a0d6d3b0609e69ff79afa63fe44dfa91f6f5.zip frameworks_av-df57a0d6d3b0609e69ff79afa63fe44dfa91f6f5.tar.gz frameworks_av-df57a0d6d3b0609e69ff79afa63fe44dfa91f6f5.tar.bz2 |
Add option to query hardware decoders only
Add an option to OMXCodec::QueryCodecs() to filter out
software codecs.
Update stagefright command line tool to list the roles of codecs.
Change-Id: Icddb79118c30fe13cc3aea20f340174cc082c4e0
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rwxr-xr-x | media/libstagefright/OMXCodec.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 3b05752..0f816ae 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -4406,26 +4406,19 @@ status_t OMXCodec::pause() { status_t QueryCodecs( const sp<IOMX> &omx, - const char *mime, bool queryDecoders, + const char *mime, bool queryDecoders, bool hwCodecOnly, Vector<CodecCapabilities> *results) { + Vector<String8> matchingCodecs; results->clear(); - for (int index = 0;; ++index) { - const char *componentName; + OMXCodec::findMatchingCodecs(mime, + !queryDecoders /*createEncoder*/, + NULL /*matchComponentName*/, + hwCodecOnly ? OMXCodec::kHardwareCodecsOnly : 0 /*flags*/, + &matchingCodecs); - if (!queryDecoders) { - componentName = GetCodec( - kEncoderInfo, sizeof(kEncoderInfo) / sizeof(kEncoderInfo[0]), - mime, index); - } else { - componentName = GetCodec( - kDecoderInfo, sizeof(kDecoderInfo) / sizeof(kDecoderInfo[0]), - mime, index); - } - - if (!componentName) { - return OK; - } + for (size_t c = 0; c < matchingCodecs.size(); c++) { + const char *componentName = matchingCodecs.itemAt(c).string(); if (strncmp(componentName, "OMX.", 4)) { // Not an OpenMax component but a software codec. @@ -4490,6 +4483,8 @@ status_t QueryCodecs( CHECK_EQ(omx->freeNode(node), (status_t)OK); } + + return OK; } void OMXCodec::restorePatchedDataPointer(BufferInfo *info) { |