summaryrefslogtreecommitdiffstats
path: root/src/multimedia/video
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-04-26 14:09:48 +0200
committerLars Knoll <lars.knoll@qt.io>2021-04-28 08:46:00 +0000
commit2dceee374cad71ad204f04acd967cc939fa93b5f (patch)
tree9974b7210a0181935da7388d7f3430c5992ff8e8 /src/multimedia/video
parent14f960eeb6bf99e6de4bfd41b0d5a6bf2de2fe67 (diff)
Fix sizeHint() of QVideoWidget/QVideoGraphicsItem
Doesn't yet fix all test failures, but it's an improvement. Change-Id: I775857f1fb580b78ae137dc71ee445a15eafd0a7 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/video')
-rw-r--r--src/multimedia/video/qvideosink.cpp9
-rw-r--r--src/multimedia/video/qvideosink.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/multimedia/video/qvideosink.cpp b/src/multimedia/video/qvideosink.cpp
index ee4c81cc6..47ebd3033 100644
--- a/src/multimedia/video/qvideosink.cpp
+++ b/src/multimedia/video/qvideosink.cpp
@@ -374,6 +374,15 @@ QPlatformVideoSink *QVideoSink::platformVideoSink()
return d->videoSink;
}
+/*!
+ Returns the size of the video currently being played back. If no video is being played,
+ this method returns an invalid size.
+ */
+QSize QVideoSink::videoSize() const
+{
+ return d->videoSink->nativeSize();
+}
+
QT_END_NAMESPACE
#include "moc_qvideosink.cpp"
diff --git a/src/multimedia/video/qvideosink.h b/src/multimedia/video/qvideosink.h
index 7092f80bf..1fa308266 100644
--- a/src/multimedia/video/qvideosink.h
+++ b/src/multimedia/video/qvideosink.h
@@ -95,6 +95,7 @@ public:
void paint(QPainter *painter, const QVideoFrame &frame);
QPlatformVideoSink *platformVideoSink();
+ QSize videoSize() const;
Q_SIGNALS:
// would never get called in windowed mode