aboutsummaryrefslogtreecommitdiff
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorLuca Abeni2009-12-14 10:33:24 +0000
committerLuca Abeni2009-12-14 10:33:24 +0000
commit9eb6e9d9d3387adf12a2517d68d458852f9232ef (patch)
tree073d116e9406058b0f81b90e4841c24a6dc89b7d /libavdevice/v4l2.c
parent9202218e5ddfa29bff95a787aaf07148289ce782 (diff)
Add support for V4L2 compressed formats in the table used for converting
between V4L2 formats and ffmpeg's formats/codecs. Patch by klchxbec AT freenet DOT de. Originally committed as revision 20857 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 5091cd4725..e06a91f11b 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -72,58 +72,81 @@ struct buff_data {
struct fmt_map {
enum PixelFormat ff_fmt;
+ enum CodecID codec_id;
uint32_t v4l2_fmt;
};
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_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,
+ },
};
static int device_open(AVFormatContext *ctx, uint32_t *capabilities)