OLD | NEW |
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" | |
18 | 17 |
19 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 18 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
20 | 19 |
21 using media::EmeConfigRule; | 20 using media::EmeConfigRule; |
22 using media::EmeFeatureSupport; | 21 using media::EmeFeatureSupport; |
23 using media::EmeInitDataType; | 22 using media::EmeInitDataType; |
24 using media::EmeSessionTypeSupport; | 23 using media::EmeSessionTypeSupport; |
25 using media::KeySystemProperties; | 24 using media::KeySystemProperties; |
26 using media::SupportedCodecs; | 25 using media::SupportedCodecs; |
27 using Robustness = cdm::WidevineKeySystemProperties::Robustness; | 26 using Robustness = cdm::WidevineKeySystemProperties::Robustness; |
(...skipping 14 matching lines...) Expand all Loading... |
42 std::string GetKeySystemName() const override { return name_; } | 41 std::string GetKeySystemName() const override { return name_; } |
43 | 42 |
44 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { | 43 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { |
45 // Here we assume that support for a container implies support for the | 44 // Here we assume that support for a container implies support for the |
46 // associated initialization data type. KeySystems handles validating | 45 // associated initialization data type. KeySystems handles validating |
47 // |init_data_type| x |container| pairings. | 46 // |init_data_type| x |container| pairings. |
48 switch (init_data_type) { | 47 switch (init_data_type) { |
49 case EmeInitDataType::WEBM: | 48 case EmeInitDataType::WEBM: |
50 return (supported_codecs_ & media::EME_CODEC_WEBM_ALL) != 0; | 49 return (supported_codecs_ & media::EME_CODEC_WEBM_ALL) != 0; |
51 case EmeInitDataType::CENC: | 50 case EmeInitDataType::CENC: |
52 #if BUILDFLAG(USE_PROPRIETARY_CODECS) | 51 #if defined(USE_PROPRIETARY_CODECS) |
53 return (supported_codecs_ & media::EME_CODEC_MP4_ALL) != 0; | 52 return (supported_codecs_ & media::EME_CODEC_MP4_ALL) != 0; |
54 #else | 53 #else |
55 return false; | 54 return false; |
56 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) | 55 #endif // defined(USE_PROPRIETARY_CODECS) |
57 case EmeInitDataType::KEYIDS: | 56 case EmeInitDataType::KEYIDS: |
58 case EmeInitDataType::UNKNOWN: | 57 case EmeInitDataType::UNKNOWN: |
59 return false; | 58 return false; |
60 } | 59 } |
61 NOTREACHED(); | 60 NOTREACHED(); |
62 return false; | 61 return false; |
63 } | 62 } |
64 | 63 |
65 SupportedCodecs GetSupportedCodecs() const override { | 64 SupportedCodecs GetSupportedCodecs() const override { |
66 return supported_codecs_; | 65 return supported_codecs_; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 it != key_system_names.end(); ++it) { | 144 it != key_system_names.end(); ++it) { |
146 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); | 145 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); |
147 if (response.compositing_codecs != media::EME_CODEC_NONE) { | 146 if (response.compositing_codecs != media::EME_CODEC_NONE) { |
148 concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties( | 147 concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties( |
149 *it, response.compositing_codecs)); | 148 *it, response.compositing_codecs)); |
150 } | 149 } |
151 } | 150 } |
152 } | 151 } |
153 | 152 |
154 } // namespace cdm | 153 } // namespace cdm |
OLD | NEW |