From 2ee7db851978e93490102ee90a93485721a20a85 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 2 Jun 2015 16:33:11 +0200 Subject: Add an env var to disable OpenGL texture-based video frames. Right now we will always use GLTextureHandle frames with Quick. This is great in many cases, but not always. Applications that wish to examine the frames (e.g. via video filters) will sometimes prefer frames in system memory, even if this is slower to display. Add QT_QUICK_NO_TEXTURE_VIDEOFRAMES which can be used to disable texture-based video frames. [ChangeLog] The environment variable QT_QUICK_NO_TEXTURE_VIDEOFRAMES can now be used to disable OpenGL texture based video frames. This can be useful in applications that wish to filter and process the video frames and are not GPU based. Change-Id: I5ca6f6d485d5bc6c2da8d47db563cd910c238ac9 Reviewed-by: Yoann Lopes --- src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp index f4efe47e7..de4cabfaf 100644 --- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp +++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp @@ -420,6 +420,17 @@ QList QSGVideoItemSurface::supportedPixelFormats( { QList formats; + static bool noGLTextures = false; + static bool noGLTexturesChecked = false; + if (handleType == QAbstractVideoBuffer::GLTextureHandle) { + if (!noGLTexturesChecked) { + noGLTexturesChecked = true; + noGLTextures = qEnvironmentVariableIsSet("QT_QUICK_NO_TEXTURE_VIDEOFRAMES"); + } + if (noGLTextures) + return formats; + } + foreach (QSGVideoNodeFactoryInterface* factory, m_backend->m_videoNodeFactories) formats.append(factory->supportedPixelFormats(handleType)); -- cgit v1.2.3