View Full Version : Phonon VideoPlayer resize problem

18th August 2011, 21:13
I'm having a very specific problem relating to resizing Phonon video playback on Linux using the GStreamer backend. I use one player to playback several videos of different sizes in my application. Video playback works fine most of the time without problem but occasionally when swicthing to another video although the widget resizes the video playing within it doesn't. This doesn't happen all the time and happens much less on my more powerful dev PC than my slower testing PC.

I have tried resizing the video again at intervals using setGeometry but this has no effect. I suspect because the widget has already resized correctly but that Phonon/GStreamer hasn't picked up that change. So the video plays but at completely the wrong size. Once the video has signaled finshed() I then restart the video and it plays at the correct size.

So my question is does anybody know of anyway I can 'nudge' Phonon to resize itself? I am starting to run out of ideas now and any help would be greatly appreciated.


Code snippets in case they are relevant :

video = new Phonon::VideoPlayer(Phonon::VideoCategory, this);

void MainWindow::playContentVideo()
QString vidpath = QApplication::applicationDirPath();
vidpath += "/content/";
vidpath += QString::number(content);
vidpath += ".ogv";

21st August 2011, 16:24
Unlikely as this is, in case someone has the same problem as me. The only way I could fix this was to change to the xine backend for Phonon instead of GStreamer one. I should also mention that the videos I'm playing are OGV files encoded using the Theora video codec.

So this isn't specifically a QT problem but more of an issue with the Phonon backends.