[FFmpeg-devel,PATCHv3,3/4] libavcodec: v4l2: add codec formats

Submitted by Jorge Ramirez-Ortiz on Aug. 2, 2017, 7:32 a.m.

Details

Message ID 1501659172-28626-4-git-send-email-jorge.ramirez-ortiz@linaro.org
State Superseded
Headers show

Commit Message

Jorge Ramirez-Ortiz Aug. 2, 2017, 7:32 a.m.
From: Alexis Ballier <aballier@gentoo.org>

In addition, enable the multi planar raw formats.

Reviewed-by: Jorge Ramirez <jorge.ramirez-ortiz@linaro.org>
Tested-by: Jorge Ramirez <jorge.ramirez-ortiz@linaro.org>
---
 libavcodec/v4l2-common.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Michael Niedermayer Aug. 2, 2017, 1:09 p.m.
On Wed, Aug 02, 2017 at 09:32:51AM +0200, Jorge Ramirez-Ortiz wrote:
> From: Alexis Ballier <aballier@gentoo.org>
> 
> In addition, enable the multi planar raw formats.
> 
> Reviewed-by: Jorge Ramirez <jorge.ramirez-ortiz@linaro.org>
> Tested-by: Jorge Ramirez <jorge.ramirez-ortiz@linaro.org>
> ---
>  libavcodec/v4l2-common.c | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)

LGTM

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/v4l2-common.c b/libavcodec/v4l2-common.c
index 815a5c4..13744fb 100644
--- a/libavcodec/v4l2-common.c
+++ b/libavcodec/v4l2-common.c
@@ -58,6 +58,36 @@  const struct v4l_fmt_map avpriv_v4l_fmt_conversion_table[] = {
     { AV_PIX_FMT_BAYER_GRBG8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SGRBG8 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME },
     { AV_PIX_FMT_BAYER_RGGB8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SRGGB8 , FF_V4L_PACK_AVPACKET | FF_V4L_PACK_AVFRAME },
 #endif
+#ifdef V4L2_PIX_FMT_NV12M
+    { AV_PIX_FMT_NV12,    AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12M      , FF_V4L_PACK_AVFRAME  },
+#endif
+#ifdef V4L2_PIX_FMT_NV21M
+    { AV_PIX_FMT_NV21,    AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV21M      , FF_V4L_PACK_AVFRAME  },
+#endif
+#ifdef V4L2_PIX_FMT_YUV420M
+    { AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420M    , FF_V4L_PACK_AVFRAME  },
+#endif
+#ifdef V4L2_PIX_FMT_NV16M
+    { AV_PIX_FMT_NV16,    AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV16M      , FF_V4L_PACK_AVFRAME  },
+#endif
+#ifdef V4L2_PIX_FMT_DV
+    { AV_PIX_FMT_NONE,    AV_CODEC_ID_DVVIDEO,  V4L2_PIX_FMT_DV         , FF_V4L_PACK_AVPACKET },
+#endif
+#ifdef V4L2_PIX_FMT_H263
+    { AV_PIX_FMT_NONE,    AV_CODEC_ID_H263,     V4L2_PIX_FMT_H263       , FF_V4L_PACK_AVPACKET },
+#endif
+#ifdef V4L2_PIX_FMT_MPEG1
+    { AV_PIX_FMT_NONE,    AV_CODEC_ID_MPEG1VIDEO, V4L2_PIX_FMT_MPEG1    , FF_V4L_PACK_AVPACKET },
+#endif
+#ifdef V4L2_PIX_FMT_MPEG2
+    { AV_PIX_FMT_NONE,    AV_CODEC_ID_MPEG2VIDEO, V4L2_PIX_FMT_MPEG2    , FF_V4L_PACK_AVPACKET },
+#endif
+#ifdef V4L2_PIX_FMT_VC1_ANNEX_G
+    { AV_PIX_FMT_NONE,    AV_CODEC_ID_VC1,      V4L2_PIX_FMT_VC1_ANNEX_G, FF_V4L_PACK_AVPACKET },
+#endif
+#ifdef V4L2_PIX_FMT_VP8
+    { AV_PIX_FMT_NONE,    AV_CODEC_ID_VP8,      V4L2_PIX_FMT_VP8        , FF_V4L_PACK_AVPACKET },
+#endif
     { AV_PIX_FMT_NONE,    AV_CODEC_ID_NONE,     0                    },
 };