mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-02 06:31:08 +00:00
ac393aa657
In order to use oes-external, the qml6glsink needs a fragment shader that uses the samplerExternalOES. The qsb tool is not able to handle shaders that contain samplerExternalOES since this feature is not supported by all target shading languages. The qsb tool is able to replace a shader in the qsb file to handle this use case. Use it to generate a shader variant that uses samplerExternalOES for OpenGL ES and select that variant if the qml6glsink negotiated texture target oes-external. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7319>
38 lines
1.2 KiB
Python
Executable file
38 lines
1.2 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
# GStreamer
|
|
# Copyright (C) 2024 Michael Tretter <m.tretter@pengutronix.de>
|
|
#
|
|
# This library is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU Library General Public
|
|
# License as published by the Free Software Foundation; either
|
|
# version 2 of the License, or (at your option) any later version.
|
|
#
|
|
# This library is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
# Library General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Library General Public
|
|
# License along with this library; if not, write to the
|
|
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
# Boston, MA 02111-1307, USA.
|
|
#
|
|
|
|
import shutil
|
|
import subprocess
|
|
import sys
|
|
|
|
assert (len(sys.argv) == 5)
|
|
|
|
qsb_tool = sys.argv[1]
|
|
qsb_output = sys.argv[2]
|
|
gles_shader = sys.argv[3]
|
|
qsb_input = sys.argv[4]
|
|
|
|
# Copy the qsb file since the qsb tool replaces the shader in place
|
|
shutil.copyfile(qsb_input, qsb_output)
|
|
|
|
subprocess.run([qsb_tool,
|
|
'--silent',
|
|
'--replace', 'glsl,100es,{}'.format(gles_shader),
|
|
qsb_output])
|