Attempt to fix a crash in the DXVA decoder in the DXVAVideoDecodeAccelerator::ProcessPendingSamples function.

Based on the crash dump, the crash occurs after the call to the CopyOutputSampleDataToPictureBuffer function. This function
attempts to copy the decoded texture out to the target surface. Prior to doing that it initializes the video format converter
object, which essentially means setting some attributes on the object, setting its input and output media types.

If the initialization of the converter fails, then this results in a call to the RETURN_AND_NOTIFY_ON_FAILURE macro which internally
invalidates the decoder. The crash occurs on return from here as the iterator is now invalid.

Proposed fixes are as below:-.
1. Move the setting of the MF_XVP_PLAYBACK_MODE and MF_LOW_LATENCY attributes on the format converter to the initialization code.
   This should ensure that we fail early if these attributes cannot be set on the converter.

2. Set the minimum attributes on the media type in the converter. These include the MFMediaType_Video, MF_MT_SUBTYPE and MF_MT_FRAME_SIZE attributes.
   The rest are not needed.

3. Try to fallback to MFVideoFormat_RGB32 if we fail to find MFVideoFormat_ARGB32 as a supported output type in the converter.

If the above steps fail, then we have some CHECK's in the code which should help catch and analyze crashes in this code path.

BUG=495216

Review URL: https://codereview.chromium.org/1591603002

Cr-Commit-Position: refs/heads/master@{#369882}
2 files changed