aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-09-13 15:29:45 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2017-09-13 15:29:45 +0200
commitd7c41e2576c09f37b33fe8bf2e38615703086045 (patch)
tree9495d9e50469b710060c58e9714e0c26110ab508
parent019d01f3fa2cd34376211b0223c2aa7221670334 (diff)
qv4l2: add Z16 depth support.
It's effectively identical to Y16, so easy to add support for this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/qv4l2/capture-win-gl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/qv4l2/capture-win-gl.cpp b/utils/qv4l2/capture-win-gl.cpp
index 65100e26..deb8efd3 100644
--- a/utils/qv4l2/capture-win-gl.cpp
+++ b/utils/qv4l2/capture-win-gl.cpp
@@ -396,6 +396,7 @@ bool CaptureWinGLEngine::hasNativeFormat(__u32 format)
V4L2_PIX_FMT_YUV565,
V4L2_PIX_FMT_YUV32,
V4L2_PIX_FMT_GREY,
+ V4L2_PIX_FMT_Z16,
V4L2_PIX_FMT_Y16,
V4L2_PIX_FMT_Y16_BE,
V4L2_PIX_FMT_HSV24,
@@ -507,6 +508,7 @@ void CaptureWinGLEngine::changeShader()
case V4L2_PIX_FMT_ARGB32:
case V4L2_PIX_FMT_ABGR32:
case V4L2_PIX_FMT_GREY:
+ case V4L2_PIX_FMT_Z16:
case V4L2_PIX_FMT_Y16:
case V4L2_PIX_FMT_Y16_BE:
case V4L2_PIX_FMT_HSV24:
@@ -630,6 +632,7 @@ void CaptureWinGLEngine::paintGL()
break;
case V4L2_PIX_FMT_GREY:
+ case V4L2_PIX_FMT_Z16:
case V4L2_PIX_FMT_Y16:
case V4L2_PIX_FMT_Y16_BE:
case V4L2_PIX_FMT_RGB332:
@@ -1545,6 +1548,7 @@ void CaptureWinGLEngine::shader_RGB(__u32 format)
m_xfer_func != V4L2_XFER_FUNC_SRGB ||
format == V4L2_PIX_FMT_BGR666 ||
format == V4L2_PIX_FMT_GREY ||
+ format == V4L2_PIX_FMT_Z16 ||
format == V4L2_PIX_FMT_Y16 ||
format == V4L2_PIX_FMT_Y16_BE ||
format == V4L2_PIX_FMT_HSV24 ||
@@ -1615,6 +1619,7 @@ void CaptureWinGLEngine::shader_RGB(__u32 format)
glTexImage2D(GL_TEXTURE_2D, 0, m_glRed, m_frameWidth, m_frameHeight, 0,
m_glRed, GL_UNSIGNED_BYTE, NULL);
break;
+ case V4L2_PIX_FMT_Z16:
case V4L2_PIX_FMT_Y16:
case V4L2_PIX_FMT_Y16_BE:
glTexImage2D(GL_TEXTURE_2D, 0, m_glRed, m_frameWidth, m_frameHeight, 0,
@@ -1664,6 +1669,7 @@ void CaptureWinGLEngine::shader_RGB(__u32 format)
" float b = color.r;";
break;
case V4L2_PIX_FMT_GREY:
+ case V4L2_PIX_FMT_Z16:
case V4L2_PIX_FMT_Y16:
case V4L2_PIX_FMT_Y16_BE:
codeHead += " float r = color.r;"
@@ -1748,6 +1754,7 @@ void CaptureWinGLEngine::render_RGB(__u32 format)
break;
case V4L2_PIX_FMT_Y16:
+ case V4L2_PIX_FMT_Z16:
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_frameWidth, m_frameHeight,
m_glRed, GL_UNSIGNED_SHORT, m_frameData);
break;

Privacy Policy