| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/mime_util_internal.h" | 5 #include "media/base/mime_util_internal.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 case MPEG4_AAC: | 448 case MPEG4_AAC: |
| 449 case VORBIS: | 449 case VORBIS: |
| 450 // These codecs are always supported; via a platform decoder (when used | 450 // These codecs are always supported; via a platform decoder (when used |
| 451 // with MSE/EME), a software decoder (the unified pipeline), or with | 451 // with MSE/EME), a software decoder (the unified pipeline), or with |
| 452 // MediaPlayer. | 452 // MediaPlayer. |
| 453 DCHECK(!is_encrypted || platform_info.has_platform_decoders); | 453 DCHECK(!is_encrypted || platform_info.has_platform_decoders); |
| 454 return true; | 454 return true; |
| 455 | 455 |
| 456 case MPEG2_AAC: | 456 case MPEG2_AAC: |
| 457 // MPEG-2 variants of AAC are not supported on Android unless the unified | 457 // MPEG-2 variants of AAC are not supported on Android unless the unified |
| 458 // media pipeline can be used. These codecs will be decoded in software. | 458 // media pipeline can be used and the container is not HLS. These codecs |
| 459 // See https:crbug.com/544268 for details. | 459 // will be decoded in software. See https:crbug.com/544268 for details. |
| 460 if (mime_type_lower_case == "application/x-mpegurl" || |
| 461 mime_type_lower_case == "application/vnd.apple.mpegurl") { |
| 462 return false; |
| 463 } |
| 460 return !is_encrypted && platform_info.is_unified_media_pipeline_enabled; | 464 return !is_encrypted && platform_info.is_unified_media_pipeline_enabled; |
| 461 | 465 |
| 462 case OPUS: | 466 case OPUS: |
| 463 // If clear, the unified pipeline can always decode Opus in software. | 467 // If clear, the unified pipeline can always decode Opus in software. |
| 464 if (!is_encrypted && platform_info.is_unified_media_pipeline_enabled) | 468 if (!is_encrypted && platform_info.is_unified_media_pipeline_enabled) |
| 465 return true; | 469 return true; |
| 466 | 470 |
| 467 // Otherwise, platform support is required. | 471 // Otherwise, platform support is required. |
| 468 if (!platform_info.supports_opus) | 472 if (!platform_info.supports_opus) |
| 469 return false; | 473 return false; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 const std::string& mime_type_lower_case, | 629 const std::string& mime_type_lower_case, |
| 626 bool is_encrypted) const { | 630 bool is_encrypted) const { |
| 627 Codec default_codec = Codec::INVALID_CODEC; | 631 Codec default_codec = Codec::INVALID_CODEC; |
| 628 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) | 632 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) |
| 629 return false; | 633 return false; |
| 630 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); | 634 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); |
| 631 } | 635 } |
| 632 | 636 |
| 633 } // namespace internal | 637 } // namespace internal |
| 634 } // namespace media | 638 } // namespace media |
| OLD | NEW |