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

Side by Side Diff: components/cdm/renderer/android_key_systems.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/android_key_systems.h" 5 #include "components/cdm/renderer/android_key_systems.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "components/cdm/common/cdm_messages_android.h" 12 #include "components/cdm/common/cdm_messages_android.h"
13 #include "components/cdm/renderer/widevine_key_system_properties.h" 13 #include "components/cdm/renderer/widevine_key_system_properties.h"
14 #include "content/public/renderer/render_thread.h" 14 #include "content/public/renderer/render_thread.h"
15 #include "media/base/eme_constants.h" 15 #include "media/base/eme_constants.h"
16 #include "media/base/media_switches.h" 16 #include "media/base/media_switches.h"
17 #include "media/media_features.h"
17 18
18 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 19 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
19 20
20 using media::EmeConfigRule; 21 using media::EmeConfigRule;
21 using media::EmeFeatureSupport; 22 using media::EmeFeatureSupport;
22 using media::EmeInitDataType; 23 using media::EmeInitDataType;
23 using media::EmeSessionTypeSupport; 24 using media::EmeSessionTypeSupport;
24 using media::KeySystemProperties; 25 using media::KeySystemProperties;
25 using media::SupportedCodecs; 26 using media::SupportedCodecs;
26 using Robustness = cdm::WidevineKeySystemProperties::Robustness; 27 using Robustness = cdm::WidevineKeySystemProperties::Robustness;
(...skipping 14 matching lines...) Expand all
41 std::string GetKeySystemName() const override { return name_; } 42 std::string GetKeySystemName() const override { return name_; }
42 43
43 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { 44 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override {
44 // Here we assume that support for a container implies support for the 45 // Here we assume that support for a container implies support for the
45 // associated initialization data type. KeySystems handles validating 46 // associated initialization data type. KeySystems handles validating
46 // |init_data_type| x |container| pairings. 47 // |init_data_type| x |container| pairings.
47 switch (init_data_type) { 48 switch (init_data_type) {
48 case EmeInitDataType::WEBM: 49 case EmeInitDataType::WEBM:
49 return (supported_codecs_ & media::EME_CODEC_WEBM_ALL) != 0; 50 return (supported_codecs_ & media::EME_CODEC_WEBM_ALL) != 0;
50 case EmeInitDataType::CENC: 51 case EmeInitDataType::CENC:
51 #if defined(USE_PROPRIETARY_CODECS) 52 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
52 return (supported_codecs_ & media::EME_CODEC_MP4_ALL) != 0; 53 return (supported_codecs_ & media::EME_CODEC_MP4_ALL) != 0;
53 #else 54 #else
54 return false; 55 return false;
55 #endif // defined(USE_PROPRIETARY_CODECS) 56 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
56 case EmeInitDataType::KEYIDS: 57 case EmeInitDataType::KEYIDS:
57 case EmeInitDataType::UNKNOWN: 58 case EmeInitDataType::UNKNOWN:
58 return false; 59 return false;
59 } 60 }
60 NOTREACHED(); 61 NOTREACHED();
61 return false; 62 return false;
62 } 63 }
63 64
64 SupportedCodecs GetSupportedCodecs() const override { 65 SupportedCodecs GetSupportedCodecs() const override {
65 return supported_codecs_; 66 return supported_codecs_;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 it != key_system_names.end(); ++it) { 145 it != key_system_names.end(); ++it) {
145 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); 146 SupportedKeySystemResponse response = QueryKeySystemSupport(*it);
146 if (response.compositing_codecs != media::EME_CODEC_NONE) { 147 if (response.compositing_codecs != media::EME_CODEC_NONE) {
147 concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties( 148 concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties(
148 *it, response.compositing_codecs)); 149 *it, response.compositing_codecs));
149 } 150 }
150 } 151 }
151 } 152 }
152 153
153 } // namespace cdm 154 } // namespace cdm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698