Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java

Issue 753963002: Revert of Modified MediaCodecBridge as per android API label 21. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
index 1f8443d10f4323eb70febffe380c6040cb58d4c2..399f355f8735a097267929ea42eb81ddb41ffda6 100644
--- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
+++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
@@ -239,35 +239,18 @@
*/
@CalledByNative
private static int[] getEncoderColorFormatsForMime(String mime) {
- MediaCodecInfo[] codecs = null;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- MediaCodecList mediaCodecList = new MediaCodecList(MediaCodecList.ALL_CODECS);
- codecs = mediaCodecList.getCodecInfos();
- } else {
- int count = MediaCodecList.getCodecCount();
- if (count <= 0) {
- return null;
- }
- codecs = new MediaCodecInfo[count];
- for (int i = 0; i < count; ++i) {
- MediaCodecInfo info = MediaCodecList.getCodecInfoAt(i);
- codecs[i] = info;
- }
- }
-
- for (int i = 0; i < codecs.length; i++) {
- if (!codecs[i].isEncoder()) {
+ int count = MediaCodecList.getCodecCount();
+ for (int i = 0; i < count; ++i) {
+ MediaCodecInfo info = MediaCodecList.getCodecInfoAt(i);
+ if (!info.isEncoder())
continue;
- }
-
- String[] supportedTypes = codecs[i].getSupportedTypes();
+
+ String[] supportedTypes = info.getSupportedTypes();
for (int j = 0; j < supportedTypes.length; ++j) {
- if (!supportedTypes[j].equalsIgnoreCase(mime)) {
+ if (!supportedTypes[j].equalsIgnoreCase(mime))
continue;
- }
-
- MediaCodecInfo.CodecCapabilities capabilities =
- codecs[i].getCapabilitiesForType(mime);
+
+ MediaCodecInfo.CodecCapabilities capabilities = info.getCapabilitiesForType(mime);
return capabilities.colorFormats;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698