[vlc-devel] [PATCH 04/31] display: don't store the dummy context in the display anymore

Steve Lhomme robux4 at ycbcr.xyz
Tue Sep 24 11:41:42 CEST 2019

On 2019-09-23 19:11, Rémi Denis-Courmont wrote:
> Le maanantaina 23. syyskuuta 2019, 18.01.09 EEST Steve Lhomme a écrit :
>> Use the one from the vout thread if it exists.
>> Later the video context will come from the decoder (if any).
> I still don't get why the VD should care/know about the decoder device at all.
> If even VD knows about the decoder device, then what's the point of the
> distinct video context?

The hint has to work both ways. If a VAAPI decoder uses a VADisplay and 
the VD uses another one it may not work at all (not sure if the same 
value would be used if the default display is used in both cases).

With D3D it's the same thing, with external rendering we want the VD to 
use the D3D device provided by the host (otherwise it just cannot work). 
That means the decoder should also use this device. And it knows about 
this device/hint through the "decoder device". I agree that the VD may 
read that external D3D device on itself without using the "decoder 
device" at all. Given the "decoder device" may not be created at all 
(it's created only on demand which won't happen for AV1 playback for 
example) maybe I should not rely on it at all and get the host D3D 
device by other means.

(there are also possibilities to use a different D3D device for decoding 
and rendering which I have local support for, but that's besides the point)

So IMO it all comes down to VAAPI and whether the VADisplay value must 
be created once and used in the decoder and the VD.

I think in all cases the VADisplay created for the decoder will be 
pushed in the video context when creating the display. So in all cases 
it should match on both sides.

I'll modify my patch (and working branches) accordingly.

More information about the vlc-devel mailing list