summaryrefslogtreecommitdiffstats
path: root/src/multimedia/playback/qmediaplayer.cpp
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2019-10-28 12:23:15 +0100
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2019-11-06 09:50:28 +0100
commitcb8f5067a2fdf73f4f5b71ab3c7bcc65dc13c387 (patch)
tree7c4cb1985e23de597a7627d0a360d4a7ed30e130 /src/multimedia/playback/qmediaplayer.cpp
parent59d0683c999bec5612f6ba91867bde4d02185204 (diff)
Introduce rendering to multiple surfaces
QAbstractVideoSurface is used to retrieve and render video frames in particular pixel format. I.e. a backend takes one video surface which asks to provide video frames in one of the supported formats returned from QAbstractVideoSurface::supportedPixelFormats(). So currently there is one source of the video frames and only one video output possible. Introducing QMediaPlayer::setVideoOutput(const QVector<QAbstractVideoSurface *> &) This func takes a list of surfaces, that support at least one shared pixel format, and presents video frames to all of them at the same time. Several surfaces, which do not have any shared pixel formats, will fail to work. Task-number: QTBUG-32939 Change-Id: Ifbdaf692755353fbd5bf3ad74baba1820e3d0237 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/multimedia/playback/qmediaplayer.cpp')
-rw-r--r--src/multimedia/playback/qmediaplayer.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp
index 48db0335e..e8bb352f7 100644
--- a/src/multimedia/playback/qmediaplayer.cpp
+++ b/src/multimedia/playback/qmediaplayer.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qmediaplayer.h"
+#include "qvideosurfaces_p.h"
#include "qvideosurfaceoutput_p.h"
#include "qmediaobject_p.h"
@@ -1168,6 +1169,24 @@ void QMediaPlayer::setVideoOutput(QAbstractVideoSurface *surface)
}
}
+/*!
+ \since 5.15
+ Sets multiple video surfaces as the video output of a media player.
+ This allows the media player to render video frames on different surfaces.
+
+ All video surfaces must support at least one shared \c QVideoFrame::PixelFormat.
+
+ If a video output has already been set on the media player the new surfaces
+ will replace it.
+
+ \sa QAbstractVideoSurface::supportedPixelFormats
+*/
+
+void QMediaPlayer::setVideoOutput(const QVector<QAbstractVideoSurface *> &surfaces)
+{
+ setVideoOutput(new QVideoSurfaces(surfaces, this));
+}
+
/*! \reimp */
QMultimedia::AvailabilityStatus QMediaPlayer::availability() const
{