aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-12 19:44:45 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-12 19:44:45 +0000
commit0105889358a460c725a64aa613d29a5b2004fccd (patch)
tree76fa537f0107422d160102078d176f8db26be730 /libavdevice/v4l2.c
parent9b4bf9c21d5fd01cb4401bec60eb29acc42b8c2a (diff)
downloadffmpeg-0105889358a460c725a64aa613d29a5b2004fccd.tar.gz
Cosmetics: simplify layout of fmt_conversion_table, make it shorter
and more readable. Originally committed as revision 25108 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c91
1 files changed, 16 insertions, 75 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index a3b8968fa0..6b85cf0594 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -78,81 +78,22 @@ struct fmt_map {
};
static struct fmt_map fmt_conversion_table[] = {
- {
- .ff_fmt = PIX_FMT_YUV420P,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_YUV420,
- },
- {
- .ff_fmt = PIX_FMT_YUV422P,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_YUV422P,
- },
- {
- .ff_fmt = PIX_FMT_YUYV422,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_YUYV,
- },
- {
- .ff_fmt = PIX_FMT_UYVY422,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_UYVY,
- },
- {
- .ff_fmt = PIX_FMT_YUV411P,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_YUV411P,
- },
- {
- .ff_fmt = PIX_FMT_YUV410P,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_YUV410,
- },
- {
- .ff_fmt = PIX_FMT_RGB555,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_RGB555,
- },
- {
- .ff_fmt = PIX_FMT_RGB565,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_RGB565,
- },
- {
- .ff_fmt = PIX_FMT_BGR24,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_BGR24,
- },
- {
- .ff_fmt = PIX_FMT_RGB24,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_RGB24,
- },
- {
- .ff_fmt = PIX_FMT_BGRA,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_BGR32,
- },
- {
- .ff_fmt = PIX_FMT_GRAY8,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_GREY,
- },
- {
- .ff_fmt = PIX_FMT_NV12,
- .codec_id = CODEC_ID_RAWVIDEO,
- .v4l2_fmt = V4L2_PIX_FMT_NV12,
- },
- {
- .ff_fmt = PIX_FMT_NONE,
- .codec_id = CODEC_ID_MJPEG,
- .v4l2_fmt = V4L2_PIX_FMT_MJPEG,
- },
- {
- .ff_fmt = PIX_FMT_NONE,
- .codec_id = CODEC_ID_MJPEG,
- .v4l2_fmt = V4L2_PIX_FMT_JPEG,
- },
+ //ff_fmt codec_id v4l2_fmt
+ { PIX_FMT_YUV420P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 },
+ { PIX_FMT_YUV422P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P },
+ { PIX_FMT_YUYV422, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV },
+ { PIX_FMT_UYVY422, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY },
+ { 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_RGB565, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 },
+ { 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_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 },
+ { PIX_FMT_NONE, CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG },
};
static int device_open(AVFormatContext *ctx, uint32_t *capabilities)