force libvlc to resize video

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
mr smith
New Cone
New Cone
Posts: 2
Joined: 22 Oct 2014 21:54

force libvlc to resize video

Postby mr smith » 22 Oct 2014 22:06

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

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

Re: force libvlc to resize video

Postby Rémi Denis-Courmont » 23 Oct 2014 09:42

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mr smith
New Cone
New Cone
Posts: 2
Joined: 22 Oct 2014 21:54

Re: force libvlc to resize video

Postby mr smith » 23 Oct 2014 11:39

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?

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

Re: force libvlc to resize video

Postby Rémi Denis-Courmont » 23 Oct 2014 13:33

How to set the size of the window is beyond the scope of LibVLC. Again, that's an application or UI framework issue.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 80 guests