[FFmpeg-devel] [PATCH]Add some v4l raw codecs

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Jan 2 17:02:10 CET 2012


Hi!

I tested attached on Intel hardware, and it makes me wonder if the existing 
RGB15 and RGB16 mappings are correct...

The order of fmt_conversion_table[] also seems strange to me, less bpp is 
preferred over more bpp. Should this be changed?
Finally, passing fourccs instead of pix_fmts would allow to support YV12.

Is it a bug that libswscale does not remove transparency for RGB0 -> RGBA?
Or should the user (application) realize that this is not a useful conversion?

Please comment, Carl Eugen

(My v4l hardware does not support Y41P.)
-------------- next part --------------
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 15356fe..72079d4 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -114,10 +114,13 @@ static struct fmt_map fmt_conversion_table[] = {
     { PIX_FMT_YUV411P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P },
     { PIX_FMT_YUV410P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410  },
     { PIX_FMT_RGB555,  CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555  },
+    { PIX_FMT_RGB555BE,CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555X },
     { PIX_FMT_RGB565,  CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565  },
+    { PIX_FMT_RGB565BE,CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X },
     { PIX_FMT_BGR24,   CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24   },
     { PIX_FMT_RGB24,   CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24   },
-    { PIX_FMT_BGRA,    CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32   },
+    { PIX_FMT_BGR0,    CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32   },
+    { PIX_FMT_0RGB,    CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32   },
     { PIX_FMT_GRAY8,   CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY    },
     { PIX_FMT_NV12,    CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12    },
     { PIX_FMT_NONE,    CODEC_ID_MJPEG,    V4L2_PIX_FMT_MJPEG   },


More information about the ffmpeg-devel mailing list