summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-10-26 09:26:24 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-26 09:26:24 -0700
commit028b537051d56e0b02acd599b42cfd13871f31c2 (patch)
tree04069b31f53bdc91a9fc8f63626c093a50a34bb1
parent467fc41b0627480e81e904a8d90ac14745a4ce61 (diff)
parent170a929648b9f5c6efbf6dcbec4f1bc73593cbde (diff)
downloadframeworks_base-028b537051d56e0b02acd599b42cfd13871f31c2.zip
frameworks_base-028b537051d56e0b02acd599b42cfd13871f31c2.tar.gz
frameworks_base-028b537051d56e0b02acd599b42cfd13871f31c2.tar.bz2
Merge "Add two creation flags to OMXCodec::Create()"
-rw-r--r--include/media/stagefright/OMXCodec.h5
-rw-r--r--media/libstagefright/OMXCodec.cpp11
2 files changed, 15 insertions, 1 deletions
diff --git a/include/media/stagefright/OMXCodec.h b/include/media/stagefright/OMXCodec.h
index 6fef2e7..0f4fbfb 100644
--- a/include/media/stagefright/OMXCodec.h
+++ b/include/media/stagefright/OMXCodec.h
@@ -39,6 +39,11 @@ struct OMXCodec : public MediaSource,
// The client wants to access the output buffer's video
// data for example for thumbnail extraction.
kClientNeedsFramebuffer = 4,
+
+ // Request for software or hardware codecs. If request
+ // can not be fullfilled, Create() returns NULL.
+ kSoftwareCodecsOnly = 8,
+ kHardwareCodecsOnly = 16,
};
static sp<MediaSource> Create(
const sp<IOMX> &omx,
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 2520f46..0d8abe2 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -450,7 +450,16 @@ void OMXCodec::findMatchingCodecs(
continue;
}
- matchingCodecs->push(String8(componentName));
+ // When requesting software-only codecs, only push software codecs
+ // When requesting hardware-only codecs, only push hardware codecs
+ // When there is request neither for software-only nor for
+ // hardware-only codecs, push all codecs
+ if (((flags & kSoftwareCodecsOnly) && IsSoftwareCodec(componentName)) ||
+ ((flags & kHardwareCodecsOnly) && !IsSoftwareCodec(componentName)) ||
+ (!(flags & (kSoftwareCodecsOnly | kHardwareCodecsOnly)))) {
+
+ matchingCodecs->push(String8(componentName));
+ }
}
if (flags & kPreferSoftwareCodecs) {