| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 if (base::StartsWith(model, model_prefixes[i], | 258 if (base::StartsWith(model, model_prefixes[i], |
| 259 base::CompareCase::INSENSITIVE_ASCII)) { | 259 base::CompareCase::INSENSITIVE_ASCII)) { |
| 260 return false; | 260 return false; |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 | 263 |
| 264 return true; | 264 return true; |
| 265 } | 265 } |
| 266 | 266 |
| 267 // static | 267 // static |
| 268 bool MediaCodecUtil::IsSetOutputSurfaceSupported() { |
| 269 JNIEnv* env = AttachCurrentThread(); |
| 270 return Java_MediaCodecUtil_isSetOutputSurfaceSupported(env); |
| 271 } |
| 272 |
| 273 // static |
| 268 bool MediaCodecUtil::CodecNeedsFlushWorkaround(MediaCodecBridge* codec) { | 274 bool MediaCodecUtil::CodecNeedsFlushWorkaround(MediaCodecBridge* codec) { |
| 269 int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); | 275 int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); |
| 270 std::string codec_name = codec->GetName(); | 276 std::string codec_name = codec->GetName(); |
| 271 return sdk_int < 18 || | 277 return sdk_int < 18 || |
| 272 (sdk_int == 18 && ("OMX.SEC.avc.dec" == codec_name || | 278 (sdk_int == 18 && ("OMX.SEC.avc.dec" == codec_name || |
| 273 "OMX.SEC.avc.dec.secure" == codec_name)) || | 279 "OMX.SEC.avc.dec.secure" == codec_name)) || |
| 274 (sdk_int == 19 && | 280 (sdk_int == 19 && |
| 275 base::StartsWith(base::android::BuildInfo::GetInstance()->model(), | 281 base::StartsWith(base::android::BuildInfo::GetInstance()->model(), |
| 276 "SM-G800", base::CompareCase::INSENSITIVE_ASCII) && | 282 "SM-G800", base::CompareCase::INSENSITIVE_ASCII) && |
| 277 ("OMX.Exynos.avc.dec" == codec_name || | 283 ("OMX.Exynos.avc.dec" == codec_name || |
| 278 "OMX.Exynos.avc.dec.secure" == codec_name)); | 284 "OMX.Exynos.avc.dec.secure" == codec_name)); |
| 279 } | 285 } |
| 280 | 286 |
| 281 } // namespace media | 287 } // namespace media |
| OLD | NEW |