[chromedriver] Add a sanity check during session initiation
[chromium-blink-merge.git] / chromecast / renderer / key_systems_cast.cc
blob246d6adef805ee9601a7ef79649b5ba2b6db0773
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.
5 #include "chromecast/renderer/key_systems_cast.h"
7 #include <string>
9 #include "base/command_line.h"
10 #include "base/logging.h"
11 #include "chromecast/media/base/key_systems_common.h"
12 #include "components/cdm/renderer/widevine_key_systems.h"
13 #include "media/base/eme_constants.h"
15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
17 namespace chromecast {
18 namespace shell {
20 void AddKeySystemWithCodecs(
21 const std::string& key_system_name,
22 std::vector<::media::KeySystemInfo>* key_systems_info) {
23 ::media::KeySystemInfo info;
24 info.key_system = key_system_name;
25 info.supported_codecs =
26 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1;
27 info.supported_init_data_types = ::media::EME_INIT_DATA_TYPE_CENC;
28 info.persistent_license_support = ::media::EME_SESSION_TYPE_NOT_SUPPORTED;
29 info.persistent_release_message_support =
30 ::media::EME_SESSION_TYPE_NOT_SUPPORTED;
31 info.persistent_state_support = ::media::EME_FEATURE_ALWAYS_ENABLED;
32 info.distinctive_identifier_support = ::media::EME_FEATURE_ALWAYS_ENABLED;
33 key_systems_info->push_back(info);
36 void AddChromecastKeySystems(
37 std::vector<::media::KeySystemInfo>* key_systems_info) {
38 #if defined(WIDEVINE_CDM_AVAILABLE)
39 AddWidevineWithCodecs(
40 cdm::WIDEVINE,
41 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1,
42 ::media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license.
43 ::media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message.
44 ::media::EME_FEATURE_NOT_SUPPORTED, // Persistent state.
45 ::media::EME_FEATURE_ALWAYS_ENABLED, // Distinctive identifier.
46 key_systems_info);
47 #endif
49 #if defined(PLAYREADY_CDM_AVAILABLE)
50 AddKeySystemWithCodecs(media::kChromecastPlayreadyKeySystem,
51 key_systems_info);
52 #endif
55 } // namespace shell
56 } // namespace chromecast