Results 1 to 3 of 3

Thread: Get aspect ratio from Phonon videoWidget

  1. #1
    Join Date
    Mar 2010
    Posts
    86
    Thanks
    11
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Get aspect ratio from Phonon videoWidget

    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.

  2. #2
    Join Date
    Jul 2012
    Posts
    53
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Get aspect ratio from Phonon videoWidget

    Just get the width and height and calculate the ratio by yourself. The way to get them is not obvious though.

  3. The following user says thank you to Seishin for this useful post:

    budda (24th October 2012)

  4. #3
    Join Date
    Mar 2010
    Posts
    86
    Thanks
    11
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Get aspect ratio from Phonon videoWidget

    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...

Similar Threads

  1. QSvgWidget cannot set fixed aspect ratio
    By gnetscher in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2012, 13:51
  2. Printing and Aspect ratio
    By cpt4 in forum Qwt
    Replies: 9
    Last Post: 30th September 2011, 14:28
  3. How to get aspect ratio on selection with rubberBand?
    By suseway in forum Qt Programming
    Replies: 6
    Last Post: 25th October 2010, 08:29
  4. keeping aspect ratio while resizing
    By franco.amato in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2009, 20:12
  5. aspect ratio of top-level widgets
    By urbangipsy in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2007, 21:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.