Page 1 of 1

Getting dx11 texture

Posted: 22 Sep 2016 18:34
by scirvir
Hey maybe the wrong place to post this, I've taken a look into this a bit and see no obvious solution, but I'm trying to get vlc to render to

a) a specific dx11 texture.
b) get the texture that vlc is rendering to so i can share it between dx11 contexts.

the callback method that i've seen https://wiki.videolan.org/LibVLC_SampleCode_SDL/ seems like it would be very under performative.

Re: Getting dx11 texture

Posted: 23 Sep 2016 14:56
by Jean-Baptiste Kempf
You can set an HWND to render

Re: Getting dx11 texture

Posted: 22 Oct 2016 07:59
by oviano
What would be the best strategy to render to a texture that you then want to overlay something with before displaying on the window though?

I have an SDL-based application using libVLC and I am forced to use the video callbacks to decode to a memory surface which I then copy to a texture which I can then render to the window before rendering the UI overlay.

Using a HWND wouldn't allow me to do that I think?

By the way the SDL example is flawed and should be changed or removed. Firstly I don't think it even works with 3.0 due to recent changes in the way the lock/display/unlock callbacks work (now it seems to lock once at the start, then call display repeatedly then call unlock). Secondly, the example has SDL rendering function calls outside the main window thread which is not allowed in SDL. I initially started off using the SDL2.0 example and while it works - probably because its so simple - I soon ran into stability issues when using that approach as part of a larger more complex application.

Re: Getting dx11 texture

Posted: 24 Oct 2016 21:34
by Jean-Baptiste Kempf
Why not put a widget above the video?

Re: Getting dx11 texture

Posted: 24 Oct 2016 21:43
by oviano
Hi Jean-Baptiste

What sort of widget do you mean? My app is a cross-platform one built on SDL and using some simple custom UI objects written to the SDL textures.

It would be great if it was possible to somehow give the libvlc the OpenGL context or DX surface to decode directly to or something. Maybe some plugins could be developed like that. Then it would be easier to do things like embed libvlc video playback into games etc.

Or maybe I just haven't seen how to do it yet?

Regards

Oliver

Re: Getting dx11 texture

Posted: 07 Dec 2016 00:34
by Jean-Baptiste Kempf
You can, but you must copy the frames.