From 1849570240443d1f75775c205fa658f7070849c6 Mon Sep 17 00:00:00 2001 From: Jeff Tinker Date: Fri, 10 Apr 2015 04:10:59 -0700 Subject: 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: Ieb32d04d61742fc1dee2105dd904690d44c46c7b --- include/media/ICrypto.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/media/ICrypto.h b/include/media/ICrypto.h index ac2b3ba..aa04dbe 100644 --- a/include/media/ICrypto.h +++ b/include/media/ICrypto.h @@ -44,6 +44,8 @@ struct ICrypto : public IInterface { virtual void notifyResolution(uint32_t width, uint32_t height) = 0; + virtual status_t setMediaDrmSession(const Vector &sessionId) = 0; + virtual ssize_t decrypt( bool secure, const uint8_t key[16], @@ -62,6 +64,9 @@ struct BnCrypto : public BnInterface { virtual status_t onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags = 0); +private: + void readVector(const Parcel &data, Vector &vector) const; + void writeVector(Parcel *reply, Vector const &vector) const; }; } // namespace android -- cgit v1.1