Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(876)

Side by Side Diff: components/cdm/renderer/android_key_systems.cc

Issue 923283002: Implement checks for distinctiveIdentifier and persistentState in requestMediaKeySystemAccess(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cast Widevine config Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 25 matching lines...) Expand all
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 AddWidevineWithCodecs( 43 AddWidevineWithCodecs(
44 WIDEVINE, 44 WIDEVINE,
45 static_cast<SupportedCodecs>(response.compositing_codecs), 45 static_cast<SupportedCodecs>(response.compositing_codecs),
46 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license.
47 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message.
48 media::EME_FEATURE_NOT_SUPPORTED, // Persistent state.
49 media::EME_FEATURE_ALWAYS_AVAILABLE, // Distinctive identifier.
46 concrete_key_systems); 50 concrete_key_systems);
47 } 51 }
48 52
49 if (response.non_compositing_codecs != media::EME_CODEC_NONE) { 53 if (response.non_compositing_codecs != media::EME_CODEC_NONE) {
50 AddWidevineWithCodecs( 54 AddWidevineWithCodecs(
ddorwin 2015/02/19 01:41:33 TODO: Remove with unprefixed. crbug.com/249976
sandersd (OOO until July 31) 2015/02/19 21:08:34 Done.
51 WIDEVINE_HR_NON_COMPOSITING, 55 WIDEVINE_HR_NON_COMPOSITING,
ddorwin 2015/02/19 01:41:33 We need to not support this in unprefixed. We migh
sandersd (OOO until July 31) 2015/02/19 21:08:34 Isn't this what IsKnownKeySystem() does?
52 static_cast<SupportedCodecs>(response.non_compositing_codecs), 56 static_cast<SupportedCodecs>(response.non_compositing_codecs),
57 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license.
58 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message.
59 media::EME_FEATURE_NOT_SUPPORTED, // Persistent state.
60 media::EME_FEATURE_ALWAYS_AVAILABLE, // Distinctive identifier.
53 concrete_key_systems); 61 concrete_key_systems);
54 } 62 }
55 } 63 }
56 64
57 void AddAndroidPlatformKeySystems( 65 void AddAndroidPlatformKeySystems(
58 std::vector<KeySystemInfo>* concrete_key_systems) { 66 std::vector<KeySystemInfo>* concrete_key_systems) {
59 std::vector<std::string> key_system_names; 67 std::vector<std::string> key_system_names;
60 content::RenderThread::Get()->Send( 68 content::RenderThread::Get()->Send(
61 new ChromeViewHostMsg_GetPlatformKeySystemNames(&key_system_names)); 69 new ChromeViewHostMsg_GetPlatformKeySystemNames(&key_system_names));
62 70
63 for (std::vector<std::string>::const_iterator it = key_system_names.begin(); 71 for (std::vector<std::string>::const_iterator it = key_system_names.begin();
64 it != key_system_names.end(); ++it) { 72 it != key_system_names.end(); ++it) {
65 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); 73 SupportedKeySystemResponse response = QueryKeySystemSupport(*it);
66 if (response.compositing_codecs != media::EME_CODEC_NONE) { 74 if (response.compositing_codecs != media::EME_CODEC_NONE) {
67 KeySystemInfo info(*it); 75 KeySystemInfo info;
76 info.key_system = *it;
68 info.supported_codecs = response.compositing_codecs; 77 info.supported_codecs = response.compositing_codecs;
69 // Here we assume that support for a container implies support for the 78 // Here we assume that support for a container implies support for the
70 // associated initialization data type. KeySystems handles validating 79 // associated initialization data type. KeySystems handles validating
71 // |init_data_type| x |container| pairings. 80 // |init_data_type| x |container| pairings.
72 if (response.compositing_codecs & media::EME_CODEC_WEBM_ALL) 81 if (response.compositing_codecs & media::EME_CODEC_WEBM_ALL)
73 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_WEBM; 82 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_WEBM;
74 #if defined(USE_PROPRIETARY_CODECS) 83 #if defined(USE_PROPRIETARY_CODECS)
75 if (response.compositing_codecs & media::EME_CODEC_MP4_ALL) 84 if (response.compositing_codecs & media::EME_CODEC_MP4_ALL)
76 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC; 85 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC;
77 #endif // defined(USE_PROPRIETARY_CODECS) 86 #endif // defined(USE_PROPRIETARY_CODECS)
87 // Assume the worst.
88 info.persistent_license_support = media::EME_SESSION_TYPE_NOT_SUPPORTED;
89 info.persistent_release_message_support =
90 media::EME_SESSION_TYPE_NOT_SUPPORTED;
91 info.persistent_state_support = media::EME_FEATURE_ALWAYS_AVAILABLE;
ddorwin 2015/02/19 01:41:33 You might mention that this is the worst case for
sandersd (OOO until July 31) 2015/02/19 21:08:34 Done.
92 info.distinctive_identifier_support = media::EME_FEATURE_ALWAYS_AVAILABLE;
78 concrete_key_systems->push_back(info); 93 concrete_key_systems->push_back(info);
79 } 94 }
80 } 95 }
81 } 96 }
82 97
83 } // namespace cdm 98 } // namespace cdm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698