Support multiple codecs per crypto instance
The initial drm hidl hal implementation assumed one
codec per crypto instance, but in fact there can be
multiple codecs per crypto instance. This change
extends the drm hal to allow multiple memory heaps
per crypto plugin. It fixes the issue of mapping
memory frequently during playback.
bug:35275191
Test: manual verification with Play Movies on angler
and in binderized mode on marlin
Change-Id: I0ec36856248623d2ad8acb8ce9873e9274883a40
diff --git a/drm/1.0/ICryptoPlugin.hal b/drm/1.0/ICryptoPlugin.hal
index d66151e..ca8fa50 100644
--- a/drm/1.0/ICryptoPlugin.hal
+++ b/drm/1.0/ICryptoPlugin.hal
@@ -62,8 +62,16 @@
* After the shared buffer base is established, the decrypt() method
* receives SharedBuffer instances which specify the buffer address range
* for decrypt source and destination addresses.
+ *
+ * There can be multiple shared buffers per crypto plugin. The buffers
+ * are distinguished by the bufferId.
+ *
+ * @param base the base IMemory of the memory buffer identified by
+ * bufferId
+ * @param bufferId identifies the specific shared buffer for which
+ * the base is being set.
*/
- setSharedBufferBase(memory base);
+ setSharedBufferBase(memory base, uint32_t bufferId);
/**
* Decrypt an array of subsamples from the source memory buffer to the