PDA

View Full Version : Get aspect ratio from Phonon videoWidget



budda
18th October 2012, 15:37
Is there a way to get the aspect ratio of a videoWidget in Phonon. I have it set to Phonon::VideoWidget::AspectRatioAuto, but am playing videos of both 4/3 and 16/9 sizing. It would be nice to know which videos are 16/9 and which are 4/3 for displaying a logo ontop of the video correctly. I didn't see any such member function on the Phonon class page for retrieving the current playing videos aspect ratio, just member functions for changing or setting the ratio.

Seishin
19th October 2012, 18:10
Just get the width and height and calculate the ratio by yourself. The way to get them is not obvious though.

budda
24th October 2012, 08:46
duh, that's a pretty simple solution. ->width() and ->height() , thanks

there's just a member function for just about everything, thought there would be a ->getAspect() with some num defines or something or possibly an ->info() class object that has all the video info packaged neatly like PHP...