summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2011-07-17 16:35:11 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2011-07-18 10:57:50 -0700
commitdf57a0d6d3b0609e69ff79afa63fe44dfa91f6f5 (patch)
tree03f9b598a4e9b41242f8a6fed36a2c5a0f994d03 /media/libstagefright/OMXCodec.cpp
parent350d9162155e1f3eab1821f5eeed762faa01f0cc (diff)
downloadframeworks_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-xmedia/libstagefright/OMXCodec.cpp27
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) {