summaryrefslogtreecommitdiffstats
path: root/drm/libdrmframework/include
diff options
context:
space:
mode:
authorTakeshi Aimi <aimitakeshi@gmail.com>2010-10-08 23:05:49 +0900
committerTakeshi Aimi <aimitakeshi@gmail.com>2010-11-02 08:06:06 +0900
commite943f84129326ab885cc7a69dcfa17f766b72b89 (patch)
tree45602605772fcd85d240cbfd900b82e0067453e9 /drm/libdrmframework/include
parentdcd25efb46c41c8d24a0a9cf61fb57f84149709e (diff)
downloadframeworks_av-e943f84129326ab885cc7a69dcfa17f766b72b89.zip
frameworks_av-e943f84129326ab885cc7a69dcfa17f766b72b89.tar.gz
frameworks_av-e943f84129326ab885cc7a69dcfa17f766b72b89.tar.bz2
Update of DRM framework
- Overload openDecryptSession() with uri parameter in order to accept URI of DRM content, Following API is added, DecryptHandle*openDecryptSession(const char* uri);. - Unify texisting three event types of processDrmInfo() so that caller of DRM framework does not have to handle many event types. - Let DrmManagerService call load/unload plugins API so that client of DRM framework does not have to manage plug-in load/unload. - Trivial fix in DrmManagerClient.java is also incorporated. Changes are made by Sony Corporation. Change-Id: If62b47fa0360718fdc943e6e6143671d7db26adc
Diffstat (limited to 'drm/libdrmframework/include')
-rw-r--r--drm/libdrmframework/include/DrmManager.h18
-rw-r--r--drm/libdrmframework/include/DrmManagerClientImpl.h40
-rw-r--r--drm/libdrmframework/include/DrmManagerService.h8
-rw-r--r--drm/libdrmframework/include/IDrmManagerService.h22
4 files changed, 41 insertions, 47 deletions
diff --git a/drm/libdrmframework/include/DrmManager.h b/drm/libdrmframework/include/DrmManager.h
index dc3e460..d782f5b 100644
--- a/drm/libdrmframework/include/DrmManager.h
+++ b/drm/libdrmframework/include/DrmManager.h
@@ -57,15 +57,19 @@ public:
void removeUniqueId(int uniqueId);
- status_t loadPlugIns(int uniqueId);
+ void addClient(int uniqueId);
- status_t loadPlugIns(int uniqueId, const String8& plugInDirPath);
+ void removeClient(int uniqueId);
+
+ status_t loadPlugIns();
+
+ status_t loadPlugIns(const String8& plugInDirPath);
+
+ status_t unloadPlugIns();
status_t setDrmServiceListener(
int uniqueId, const sp<IDrmServiceListener>& drmServiceListener);
- status_t unloadPlugIns(int uniqueId);
-
status_t installDrmEngine(int uniqueId, const String8& drmEngineFile);
DrmConstraints* getConstraints(int uniqueId, const String8* path, const int action);
@@ -107,6 +111,8 @@ public:
DecryptHandle* openDecryptSession(int uniqueId, int fd, int offset, int length);
+ DecryptHandle* openDecryptSession(int uniqueId, const char* uri);
+
status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
status_t initializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
@@ -129,12 +135,8 @@ private:
String8 getSupportedPlugInIdFromPath(int uniqueId, const String8& path);
- void populate(int uniqueId);
-
bool canHandle(int uniqueId, const String8& path);
- void initializePlugIns(int uniqueId);
-
private:
static Vector<int> mUniqueIdVector;
static const String8 EMPTY_STRING;
diff --git a/drm/libdrmframework/include/DrmManagerClientImpl.h b/drm/libdrmframework/include/DrmManagerClientImpl.h
index 492c7f5..1c6be46 100644
--- a/drm/libdrmframework/include/DrmManagerClientImpl.h
+++ b/drm/libdrmframework/include/DrmManagerClientImpl.h
@@ -35,36 +35,29 @@ class DrmInfoEvent;
*/
class DrmManagerClientImpl : public BnDrmServiceListener {
private:
- DrmManagerClientImpl();
+ DrmManagerClientImpl() { }
public:
static DrmManagerClientImpl* create(int* pUniqueId);
static void remove(int uniqueId);
- virtual ~DrmManagerClientImpl();
+ virtual ~DrmManagerClientImpl() { }
public:
/**
- * Initialize DRM Manager
- * load available plug-ins from default plugInDirPath
+ * Adds the client respective to given unique id.
*
* @param[in] uniqueId Unique identifier for a session
- * @return status_t
- * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- status_t loadPlugIns(int uniqueId);
+ void addClient(int uniqueId);
/**
- * Finalize DRM Manager
- * release resources associated with each plug-in
- * unload all plug-ins and etc.
+ * Removes the client respective to given unique id.
*
* @param[in] uniqueId Unique identifier for a session
- * @return status_t
- * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- status_t unloadPlugIns(int uniqueId);
+ void removeClient(int uniqueId);
/**
* Register a callback to be invoked when the caller required to
@@ -301,6 +294,16 @@ public:
DecryptHandle* openDecryptSession(int uniqueId, int fd, int offset, int length);
/**
+ * Open the decrypt session to decrypt the given protected content
+ *
+ * @param[in] uniqueId Unique identifier for a session
+ * @param[in] uri Path of the protected content to be decrypted
+ * @return
+ * Handle for the decryption session
+ */
+ DecryptHandle* openDecryptSession(int uniqueId, const char* uri);
+
+ /**
* Close the decrypt session for the given handle
*
* @param[in] uniqueId Unique identifier for a session
@@ -379,17 +382,6 @@ public:
private:
/**
- * Initialize DRM Manager
- * load available plug-ins from plugInDirPath
- *
- * @param[in] uniqueId Unique identifier for a session
- * @param[in] plugInDirPath Directory from where to load plug-ins
- * @return status_t
- * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
- */
- status_t loadPlugIns(int uniqueId, const String8& plugInDirPath);
-
- /**
* Install new DRM Engine Plug-in at the runtime
*
* @param[in] uniqueId Unique identifier for a session
diff --git a/drm/libdrmframework/include/DrmManagerService.h b/drm/libdrmframework/include/DrmManagerService.h
index f455e15..4a3aeae 100644
--- a/drm/libdrmframework/include/DrmManagerService.h
+++ b/drm/libdrmframework/include/DrmManagerService.h
@@ -50,15 +50,13 @@ public:
void removeUniqueId(int uniqueId);
- status_t loadPlugIns(int uniqueId);
+ void addClient(int uniqueId);
- status_t loadPlugIns(int uniqueId, const String8& plugInDirPath);
+ void removeClient(int uniqueId);
status_t setDrmServiceListener(
int uniqueId, const sp<IDrmServiceListener>& drmServiceListener);
- status_t unloadPlugIns(int uniqueId);
-
status_t installDrmEngine(int uniqueId, const String8& drmEngineFile);
DrmConstraints* getConstraints(int uniqueId, const String8* path, const int action);
@@ -100,6 +98,8 @@ public:
DecryptHandle* openDecryptSession(int uniqueId, int fd, int offset, int length);
+ DecryptHandle* openDecryptSession(int uniqueId, const char* uri);
+
status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
status_t initializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
diff --git a/drm/libdrmframework/include/IDrmManagerService.h b/drm/libdrmframework/include/IDrmManagerService.h
index 5c668ed..1275488 100644
--- a/drm/libdrmframework/include/IDrmManagerService.h
+++ b/drm/libdrmframework/include/IDrmManagerService.h
@@ -46,10 +46,9 @@ public:
enum {
ADD_UNIQUEID = IBinder::FIRST_CALL_TRANSACTION,
REMOVE_UNIQUEID,
- LOAD_PLUGINS,
- LOAD_PLUGINS_FROM_PATH,
+ ADD_CLIENT,
+ REMOVE_CLIENT,
SET_DRM_SERVICE_LISTENER,
- UNLOAD_PLUGINS,
INSTALL_DRM_ENGINE,
GET_CONSTRAINTS_FROM_CONTENT,
CAN_HANDLE,
@@ -69,6 +68,7 @@ public:
CLOSE_CONVERT_SESSION,
GET_ALL_SUPPORT_INFO,
OPEN_DECRYPT_SESSION,
+ OPEN_DECRYPT_SESSION_FROM_URI,
CLOSE_DECRYPT_SESSION,
INITIALIZE_DECRYPT_UNIT,
DECRYPT,
@@ -84,15 +84,13 @@ public:
virtual void removeUniqueId(int uniqueId) = 0;
- virtual status_t loadPlugIns(int uniqueId) = 0;
+ virtual void addClient(int uniqueId) = 0;
- virtual status_t loadPlugIns(int uniqueId, const String8& plugInDirPath) = 0;
+ virtual void removeClient(int uniqueId) = 0;
virtual status_t setDrmServiceListener(
int uniqueId, const sp<IDrmServiceListener>& infoListener) = 0;
- virtual status_t unloadPlugIns(int uniqueId) = 0;
-
virtual status_t installDrmEngine(int uniqueId, const String8& drmEngineFile) = 0;
virtual DrmConstraints* getConstraints(
@@ -140,6 +138,8 @@ public:
virtual DecryptHandle* openDecryptSession(int uniqueId, int fd, int offset, int length) = 0;
+ virtual DecryptHandle* openDecryptSession(int uniqueId, const char* uri) = 0;
+
virtual status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) = 0;
virtual status_t initializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
@@ -168,15 +168,13 @@ public:
virtual void removeUniqueId(int uniqueId);
- virtual status_t loadPlugIns(int uniqueId);
+ virtual void addClient(int uniqueId);
- virtual status_t loadPlugIns(int uniqueId, const String8& plugInDirPath);
+ virtual void removeClient(int uniqueId);
virtual status_t setDrmServiceListener(
int uniqueId, const sp<IDrmServiceListener>& infoListener);
- virtual status_t unloadPlugIns(int uniqueId);
-
virtual status_t installDrmEngine(int uniqueId, const String8& drmEngineFile);
virtual DrmConstraints* getConstraints(int uniqueId, const String8* path, const int action);
@@ -221,6 +219,8 @@ public:
virtual DecryptHandle* openDecryptSession(int uniqueId, int fd, int offset, int length);
+ virtual DecryptHandle* openDecryptSession(int uniqueId, const char* uri);
+
virtual status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
virtual status_t initializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,