Move the DXVA decoder off the GPU thread.
The DXVA decoder runs on the GPU thread today. When the decoder has enough data to produce an output frame
the IMFTransform::ProcessOutput call blocks while waiting for the media foundation threads to produce the output
frame. This causes lots of jankiness and dropped frames while playing H.264 videos especially HD 1080P videos.
The approach we are taking to resolve this is to move the actual IMFTransform decoding off the GPU thread. This is
implemented by creating a worker thread per DXVA decoder instance. The lifetime of this thread is dependent on the
lifetime of the DXVAVideoDecodeAccelerator class. The IMFTransform decoder instance is created and destroyed on the main
thread. However the calls to ProcessInput/ProcessOutput etc happen on the decoder thread. The decoder state is modified
on both the GPU thread and the worker thread. The methods to get and set the state are now thread safe via InterLocked API
calls.
The copying of the decoded texture to the GPU texture is still done on the main thread. Will work on moving this to the
worker thread in a future patch.
BUG=426675, 430375, 426707
Review URL: https://codereview.chromium.org/
765533005
Cr-Commit-Position: refs/heads/master@{#306929}