| 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 |
| 92 // Blacklist some devices on Jellybean as for MediaCodec support is buggy. | 93 // Blacklist some devices on Jellybean as for MediaCodec support is buggy. |
| 93 // http://crbug.com/365494. | 94 // http://crbug.com/365494, http://crbug.com/615872 |
| 94 if (base::android::BuildInfo::GetInstance()->sdk_int() == 16) { | 95 if (base::android::BuildInfo::GetInstance()->sdk_int() <= 19) { |
| 95 std::string model(base::android::BuildInfo::GetInstance()->model()); | 96 std::string model(base::android::BuildInfo::GetInstance()->model()); |
| 96 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000"; | 97 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000" && |
| 98 model != "GT-N7100"; |
| 97 } | 99 } |
| 98 return true; | 100 return true; |
| 99 } | 101 } |
| 100 | 102 |
| 101 // static | 103 // static |
| 102 bool MediaCodecUtil::SupportsSetParameters() { | 104 bool MediaCodecUtil::SupportsSetParameters() { |
| 103 // MediaCodec.setParameters() is only available starting with K. | 105 // MediaCodec.setParameters() is only available starting with K. |
| 104 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; | 106 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; |
| 105 } | 107 } |
| 106 | 108 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 if (base::StartsWith(model, model_prefixes[i], | 239 if (base::StartsWith(model, model_prefixes[i], |
| 238 base::CompareCase::INSENSITIVE_ASCII)) { | 240 base::CompareCase::INSENSITIVE_ASCII)) { |
| 239 return false; | 241 return false; |
| 240 } | 242 } |
| 241 } | 243 } |
| 242 | 244 |
| 243 return true; | 245 return true; |
| 244 } | 246 } |
| 245 | 247 |
| 246 } // namespace media | 248 } // namespace media |
| OLD | NEW |