codec2: thread-safe guarantee for blockpool in C2VDAComponent
In previous code we use the same shared_ptr of blockpool in both decoder and
dequeue thread, and may reset the shared_ptr before another thread tempts to
use it.
The modified flow is, decoder thread gets blockpool reference from store first,
allocate buffers, and then pass the ownership to dequeue thread for buffer
recycle. When dequeue thread is stopped, blockpool reference is dropped from
component.
Bug: 80404901
Test: CtsMediaTestCases android.media.cts.DecodeAccuracyTest
Test: CtsMediaTestCases android.media.cts.MediaCodecTest#testAsyncStopAndReset
Change-Id: I7beb730289647edd6ae0999c70ff895da430514e
2 files changed