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