Hello,
VLC uses X to display video in their example (https://github.com/videolan/vlc/blob/ma ... player.cpp).
The problem with this is that, whatever my application contains, VLC will draw on top of everything because it takes the whole X window as a drawable component (see https://www.videolan.org/developers/vlc ... 695147ba5b)
My question is: Is there a way to embed a X drawable component (like, recreating a window inside another one, or whatever less-scary-solution) in a wxWidget, so that I can pass VLC only part of my application, and have the video constrained in the widget's bounds ?
If not, has anybody managed to display a video on Linux using wxWidgets + VLC/AnotherLibraryThatIWouldHaveForgotten ?
Creating a x11 drawable window in a wxWidget
Re: Creating a x11 drawable window in a wxWidget
Code: Select all
libvlc_media_player_set_xwindow(media_player, GET_XID(this->player_widget));
I don't work under Linux, but under Windows VLC only draws into the window handle that i pass to the Windows equivalent of that function.
Use the source, Luke!
Re: Creating a x11 drawable window in a wxWidget
Well that's what I thought at first, but for some reason it doesn't work as expected (video all over the screen, even over the controls) :/doublemax wrote:Isn't that already what you're asking for?Code: Select all
libvlc_media_player_set_xwindow(media_player, GET_XID(this->player_widget));
Re: Creating a x11 drawable window in a wxWidget
Also, to get the example to compile with the compilation command at the top of the file, I had to modify the following:
became
Also,
Code: Select all
// wx_player.cpp:14:32: fatal error: wx/gtk/win_gtk.h: No such file or directory
// #include <wx/gtk/win_gtk.h>
#ifdef __WXGTK__
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <wx/gtk/win_gtk.h>
#define GET_XID(window) GDK_WINDOW_XWINDOW(GTK_PIZZA(window->m_wxwindow)->bin_window)
#endif
Code: Select all
#ifdef __WXGTK__
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#define GET_XID() GDK_WINDOW_XWINDOW(gtk_widget_get_window( (GtkWidget *) GetHandle() ))
#endif
Code: Select all
libvlc_media_player_set_xwindow(media_player, GET_XID(this->player_widget));
// became
libvlc_media_player_set_xwindow(media_player, GET_XID());
Re: Creating a x11 drawable window in a wxWidget
I also tried this for GET_XID:
But this opens the video in another window, and I don't understand why...
Code: Select all
#define GET_XID(widget) GDK_WINDOW_XWINDOW(gtk_widget_get_window((GtkWidget*)widget->GetHandle()))
Re: Creating a x11 drawable window in a wxWidget
Hi,
AFAIK, the latest VLC is no longer use wxWidgets.
Did you try gstreamer? This is the way wxWidgets supports playing audio/video. Just check 'media' sample.
Thank you.
AFAIK, the latest VLC is no longer use wxWidgets.
Did you try gstreamer? This is the way wxWidgets supports playing audio/video. Just check 'media' sample.
Thank you.