diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2011-07-18 11:07:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-18 11:07:47 -0700 |
commit | db4d3717b4677b3239546a248dc0a7d82db4ba50 (patch) | |
tree | 31666bc44c0df4ae95bf212299c571eb3be1ed09 /media/libstagefright/OMXCodec.cpp | |
parent | 67a124dcac0578aed94aebf451675a5f4c8a1e4e (diff) | |
parent | df57a0d6d3b0609e69ff79afa63fe44dfa91f6f5 (diff) | |
download | frameworks_av-db4d3717b4677b3239546a248dc0a7d82db4ba50.zip frameworks_av-db4d3717b4677b3239546a248dc0a7d82db4ba50.tar.gz frameworks_av-db4d3717b4677b3239546a248dc0a7d82db4ba50.tar.bz2 |
Merge "Add option to query hardware decoders only"
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 5cab60e..4f8336e 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -4330,26 +4330,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. @@ -4411,6 +4404,8 @@ status_t QueryCodecs( CHECK_EQ(omx->freeNode(node), (status_t)OK); } + + return OK; } void OMXCodec::restorePatchedDataPointer(BufferInfo *info) { |