summaryrefslogtreecommitdiffstats
path: root/drm/libdrmframework
diff options
context:
space:
mode:
authorTakeshi Aimi <aimitakeshi@gmail.com>2010-11-16 13:56:11 +0900
committerTakeshi Aimi <aimitakeshi@gmail.com>2010-11-19 22:02:51 +0900
commit3473846f64f5b28e1cbeb70ef5867073fc93159e (patch)
tree9651de1dd360d8d77d9d4a53a23ed1181845b93c /drm/libdrmframework
parentcf6a8d23345a6e54834e53b1eb7e465f3cb5e914 (diff)
downloadframeworks_av-3473846f64f5b28e1cbeb70ef5867073fc93159e.zip
frameworks_av-3473846f64f5b28e1cbeb70ef5867073fc93159e.tar.gz
frameworks_av-3473846f64f5b28e1cbeb70ef5867073fc93159e.tar.bz2
Update of DRM Framework.
-Access permission handling Introduce an internal function which allows the desired process to access decryption flow. This new function is just for reference and each OEM manufacturer should implement/replace with their solutions. -New API, getMetadata() This API is for retrieving media metadata from container-based DRM, such as OMA forward-lock content. This API asks DRM agent to retrieve media metadata hiddein inside of DRM special container. -New API, acquireRights() This API wraps acquireDrmInfo() and processDrmInfo(). If DRM agent has valid implementation of both APIs, Application can acquire DrmRights only by calling this API. -Bug fix in event loop of OnInfoListener. Separate OnInfo event loop from mail thread loop so as to avoid the issue that message is not dispatched when mail thread is busy. Changes are made by SEMC and Sony. Change-Id: I04ee3e0988152a71e221f2256d83253749a29da0
Diffstat (limited to 'drm/libdrmframework')
-rw-r--r--drm/libdrmframework/DrmManagerClient.cpp4
-rw-r--r--drm/libdrmframework/DrmManagerClientImpl.cpp8
-rw-r--r--drm/libdrmframework/include/DrmManager.h3
-rw-r--r--drm/libdrmframework/include/DrmManagerClientImpl.h12
-rw-r--r--drm/libdrmframework/include/DrmManagerService.h2
-rw-r--r--drm/libdrmframework/include/IDrmManagerService.h6
-rw-r--r--drm/libdrmframework/plugins/common/include/DrmEngineBase.h14
-rw-r--r--drm/libdrmframework/plugins/common/include/IDrmEngine.h13
-rw-r--r--drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h2
-rw-r--r--drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp5
10 files changed, 69 insertions, 0 deletions
diff --git a/drm/libdrmframework/DrmManagerClient.cpp b/drm/libdrmframework/DrmManagerClient.cpp
index f0439eb..fa3d52a 100644
--- a/drm/libdrmframework/DrmManagerClient.cpp
+++ b/drm/libdrmframework/DrmManagerClient.cpp
@@ -43,6 +43,10 @@ DrmConstraints* DrmManagerClient::getConstraints(const String8* path, const int
return mDrmManagerClientImpl->getConstraints(mUniqueId, path, action);
}
+DrmMetadata* DrmManagerClient::getMetadata(const String8* path) {
+ return mDrmManagerClientImpl->getMetadata(mUniqueId, path);
+}
+
bool DrmManagerClient::canHandle(const String8& path, const String8& mimeType) {
return mDrmManagerClientImpl->canHandle(mUniqueId, path, mimeType);
}
diff --git a/drm/libdrmframework/DrmManagerClientImpl.cpp b/drm/libdrmframework/DrmManagerClientImpl.cpp
index b3ae9a7..32fa491 100644
--- a/drm/libdrmframework/DrmManagerClientImpl.cpp
+++ b/drm/libdrmframework/DrmManagerClientImpl.cpp
@@ -101,6 +101,14 @@ DrmConstraints* DrmManagerClientImpl::getConstraints(
return drmConstraints;
}
+DrmMetadata* DrmManagerClientImpl::getMetadata(int uniqueId, const String8* path) {
+ DrmMetadata *drmMetadata = NULL;
+ if ((NULL != path) && (EMPTY_STRING != *path)) {
+ drmMetadata = getDrmManagerService()->getMetadata(uniqueId, path);
+ }
+ return drmMetadata;
+}
+
bool DrmManagerClientImpl::canHandle(int uniqueId, const String8& path, const String8& mimeType) {
bool retCode = false;
if ((EMPTY_STRING != path) || (EMPTY_STRING != mimeType)) {
diff --git a/drm/libdrmframework/include/DrmManager.h b/drm/libdrmframework/include/DrmManager.h
index d782f5b..bc462c2 100644
--- a/drm/libdrmframework/include/DrmManager.h
+++ b/drm/libdrmframework/include/DrmManager.h
@@ -32,6 +32,7 @@ class DrmUnregistrationInfo;
class DrmRightsAcquisitionInfo;
class DrmContentIds;
class DrmConstraints;
+class DrmMetadata;
class DrmRights;
class DrmInfo;
class DrmInfoStatus;
@@ -74,6 +75,8 @@ public:
DrmConstraints* getConstraints(int uniqueId, const String8* path, const int action);
+ DrmMetadata* getMetadata(int uniqueId, const String8* path);
+
bool canHandle(int uniqueId, const String8& path, const String8& mimeType);
DrmInfoStatus* processDrmInfo(int uniqueId, const DrmInfo* drmInfo);
diff --git a/drm/libdrmframework/include/DrmManagerClientImpl.h b/drm/libdrmframework/include/DrmManagerClientImpl.h
index 1c6be46..ff84fc7 100644
--- a/drm/libdrmframework/include/DrmManagerClientImpl.h
+++ b/drm/libdrmframework/include/DrmManagerClientImpl.h
@@ -86,6 +86,18 @@ public:
DrmConstraints* getConstraints(int uniqueId, const String8* path, const int action);
/**
+ * Get metadata information associated with input content.
+ *
+ * @param[in] uniqueId Unique identifier for a session
+ * @param[in] path Path of the protected content
+ * @return DrmMetadata
+ * key-value pairs of metadata are embedded in it
+ * @note
+ * In case of error, return NULL
+ */
+ DrmMetadata* getMetadata(int uniqueId, const String8* path);
+
+ /**
* Check whether the given mimetype or path can be handled
*
* @param[in] uniqueId Unique identifier for a session
diff --git a/drm/libdrmframework/include/DrmManagerService.h b/drm/libdrmframework/include/DrmManagerService.h
index 4a3aeae..f346356 100644
--- a/drm/libdrmframework/include/DrmManagerService.h
+++ b/drm/libdrmframework/include/DrmManagerService.h
@@ -61,6 +61,8 @@ public:
DrmConstraints* getConstraints(int uniqueId, const String8* path, const int action);
+ DrmMetadata* getMetadata(int uniqueId, const String8* path);
+
bool canHandle(int uniqueId, const String8& path, const String8& mimeType);
DrmInfoStatus* processDrmInfo(int uniqueId, const DrmInfo* drmInfo);
diff --git a/drm/libdrmframework/include/IDrmManagerService.h b/drm/libdrmframework/include/IDrmManagerService.h
index 1275488..f1dabd3 100644
--- a/drm/libdrmframework/include/IDrmManagerService.h
+++ b/drm/libdrmframework/include/IDrmManagerService.h
@@ -27,6 +27,7 @@ namespace android {
class DrmContentIds;
class DrmConstraints;
+class DrmMetadata;
class DrmRights;
class DrmInfo;
class DrmInfoStatus;
@@ -51,6 +52,7 @@ public:
SET_DRM_SERVICE_LISTENER,
INSTALL_DRM_ENGINE,
GET_CONSTRAINTS_FROM_CONTENT,
+ GET_METADATA_FROM_CONTENT,
CAN_HANDLE,
PROCESS_DRM_INFO,
ACQUIRE_DRM_INFO,
@@ -96,6 +98,8 @@ public:
virtual DrmConstraints* getConstraints(
int uniqueId, const String8* path, const int action) = 0;
+ virtual DrmMetadata* getMetadata(int uniqueId, const String8* path) = 0;
+
virtual bool canHandle(int uniqueId, const String8& path, const String8& mimeType) = 0;
virtual DrmInfoStatus* processDrmInfo(int uniqueId, const DrmInfo* drmInfo) = 0;
@@ -179,6 +183,8 @@ public:
virtual DrmConstraints* getConstraints(int uniqueId, const String8* path, const int action);
+ virtual DrmMetadata* getMetadata(int uniqueId, const String8* path);
+
virtual bool canHandle(int uniqueId, const String8& path, const String8& mimeType);
virtual DrmInfoStatus* processDrmInfo(int uniqueId, const DrmInfo* drmInfo);
diff --git a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h b/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
index 5851af5..67b6355 100644
--- a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
+++ b/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
@@ -36,6 +36,8 @@ public:
public:
DrmConstraints* getConstraints(int uniqueId, const String8* path, int action);
+ DrmMetadata* getMetadata(int uniqueId, const String8* path);
+
status_t initialize(int uniqueId);
status_t setOnInfoListener(int uniqueId, const IDrmEngine::OnInfoListener* infoListener);
@@ -117,6 +119,18 @@ protected:
int uniqueId, const String8* path, int action) = 0;
/**
+ * Get metadata information associated with input content
+ *
+ * @param[in] uniqueId Unique identifier for a session
+ * @param[in] path Path of the protected content
+ * @return DrmMetadata
+ * key-value pairs of metadata
+ * @note
+ * In case of error, return NULL
+ */
+ virtual DrmMetadata* onGetMetadata(int uniqueId, const String8* path) = 0;
+
+ /**
* Initialize plug-in
*
* @param[in] uniqueId Unique identifier for a session
diff --git a/drm/libdrmframework/plugins/common/include/IDrmEngine.h b/drm/libdrmframework/plugins/common/include/IDrmEngine.h
index cc03ef2..f839070 100644
--- a/drm/libdrmframework/plugins/common/include/IDrmEngine.h
+++ b/drm/libdrmframework/plugins/common/include/IDrmEngine.h
@@ -23,6 +23,7 @@ namespace android {
class DrmContentIds;
class DrmConstraints;
+class DrmMetadata;
class DrmRights;
class DrmInfo;
class DrmInfoStatus;
@@ -105,6 +106,18 @@ public:
int uniqueId, const String8* path, int action) = 0;
/**
+ * Get metadata information associated with input content
+ *
+ * @param[in] uniqueId Unique identifier for a session
+ * @param[in] path Path of the protected content
+ * @return DrmMetadata
+ * key-value pairs of metadata
+ * @note
+ * In case of error, return NULL
+ */
+ virtual DrmMetadata* getMetadata(int uniqueId, const String8* path) = 0;
+
+ /**
* Get whether the given content can be handled by this plugin or not
*
* @param[in] uniqueId Unique identifier for a session
diff --git a/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h b/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
index ddb7fd3..bbcd9ed 100644
--- a/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
+++ b/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
@@ -30,6 +30,8 @@ public:
protected:
DrmConstraints* onGetConstraints(int uniqueId, const String8* path, int action);
+ DrmMetadata* onGetMetadata(int uniqueId, const String8* path);
+
status_t onInitialize(int uniqueId);
status_t onSetOnInfoListener(int uniqueId, const IDrmEngine::OnInfoListener* infoListener);
diff --git a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
index 41f8e91..dee1fdb 100644
--- a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
+++ b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
@@ -20,6 +20,7 @@
#include <drm/DrmRights.h>
#include <drm/DrmConstraints.h>
+#include <drm/DrmMetadata.h>
#include <drm/DrmInfo.h>
#include <drm/DrmInfoEvent.h>
#include <drm/DrmInfoStatus.h>
@@ -51,6 +52,10 @@ DrmPassthruPlugIn::~DrmPassthruPlugIn() {
}
+DrmMetadata* DrmPassthruPlugIn::onGetMetadata(int uniqueId, const String8* path) {
+ return NULL;
+}
+
DrmConstraints* DrmPassthruPlugIn::onGetConstraints(
int uniqueId, const String8* path, int action) {
LOGD("DrmPassthruPlugIn::onGetConstraints From Path: %d", uniqueId);