LibVLC, X11, Fullscreen and Keyboard Input - A bug, a workaround and a custom player program
Posted: 06 Apr 2019 18:36
First off, let me raise my hat to all the VLC developers out there. I always been a fan of VLC since v1.0.0 for WIN32. Now that I have this idea of a custom app in my mind and kind of know how I can create it, I'm excited to share it with anyone interested when it's ready.
LibVLC Features discussions throughout this forum
I read many times in this forum that if someone uses LibVLC, the best way to get app features is to hook it to a parent X11 window using libvlc_media_player_set_xwindow(). Well, let me kindly disagree with those who think so. There's already a tonne of work invested into LibVLC. Why not use it to the fullest? So, features that would be interesting to have is Get the X11 window ID (if LibVLC created it), take care of the FULLSCREEN feature (I know it's a tough one, but read further down) and provide a callback feature for keyboard entries.
But what about me?
Well, VLC has now become a huge system, and it's very difficult for me to understand how it all works. So many languages/systems/packages. I'm at a complete loss. Let me tell you, VLC developers are saints. I'm currently using VLC 2.2.8 under FreeBSD 11.2. This error is listed in the standard output:
I believe it occurs while my program does a sleep(1); and the LibVLC thread loads the video. After that, I can pause/play/stop the video, but it runs from LibVLC's own window, not the one I provided using libvlc_media_player_set_xwindow(). Now dear developers, don't waste time on this because it's obviously not your latest VLC version.
My lame attempt at building VLC
I downloaded VLC v3.0.6 and tried to compile it. I got a few puzzling compiling errors, google was my friend. But in the end, it would never run, big system, lots of dependencies and version conflicts in system paths. I don't know how to address those, and don't want to break my system by deleting some files that I'm not supposed to. I'll just work around the issues as they present themselves. And when a newer VLC version is available under FreeBSD, I'll test it again.
FULLSCREEN Tip!!!
I'm using an old X11 window manager, one that doesn't recognise the X11 Window Hints obviously. Step 1 is to search for the X11 window that LibVLC has created in the X11 window tree. Step 2, run these functions:
I'll test this later under a Gnome Linux if this still works.
What's next for me?
I need to figure out a way to capture the keyboard entries, and then I'll publish the program on my GitHub account for those interested in a quick shortcut. I'll reply back when it's ready or any questions/comments you may have.
https://github.com/fossette
LibVLC Features discussions throughout this forum
I read many times in this forum that if someone uses LibVLC, the best way to get app features is to hook it to a parent X11 window using libvlc_media_player_set_xwindow(). Well, let me kindly disagree with those who think so. There's already a tonne of work invested into LibVLC. Why not use it to the fullest? So, features that would be interesting to have is Get the X11 window ID (if LibVLC created it), take care of the FULLSCREEN feature (I know it's a tough one, but read further down) and provide a callback feature for keyboard entries.
But what about me?
Well, VLC has now become a huge system, and it's very difficult for me to understand how it all works. So many languages/systems/packages. I'm at a complete loss. Let me tell you, VLC developers are saints. I'm currently using VLC 2.2.8 under FreeBSD 11.2. This error is listed in the standard output:
Code: Select all
[000000080b640450] avcodec decoder: Using NVIDIA VDPAU Driver Shared Library 390.87 Tue Aug 21 15:52:44 PDT 2018 for hardware decoding.
[0000000821033050] xcb_window window error: bad X11 window 0x03c00001
My lame attempt at building VLC
I downloaded VLC v3.0.6 and tried to compile it. I got a few puzzling compiling errors, google was my friend. But in the end, it would never run, big system, lots of dependencies and version conflicts in system paths. I don't know how to address those, and don't want to break my system by deleting some files that I'm not supposed to. I'll just work around the issues as they present themselves. And when a newer VLC version is available under FreeBSD, I'll test it again.
FULLSCREEN Tip!!!
I'm using an old X11 window manager, one that doesn't recognise the X11 Window Hints obviously. Step 1 is to search for the X11 window that LibVLC has created in the X11 window tree. Step 2, run these functions:
Code: Select all
XMoveResizeWindow(pX11Display, wVlc, 0, 0, screenwidth, screenheight);
XTranslateCoordinates(pX11Display, wVlc, wRoot, 0, 0, &x, &y, &w2);
if (x > 0 || y > 0)
XMoveWindow(pX11Display, wVlc, -x, -y);
What's next for me?
I need to figure out a way to capture the keyboard entries, and then I'll publish the program on my GitHub account for those interested in a quick shortcut. I'll reply back when it's ready or any questions/comments you may have.
https://github.com/fossette