| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 ConvertUTF8ToJavaString(env, android_mime_type); | 94 ConvertUTF8ToJavaString(env, android_mime_type); |
| 95 return Java_MediaCodecUtil_isEncoderSupportedByDevice(env, j_mime); | 95 return Java_MediaCodecUtil_isEncoderSupportedByDevice(env, j_mime); |
| 96 } | 96 } |
| 97 | 97 |
| 98 // static | 98 // static |
| 99 bool MediaCodecUtil::IsMediaCodecAvailable() { | 99 bool MediaCodecUtil::IsMediaCodecAvailable() { |
| 100 // Blacklist some devices on Jellybean as MediaCodec is buggy. | 100 // Blacklist some devices on Jellybean as MediaCodec is buggy. |
| 101 // http://crbug.com/365494, http://crbug.com/615872 | 101 // http://crbug.com/365494, http://crbug.com/615872 |
| 102 // Blacklist Lenovo A6600 / A6800 on KitKat, which tends to crash a lot. | 102 // Blacklist Lenovo A6600 / A6800 on KitKat, which tends to crash a lot. |
| 103 // See crbug.com/628059 . We include < K since they don't exist. | 103 // See crbug.com/628059 . We include < K since they don't exist. |
| 104 // Blacklist Samsung Galaxy Star Pro (GT-S7262) (crbug.com/634920). |
| 104 // GT-S5282 and GT-I8552 are for crbug.com/634920 . | 105 // GT-S5282 and GT-I8552 are for crbug.com/634920 . |
| 105 if (base::android::BuildInfo::GetInstance()->sdk_int() <= 19) { | 106 if (base::android::BuildInfo::GetInstance()->sdk_int() <= 19) { |
| 106 std::string model(base::android::BuildInfo::GetInstance()->model()); | 107 std::string model(base::android::BuildInfo::GetInstance()->model()); |
| 107 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000" && | 108 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000" && |
| 108 model != "GT-N7100" && model != "A6600" && model != "A6800" && | 109 model != "GT-N7100" && model != "A6600" && model != "A6800" && |
| 109 model != "GT-S5282" && model != "GT-I8552"; | 110 model != "GT-S7262" && model != "GT-S5282" && model != "GT-I8552"; |
| 110 } | 111 } |
| 111 | 112 |
| 112 return true; | 113 return true; |
| 113 } | 114 } |
| 114 | 115 |
| 115 // static | 116 // static |
| 116 bool MediaCodecUtil::SupportsSetParameters() { | 117 bool MediaCodecUtil::SupportsSetParameters() { |
| 117 // MediaCodec.setParameters() is only available starting with K. | 118 // MediaCodec.setParameters() is only available starting with K. |
| 118 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; | 119 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; |
| 119 } | 120 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 (sdk_int == 18 && ("OMX.SEC.avc.dec" == codec_name || | 259 (sdk_int == 18 && ("OMX.SEC.avc.dec" == codec_name || |
| 259 "OMX.SEC.avc.dec.secure" == codec_name)) || | 260 "OMX.SEC.avc.dec.secure" == codec_name)) || |
| 260 (sdk_int == 19 && | 261 (sdk_int == 19 && |
| 261 base::StartsWith(base::android::BuildInfo::GetInstance()->model(), | 262 base::StartsWith(base::android::BuildInfo::GetInstance()->model(), |
| 262 "SM-G800", base::CompareCase::INSENSITIVE_ASCII) && | 263 "SM-G800", base::CompareCase::INSENSITIVE_ASCII) && |
| 263 ("OMX.Exynos.avc.dec" == codec_name || | 264 ("OMX.Exynos.avc.dec" == codec_name || |
| 264 "OMX.Exynos.avc.dec.secure" == codec_name)); | 265 "OMX.Exynos.avc.dec.secure" == codec_name)); |
| 265 } | 266 } |
| 266 | 267 |
| 267 } // namespace media | 268 } // namespace media |
| OLD | NEW |