Handle MCVD cleanup properly if texture has been destroyed.
If AbstractTexture drops its reference to the underlying texture, then that texture might have been freed. This happens when the gl stub is lost. Previously, MCVD assumed that the CodecImage attached to the texture was valid. However, if the AbstractTexture has dropped its ref to the texture, and there are no other refs, then this assumption isn't right. This CL checks if the AbstractTexture still has a TextureBase before referencing the CodecImage. An alternate approach of holding a scoped_refptr to the CodecImage in the callback would also work, but might keep the CodecImage around longer than it should when the stub is destroyed. This can hold the MediaCodec open longer if the CodecImage has an unrendered codec buffer. Bug: 863012 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: If83a9eb0c27d6eb8e995424bdf71f7f7bc93590d Reviewed-on: https://chromium-review.googlesource.com/1135697Reviewed-by:Dale Curtis <dalecurtis@chromium.org> Commit-Queue: Frank Liberato <liberato@chromium.org> Cr-Commit-Position: refs/heads/master@{#574717}
Showing
Please register or sign in to comment