Note that the check is commented out in this patch
https://chromium-review.googlesource.com/c/chromium/src/+/956602/11/media/mojo/services/mojo_cdm_service_context.cc#42
This is because D3D11VideoDecoderImpl is running on a different thread than D3D11VideoDecoder.
There are several ways to fix this.
1.
I don't think D3D11VideoDecoderImpl must inherit VideoDecoder. It could still mirror, or make it similar to VD but I don't think it has to.
So the solution is to call cdm_context->GetCdmProxyContext() in D3D11VideoDecoder, and pass CdmProxyContext* to D3D11VideoDecoderImpl::Initialize() that accepts CdmProxyContext*.
2.
cdm_context->GetCdmProxyContext() could be called in D3D11VideoDecoder and pass the CdmProxyContext* thru a public method on D3D11VideoDecoderImpl. CdmContext* passed to Initialize() could be null.
3.
Allow CdmProxyContextRef::GetCdmProxyContext() to be called from a different thread.
This might make the most sense because CdmProxyContext's other methods will also be called from the thread that's running D3D11VideoDecoderImpl.
Comment 1 by yini...@chromium.org
, Apr 16 2018