Fix errors in destruction sequence of GpuVideoEncodeAccelerator::OnWillDestroyStub()
On Windows, we can use GPU IO thread to filter some messages for GPUVEA. In that case, while GpuVideoEncodeAccelerator::OnWillDestroyStub() is running on main thread, GpuVideoEncodeAccelerator::OnEncodeFrameCreated() can run on IO thread. If |encoder_| is reset on main thread and accessed on IO thread, we see the crashes listed on the bug. This CL solves the issue by: - Checking |filter_removed_| which is signaled on IO thread before deciding to continue with encode GpuVideoEncodeAccelerator::OnEncodeFrameCreated() on IO thread. - Making sure that |encoder_worker_thread_| tasks are completed before reset. BUG=715759 TEST=Tested AppRTC loopback with H264. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2849443003 Cr-Commit-Position: refs/heads/master@{#468457}
Showing
Please register or sign in to comment