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/logging.h" | 10 #include "base/logging.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 << "unrecognized codec"; | 33 << "unrecognized codec"; |
34 DCHECK(!(response.non_compositing_codecs & ~media::EME_CODEC_ALL)) | 34 DCHECK(!(response.non_compositing_codecs & ~media::EME_CODEC_ALL)) |
35 << "unrecognized codec"; | 35 << "unrecognized codec"; |
36 return response; | 36 return response; |
37 } | 37 } |
38 | 38 |
39 void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems) { | 39 void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems) { |
40 SupportedKeySystemResponse response = QueryKeySystemSupport( | 40 SupportedKeySystemResponse response = QueryKeySystemSupport( |
41 kWidevineKeySystem); | 41 kWidevineKeySystem); |
42 if (response.compositing_codecs != media::EME_CODEC_NONE) { | 42 if (response.compositing_codecs != media::EME_CODEC_NONE) { |
43 // When creating the WIDEVINE key system, BrowserCdmFactoryAndroid | |
44 // configures the CDM's security level based on the | |
45 // --mediadrm-enable-non-compositing flag. Therefore the supported | |
46 // codec/robustenss combinations depend on that flag. | |
47 // TODO(sandersd): For unprefixed, set the security level based on the | |
48 // requested robustness instead of the flag. | |
49 SupportedCodecs codecs = | |
50 static_cast<SupportedCodecs>(response.compositing_codecs); | |
51 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
52 switches::kMediaDrmEnableNonCompositing)) { | |
53 codecs = static_cast<SupportedCodecs>(response.non_compositing_codecs); | |
ddorwin
2015/03/13 19:24:47
Note: Using non_compositing_codecs here matches th
sandersd (OOO until July 31)
2015/03/13 20:11:56
I rearranged this to make it more correct, but the
| |
54 } | |
43 AddWidevineWithCodecs( | 55 AddWidevineWithCodecs( |
44 WIDEVINE, | 56 WIDEVINE, |
45 static_cast<SupportedCodecs>(response.compositing_codecs), | 57 codecs, |
46 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. | 58 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. |
47 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. | 59 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. |
48 media::EME_FEATURE_NOT_SUPPORTED, // Persistent state. | 60 media::EME_FEATURE_NOT_SUPPORTED, // Persistent state. |
49 media::EME_FEATURE_ALWAYS_ENABLED, // Distinctive identifier. | 61 media::EME_FEATURE_ALWAYS_ENABLED, // Distinctive identifier. |
50 concrete_key_systems); | 62 concrete_key_systems); |
51 } | 63 } |
52 | 64 |
53 if (response.non_compositing_codecs != media::EME_CODEC_NONE) { | 65 if (response.non_compositing_codecs != media::EME_CODEC_NONE) { |
66 // When creating the WIDEVINE_HR_NON_COMPOSITING key system, | |
ddorwin
2015/03/13 19:24:47
This is the "L1 key system". It's actually confusi
sandersd (OOO until July 31)
2015/03/13 20:11:56
Turns out we do. Done.
ddorwin
2015/03/16 23:25:07
As I noted, I don't think that bug covers this iss
sandersd (OOO until July 31)
2015/03/17 22:10:37
Acknowledged.
| |
67 // BrowserCdmFactoryAndroid does not configure the CDM's security level | |
68 // (that is, leaves it as L1). | |
54 // TODO(ddorwin): Remove with unprefixed. http://crbug.com/249976 | 69 // TODO(ddorwin): Remove with unprefixed. http://crbug.com/249976 |
55 AddWidevineWithCodecs( | 70 AddWidevineWithCodecs( |
56 WIDEVINE_HR_NON_COMPOSITING, | 71 WIDEVINE_HR_NON_COMPOSITING, |
57 static_cast<SupportedCodecs>(response.non_compositing_codecs), | 72 static_cast<SupportedCodecs>(response.non_compositing_codecs), |
58 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. | 73 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. |
59 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. | 74 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. |
60 media::EME_FEATURE_NOT_SUPPORTED, // Persistent state. | 75 media::EME_FEATURE_NOT_SUPPORTED, // Persistent state. |
61 media::EME_FEATURE_ALWAYS_ENABLED, // Distinctive identifier. | 76 media::EME_FEATURE_ALWAYS_ENABLED, // Distinctive identifier. |
62 concrete_key_systems); | 77 concrete_key_systems); |
63 } | 78 } |
(...skipping 26 matching lines...) Expand all Loading... | |
90 info.persistent_release_message_support = | 105 info.persistent_release_message_support = |
91 media::EME_SESSION_TYPE_NOT_SUPPORTED; | 106 media::EME_SESSION_TYPE_NOT_SUPPORTED; |
92 info.persistent_state_support = media::EME_FEATURE_ALWAYS_ENABLED; | 107 info.persistent_state_support = media::EME_FEATURE_ALWAYS_ENABLED; |
93 info.distinctive_identifier_support = media::EME_FEATURE_ALWAYS_ENABLED; | 108 info.distinctive_identifier_support = media::EME_FEATURE_ALWAYS_ENABLED; |
94 concrete_key_systems->push_back(info); | 109 concrete_key_systems->push_back(info); |
95 } | 110 } |
96 } | 111 } |
97 } | 112 } |
98 | 113 |
99 } // namespace cdm | 114 } // namespace cdm |
OLD | NEW |