[vlc-devel] [PATCH 12/14] filter_chain: add a default implementation for the video_allocator

Alexandre Janniaux ajanni at videolabs.io
Mon Aug 12 11:54:27 CEST 2019


Hi,


On Tue, Jul 30, 2019 at 08:57:24AM +0200, Steve Lhomme wrote:
> On 2019-07-29 21:08, Alexandre Janniaux wrote:
> > opengl filters in a d3d11 video output pipeline for example.
> >
> > If I understand this pipeline correctly, the most valid use case for video
> > context is for conversion filters, and especially conversion into the format and
> > context required by the display.
> >
> > Potentially, you could have a d3d11 followed by an openGL filter, then followed
> > by the d3d11 video output. In that case, you need to introduce a converter:
> > + the d3d11 filter will probably output a DXGI image.
> > + the opengl filter would need an imported opengl texture [1] and exports an
> > opengl texture, or ideally directly another native handle like a DXGI image. I
> > don't really know if there is something else on Windows, but it seems to be like
> > GBM on linux.
> > + the display will need a DXGI image.
>
> No, D3D11 doesn't deal with DXGI resources, only D3D11 resources (which are
> a higher level and tied to a device).
>
> > [1] https://www.khronos.org/registry/OpenGL/extensions/NV/WGL_NV_DX_interop2.txt
>
> As seen here, there's no DXGI (only a swapchain).
>

I made some more research on the subject and it seems that you're right, which
basically means that opengl textures and d3d11 textures are playing different
roles. OpenGL ones are more abstract, and in particular the textures also
references the different mipmaps levels, which you probably don't want and
don't care when transfering from filter to filter, and as I said it's not
really like native buffers. I'm currently making some code to use GBM buffers
for this case as output of opengl filters instead, so I'm following your work
on video context closely.

In addition, both textures doesn't support transfer across process. D3D11 allow
transfer across devices if they stay in the same process. But you can probably
still get a DXGI resource from D3D11 with a SHARE NTHANDLE flag and transfer it
that way. It would be interesting to see if it can be done after creating d3d11
textures. In any case, D3D* and DXGI seem interoperable with all other windows
API, and would be with opengl with the previous extension or with an ANGLE
opengl provider.

Regards,

--
Alexandre Janniaux
VideoLabs


More information about the vlc-devel mailing list