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

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

Issue 1585083003: EME: Do not special case an empty robustness string. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | 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 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 747
748 EmeConfigRule KeySystemsImpl::GetRobustnessConfigRule( 748 EmeConfigRule KeySystemsImpl::GetRobustnessConfigRule(
749 const std::string& key_system, 749 const std::string& key_system,
750 EmeMediaType media_type, 750 EmeMediaType media_type,
751 const std::string& requested_robustness) const { 751 const std::string& requested_robustness) const {
752 DCHECK(thread_checker_.CalledOnValidThread()); 752 DCHECK(thread_checker_.CalledOnValidThread());
753 753
754 EmeRobustness robustness = ConvertRobustness(requested_robustness); 754 EmeRobustness robustness = ConvertRobustness(requested_robustness);
755 if (robustness == EmeRobustness::INVALID) 755 if (robustness == EmeRobustness::INVALID)
756 return EmeConfigRule::NOT_SUPPORTED; 756 return EmeConfigRule::NOT_SUPPORTED;
757 if (robustness == EmeRobustness::EMPTY)
758 return EmeConfigRule::SUPPORTED;
759 757
760 KeySystemInfoMap::const_iterator key_system_iter = 758 KeySystemInfoMap::const_iterator key_system_iter =
761 concrete_key_system_map_.find(key_system); 759 concrete_key_system_map_.find(key_system);
762 if (key_system_iter == concrete_key_system_map_.end()) { 760 if (key_system_iter == concrete_key_system_map_.end()) {
763 NOTREACHED(); 761 NOTREACHED();
764 return EmeConfigRule::NOT_SUPPORTED; 762 return EmeConfigRule::NOT_SUPPORTED;
765 } 763 }
766 764
767 EmeRobustness max_robustness = EmeRobustness::INVALID; 765 EmeRobustness max_robustness = EmeRobustness::INVALID;
768 switch (media_type) { 766 switch (media_type) {
(...skipping 11 matching lines...) Expand all
780 if ((max_robustness == EmeRobustness::HW_SECURE_CRYPTO && 778 if ((max_robustness == EmeRobustness::HW_SECURE_CRYPTO &&
781 robustness == EmeRobustness::SW_SECURE_DECODE) || 779 robustness == EmeRobustness::SW_SECURE_DECODE) ||
782 (max_robustness == EmeRobustness::SW_SECURE_DECODE && 780 (max_robustness == EmeRobustness::SW_SECURE_DECODE &&
783 robustness == EmeRobustness::HW_SECURE_CRYPTO) || 781 robustness == EmeRobustness::HW_SECURE_CRYPTO) ||
784 robustness > max_robustness) { 782 robustness > max_robustness) {
785 return EmeConfigRule::NOT_SUPPORTED; 783 return EmeConfigRule::NOT_SUPPORTED;
786 } 784 }
787 785
788 if (key_system == kWidevineKeySystem) { 786 if (key_system == kWidevineKeySystem) {
789 #if defined(OS_CHROMEOS) 787 #if defined(OS_CHROMEOS)
788 // TODO(ddorwin): Remove this once we have confirmed it is not necessary.
789 // See https://crbug.com/482277
790 if (robustness == EmeRobustness::EMPTY)
791 return EmeConfigRule::SUPPORTED;
792
790 // Hardware security requires remote attestation. 793 // Hardware security requires remote attestation.
791 if (robustness >= EmeRobustness::HW_SECURE_CRYPTO) 794 if (robustness >= EmeRobustness::HW_SECURE_CRYPTO)
792 return EmeConfigRule::IDENTIFIER_REQUIRED; 795 return EmeConfigRule::IDENTIFIER_REQUIRED;
793 796
794 // For video, recommend remote attestation if HW_SECURE_ALL is available, 797 // For video, recommend remote attestation if HW_SECURE_ALL is available,
795 // because it enables hardware accelerated decoding. 798 // because it enables hardware accelerated decoding.
796 // TODO(sandersd): Only do this when hardware accelerated decoding is 799 // TODO(sandersd): Only do this when hardware accelerated decoding is
797 // available for the requested codecs. 800 // available for the requested codecs.
798 if (media_type == EmeMediaType::VIDEO && 801 if (media_type == EmeMediaType::VIDEO &&
799 max_robustness == EmeRobustness::HW_SECURE_ALL) { 802 max_robustness == EmeRobustness::HW_SECURE_ALL) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 KeySystemsImpl::GetInstance()->AddContainerMask(container, mask); 933 KeySystemsImpl::GetInstance()->AddContainerMask(container, mask);
931 } 934 }
932 935
933 MEDIA_EXPORT void AddCodecMask(EmeMediaType media_type, 936 MEDIA_EXPORT void AddCodecMask(EmeMediaType media_type,
934 const std::string& codec, 937 const std::string& codec,
935 uint32_t mask) { 938 uint32_t mask) {
936 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); 939 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask);
937 } 940 }
938 941
939 } // namespace media 942 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698