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

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

Issue 1132773003: Revert of Plumb |use_secure_codecs| through to BrowserCdmFactoryAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/eme_constants.h ('k') | media/blink/cdm_session_adapter.h » ('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 #include <string> 7 #include <string>
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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 SupportedCodecs codec = GetCodecForString(codecs[i]); 715 SupportedCodecs codec = GetCodecForString(codecs[i]);
716 if ((codec & key_system_codec_mask & container_codec_mask) == 0) 716 if ((codec & key_system_codec_mask & container_codec_mask) == 0)
717 return EmeConfigRule::NOT_SUPPORTED; 717 return EmeConfigRule::NOT_SUPPORTED;
718 #if defined(OS_ANDROID) 718 #if defined(OS_ANDROID)
719 // Check whether the codec supports a hardware-secure mode. The goal is to 719 // Check whether the codec supports a hardware-secure mode. The goal is to
720 // prevent mixing of non-hardware-secure codecs with hardware-secure codecs, 720 // prevent mixing of non-hardware-secure codecs with hardware-secure codecs,
721 // since the mode is fixed at CDM creation. 721 // since the mode is fixed at CDM creation.
722 // 722 //
723 // Because the check for regular codec support is early-exit, we don't have 723 // Because the check for regular codec support is early-exit, we don't have
724 // to consider codecs that are only supported in hardware-secure mode. We 724 // to consider codecs that are only supported in hardware-secure mode. We
725 // could do so, and make use of HW_SECURE_CODECS_REQUIRED, if it turns out 725 // could do so, and make use of SECURE_CODECS_REQUIRED, if it turns out that
726 // that hardware-secure-only codecs actually exist and are useful. 726 // hardware-secure-only codecs actually exist and are useful.
727 if ((codec & key_system_secure_codec_mask) == 0) 727 if ((codec & key_system_secure_codec_mask) == 0)
728 support = EmeConfigRule::HW_SECURE_CODECS_NOT_ALLOWED; 728 support = EmeConfigRule::SECURE_CODECS_NOT_ALLOWED;
729 #endif // defined(OS_ANDROID) 729 #endif // defined(OS_ANDROID)
730 } 730 }
731 731
732 return support; 732 return support;
733 } 733 }
734 734
735 EmeConfigRule KeySystemsImpl::GetRobustnessConfigRule( 735 EmeConfigRule KeySystemsImpl::GetRobustnessConfigRule(
736 const std::string& key_system, 736 const std::string& key_system,
737 EmeMediaType media_type, 737 EmeMediaType media_type,
738 const std::string& requested_robustness) const { 738 const std::string& requested_robustness) const {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 // For video, recommend remote attestation if HW_SECURE_ALL is available, 781 // For video, recommend remote attestation if HW_SECURE_ALL is available,
782 // because it enables hardware accelerated decoding. 782 // because it enables hardware accelerated decoding.
783 // TODO(sandersd): Only do this when hardware accelerated decoding is 783 // TODO(sandersd): Only do this when hardware accelerated decoding is
784 // available for the requested codecs. 784 // available for the requested codecs.
785 if (media_type == EmeMediaType::VIDEO && 785 if (media_type == EmeMediaType::VIDEO &&
786 max_robustness == EmeRobustness::HW_SECURE_ALL) { 786 max_robustness == EmeRobustness::HW_SECURE_ALL) {
787 return EmeConfigRule::IDENTIFIER_RECOMMENDED; 787 return EmeConfigRule::IDENTIFIER_RECOMMENDED;
788 } 788 }
789 #elif defined(OS_ANDROID) 789 #elif defined(OS_ANDROID)
790 if (robustness > EmeRobustness::SW_SECURE_CRYPTO) 790 if (robustness > EmeRobustness::SW_SECURE_CRYPTO)
791 return EmeConfigRule::HW_SECURE_CODECS_REQUIRED; 791 return EmeConfigRule::SECURE_CODECS_REQUIRED;
792 #endif // defined(OS_CHROMEOS) 792 #endif // defined(OS_CHROMEOS)
793 } 793 }
794 794
795 return EmeConfigRule::SUPPORTED; 795 return EmeConfigRule::SUPPORTED;
796 } 796 }
797 797
798 EmeSessionTypeSupport KeySystemsImpl::GetPersistentLicenseSessionSupport( 798 EmeSessionTypeSupport KeySystemsImpl::GetPersistentLicenseSessionSupport(
799 const std::string& key_system) const { 799 const std::string& key_system) const {
800 DCHECK(thread_checker_.CalledOnValidThread()); 800 DCHECK(thread_checker_.CalledOnValidThread());
801 801
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 } 933 }
934 934
935 MEDIA_EXPORT void AddCodecMask( 935 MEDIA_EXPORT void AddCodecMask(
936 EmeMediaType media_type, 936 EmeMediaType media_type,
937 const std::string& codec, 937 const std::string& codec,
938 uint32 mask) { 938 uint32 mask) {
939 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); 939 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask);
940 } 940 }
941 941
942 } // namespace media 942 } // namespace media
OLDNEW
« no previous file with comments | « media/base/eme_constants.h ('k') | media/blink/cdm_session_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698