diff options
author | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-01-08 16:00:35 +0100 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-01-14 13:51:52 +0000 |
commit | 12e31cd9b912368f88d0f776b1efff3d6111078a (patch) | |
tree | 966b93c102143c135167abf5b26ba13b835f11dd | |
parent | bd0cd075337a8711b29b7e3d568ae4afb46d1887 (diff) |
Handle supportedFormatsChanged in QVideoSurfaces
Need to proxy supportedFormatsChanged signal from internal surfaces, since it impacts supported
formats, also GLContext property should be set to share gl contexts between renderers.
Change-Id: I9774be4d79dcd09190769def7e6ffd11a85fcc86
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r-- | src/multimedia/video/qvideosurfaces.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/multimedia/video/qvideosurfaces.cpp b/src/multimedia/video/qvideosurfaces.cpp index 459a6675a..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() |