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

Side by Side Diff: components/cdm/renderer/external_clear_key_key_system_properties.cc

Issue 2572883002: Convert USE_PROPRIETARY_CODECS to a buildflag header. (Closed)
Patch Set: Merge Created 4 years 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/cdm/renderer/external_clear_key_key_system_properties.h" 5 #include "components/cdm/renderer/external_clear_key_key_system_properties.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/eme_constants.h" 8 #include "media/base/eme_constants.h"
9 #include "media/media_features.h"
9 #include "ppapi/features/features.h" 10 #include "ppapi/features/features.h"
10 11
11 namespace cdm { 12 namespace cdm {
12 13
13 #if BUILDFLAG(ENABLE_PEPPER_CDMS) 14 #if BUILDFLAG(ENABLE_PEPPER_CDMS)
14 const char kExternalClearKeyPepperType[] = "application/x-ppapi-clearkey-cdm"; 15 const char kExternalClearKeyPepperType[] = "application/x-ppapi-clearkey-cdm";
15 #endif 16 #endif
16 17
17 ExternalClearKeyProperties::ExternalClearKeyProperties( 18 ExternalClearKeyProperties::ExternalClearKeyProperties(
18 const std::string& key_system_name) 19 const std::string& key_system_name)
19 : key_system_name_(key_system_name) {} 20 : key_system_name_(key_system_name) {}
20 21
21 ExternalClearKeyProperties::~ExternalClearKeyProperties() {} 22 ExternalClearKeyProperties::~ExternalClearKeyProperties() {}
22 23
23 std::string ExternalClearKeyProperties::GetKeySystemName() const { 24 std::string ExternalClearKeyProperties::GetKeySystemName() const {
24 return key_system_name_; 25 return key_system_name_;
25 } 26 }
26 27
27 bool ExternalClearKeyProperties::IsSupportedInitDataType( 28 bool ExternalClearKeyProperties::IsSupportedInitDataType(
28 media::EmeInitDataType init_data_type) const { 29 media::EmeInitDataType init_data_type) const {
29 switch (init_data_type) { 30 switch (init_data_type) {
30 case media::EmeInitDataType::WEBM: 31 case media::EmeInitDataType::WEBM:
31 case media::EmeInitDataType::KEYIDS: 32 case media::EmeInitDataType::KEYIDS:
32 return true; 33 return true;
33 34
34 case media::EmeInitDataType::CENC: 35 case media::EmeInitDataType::CENC:
35 #if defined(USE_PROPRIETARY_CODECS) 36 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
36 return true; 37 return true;
37 #else 38 #else
38 return false; 39 return false;
39 #endif // defined(USE_PROPRIETARY_CODECS) 40 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
40 41
41 case media::EmeInitDataType::UNKNOWN: 42 case media::EmeInitDataType::UNKNOWN:
42 return false; 43 return false;
43 } 44 }
44 NOTREACHED(); 45 NOTREACHED();
45 return false; 46 return false;
46 } 47 }
47 48
48 media::SupportedCodecs ExternalClearKeyProperties::GetSupportedCodecs() const { 49 media::SupportedCodecs ExternalClearKeyProperties::GetSupportedCodecs() const {
49 #if defined(USE_PROPRIETARY_CODECS) 50 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
50 return media::EME_CODEC_MP4_ALL | media::EME_CODEC_WEBM_ALL; 51 return media::EME_CODEC_MP4_ALL | media::EME_CODEC_WEBM_ALL;
51 #else 52 #else
52 return media::EME_CODEC_WEBM_ALL; 53 return media::EME_CODEC_WEBM_ALL;
53 #endif 54 #endif
54 } 55 }
55 56
56 media::EmeConfigRule ExternalClearKeyProperties::GetRobustnessConfigRule( 57 media::EmeConfigRule ExternalClearKeyProperties::GetRobustnessConfigRule(
57 media::EmeMediaType media_type, 58 media::EmeMediaType media_type,
58 const std::string& requested_robustness) const { 59 const std::string& requested_robustness) const {
59 return requested_robustness.empty() ? media::EmeConfigRule::SUPPORTED 60 return requested_robustness.empty() ? media::EmeConfigRule::SUPPORTED
(...skipping 21 matching lines...) Expand all
81 return media::EmeFeatureSupport::NOT_SUPPORTED; 82 return media::EmeFeatureSupport::NOT_SUPPORTED;
82 } 83 }
83 84
84 #if BUILDFLAG(ENABLE_PEPPER_CDMS) 85 #if BUILDFLAG(ENABLE_PEPPER_CDMS)
85 std::string ExternalClearKeyProperties::GetPepperType() const { 86 std::string ExternalClearKeyProperties::GetPepperType() const {
86 return kExternalClearKeyPepperType; 87 return kExternalClearKeyPepperType;
87 } 88 }
88 #endif 89 #endif
89 90
90 } // namespace cdm 91 } // namespace cdm
OLDNEW
« no previous file with comments | « components/cdm/renderer/android_key_systems.cc ('k') | components/cdm/renderer/widevine_key_system_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698