Unbind the media player handle

This forum is about all development around libVLC.
neosettler
Cone that earned his stripes
Cone that earned his stripes
Posts: 107
Joined: 18 Dec 2012 17:44

Unbind the media player handle

Postby neosettler » 28 Jan 2019 00:07

Greetings,

Is there a way to unbind libvlc_media_player_set_hwnd handle to it's default state, if any? I'd like to change from an output to a window handle to a render to texture while playing the same video.

So far, setting libvlc_media_player_set_hwnd to null doesn't seem to have any effect.

also, could this be detached as well? Removing the callbacks that is.

Code: Select all

libvlc_video_set_format_callbacks(m_VLC_Player, ZVideoLandMovie::CallbackSetup, ZVideoLandMovie::CallbackCleanup);

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Unbind the media player handle

Postby mfkl » 28 Jan 2019 04:45

setting libvlc_media_player_set_hwnd to null doesn't seem to have any effect.
What kind of effect are you expecting? Setting it to null stops VLC from using that HWND to draw I believe.
could this be detached as well? Removing the callbacks that is.
Try calling libvlc_video_set_format_callbacks with NULL arguments? If that doesn't work, dispose of your mediaplayer and create a new one?
https://mfkl.github.io

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Unbind the media player handle

Postby Rémi Denis-Courmont » 28 Jan 2019 19:34

Stop the media player instance, delete it and create a new one.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

neosettler
Cone that earned his stripes
Cone that earned his stripes
Posts: 107
Joined: 18 Dec 2012 17:44

Re: Unbind the media player handle

Postby neosettler » 30 Jan 2019 03:12

Good idea, delete and create works!

One remaining issue with this approach is that using Qt::QWidget::windId as a render target, the QWidget does not refresh after deleting a media player that was using its handle. Seems like the winId (handle) is being messed with somehow. Any hint would be much appreciated.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests