aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2015-02-27 01:34:52 +0100
committerLuca Barbato <lu_zero@gentoo.org>2015-03-02 12:07:59 +0100
commit9a26ba971387a348e14f363ddcdcb5bba0b413d1 (patch)
treece7a973fad21974c245b33beb2fb4f50a0484e4b /libavdevice/v4l2.c
parent619d5e7db88941cadb8136f805564e885c6c6434 (diff)
downloadffmpeg-9a26ba971387a348e14f363ddcdcb5bba0b413d1.tar.gz
v4l2: Add support for h264
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index d2707e6848..3631c1f240 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -111,6 +111,9 @@ static struct fmt_map fmt_conversion_table[] = {
{ AV_PIX_FMT_NV12, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 },
{ AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG },
{ AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG },
+#ifdef V4L2_PIX_FMT_H264
+ { AV_PIX_FMT_NONE, AV_CODEC_ID_H264, V4L2_PIX_FMT_H264 },
+#endif
};
static int device_open(AVFormatContext *ctx)
@@ -782,8 +785,10 @@ static int v4l2_read_header(AVFormatContext *s1)
if (s->pixel_format) {
AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
- if (codec)
+ if (codec) {
s1->video_codec_id = codec->id;
+ st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ }
pix_fmt = av_get_pix_fmt(s->pixel_format);