Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 16e79115 authored by Chong Zhang's avatar Chong Zhang
Browse files

MediaCodecSource: stop puller from caller's thread instead of looper

Currently CameraSource/AudioSource's stop() and read() are both called
from the puller's looper. This works if source operates normally (i.e.
read() returns regularly before source is stopped), as the stop() will
eventually be handled by the looper. However, if for some reason the
source hang, it will get stuck in read(), and the stop() will never
be processed, which could lead to ANR (in addition to the source hang).

We need to move the source's stop out of the puller's looper. It also
can't be on MediaCodecSource's looper, because the source's stop
synchrounously waits for all outstanding buffers to return, these
are only returned when MediaCodecSource's looper processes the buffer.

This change moves the stop to MediaCodecSource::stop, after encoder
is shutdown.

Bug: 16522726
Change-Id: Ie91f563c5d8a98ab091bf1945af4e51f662b9403
parent 44622db9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment