Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: media/base/key_systems.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/android/media_player_bridge.cc ('k') | media/base/mime_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 (!base::StartsWithASCII(container_mime_type, "audio/", true)) 677 if (!base::StartsWith(container_mime_type, "audio/",
678 base::CompareCase::SENSITIVE))
678 return EmeConfigRule::NOT_SUPPORTED; 679 return EmeConfigRule::NOT_SUPPORTED;
679 media_type_codec_mask = audio_codec_mask_; 680 media_type_codec_mask = audio_codec_mask_;
680 break; 681 break;
681 case EmeMediaType::VIDEO: 682 case EmeMediaType::VIDEO:
682 if (!base::StartsWithASCII(container_mime_type, "video/", true)) 683 if (!base::StartsWith(container_mime_type, "video/",
684 base::CompareCase::SENSITIVE))
683 return EmeConfigRule::NOT_SUPPORTED; 685 return EmeConfigRule::NOT_SUPPORTED;
684 media_type_codec_mask = video_codec_mask_; 686 media_type_codec_mask = video_codec_mask_;
685 break; 687 break;
686 } 688 }
687 689
688 // Look up the key system's supported codecs. 690 // Look up the key system's supported codecs.
689 KeySystemInfoMap::const_iterator key_system_iter = 691 KeySystemInfoMap::const_iterator key_system_iter =
690 concrete_key_system_map_.find(key_system); 692 concrete_key_system_map_.find(key_system);
691 if (key_system_iter == concrete_key_system_map_.end()) { 693 if (key_system_iter == concrete_key_system_map_.end()) {
692 NOTREACHED(); 694 NOTREACHED();
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 } 933 }
932 934
933 MEDIA_EXPORT void AddCodecMask( 935 MEDIA_EXPORT void AddCodecMask(
934 EmeMediaType media_type, 936 EmeMediaType media_type,
935 const std::string& codec, 937 const std::string& codec,
936 uint32 mask) { 938 uint32 mask) {
937 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); 939 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask);
938 } 940 }
939 941
940 } // namespace media 942 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_player_bridge.cc ('k') | media/base/mime_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698