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 #include <vector> | 10 #include <vector> |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 365 |
366 // static | 366 // static |
367 bool MediaCodecUtil::IsPassthroughAudioFormat(AudioCodec codec) { | 367 bool MediaCodecUtil::IsPassthroughAudioFormat(AudioCodec codec) { |
368 return codec == kCodecAC3 || codec == kCodecEAC3; | 368 return codec == kCodecAC3 || codec == kCodecEAC3; |
369 } | 369 } |
370 | 370 |
371 // static | 371 // static |
372 bool MediaCodecUtil::CodecNeedsFlushWorkaround(MediaCodecBridge* codec) { | 372 bool MediaCodecUtil::CodecNeedsFlushWorkaround(MediaCodecBridge* codec) { |
373 int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); | 373 int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); |
374 std::string codec_name = codec->GetName(); | 374 std::string codec_name = codec->GetName(); |
375 return sdk_int < 18 || | 375 return sdk_int < SDK_VERSION_JELLY_BEAN_MR2 || |
376 (sdk_int == 18 && ("OMX.SEC.avc.dec" == codec_name || | 376 (sdk_int == SDK_VERSION_JELLY_BEAN_MR2 && |
377 "OMX.SEC.avc.dec.secure" == codec_name)) || | 377 ("OMX.SEC.avc.dec" == codec_name || |
378 (sdk_int == 19 && | 378 "OMX.SEC.avc.dec.secure" == codec_name)) || |
| 379 (sdk_int == SDK_VERSION_KITKAT && |
379 base::StartsWith(base::android::BuildInfo::GetInstance()->model(), | 380 base::StartsWith(base::android::BuildInfo::GetInstance()->model(), |
380 "SM-G800", base::CompareCase::INSENSITIVE_ASCII) && | 381 "SM-G800", base::CompareCase::INSENSITIVE_ASCII) && |
381 ("OMX.Exynos.avc.dec" == codec_name || | 382 ("OMX.Exynos.avc.dec" == codec_name || |
382 "OMX.Exynos.avc.dec.secure" == codec_name)); | 383 "OMX.Exynos.avc.dec.secure" == codec_name)); |
383 } | 384 } |
384 | 385 |
385 } // namespace media | 386 } // namespace media |
OLD | NEW |