WV DRM plugin stubs to report key request type for unprefixed EME

This CL allows the framework CLs to compile.  The stubs need to
be implemented properly in the DRM plugin and CDM.

bug: 19771299
Change-Id: I9e4b107370a4d73851ee28bcb9ab6087fdffeb13
This commit is contained in:
Jeff Tinker
2015-03-17 10:42:51 -07:00
parent 6d9e0302f2
commit a0e6f2804e
3 changed files with 14 additions and 5 deletions

View File

@@ -59,7 +59,8 @@ class WVDrmPlugin : public android::DrmPlugin,
KeyType keyType,
const KeyedVector<String8, String8>& optionalParameters,
Vector<uint8_t>& request,
String8& defaultUrl);
String8& defaultUrl,
KeyRequestType *keyRequestType);
virtual status_t provideKeyResponse(const Vector<uint8_t>& scope,
const Vector<uint8_t>& response,

View File

@@ -120,7 +120,8 @@ status_t WVDrmPlugin::getKeyRequest(
KeyType keyType,
const KeyedVector<String8, String8>& optionalParameters,
Vector<uint8_t>& request,
String8& defaultUrl) {
String8& defaultUrl,
KeyRequestType *keyRequestType) {
CdmLicenseType cdmLicenseType;
CdmSessionId cdmSessionId;
CdmKeySetId cdmKeySetId;
@@ -137,6 +138,11 @@ status_t WVDrmPlugin::getKeyRequest(
return android::ERROR_DRM_CANNOT_HANDLE;
}
// TODO: set *keyRequestType properly, this is
// just a stub implementation to allow the framework
// changes to build and run
*keyRequestType = kKeyRequestType_Initial;
string cdmInitDataType = initDataType.string();
// Provide backwards-compatibility for apps that pass non-EME-compatible MIME
// types.

View File

@@ -298,24 +298,26 @@ TEST_F(WVDrmPluginTest, GeneratesKeyRequests) {
Vector<uint8_t> request;
String8 defaultUrl;
DrmPlugin::KeyRequestType keyRequestType;
status_t res = plugin.getKeyRequest(sessionId, initData, mimeType,
DrmPlugin::kKeyType_Offline,
parameters, request, defaultUrl);
parameters, request, defaultUrl,
&keyRequestType);
ASSERT_EQ(OK, res);
EXPECT_THAT(request, ElementsAreArray(requestRaw, kRequestSize));
EXPECT_STREQ(kDefaultUrl, defaultUrl.string());
res = plugin.getKeyRequest(sessionId, initData, mimeType,
DrmPlugin::kKeyType_Streaming, parameters,
request, defaultUrl);
request, defaultUrl, &keyRequestType);
ASSERT_EQ(OK, res);
EXPECT_THAT(request, ElementsAreArray(requestRaw, kRequestSize));
EXPECT_STREQ(kDefaultUrl, defaultUrl.string());
res = plugin.getKeyRequest(keySetId, initData, mimeType,
DrmPlugin::kKeyType_Release, parameters,
request, defaultUrl);
request, defaultUrl, &keyRequestType);
ASSERT_EQ(OK, res);
EXPECT_THAT(request, ElementsAreArray(requestRaw, kRequestSize));
EXPECT_STREQ(kDefaultUrl, defaultUrl.string());