[FFmpeg-devel] avdevice/v4l2-common: add Z16 pixel format

Submitted by Pablo Rubio Fernández on Nov. 26, 2018, 3:30 p.m.

Details

Message ID CAHKtxpA9NB51Zc79VwRHnaao_VDw2JRA2KbkfwErPQqDFQHUGg@mail.gmail.com
State New
Headers show

Commit Message

Pablo Rubio Fernández Nov. 26, 2018, 3:30 p.m.
Simple patch to work with Z16 pixel format as gray16le.

Patch hide | download patch | download mbox

From 39e24c9cbbdacc594e47112dabcaed777028d6b6 Mon Sep 17 00:00:00 2001
From: prubio <prubio@elitegrupo.com>
Date: Mon, 26 Nov 2018 10:04:07 +0100
Subject: [PATCH] avdevice/v4l2-common: add Z16 pixel format

Added Z16 pixel format. Works as gray16le.
---
 libavdevice/v4l2-common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavdevice/v4l2-common.c b/libavdevice/v4l2-common.c
index 2d6bfac..7154548 100644
--- a/libavdevice/v4l2-common.c
+++ b/libavdevice/v4l2-common.c
@@ -43,6 +43,9 @@  const struct fmt_map ff_fmt_conversion_table[] = {
     { AV_PIX_FMT_BGR0,    AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32   },
     { AV_PIX_FMT_0RGB,    AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32   },
     { AV_PIX_FMT_GRAY8,   AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY    },
+#ifdef V4L2_PIX_FMT_Z16
+    { AV_PIX_FMT_GRAY16LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Z16    },
+#endif
 #ifdef V4L2_PIX_FMT_Y16
     { AV_PIX_FMT_GRAY16LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_Y16     },
 #endif
-- 
2.7.4