DescriptionRemove MediaPlayerAndroid::IsSurfaceInUse() call
When tearing down a MediaSourcePlayer, the video codec could still be decoding.
Therefore, we introduced IsSurfaceInUse() call to destroy the surface view after codec finishes decoding.
However, this function doesn't really help due to 2 reasons:
1. Surface view can go away any time. For example, user click exitfullscreen button.
So waiting for decoder to gracefully finish decoding is not applicable in many cases.
2. Waiting for decoder to finish before destroying the surface view might introduce the following racing issue:
Video A tries to exit fullscreen, but pending decoder job deletion.
Video B calls enter fullscreen, but since the surface is in use, it will fail to do so.
video A exits fullscreen, but video B doesn't know that, and it will wait forever.
This change removes the asynchronous behavior when ReleaseMediaResources() is called.
This makes the code more easy to read and avoids the racing issue above.
BUG=422158
Committed: https://crrev.com/5f39149e06b561f79625450c0aaf69be3c5fc95b
Cr-Commit-Position: refs/heads/master@{#299556}
Patch Set 1 #
Messages
Total messages: 7 (2 generated)
|