summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2011-07-18 11:07:47 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-18 11:07:47 -0700
commitdb4d3717b4677b3239546a248dc0a7d82db4ba50 (patch)
tree31666bc44c0df4ae95bf212299c571eb3be1ed09 /media/libstagefright/OMXCodec.cpp
parent67a124dcac0578aed94aebf451675a5f4c8a1e4e (diff)
parentdf57a0d6d3b0609e69ff79afa63fe44dfa91f6f5 (diff)
downloadframeworks_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-xmedia/libstagefright/OMXCodec.cpp27
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) {