summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorTakeshi Aimi <aimitakeshi@gmail.com>2010-09-20 23:40:41 +0900
committerTakeshi Aimi <aimitakeshi@gmail.com>2010-10-04 22:14:53 +0900
commit2272ee27d9022d173b6eab45c409b3c3f57f30ec (patch)
tree42fd86597781bdf6b3795907ec1d086b0b549a5c /include/drm
parent0335b70c6cdbe96650d4bed817f9233cd8db1c6d (diff)
downloadframeworks_av-2272ee27d9022d173b6eab45c409b3c3f57f30ec.zip
frameworks_av-2272ee27d9022d173b6eab45c409b3c3f57f30ec.tar.gz
frameworks_av-2272ee27d9022d173b6eab45c409b3c3f57f30ec.tar.bz2
Update of DRM framework.
- Change "void" type of return value to "int" for returning status. - Add some of overloaded Java APIs which accept database Uri as input. - Add asynchronous APIs - Add OnEventListener and OnErrorListener for asynchronous APIs - Disable debug log - Change decrypt() API to accept an optional buffer needed by some of DRM schemes Changes are incorporated by Sony Corporation. Change-Id: I414a165e22cc79be6ea7cd28041788aa2b6b8f7c
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/DrmInfoEvent.h34
-rw-r--r--include/drm/DrmManagerClient.h38
-rw-r--r--include/drm/DrmRights.h3
-rw-r--r--include/drm/drm_framework_common.h4
4 files changed, 55 insertions, 24 deletions
diff --git a/include/drm/DrmInfoEvent.h b/include/drm/DrmInfoEvent.h
index 5e8817c..c722bd3 100644
--- a/include/drm/DrmInfoEvent.h
+++ b/include/drm/DrmInfoEvent.h
@@ -27,28 +27,40 @@ class String8;
*/
class DrmInfoEvent {
public:
+ /**
+ * The following constant values should be in sync with DrmInfoEvent.java
+ */
//! TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT, when registration has been
//! already done by another account ID.
- static const int TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT = 0x0000001;
+ static const int TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT = 1;
//! TYPE_REMOVE_RIGHTS, when the rights needs to be removed completely.
- static const int TYPE_REMOVE_RIGHTS = 0x0000002;
+ static const int TYPE_REMOVE_RIGHTS = 2;
//! TYPE_RIGHTS_INSTALLED, when the rights are downloaded and installed ok.
- static const int TYPE_RIGHTS_INSTALLED = 0x0000003;
+ static const int TYPE_RIGHTS_INSTALLED = 3;
+ //! TYPE_WAIT_FOR_RIGHTS, rights object is on it's way to phone,
+ //! wait before calling checkRights again
+ static const int TYPE_WAIT_FOR_RIGHTS = 4;
+ //! TYPE_ACCOUNT_ALREADY_REGISTERED, when registration has been
+ //! already done for the given account.
+ static const int TYPE_ACCOUNT_ALREADY_REGISTERED = 5;
+
+ /**
+ * The following constant values should be in sync with DrmErrorEvent.java
+ */
//! TYPE_RIGHTS_NOT_INSTALLED, when something went wrong installing the rights
- static const int TYPE_RIGHTS_NOT_INSTALLED = 0x0000004;
+ static const int TYPE_RIGHTS_NOT_INSTALLED = 2001;
//! TYPE_RIGHTS_RENEWAL_NOT_ALLOWED, when the server rejects renewal of rights
- static const int TYPE_RIGHTS_RENEWAL_NOT_ALLOWED = 0x0000005;
+ static const int TYPE_RIGHTS_RENEWAL_NOT_ALLOWED = 2002;
//! TYPE_NOT_SUPPORTED, when answer from server can not be handled by the native agent
- static const int TYPE_NOT_SUPPORTED = 0x0000006;
- //! TYPE_WAIT_FOR_RIGHTS, rights object is on it's way to phone,
- //! wait before calling checkRights again
- static const int TYPE_WAIT_FOR_RIGHTS = 0x0000007;
+ static const int TYPE_NOT_SUPPORTED = 2003;
//! TYPE_OUT_OF_MEMORY, when memory allocation fail during renewal.
//! Can in the future perhaps be used to trigger garbage collector
- static const int TYPE_OUT_OF_MEMORY = 0x0000008;
+ static const int TYPE_OUT_OF_MEMORY = 2004;
//! TYPE_NO_INTERNET_CONNECTION, when the Internet connection is missing and no attempt
//! can be made to renew rights
- static const int TYPE_NO_INTERNET_CONNECTION = 0x0000009;
+ static const int TYPE_NO_INTERNET_CONNECTION = 2005;
+ //! TYPE_REGISTRATION_FAILED, when registration with server failed.
+ static const int TYPE_REGISTRATION_FAILED = 2006;
public:
/**
diff --git a/include/drm/DrmManagerClient.h b/include/drm/DrmManagerClient.h
index 7d14c44..c2ad084 100644
--- a/include/drm/DrmManagerClient.h
+++ b/include/drm/DrmManagerClient.h
@@ -70,8 +70,10 @@ public:
* Close the decrypt session for the given handle
*
* @param[in] decryptHandle Handle for the decryption session
+ * @return status_t
+ * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- void closeDecryptSession(DecryptHandle* decryptHandle);
+ status_t closeDecryptSession(DecryptHandle* decryptHandle);
/**
* Consumes the rights for a content.
@@ -81,8 +83,11 @@ public:
* @param[in] decryptHandle Handle for the decryption session
* @param[in] action Action to perform. (Action::DEFAULT, Action::PLAY, etc)
* @param[in] reserve True if the rights should be reserved.
+ * @return status_t
+ * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure.
+ * In case license has been expired, DRM_ERROR_LICENSE_EXPIRED will be returned.
*/
- void consumeRights(DecryptHandle* decryptHandle, int action, bool reserve);
+ status_t consumeRights(DecryptHandle* decryptHandle, int action, bool reserve);
/**
* Informs the DRM engine about the playback actions performed on the DRM files.
@@ -90,9 +95,11 @@ public:
* @param[in] decryptHandle Handle for the decryption session
* @param[in] playbackStatus Playback action (Playback::START, Playback::STOP, Playback::PAUSE)
* @param[in] position Position in the file (in milliseconds) where the start occurs.
- * Only valid together with Playback::START.
+ * Only valid together with Playback::START.
+ * @return status_t
+ * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- void setPlaybackStatus(DecryptHandle* decryptHandle, int playbackStatus, int position);
+ status_t setPlaybackStatus(DecryptHandle* decryptHandle, int playbackStatus, int position);
/**
* Initialize decryption for the given unit of the protected content
@@ -100,8 +107,10 @@ public:
* @param[in] decryptHandle Handle for the decryption session
* @param[in] decryptUnitId ID which specifies decryption unit, such as track ID
* @param[in] headerInfo Information for initializing decryption of this decrypUnit
+ * @return status_t
+ * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- void initializeDecryptUnit(
+ status_t initializeDecryptUnit(
DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* headerInfo);
/**
@@ -113,6 +122,7 @@ public:
* @param[in] decryptUnitId ID which specifies decryption unit, such as track ID
* @param[in] encBuffer Encrypted data block
* @param[out] decBuffer Decrypted data block
+ * @param[in] IV Optional buffer
* @return status_t
* Returns the error code for this API
* DRM_NO_ERROR for success, and one of DRM_ERROR_UNKNOWN, DRM_ERROR_LICENSE_EXPIRED
@@ -121,15 +131,17 @@ public:
*/
status_t decrypt(
DecryptHandle* decryptHandle, int decryptUnitId,
- const DrmBuffer* encBuffer, DrmBuffer** decBuffer);
+ const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV = NULL);
/**
* Finalize decryption for the given unit of the protected content
*
* @param[in] decryptHandle Handle for the decryption session
* @param[in] decryptUnitId ID which specifies decryption unit, such as track ID
+ * @return status_t
+ * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- void finalizeDecryptUnit(DecryptHandle* decryptHandle, int decryptUnitId);
+ status_t finalizeDecryptUnit(DecryptHandle* decryptHandle, int decryptUnitId);
/**
* Reads the specified number of bytes from an open DRM file.
@@ -217,8 +229,10 @@ public:
* @param[in] drmRights DrmRights to be saved
* @param[in] rightsPath File path where rights to be saved
* @param[in] contentPath File path where content was saved
+ * @return status_t
+ * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- void saveRights(
+ status_t saveRights(
const DrmRights& drmRights, const String8& rightsPath, const String8& contentPath);
/**
@@ -256,15 +270,19 @@ public:
* Removes the rights associated with the given protected content
*
* @param[in] path Path of the protected content
+ * @return status_t
+ * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- void removeRights(const String8& path);
+ status_t removeRights(const String8& path);
/**
* Removes all the rights information of each plug-in associated with
* DRM framework. Will be used in master reset
*
+ * @return status_t
+ * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
*/
- void removeAllRights();
+ status_t removeAllRights();
/**
* This API is for Forward Lock DRM.
diff --git a/include/drm/DrmRights.h b/include/drm/DrmRights.h
index e04a066..11f8f78 100644
--- a/include/drm/DrmRights.h
+++ b/include/drm/DrmRights.h
@@ -61,7 +61,7 @@ public:
/**
* Destructor for DrmRights
*/
- virtual ~DrmRights() {}
+ virtual ~DrmRights();
public:
/**
@@ -97,6 +97,7 @@ private:
String8 mMimeType;
String8 mAccountId;
String8 mSubscriptionId;
+ char* mRightsFromFile;
};
};
diff --git a/include/drm/drm_framework_common.h b/include/drm/drm_framework_common.h
index 8b8a9f5..c5765a9 100644
--- a/include/drm/drm_framework_common.h
+++ b/include/drm/drm_framework_common.h
@@ -254,13 +254,13 @@ public:
* (file format is not encrypted but ES is encrypted)
* e.g., Marlin DRM (MP4 file format), WM-DRM (asf file format)
*
- * DecryptAPI::TYPE_ELEMENTARY_STREAM_BASED
+ * DecryptApiType::ELEMENTARY_STREAM_BASED
* Decryption API set for ES based DRM
* initializeDecryptUnit(), decrypt(), and finalizeDecryptUnit()
* 2. Decrypt APIs for container based DRM (file format itself is encrypted)
* e.g., OMA DRM (dcf file format)
*
- * DecryptAPI::TYPE_CONTAINER_BASED
+ * DecryptApiType::CONTAINER_BASED
* POSIX based Decryption API set for container based DRM
* pread()
*/