Autoscaling does not work with 4.0.0 if window handle was set

This forum is about all development around libVLC.
filipp
New Cone
New Cone
Posts: 2
Joined: 10 Mar 2020 20:42

Autoscaling does not work with 4.0.0 if window handle was set

Postby filipp » 10 Mar 2020 21:06

And calling libvlc_video_set_scale just interrupts the program without any messages. In version 3 everything works correctly. Help, please, what am I doing wrong?

Code: Select all

int main(int argc, char *argv[]) { libvlc_instance_t* inst = libvlc_new(0, NULL); libvlc_media_t* m = libvlc_media_new_path(inst, "1.mp4"); libvlc_media_player_t* mp = libvlc_media_player_new_from_media(m); libvlc_media_release(m); libvlc_media_player_set_hwnd(mp, GetDesktopWindow()); // Desktop for example // libvlc_media_player_set_hwnd(mp, reinterpret_cast<unsigned __int64*>(ui.videoWidget->winId())); // Tried Qt widget libvlc_media_player_play(mp); Sleep(1000); libvlc_video_set_scale(mp, 2.0); // crash Sleep(10000); return 0; }
OS: Windows 10
Compiler: MSVC 2017
vout: direct3d11

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

Re: Autoscaling does not work with 4.0.0 if window handle was set

Postby Rémi Denis-Courmont » 10 Mar 2020 21:33

Hard to say without stack backtrace
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

filipp
New Cone
New Cone
Posts: 2
Joined: 10 Mar 2020 20:42

Re: Autoscaling does not work with 4.0.0 if window handle was set

Postby filipp » 11 Mar 2020 19:28

Full code:

Code: Select all

#include <QApplication> #include <vlc/vlc.h> #include <QWidget> class MyWidget : public QWidget { libvlc_instance_t* inst; libvlc_media_player_t* mp; public: MyWidget() : QWidget() { inst = libvlc_new (0, NULL); libvlc_media_t* m = libvlc_media_new_path (inst, "q.mp4"); mp = libvlc_media_player_new_from_media(m); libvlc_media_release (m); void* drawable = reinterpret_cast<unsigned __int64*>(this->winId()); libvlc_media_player_set_hwnd (mp, drawable); libvlc_media_player_play (mp); } protected: void mouseDoubleClickEvent(QMouseEvent *) override { libvlc_video_set_scale(mp, 2.0); // <=========================== CRASH!!! } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget* widget = new MyWidget(); widget->show(); a.exec(); return 0; }
Call stack (gdb bt full) large enough:
https://gist.github.com/FilippVolodin/31890ba8eea29f5cedf6197cea32326c

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

Re: Autoscaling does not work with 4.0.0 if window handle was set

Postby Rémi Denis-Courmont » 12 Mar 2020 12:17

Seems like a regression in the VLC Windows windowing code.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests