Page 1 of 1

force libvlc to resize video

Posted: 22 Oct 2014 22:06
by mr smith
Hello. I'm developing libvlc based application on qt. And I want it to go fullscreen/normal size by user action (as vlc do).
My video window is embedde into a top-level window of my app. If I do libvlc_set_fullscreen and make top level window to do fullscreen it works from time to time. Most of the time video does not resize, but sometimes it does. It's wierd.
There is doc saying:

* @warning With most window managers, only a top-level windows can be in
* full-screen mode. Hence, this function will not operate properly if
* libvlc_media_player_set_xwindow() was used to embed the video in a
* non-top-level window. In that case, the embedding window must be reparented
* to the root window <b>before</b> fullscreen mode is enabled. You will want
* to reparent it back to its normal parent when disabling fullscreen.

But calling
video->setParent(NULL);
video->show();
before
libvlc_set_fullscreen(vlcPlayer, fullscreen);
not helping at all. I see no video at all

Is there any method to resize video output from libvlc api, or a propper way (an example) of dealing with non-top-level video window?

Thanx

Re: force libvlc to resize video

Posted: 23 Oct 2014 09:42
by Rémi Denis-Courmont
You can't use set_xwindow and set_fullscreen on the same media player. If you use set_xwindow, you must implement fullscreen mode in your application; LibVLC needs not know about it.

Re: force libvlc to resize video

Posted: 23 Oct 2014 11:39
by mr smith
You can't use set_xwindow and set_fullscreen on the same media player. If you use set_xwindow, you must implement fullscreen mode in your application; LibVLC needs not know about it.
Ok. So I have to fit video into fullscreen window. How can I do this? There is no libvlc_video_set_size... I guess libvlc_video_set_format could help me, but i need other params to fill. I dont know where to get them. Can you guide me how to change video size?

Re: force libvlc to resize video

Posted: 23 Oct 2014 13:33
by Rémi Denis-Courmont
How to set the size of the window is beyond the scope of LibVLC. Again, that's an application or UI framework issue.