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

Unified Diff: media/base/android/media_codec_util.cc

Issue 2686963002: Fix and update MediaCodec blacklist. (Closed)
Patch Set: Created 3 years, 10 months 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
Index: media/base/android/media_codec_util.cc
diff --git a/media/base/android/media_codec_util.cc b/media/base/android/media_codec_util.cc
index 171991d4ba4e46eff6f2a4e4715238051ae921d6..922b1688d658ab7d956827c6d0e541ea8a8aeb9a 100644
--- a/media/base/android/media_codec_util.cc
+++ b/media/base/android/media_codec_util.cc
@@ -104,26 +104,50 @@ static bool IsEncoderSupportedByDevice(const std::string& android_mime_type) {
// static
bool MediaCodecUtil::IsMediaCodecAvailable() {
+ return IsMediaCodecAvailableForSdk(
+ base::android::BuildInfo::GetInstance()->sdk_int(), nullptr);
+}
+
+// static
+bool MediaCodecUtil::IsMediaCodecAvailableForSdk(int sdk,
+ const char* model_for_test) {
// Blacklist some devices on Jellybean as MediaCodec is buggy.
// http://crbug.com/365494, http://crbug.com/615872
// Blacklist Lenovo A6600 / A6800 on KitKat, which tends to crash a lot.
// See crbug.com/628059 . We include < K since they don't exist.
// Blacklist Samsung Galaxy Star Pro (GT-S7262) (crbug.com/634920).
// GT-S5282 and GT-I8552 are for crbug.com/634920 .
- if (base::android::BuildInfo::GetInstance()->sdk_int() <= 19) {
- std::string model(base::android::BuildInfo::GetInstance()->model());
- return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000" &&
- model != "GT-N7100" && model != "A6600" && model != "A6800" &&
- model != "GT-S7262" && model != "GT-S5282" && model != "GT-I8552";
- } else if (base::android::BuildInfo::GetInstance()->sdk_int() < 19) {
+ // Blacklist LGMS330 on L for crbug.com/654905 .
+
+ // None of our tests fail >= marshmallow.
+ if (sdk >= base::android::SDK_VERSION_MARSHMALLOW)
+ return true;
+
+ bool is_supported = true;
+ std::string model(model_for_test
+ ? model_for_test
+ : base::android::BuildInfo::GetInstance()->model());
+
+ if (sdk <= base::android::SDK_VERSION_KITKAT) {
+ is_supported &=
+ model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000" &&
CalebRouleau 2017/02/09 00:12:09 Nit: Prefer ordering the operations like: J K L
liberato (no reviews please) 2017/02/09 18:38:56 the (new) map is initialized in order.
+ model != "GT-N7100" && model != "A6600" && model != "A6800" &&
+ model != "GT-S7262" && model != "GT-S5282" && model != "GT-I8552";
+ }
+
+ if (sdk <= base::android::SDK_VERSION_JELLY_BEAN_MR2) {
// For JB, these tend to fail often (crbug.com/654905), but not with K+.
- std::string model(base::android::BuildInfo::GetInstance()->model());
- return model != "GT-P3113" && model != "GT-P5110" && model != "GT-P5100" &&
- model != "GT-P5113" && model != "GT-P3110" && model != "GT-N5110" &&
- model != "e-tab4" && model != "GT-I8200Q";
+ is_supported &= model != "GT-P3113" && model != "GT-P5110" &&
+ model != "GT-P5100" && model != "GT-P5113" &&
+ model != "GT-P3110" && model != "GT-N5110" &&
+ model != "e-tab4" && model != "GT-I8200Q";
}
- return true;
+ // Note that LGMS330 started on L.
+ if (sdk <= base::android::SDK_VERSION_LOLLIPOP_MR1)
+ is_supported &= model != "LGMS330";
+
+ return is_supported;
}
// static

Powered by Google App Engine
This is Rietveld 408576698