Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Leontiev <aleontiev@elvees.com>2018-05-10 18:31:20 +0300
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-05-10 23:40:57 +0300
commit94818025394b5e840a2c94ce8ddd501c8cc17652 (patch)
tree57e8adf20fc84863a48226fe1f41551a5694e740 /libavdevice
parent0612e29b59d46942f732d6d59dbc863ac1b1e980 (diff)
lavd/v4l2: Add ARGB and XRGB packed pixel formats
Formats ARGB32, XRGB32, ABGR32, and XBGR32 were added to V4L2 instead of ill-defined deprecated RGB32/BGR32 pixel formats. When pixel format is not specified explicitly FFmpeg tries formats in order in which they are stored in the table. Therefore formats are sorted as follows: BGR is preferred over RGB and XBGR is preferred over ARGB, because it could give better performance by ignoring alpha component.
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/v4l2-common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavdevice/v4l2-common.c b/libavdevice/v4l2-common.c
index 196c09b7fc..2d6bfac8ca 100644
--- a/libavdevice/v4l2-common.c
+++ b/libavdevice/v4l2-common.c
@@ -34,6 +34,12 @@ const struct fmt_map ff_fmt_conversion_table[] = {
{ AV_PIX_FMT_RGB565BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X },
{ AV_PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 },
{ AV_PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 },
+#ifdef V4L2_PIX_FMT_XBGR32
+ { AV_PIX_FMT_BGR0, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_XBGR32 },
+ { AV_PIX_FMT_0RGB, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_XRGB32 },
+ { AV_PIX_FMT_BGRA, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_ABGR32 },
+ { AV_PIX_FMT_ARGB, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_ARGB32 },
+#endif
{ 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 },