From f844a2acbb7ecc4d7b1776d1d6eeb8feab7044f1 Mon Sep 17 00:00:00 2001 From: Massimo Callegari Date: Fri, 24 Aug 2018 23:41:13 +0200 Subject: Add OpenGL core profile support to QtMultimediaQuickTools When requesting a OGL Core profile via QSurfaceFormat::setDefaultFormat (e.g. to use Qt3D advanced features), it is no longer possible to render QML Video items. This is because the requested shaders should be _core versions. This patch adds the core shaders so QtMultimedia stops whining, and bind textures with the proper format, since GL_LUMINANCE and GL_LUMINANCE_ALPHA are no longer valid in OGL 4. Task-number: QTBUG-51064 Change-Id: I909e01e7dc7be07549e9ecf0a6425b309af38ea1 Reviewed-by: VaL Doroshchuk Reviewed-by: Christian Stromme --- .../shaders/biplanaryuvvideo_core.frag | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/qtmultimediaquicktools/shaders/biplanaryuvvideo_core.frag (limited to 'src/qtmultimediaquicktools/shaders/biplanaryuvvideo_core.frag') diff --git a/src/qtmultimediaquicktools/shaders/biplanaryuvvideo_core.frag b/src/qtmultimediaquicktools/shaders/biplanaryuvvideo_core.frag new file mode 100644 index 000000000..1261782f8 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders/biplanaryuvvideo_core.frag @@ -0,0 +1,16 @@ +#version 150 core +uniform sampler2D plane1Texture; +uniform sampler2D plane2Texture; +uniform mat4 colorMatrix; +uniform float opacity; +in vec2 plane1TexCoord; +in vec2 plane2TexCoord; +out vec4 fragColor; + +void main() +{ + float Y = texture(plane1Texture, plane1TexCoord).r; + vec2 UV = texture(plane2Texture, plane2TexCoord).ra; + vec4 color = vec4(Y, UV.x, UV.y, 1.); + fragColor = colorMatrix * color * opacity; +} -- cgit v1.2.3