CCodecBufferChannel: Add the allocated block to ref-tracker in EncryptedLinearInputBuffers

When a EncryptedLinearBlockBuffer is allocated, update the
weak-reference to that block in the corresponding slot so
it does not get overwritten by subsequent allocations.

Fixes corruption issue with secure video playback (esp. for apps
that do not call MediaCodec.getInputBuffer() for every input available;
but rely on {index, ByteBuffer} association from an initial call to
MediaCodec.getInputBuffers(..))

Bug: 117861662
Test: play video on Netflix player, Youtube, Local playback

Change-Id: I9200438a552a20cfabe0ee5f39e6d56729205ae9
(cherry picked from commit 075f99539e1e7782369cf812e15417b325fc43e5)
1 file changed
tree: 2dff7215a9485e969771c6da47908e959cac497b
  1. codec2/
  2. hooks/
  3. media/
  4. Android.bp
  5. OWNERS