Getting dx11 texture

This forum is about all development around libVLC.
scirvir
New Cone
New Cone
Posts: 1
Joined: 22 Sep 2016 17:48

Getting dx11 texture

Postby scirvir » 22 Sep 2016 18:34

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Getting dx11 texture

Postby Jean-Baptiste Kempf » 23 Sep 2016 14:56

You can set an HWND to render
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

oviano
Cone that earned his stripes
Cone that earned his stripes
Posts: 120
Joined: 12 Jan 2012 11:12

Re: Getting dx11 texture

Postby oviano » 22 Oct 2016 07:59

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Getting dx11 texture

Postby Jean-Baptiste Kempf » 24 Oct 2016 21:34

Why not put a widget above the video?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

oviano
Cone that earned his stripes
Cone that earned his stripes
Posts: 120
Joined: 12 Jan 2012 11:12

Re: Getting dx11 texture

Postby oviano » 24 Oct 2016 21:43

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

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Getting dx11 texture

Postby Jean-Baptiste Kempf » 07 Dec 2016 00:34

You can, but you must copy the frames.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 27 guests