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

Side by Side Diff: chrome/renderer/media/chrome_key_systems.cc

Issue 79903002: Add decrypt-only external clear key browser tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/renderer/media/chrome_key_systems.h" 5 #include "chrome/renderer/media/chrome_key_systems.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 additional_param_values)); 57 additional_param_values));
58 58
59 return is_registered; 59 return is_registered;
60 } 60 }
61 61
62 // External Clear Key (used for testing). 62 // External Clear Key (used for testing).
63 static void AddExternalClearKey( 63 static void AddExternalClearKey(
64 std::vector<KeySystemInfo>* concrete_key_systems) { 64 std::vector<KeySystemInfo>* concrete_key_systems) {
65 static const char kExternalClearKeyKeySystem[] = 65 static const char kExternalClearKeyKeySystem[] =
66 "org.chromium.externalclearkey"; 66 "org.chromium.externalclearkey";
67 static const char kDecryptOnlyExternalClearKeyKeySystem[] =
68 "org.chromium.externalclearkey.decryptonly";
67 static const char kExternalClearKeyPepperType[] = 69 static const char kExternalClearKeyPepperType[] =
68 "application/x-ppapi-clearkey-cdm"; 70 "application/x-ppapi-clearkey-cdm";
69 71
70 std::vector<base::string16> additional_param_names; 72 std::vector<base::string16> additional_param_names;
71 std::vector<base::string16> additional_param_values; 73 std::vector<base::string16> additional_param_values;
72 if (!IsPepperCdmRegistered(kExternalClearKeyPepperType, 74 if (!IsPepperCdmRegistered(kExternalClearKeyPepperType,
73 &additional_param_names, 75 &additional_param_names,
74 &additional_param_values)) { 76 &additional_param_values)) {
75 return; 77 return;
76 } 78 }
77 79
78 KeySystemInfo info(kExternalClearKeyKeySystem); 80 KeySystemInfo info(kExternalClearKeyKeySystem);
79 81
80 info.supported_types.push_back(std::make_pair(kAudioWebM, kVorbis)); 82 info.supported_types.push_back(std::make_pair(kAudioWebM, kVorbis));
81 info.supported_types.push_back(std::make_pair(kVideoWebM, kVorbisVP8)); 83 info.supported_types.push_back(std::make_pair(kVideoWebM, kVorbisVP8));
82 #if defined(USE_PROPRIETARY_CODECS) 84 #if defined(USE_PROPRIETARY_CODECS)
83 info.supported_types.push_back(std::make_pair(kAudioMp4, kMp4a)); 85 info.supported_types.push_back(std::make_pair(kAudioMp4, kMp4a));
84 info.supported_types.push_back(std::make_pair(kVideoMp4, kMp4aAvc1Avc3)); 86 info.supported_types.push_back(std::make_pair(kVideoMp4, kMp4aAvc1Avc3));
85 #endif // defined(USE_PROPRIETARY_CODECS) 87 #endif // defined(USE_PROPRIETARY_CODECS)
86 info.pepper_type = kExternalClearKeyPepperType; 88 info.pepper_type = kExternalClearKeyPepperType;
87 89
88 concrete_key_systems->push_back(info); 90 concrete_key_systems->push_back(info);
89 91
90 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually 92 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually
91 // will be refused by ClearKeyCdm. This is to test the CDM initialization 93 // will be refused by ClearKeyCdm. This is to test the CDM initialization
92 // failure case. 94 // failure case.
93 info.key_system += ".initializefail"; 95 info.key_system += ".initializefail";
94 concrete_key_systems->push_back(info); 96 concrete_key_systems->push_back(info);
97
98 // Add support of decrypt-only mode in ClearKeyCdm.
99 info.key_system = kDecryptOnlyExternalClearKeyKeySystem;
ddorwin 2013/11/21 04:10:58 This and 95 should be consistent.
xhwang 2013/11/22 01:47:36 Done.
100 concrete_key_systems->push_back(info);
95 } 101 }
96 #endif // defined(ENABLE_PEPPER_CDMS) 102 #endif // defined(ENABLE_PEPPER_CDMS)
97 103
98 104
99 #if defined(WIDEVINE_CDM_AVAILABLE) 105 #if defined(WIDEVINE_CDM_AVAILABLE)
100 enum WidevineCdmType { 106 enum WidevineCdmType {
101 WIDEVINE, 107 WIDEVINE,
102 WIDEVINE_HR, 108 WIDEVINE_HR,
103 #if defined(OS_ANDROID) 109 #if defined(OS_ANDROID)
104 WIDEVINE_HR_NON_COMPOSITING, 110 WIDEVINE_HR_NON_COMPOSITING,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 #endif 311 #endif
306 312
307 #if defined(WIDEVINE_CDM_AVAILABLE) 313 #if defined(WIDEVINE_CDM_AVAILABLE)
308 #if defined(ENABLE_PEPPER_CDMS) 314 #if defined(ENABLE_PEPPER_CDMS)
309 AddPepperBasedWidevine(key_systems_info); 315 AddPepperBasedWidevine(key_systems_info);
310 #elif defined(OS_ANDROID) 316 #elif defined(OS_ANDROID)
311 AddAndroidWidevine(key_systems_info); 317 AddAndroidWidevine(key_systems_info);
312 #endif 318 #endif
313 #endif 319 #endif
314 } 320 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698