Fix memory leak due to un-released gralloc buffers
When Acodec receives an error event at LoadedToIdleState,
it will not release allocated buffers which will cause gralloc
buffer leak issue. We need to first release these buffers and
then process the error event. If the application uses surfaceTexture
view, the size of leak is height x width x 10 bytes.
As a solution, when ACodec receives an error at LoadedToIdleState state
and if input and output ports buffers belong to us, free the buffers
and then report the fatal error to application.
Test: Build is successful, atest CtsVideoTestCases, atest
mediacodecTest, atest CtsMediaMiscTestCases, atest
CtsMediaPlayerTestCases
Change-Id: Ic89a316881678a0e6104b10e923c32a758d00c7c
Signed-off-by: Saurabh <sbbanore@amazon.com>
Loading
Please register or sign in to comment