stagefright: rework MediaCodecSource
Redesigned MediaCodecSource to fix issues with source::stop(), where
there were still outstanding input buffers when the input source was
closed.
- moved input queue and state inside Puller
- Puller::pause, resume and stop is now atomic from caller's thread
- input source is accessed from Puller's looper, unless a blocked read
operation is detected.
- added stop timeout, so if Puller's looper is blocked, but it is not
yet detected, input source->stop is still called.
- using Mutexed helper class to ensure locked member access
Bug: 26964806
Change-Id: Icd6d4fc42a7c8e08b54e856c028f3d1fed5ae32d
2 files changed