| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 408 } |
| 409 } | 409 } |
| 410 | 410 |
| 411 SupportsType MimeUtil::IsSupportedMediaFormat( | 411 SupportsType MimeUtil::IsSupportedMediaFormat( |
| 412 const std::string& mime_type, | 412 const std::string& mime_type, |
| 413 const std::vector<std::string>& codecs, | 413 const std::vector<std::string>& codecs, |
| 414 bool is_encrypted) const { | 414 bool is_encrypted) const { |
| 415 const std::string mime_type_lower_case = base::ToLowerASCII(mime_type); | 415 const std::string mime_type_lower_case = base::ToLowerASCII(mime_type); |
| 416 MediaFormatMappings::const_iterator it_media_format_map = | 416 MediaFormatMappings::const_iterator it_media_format_map = |
| 417 media_format_map_.find(mime_type_lower_case); | 417 media_format_map_.find(mime_type_lower_case); |
| 418 if (it_media_format_map == media_format_map_.end()) | 418 if (it_media_format_map == media_format_map_.end()) { |
| 419 DVLOG(3) << __func__ << " Unrecognized mime type: " << mime_type; |
| 419 return IsNotSupported; | 420 return IsNotSupported; |
| 421 } |
| 420 | 422 |
| 421 if (it_media_format_map->second.empty()) { | 423 if (it_media_format_map->second.empty()) { |
| 422 // We get here if the mimetype does not expect a codecs parameter. | 424 // We get here if the mimetype does not expect a codecs parameter. |
| 423 if (codecs.empty()) { | 425 if (codecs.empty()) { |
| 424 return IsDefaultCodecSupported(mime_type_lower_case, is_encrypted); | 426 return IsDefaultCodecSupported(mime_type_lower_case, is_encrypted); |
| 425 } else { | 427 } else { |
| 426 return IsNotSupported; | 428 return IsNotSupported; |
| 427 } | 429 } |
| 428 } | 430 } |
| 429 | 431 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 SupportsType MimeUtil::IsDefaultCodecSupported(const std::string& mime_type, | 836 SupportsType MimeUtil::IsDefaultCodecSupported(const std::string& mime_type, |
| 835 bool is_encrypted) const { | 837 bool is_encrypted) const { |
| 836 Codec default_codec = Codec::INVALID_CODEC; | 838 Codec default_codec = Codec::INVALID_CODEC; |
| 837 if (!GetDefaultCodec(mime_type, &default_codec)) | 839 if (!GetDefaultCodec(mime_type, &default_codec)) |
| 838 return IsNotSupported; | 840 return IsNotSupported; |
| 839 return IsSimpleCodecSupported(mime_type, default_codec, is_encrypted); | 841 return IsSimpleCodecSupported(mime_type, default_codec, is_encrypted); |
| 840 } | 842 } |
| 841 | 843 |
| 842 } // namespace internal | 844 } // namespace internal |
| 843 } // namespace media | 845 } // namespace media |
| OLD | NEW |