Chromium Code Reviews
Description[M52] Make AVDA fall back to software decoding if needed.
This is a merge to M52 of:
https://codereview.chromium.org/2084143002
https://codereview.chromium.org/2091253003
Android MediaCodec creation will sometimes never come back. On a
N7 (2013) with Lollipop, this can happens when an attempt to allocate
a hardware codec fails, and falls back to a software codec. Once
mediaserver gets into a bad state, future attempts to create a
hardware codec will hang. As a result, no additional AVDA instances
will get codecs. Further, destroying any of them will hang the gpu
process when it tries to join the thread that handles construction.
This CL does several things:
- Don't join the construction thread if there are outstanding
MediaCodec creations on it. While this may sometimes not
shut down the thread if the AVDA is destroyed while the
creation is pending (and would return if we just waited a bit
longer), the thread will be shut down the next time an AVDA
instance is destroyed. It isn't leaked permanently.
- Fall back to requesting a software codec if we believe that
construction of a hardware codec is hung. We don't attempt
to salvage the AVDA instance(s) that have pending HW codecs,
but future AVDA instances will fall back to software. If
those HW codecs are eventually allocated, then we will start
requesting HW codecs again. For example, if we simply time
out too quickly, or if mediaserver is restarted, then we can
try for hardware codecs for future AVDA instances.
- Release hardware codecs on a separate thread, since that can
hang too if mediaserver is in a bad state.
BUG=613238, 622927
TBR=dalecurtis@chromium.org
NOPRESUBMIT=true
NOTRY=true
Patch Set 1 #Messages
Total messages: 4 (1 generated)
|