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>
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user