summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2019-01-21 13:27:11 +0100
committerSamuel Gaist <samuel.gaist@idiap.ch>2019-01-29 10:51:37 +0000
commit3c2e902e319ff9329f26103250f43eb540be4302 (patch)
tree978ccbfc8b64549a6196b0308d835d997e3eccf2 /src/qtmultimediaquicktools
parent67c4ec55b12c9c397838e3cf3392b66cbd4c142a (diff)
Fix comment for YUV fragment shaders
The comment contains information which makes it misleading to understand how the components are passed. Change-Id: I29cdb5eec1e8014fa7f0ca3f1a0f54258fdb431f Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools')
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_yuv.cpp4
-rw-r--r--src/qtmultimediaquicktools/shaders/uyvyvideo.frag1
-rw-r--r--src/qtmultimediaquicktools/shaders/uyvyvideo_core.frag3
-rw-r--r--src/qtmultimediaquicktools/shaders/yuyvvideo.frag3
-rw-r--r--src/qtmultimediaquicktools/shaders/yuyvvideo_core.frag3
5 files changed, 9 insertions, 5 deletions
diff --git a/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp b/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp
index 43cd5a2b2..8e4ea01a1 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp
@@ -388,8 +388,8 @@ void QSGVideoMaterial_YUV::bind()
// In YUYV texture the UV plane appears with the 1/2 of image and Y width.
m_planeWidth[1] = fw / 2;
functions->glActiveTexture(GL_TEXTURE1);
- // Either r,b (YUYV) or g,a (UYVY) values are used as source of YV.
- // Additionally Y and V are set per 2 pixels hence only 1/2 of image with is used.
+ // Either r,b (YUYV) or g,a (UYVY) values are used as source of UV.
+ // Additionally U and V are set per 2 pixels hence only 1/2 of image width is used.
// Interpreting this properly in shaders allows to not copy or not make conditionals inside shaders,
// only interpretation of data changes.
bindTexture(m_textureIds[1], m_planeWidth[1], m_frame.height(), m_frame.bits(), GL_RGBA);
diff --git a/src/qtmultimediaquicktools/shaders/uyvyvideo.frag b/src/qtmultimediaquicktools/shaders/uyvyvideo.frag
index 5c62441c2..244464e73 100644
--- a/src/qtmultimediaquicktools/shaders/uyvyvideo.frag
+++ b/src/qtmultimediaquicktools/shaders/uyvyvideo.frag
@@ -1,3 +1,4 @@
+// Reference: qgsvideonode_yuv.cpp:387 to 398
uniform sampler2D yTexture; // Y component passed as GL_LUMINANCE_ALPHA, in uyvy Y = a
uniform sampler2D uvTexture; // UV component passed as RGBA macropixel, in uyvy U = r, V = b
uniform mediump mat4 colorMatrix;
diff --git a/src/qtmultimediaquicktools/shaders/uyvyvideo_core.frag b/src/qtmultimediaquicktools/shaders/uyvyvideo_core.frag
index 75c7de5a6..b151a7c7f 100644
--- a/src/qtmultimediaquicktools/shaders/uyvyvideo_core.frag
+++ b/src/qtmultimediaquicktools/shaders/uyvyvideo_core.frag
@@ -1,5 +1,6 @@
#version 150 core
-uniform sampler2D yTexture; // Y component passed as GL_LUMINANCE_ALPHA, in uyvy Y = a
+// Reference: qgsvideonode_yuv.cpp:387 to 398
+uniform sampler2D yTexture; // Y component passed as GL_RG, in uyvy Y = a
uniform sampler2D uvTexture; // UV component passed as RGBA macropixel, in uyvy U = r, V = b
uniform mat4 colorMatrix;
uniform float opacity;
diff --git a/src/qtmultimediaquicktools/shaders/yuyvvideo.frag b/src/qtmultimediaquicktools/shaders/yuyvvideo.frag
index 5ce8b7366..c2ad65b78 100644
--- a/src/qtmultimediaquicktools/shaders/yuyvvideo.frag
+++ b/src/qtmultimediaquicktools/shaders/yuyvvideo.frag
@@ -1,5 +1,6 @@
+// Reference: qgsvideonode_yuv.cpp:387 to 398
uniform sampler2D yTexture; // Y component passed as GL_LUMINANCE_ALPHA, in yuyv Y = r
-uniform sampler2D uvTexture; // UV component passed as RGBA macropixel, in uyvy U = g, V = a
+uniform sampler2D uvTexture; // UV component passed as RGBA macropixel, in yuyv U = g, V = a
uniform mediump mat4 colorMatrix;
uniform lowp float opacity;
varying highp vec2 qt_TexCoord;
diff --git a/src/qtmultimediaquicktools/shaders/yuyvvideo_core.frag b/src/qtmultimediaquicktools/shaders/yuyvvideo_core.frag
index 010c4a5f2..a30d7818a 100644
--- a/src/qtmultimediaquicktools/shaders/yuyvvideo_core.frag
+++ b/src/qtmultimediaquicktools/shaders/yuyvvideo_core.frag
@@ -1,5 +1,6 @@
#version 150 core
-uniform sampler2D yTexture; // Y component passed as GL_LUMINANCE_ALPHA, in yuyv Y = r
+// Reference: qgsvideonode_yuv.cpp:387 to 398
+uniform sampler2D yTexture; // Y component passed as GL_RG, in yuyv Y = r
uniform sampler2D uvTexture; // UV component passed as RGBA macropixel, in uyvy U = g, V = a
uniform mat4 colorMatrix;
uniform float opacity;