summaryrefslogtreecommitdiffstats
path: root/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drm')
-rw-r--r--drm/mediadrm/plugins/clearkey/DrmPlugin.cpp5
-rw-r--r--drm/mediadrm/plugins/clearkey/DrmPlugin.h3
-rw-r--r--drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp14
-rw-r--r--drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h3
4 files changed, 20 insertions, 5 deletions
diff --git a/drm/mediadrm/plugins/clearkey/DrmPlugin.cpp b/drm/mediadrm/plugins/clearkey/DrmPlugin.cpp
index 96fca94..6b8c772 100644
--- a/drm/mediadrm/plugins/clearkey/DrmPlugin.cpp
+++ b/drm/mediadrm/plugins/clearkey/DrmPlugin.cpp
@@ -48,12 +48,13 @@ status_t DrmPlugin::getKeyRequest(
KeyType keyType,
const KeyedVector<String8, String8>& optionalParameters,
Vector<uint8_t>& request,
- String8& defaultUrl) {
+ String8& defaultUrl,
+ DrmPlugin::KeyRequestType *keyRequestType) {
UNUSED(optionalParameters);
if (keyType != kKeyType_Streaming) {
return android::ERROR_DRM_CANNOT_HANDLE;
}
-
+ *keyRequestType = DrmPlugin::kKeyRequestType_Initial;
sp<Session> session = mSessionLibrary->findSession(scope);
defaultUrl.clear();
return session->getKeyRequest(initData, initDataType, &request);
diff --git a/drm/mediadrm/plugins/clearkey/DrmPlugin.h b/drm/mediadrm/plugins/clearkey/DrmPlugin.h
index 6139f1f..ba4aefe 100644
--- a/drm/mediadrm/plugins/clearkey/DrmPlugin.h
+++ b/drm/mediadrm/plugins/clearkey/DrmPlugin.h
@@ -54,7 +54,8 @@ public:
KeyType keyType,
const KeyedVector<String8, String8>& optionalParameters,
Vector<uint8_t>& request,
- String8& defaultUrl);
+ String8& defaultUrl,
+ DrmPlugin::KeyRequestType *keyRequestType);
virtual status_t provideKeyResponse(
const Vector<uint8_t>& scope,
diff --git a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp
index 7eac0a1..9b786c5 100644
--- a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp
+++ b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp
@@ -111,7 +111,8 @@ namespace android {
Vector<uint8_t> const &initData,
String8 const &mimeType, KeyType keyType,
KeyedVector<String8, String8> const &optionalParameters,
- Vector<uint8_t> &request, String8 &defaultUrl)
+ Vector<uint8_t> &request, String8 &defaultUrl,
+ KeyRequestType *keyRequestType)
{
Mutex::Autolock lock(mLock);
ALOGD("MockDrmPlugin::getKeyRequest(sessionId=%s, initData=%s, mimeType=%s"
@@ -149,6 +150,7 @@ namespace android {
// Properties used in mock test, set by cts test app returned from mock plugin
// byte[] mock-request -> request
// string mock-default-url -> defaultUrl
+ // string mock-key-request-type -> keyRequestType
index = mByteArrayProperties.indexOfKey(String8("mock-request"));
if (index < 0) {
@@ -165,6 +167,16 @@ namespace android {
} else {
defaultUrl = mStringProperties.valueAt(index);
}
+
+ index = mStringProperties.indexOfKey(String8("mock-keyRequestType"));
+ if (index < 0) {
+ ALOGD("Missing 'mock-keyRequestType' parameter for mock");
+ return BAD_VALUE;
+ } else {
+ *keyRequestType = static_cast<KeyRequestType>(
+ atoi(mStringProperties.valueAt(index).string()));
+ }
+
return OK;
}
diff --git a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h
index d1d8058..d0f2ddb 100644
--- a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h
+++ b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h
@@ -62,7 +62,8 @@ namespace android {
Vector<uint8_t> const &initData,
String8 const &mimeType, KeyType keyType,
KeyedVector<String8, String8> const &optionalParameters,
- Vector<uint8_t> &request, String8 &defaultUrl);
+ Vector<uint8_t> &request, String8 &defaultUrl,
+ KeyRequestType *keyRequestType);
status_t provideKeyResponse(Vector<uint8_t> const &sessionId,
Vector<uint8_t> const &response,