diff options
Diffstat (limited to 'src/multimedia/video/qvideosurfaces.cpp')
-rw-r--r-- | src/multimedia/video/qvideosurfaces.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/multimedia/video/qvideosurfaces.cpp b/src/multimedia/video/qvideosurfaces.cpp index c7de5ea12..793879382 100644 --- a/src/multimedia/video/qvideosurfaces.cpp +++ b/src/multimedia/video/qvideosurfaces.cpp @@ -45,6 +45,15 @@ QVideoSurfaces::QVideoSurfaces(const QVector<QAbstractVideoSurface *> &s, QObjec : QAbstractVideoSurface(parent) , m_surfaces(s) { + for (auto a : s) { + connect(a, &QAbstractVideoSurface::supportedFormatsChanged, this, [this, a] { + auto context = property("GLContext").value<QObject *>(); + if (!context) + setProperty("GLContext", a->property("GLContext")); + + emit supportedFormatsChanged(); + }); + } } QVideoSurfaces::~QVideoSurfaces() @@ -71,13 +80,15 @@ bool QVideoSurfaces::start(const QVideoSurfaceFormat &format) for (auto &s : m_surfaces) result &= s->start(format); - return result; + return result && QAbstractVideoSurface::start(format); } void QVideoSurfaces::stop() { for (auto &s : m_surfaces) s->stop(); + + QAbstractVideoSurface::stop(); } bool QVideoSurfaces::present(const QVideoFrame &frame) |