BlackBerry: Fix frame size of video playback

Adapt the frame size dynamically, since mmrenderer resizes
the source viewport of the native video window at runtime on
some hardware platforms.

Task-number: QTBUG-31534
Change-Id: Ie637d7a80697175dacb454535fbe251b2c7a6809
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
This commit is contained in:
Tobias Koenig
2013-06-04 16:09:32 +02:00
committed by The Qt Project
parent 3d45b9147e
commit 056fe7e11e
3 changed files with 49 additions and 8 deletions

View File

@@ -142,8 +142,14 @@ void BbPlayerVideoRendererControl::resume()
void BbPlayerVideoRendererControl::frameGrabbed(const QImage &frame)
{
if (m_surface) {
if (!m_surface->isActive())
if (!m_surface->isActive()) {
m_surface->start(QVideoSurfaceFormat(frame.size(), QVideoFrame::Format_ARGB32));
} else {
if (m_surface->surfaceFormat().frameSize() != frame.size()) {
m_surface->stop();
m_surface->start(QVideoSurfaceFormat(frame.size(), QVideoFrame::Format_ARGB32));
}
}
m_surface->present(frame.copy());
}