Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/android/media_codec_util.h" | 5 #include "media/base/android/media_codec_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 ScopedJavaLocalRef<jstring> j_mime = | 82 ScopedJavaLocalRef<jstring> j_mime = |
| 83 ConvertUTF8ToJavaString(env, android_mime_type); | 83 ConvertUTF8ToJavaString(env, android_mime_type); |
| 84 return Java_MediaCodecUtil_isDecoderSupportedForDevice(env, j_mime.obj()); | 84 return Java_MediaCodecUtil_isDecoderSupportedForDevice(env, j_mime.obj()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 // static | 87 // static |
| 88 bool MediaCodecUtil::IsMediaCodecAvailable() { | 88 bool MediaCodecUtil::IsMediaCodecAvailable() { |
| 89 // MediaCodec is only available on JB and greater. | 89 // MediaCodec is only available on JB and greater. |
| 90 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) | 90 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) |
| 91 return false; | 91 return false; |
| 92 | |
| 93 // Blacklist some devices on Jellybean-MR2 as for MediaCodec support is buggy. | |
| 94 // http://crbug.com/615872 | |
| 95 if (base::android::BuildInfo::GetInstance()->sdk_int() == 18) { | |
|
liberato (no reviews please)
2016/05/31 15:37:08
i'd be surprised if api level 17 (JB MR1) weren't
| |
| 96 std::string model(base::android::BuildInfo::GetInstance()->model()); | |
| 97 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7100"; | |
| 98 } | |
| 99 | |
| 100 // Blacklist some devices on KitKat as for MediaCodec support is buggy. | |
| 101 // http://crbug.com/615872 | |
| 102 if (base::android::BuildInfo::GetInstance()->sdk_int() == 19) { | |
| 103 std::string model(base::android::BuildInfo::GetInstance()->model()); | |
| 104 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7100"; | |
| 105 } | |
| 106 | |
| 92 // Blacklist some devices on Jellybean as for MediaCodec support is buggy. | 107 // Blacklist some devices on Jellybean as for MediaCodec support is buggy. |
| 93 // http://crbug.com/365494. | 108 // http://crbug.com/365494. |
| 94 if (base::android::BuildInfo::GetInstance()->sdk_int() == 16) { | 109 if (base::android::BuildInfo::GetInstance()->sdk_int() == 16) { |
| 95 std::string model(base::android::BuildInfo::GetInstance()->model()); | 110 std::string model(base::android::BuildInfo::GetInstance()->model()); |
| 96 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000"; | 111 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000" |
| 112 && model != "GT-N7100"; | |
| 97 } | 113 } |
| 98 return true; | 114 return true; |
| 99 } | 115 } |
| 100 | 116 |
| 101 // static | 117 // static |
| 102 bool MediaCodecUtil::SupportsSetParameters() { | 118 bool MediaCodecUtil::SupportsSetParameters() { |
| 103 // MediaCodec.setParameters() is only available starting with K. | 119 // MediaCodec.setParameters() is only available starting with K. |
| 104 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; | 120 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; |
| 105 } | 121 } |
| 106 | 122 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 if (base::StartsWith(model, model_prefixes[i], | 253 if (base::StartsWith(model, model_prefixes[i], |
| 238 base::CompareCase::INSENSITIVE_ASCII)) { | 254 base::CompareCase::INSENSITIVE_ASCII)) { |
| 239 return false; | 255 return false; |
| 240 } | 256 } |
| 241 } | 257 } |
| 242 | 258 |
| 243 return true; | 259 return true; |
| 244 } | 260 } |
| 245 | 261 |
| 246 } // namespace media | 262 } // namespace media |
| OLD | NEW |