summaryrefslogtreecommitdiffstats
path: root/src/multimediawidgets/qvideowidget.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-08-24 14:37:01 +0200
committerLars Knoll <lars.knoll@qt.io>2021-08-25 23:11:02 +0200
commit5ef8dd45acf2b9a1d0c8a6c49cad2258f2fad95e (patch)
tree75ce22dfd97b07bf991b7ba325469feb657d0d02 /src/multimediawidgets/qvideowidget.cpp
parent671396809fd866e0e3d7793f8fd635b0ad33bed7 (diff)
Move the QVideoSink::paint() method to QVideoFrame
This makes a lot more sense as the videoframe can now paint itself. It also allows us to removes a lot of API from QVideoSink that never quite fit in there. Pick-to: 6.2 Change-Id: I70f32416a0e3850c2a9f8ee3853f38b06031905f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/multimediawidgets/qvideowidget.cpp')
-rw-r--r--src/multimediawidgets/qvideowidget.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/multimediawidgets/qvideowidget.cpp b/src/multimediawidgets/qvideowidget.cpp
index ec74cad96..90de31614 100644
--- a/src/multimediawidgets/qvideowidget.cpp
+++ b/src/multimediawidgets/qvideowidget.cpp
@@ -272,7 +272,10 @@ void QVideoWidget::paintEvent(QPaintEvent *event)
if (d->videoSink && d->lastFrame.isValid()) {
QPainter painter(this);
- d->videoSink->paint(&painter, d->lastFrame);
+ QVideoFrame::PaintOptions options = {
+ Qt::black, d->aspectRatioMode
+ };
+ d->lastFrame.paint(&painter, rect(), options);
return;
} else if (testAttribute(Qt::WA_OpaquePaintEvent)) {
QPainter painter(this);