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/widevine_key_systems.h" | 5 #include "components/cdm/renderer/widevine_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 11 matching lines...) Expand all Loading... |
22 // Return |name|'s parent key system. | 22 // Return |name|'s parent key system. |
23 static std::string GetDirectParentName(std::string name) { | 23 static std::string GetDirectParentName(std::string name) { |
24 size_t last_period = name.find_last_of('.'); | 24 size_t last_period = name.find_last_of('.'); |
25 DCHECK_GT(last_period, 0u); | 25 DCHECK_GT(last_period, 0u); |
26 return name.substr(0u, last_period); | 26 return name.substr(0u, last_period); |
27 } | 27 } |
28 | 28 |
29 void AddWidevineWithCodecs( | 29 void AddWidevineWithCodecs( |
30 WidevineCdmType widevine_cdm_type, | 30 WidevineCdmType widevine_cdm_type, |
31 SupportedCodecs supported_codecs, | 31 SupportedCodecs supported_codecs, |
| 32 media::EmeRobustness max_audio_robustness, |
| 33 media::EmeRobustness max_video_robustness, |
32 media::EmeSessionTypeSupport persistent_license_support, | 34 media::EmeSessionTypeSupport persistent_license_support, |
33 media::EmeSessionTypeSupport persistent_release_message_support, | 35 media::EmeSessionTypeSupport persistent_release_message_support, |
34 media::EmeFeatureSupport persistent_state_support, | 36 media::EmeFeatureSupport persistent_state_support, |
35 media::EmeFeatureSupport distinctive_identifier_support, | 37 media::EmeFeatureSupport distinctive_identifier_support, |
36 std::vector<KeySystemInfo>* concrete_key_systems) { | 38 std::vector<KeySystemInfo>* concrete_key_systems) { |
37 KeySystemInfo info; | 39 KeySystemInfo info; |
38 info.key_system = kWidevineKeySystem; | 40 info.key_system = kWidevineKeySystem; |
39 | 41 |
40 switch (widevine_cdm_type) { | 42 switch (widevine_cdm_type) { |
41 case WIDEVINE: | 43 case WIDEVINE: |
(...skipping 17 matching lines...) Expand all Loading... |
59 // Here we assume that support for a container imples support for the | 61 // Here we assume that support for a container imples support for the |
60 // associated initialization data type. KeySystems handles validating | 62 // associated initialization data type. KeySystems handles validating |
61 // |init_data_type| x |container| pairings. | 63 // |init_data_type| x |container| pairings. |
62 if (supported_codecs & media::EME_CODEC_WEBM_ALL) | 64 if (supported_codecs & media::EME_CODEC_WEBM_ALL) |
63 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_WEBM; | 65 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_WEBM; |
64 #if defined(USE_PROPRIETARY_CODECS) | 66 #if defined(USE_PROPRIETARY_CODECS) |
65 if (supported_codecs & media::EME_CODEC_MP4_ALL) | 67 if (supported_codecs & media::EME_CODEC_MP4_ALL) |
66 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC; | 68 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC; |
67 #endif // defined(USE_PROPRIETARY_CODECS) | 69 #endif // defined(USE_PROPRIETARY_CODECS) |
68 | 70 |
| 71 info.max_audio_robustness = max_audio_robustness; |
| 72 info.max_video_robustness = max_video_robustness; |
69 info.persistent_license_support = persistent_license_support; | 73 info.persistent_license_support = persistent_license_support; |
70 info.persistent_release_message_support = persistent_release_message_support; | 74 info.persistent_release_message_support = persistent_release_message_support; |
71 info.persistent_state_support = persistent_state_support; | 75 info.persistent_state_support = persistent_state_support; |
72 info.distinctive_identifier_support = distinctive_identifier_support; | 76 info.distinctive_identifier_support = distinctive_identifier_support; |
73 | 77 |
74 #if defined(ENABLE_PEPPER_CDMS) | 78 #if defined(ENABLE_PEPPER_CDMS) |
75 info.pepper_type = kWidevineCdmPluginMimeType; | 79 info.pepper_type = kWidevineCdmPluginMimeType; |
76 #endif // defined(ENABLE_PEPPER_CDMS) | 80 #endif // defined(ENABLE_PEPPER_CDMS) |
77 | 81 |
78 concrete_key_systems->push_back(info); | 82 concrete_key_systems->push_back(info); |
79 } | 83 } |
80 | 84 |
81 } // namespace cdm | 85 } // namespace cdm |
82 | 86 |
83 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 87 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
OLD | NEW |