summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2015-04-10 04:10:10 -0700
committerJeff Tinker <jtinker@google.com>2015-04-10 04:10:10 -0700
commitac7d8fe36f6bb825b0a4031ee521caf95df39f2a (patch)
treecdaa7b75ed925d83315b8a17a0baf1d38032e3f3 /include/media
parent9a498ef11566a5ae82c24b0651c58280309dfd04 (diff)
downloadframeworks_native-ac7d8fe36f6bb825b0a4031ee521caf95df39f2a.zip
frameworks_native-ac7d8fe36f6bb825b0a4031ee521caf95df39f2a.tar.gz
frameworks_native-ac7d8fe36f6bb825b0a4031ee521caf95df39f2a.tar.bz2
Add a method to associate MediaDrm session with MediaCrypto
Previously, to associate a MediaDrm session with MediaCrypto, the MediaDrm sessionId was passed as initData to the MediaCrypto constructor. This is not ideal for two reasons: it's pretty obscure and you can't change the association without tearing down the MediaCodec/MediaCrypto and starting all over. Use cases like key rotation require being able to update the MediaDrm session post-construction. This CL addresses both of these issues. bug: 19570317 Change-Id: Iede35e73e9007df13254edaa5877cb4832b28646
Diffstat (limited to 'include/media')
-rw-r--r--include/media/hardware/CryptoAPI.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/media/hardware/CryptoAPI.h b/include/media/hardware/CryptoAPI.h
index ab8e2e2..3e3257f 100644
--- a/include/media/hardware/CryptoAPI.h
+++ b/include/media/hardware/CryptoAPI.h
@@ -14,7 +14,9 @@
* limitations under the License.
*/
+#include <media/stagefright/MediaErrors.h>
#include <utils/Errors.h>
+#include <utils/Vector.h>
#ifndef CRYPTO_API_H_
@@ -71,6 +73,16 @@ struct CryptoPlugin {
virtual void notifyResolution(uint32_t /* width */, uint32_t /* height */) {}
+ // A MediaDrm session may be associated with a MediaCrypto session. The
+ // associated MediaDrm session is used to load decryption keys
+ // into the crypto/drm plugin. The keys are then referenced by key-id
+ // in the 'key' parameter to the decrypt() method.
+ // Should return NO_ERROR on success, ERROR_DRM_SESSION_NOT_OPENED if
+ // the session is not opened and a code from MediaErrors.h otherwise.
+ virtual status_t setMediaDrmSession(const Vector<uint8_t> & /*sessionId */) {
+ return ERROR_UNSUPPORTED;
+ }
+
// If the error returned falls into the range
// ERROR_DRM_VENDOR_MIN..ERROR_DRM_VENDOR_MAX, errorDetailMsg should be
// filled in with an appropriate string.