Android 7.1.2 Release 4 (N2G47H)
Fixed the Media CTS testVideoSurfaceResetting random failure issue.

Bug: 32721372
BZ: IMINAN-51199

During the decoding process, there're >= 2 threads (such as ISV and
MediaCodec) which may share the same gralloc buffer
(obj_surface->share_info), although their allocated surfaces belong
to each corresponding decoding context.

So fixed the random issue by registering (referencing) the gralloc
buffer before locking it (for read/write), to avoid its potential
free by other processes/threads. And the gralloc HAL would
defer to free the buffer once all of the registered processes or
threads have unregistered it.

Change-Id: Ied970b0e9a9de512cec9e0841a591cc4d98e327d
Signed-off-by: Austin Hu <austin.hu@intel.com>
3 files changed