Page 1 of 1

Window sizing problem

Posted: 06 Jan 2009 23:26
by Lohkay
Hi, hope someone can hint me regarding a problem I've been trying to solve. I have a WPF application that uses VLC through a WindowFormHost and everything works fine normally. I do get a situation from time to time where the video is cropped inside the window I give VLC. I've used Spy++ to monitor the windows inside my application and I noticed that VLC adds a child window to the window I give him... this same behavior is present in the VLC player as well. In the following screenshot, I've selected the window I give VLC which gets renamed to "VLC (hardware YUV DirectX)":

Image

Notice the white rectangle which represents the size of the window. Inside that window, there's another window without a caption that holds the actual video. It would seem VLC uses this dual window system to implement black bars to keep the aspect ratio which is just fine by me. But like you saw in the previous screenshot, the video isn't using the whole window size... and actually I'm only getting a crop out of the video. Here's a screenshot of me getting info on that child window:

Image

Notice that spy++ gives me a Rect much smaller for that child window. Like I said above, this only happen occasionally and appears to be very random, the size of the child window can be anywhere from 10% to 100% of the parent window. I'm not assuming that the problem is in the VLC library and I'm really just looking for insights of how those 2 windows interact and why would a problem like that raise its ugly head from time to time.

This is running on Window XP SP3 with DX 9.0c. Application is running in WPF with framework 3.5 SP1. libVLC version used is 0.9.8.1

Thanks

Re: Window sizing problem

Posted: 09 Jan 2009 20:43
by Lohkay
Hello, I was wondering, did I formulate my question incorrectly or didn't provide enough information? I see people coming into the thread but not a single answer or comment. I didn't find a solution on my side... it would seem that whatever I do (try to refresh the window after starting VLC, send WM_Paint messages, etc) doesn't change anything to the problem. But if I manually move the window or resize it, it fixes itself.

Re: Window sizing problem

Posted: 10 Jan 2009 03:32
by Jean-Baptiste Kempf
Probably noone knows enough WPF to understand the issue.
maybe your code is the issue, can you submit it?