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 b826dba0ac847bb25a814af2b8b96ceb5fb5a822)
1 file changed
tree: 6c627ef7a9c4cc7524bded671fd3f35f6f13c6dd
  1. codec2/
  2. hooks/
  3. media/
  4. Android.bp
  5. OWNERS