| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/key_systems.h" | 5 #include "media/base/key_systems.h" |
| 6 | 6 |
| 7 | 7 |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 const std::string& key_system, | 667 const std::string& key_system, |
| 668 EmeMediaType media_type, | 668 EmeMediaType media_type, |
| 669 const std::string& container_mime_type, | 669 const std::string& container_mime_type, |
| 670 const std::vector<std::string>& codecs) const { | 670 const std::vector<std::string>& codecs) const { |
| 671 DCHECK(thread_checker_.CalledOnValidThread()); | 671 DCHECK(thread_checker_.CalledOnValidThread()); |
| 672 | 672 |
| 673 // Make sure the container matches |media_type|. | 673 // Make sure the container matches |media_type|. |
| 674 SupportedCodecs media_type_codec_mask = EME_CODEC_NONE; | 674 SupportedCodecs media_type_codec_mask = EME_CODEC_NONE; |
| 675 switch (media_type) { | 675 switch (media_type) { |
| 676 case EmeMediaType::AUDIO: | 676 case EmeMediaType::AUDIO: |
| 677 if (!StartsWithASCII(container_mime_type, "audio/", true)) | 677 if (!base::StartsWithASCII(container_mime_type, "audio/", true)) |
| 678 return EmeConfigRule::NOT_SUPPORTED; | 678 return EmeConfigRule::NOT_SUPPORTED; |
| 679 media_type_codec_mask = audio_codec_mask_; | 679 media_type_codec_mask = audio_codec_mask_; |
| 680 break; | 680 break; |
| 681 case EmeMediaType::VIDEO: | 681 case EmeMediaType::VIDEO: |
| 682 if (!StartsWithASCII(container_mime_type, "video/", true)) | 682 if (!base::StartsWithASCII(container_mime_type, "video/", true)) |
| 683 return EmeConfigRule::NOT_SUPPORTED; | 683 return EmeConfigRule::NOT_SUPPORTED; |
| 684 media_type_codec_mask = video_codec_mask_; | 684 media_type_codec_mask = video_codec_mask_; |
| 685 break; | 685 break; |
| 686 } | 686 } |
| 687 | 687 |
| 688 // Look up the key system's supported codecs. | 688 // Look up the key system's supported codecs. |
| 689 KeySystemInfoMap::const_iterator key_system_iter = | 689 KeySystemInfoMap::const_iterator key_system_iter = |
| 690 concrete_key_system_map_.find(key_system); | 690 concrete_key_system_map_.find(key_system); |
| 691 if (key_system_iter == concrete_key_system_map_.end()) { | 691 if (key_system_iter == concrete_key_system_map_.end()) { |
| 692 NOTREACHED(); | 692 NOTREACHED(); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 } | 931 } |
| 932 | 932 |
| 933 MEDIA_EXPORT void AddCodecMask( | 933 MEDIA_EXPORT void AddCodecMask( |
| 934 EmeMediaType media_type, | 934 EmeMediaType media_type, |
| 935 const std::string& codec, | 935 const std::string& codec, |
| 936 uint32 mask) { | 936 uint32 mask) { |
| 937 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); | 937 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); |
| 938 } | 938 } |
| 939 | 939 |
| 940 } // namespace media | 940 } // namespace media |
| OLD | NEW |