| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/cdm/renderer/widevine_key_systems.h" | |
| 6 | |
| 7 #include <stddef.h> | |
| 8 | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/logging.h" | |
| 13 #include "build/build_config.h" | |
| 14 #include "media/base/eme_constants.h" | |
| 15 | |
| 16 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | |
| 17 | |
| 18 #if defined(WIDEVINE_CDM_AVAILABLE) | |
| 19 | |
| 20 using media::KeySystemInfo; | |
| 21 using media::SupportedCodecs; | |
| 22 | |
| 23 namespace cdm { | |
| 24 | |
| 25 void AddWidevineWithCodecs( | |
| 26 SupportedCodecs supported_codecs, | |
| 27 #if defined(OS_ANDROID) | |
| 28 SupportedCodecs supported_secure_codecs, | |
| 29 #endif // defined(OS_ANDROID) | |
| 30 media::EmeRobustness max_audio_robustness, | |
| 31 media::EmeRobustness max_video_robustness, | |
| 32 media::EmeSessionTypeSupport persistent_license_support, | |
| 33 media::EmeSessionTypeSupport persistent_release_message_support, | |
| 34 media::EmeFeatureSupport persistent_state_support, | |
| 35 media::EmeFeatureSupport distinctive_identifier_support, | |
| 36 std::vector<KeySystemInfo>* concrete_key_systems) { | |
| 37 KeySystemInfo info; | |
| 38 info.key_system = kWidevineKeySystem; | |
| 39 | |
| 40 // TODO(xhwang): A container or an initDataType may be supported even though | |
| 41 // there are no codecs supported in that container. Fix this when we support | |
| 42 // initDataType. | |
| 43 info.supported_codecs = supported_codecs; | |
| 44 #if defined(OS_ANDROID) | |
| 45 info.supported_secure_codecs = supported_secure_codecs; | |
| 46 #endif // defined(OS_ANDROID) | |
| 47 | |
| 48 // Here we assume that support for a container imples support for the | |
| 49 // associated initialization data type. KeySystems handles validating | |
| 50 // |init_data_type| x |container| pairings. | |
| 51 if (supported_codecs & media::EME_CODEC_WEBM_ALL) | |
| 52 info.supported_init_data_types |= media::kInitDataTypeMaskWebM; | |
| 53 #if defined(USE_PROPRIETARY_CODECS) | |
| 54 if (supported_codecs & media::EME_CODEC_MP4_ALL) | |
| 55 info.supported_init_data_types |= media::kInitDataTypeMaskCenc; | |
| 56 #endif // defined(USE_PROPRIETARY_CODECS) | |
| 57 | |
| 58 info.max_audio_robustness = max_audio_robustness; | |
| 59 info.max_video_robustness = max_video_robustness; | |
| 60 info.persistent_license_support = persistent_license_support; | |
| 61 info.persistent_release_message_support = persistent_release_message_support; | |
| 62 info.persistent_state_support = persistent_state_support; | |
| 63 info.distinctive_identifier_support = distinctive_identifier_support; | |
| 64 | |
| 65 #if defined(ENABLE_PEPPER_CDMS) | |
| 66 info.pepper_type = kWidevineCdmPluginMimeType; | |
| 67 #endif // defined(ENABLE_PEPPER_CDMS) | |
| 68 | |
| 69 concrete_key_systems->push_back(info); | |
| 70 } | |
| 71 | |
| 72 } // namespace cdm | |
| 73 | |
| 74 #endif // defined(WIDEVINE_CDM_AVAILABLE) | |
| OLD | NEW |