summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-25 09:10:19 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-26 14:43:00 (GMT)
commit58d8c744dbcde532270b62484ea16d865589bc38 (patch)
tree281223a48054892bc5b5163f55759a7a20aff3d4 /src/3rdparty/phonon
parent3ac80bf663a2a8d69b860c44b0285fe72750da58 (diff)
downloadQt-58d8c744dbcde532270b62484ea16d865589bc38.zip
Qt-58d8c744dbcde532270b62484ea16d865589bc38.tar.gz
Qt-58d8c744dbcde532270b62484ea16d865589bc38.tar.bz2
Clip video rect to physical screen dimensions
The CVideoPlayerUtility API requires both a native window handle and an absolute screen rectangle in order to define the location of the rendered video output. On certain devices, such as the Nokia E75, which runs S60 3.2, if the absolute rectangle extends outside the physical screen extent, no video is rendered. This change works around this defect in the platform by clipping the video rectangle to the physical screen extent. Task-number: QTBUG-5467 Reviewed-by: trustme
Diffstat (limited to 'src/3rdparty/phonon')
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
index be58e91..b6f53ae 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
@@ -446,7 +446,18 @@ QSize scaleToAspect(const QSize& srcRect, int aspectWidth, int aspectHeight)
void MMF::VideoPlayer::updateVideoRect()
{
QRect videoRect;
- const QRect windowRect = m_videoOutput->videoWindowRect();
+ QRect windowRect = m_videoOutput->videoWindowRect();
+
+ // Clip to physical window size
+ // This is due to a defect in the layout when running on S60 3.2, which
+ // results in the rectangle of the video widget extending outside the
+ // screen in certain circumstances. These include the initial startup
+ // of the mediaplayer demo in portrait mode. When this rectangle is
+ // passed to the CVideoPlayerUtility, no video is rendered.
+ const TSize screenSize = m_screenDevice.SizeInPixels();
+ const QRect screenRect(0, 0, screenSize.iWidth, screenSize.iHeight);
+ windowRect = windowRect.intersected(screenRect);
+
const QSize windowSize = windowRect.size();
// Calculate size of smallest rect which contains video frame size