diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-06-02 16:33:11 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-06-03 12:47:44 +0000 |
commit | 2ee7db851978e93490102ee90a93485721a20a85 (patch) | |
tree | 4a8a6f870da8fdd140320eda7df88e2e24a6cbc4 /src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp | |
parent | 912b8e56479c815782a0e9877efd675aa9326368 (diff) |
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 <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp')
-rw-r--r-- | src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<QVideoFrame::PixelFormat> QSGVideoItemSurface::supportedPixelFormats( { QList<QVideoFrame::PixelFormat> 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)); |