diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-04-26 17:23:21 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-28 08:46:06 +0000 |
commit | 2f322997e3ee6651b7517520355b7eda5f190925 (patch) | |
tree | fba8cae6d0759c748d140e774990b5f041f7b01a /src/multimediawidgets | |
parent | 2dceee374cad71ad204f04acd967cc939fa93b5f (diff) | |
download | qtmultimedia-2f322997e3ee6651b7517520355b7eda5f190925.tar.gz |
Fix test failures in tst_qvideowidget and tst_qgraphicsvideoitem
This passes now, but might require some more massaging to get
correct display rects for the widget case.
Change-Id: I4673240bb1afacfe714580e586e293c09f690d11
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimediawidgets')
-rw-r--r-- | src/multimediawidgets/qgraphicsvideoitem.cpp | 16 | ||||
-rw-r--r-- | src/multimediawidgets/qvideowidget.cpp | 1 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/multimediawidgets/qgraphicsvideoitem.cpp b/src/multimediawidgets/qgraphicsvideoitem.cpp index 240a9eb32..e72ce90ad 100644 --- a/src/multimediawidgets/qgraphicsvideoitem.cpp +++ b/src/multimediawidgets/qgraphicsvideoitem.cpp @@ -64,10 +64,8 @@ public: QGraphicsVideoItem *q_ptr = nullptr; QVideoSink *sink = nullptr; - Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio; QRectF rect; QRectF boundingRect; - QRectF sourceRect; QSizeF nativeSize; QVideoFrame m_frame; @@ -81,7 +79,10 @@ void QGraphicsVideoItemPrivate::updateRects() q_ptr->prepareGeometryChange(); boundingRect = rect; - if (aspectRatioMode == Qt::KeepAspectRatio && !nativeSize.isEmpty()) { + if (nativeSize.isEmpty()) + return; + + if (sink->aspectRatioMode() == Qt::KeepAspectRatio) { QSizeF size = nativeSize; size.scale(rect.size(), Qt::KeepAspectRatio); @@ -93,13 +94,10 @@ void QGraphicsVideoItemPrivate::updateRects() void QGraphicsVideoItemPrivate::_q_present(const QVideoFrame &frame) { m_frame = frame; - if (q_ptr->isObscured()) { - q_ptr->update(boundingRect); - } else { - q_ptr->update(boundingRect); - } + q_ptr->update(boundingRect); + if (frame.isValid()) { - const QSize &size = frame.size(); + const QSize &size = frame.surfaceFormat().viewport().size(); if (nativeSize != size) { nativeSize = size; diff --git a/src/multimediawidgets/qvideowidget.cpp b/src/multimediawidgets/qvideowidget.cpp index ff7b488d6..f6a6d6f0c 100644 --- a/src/multimediawidgets/qvideowidget.cpp +++ b/src/multimediawidgets/qvideowidget.cpp @@ -179,7 +179,6 @@ void QVideoWidget::setFullScreen(bool fullScreen) } d->wasFullScreen = fullScreen; d->videoSink->setFullScreen(fullScreen); - emit fullScreenChanged(fullScreen); } /*! |