projects
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
619d5e7
)
v4l2: Add support for h264
author
Luca Barbato
<lu_zero@gentoo.org>
Fri, 27 Feb 2015 00:34:52 +0000
(
01:34
+0100)
committer
Luca Barbato
<lu_zero@gentoo.org>
Mon, 2 Mar 2015 11:07:59 +0000
(12:07 +0100)
libavdevice/v4l2.c
patch
|
blob
|
blame
|
history
diff --git
a/libavdevice/v4l2.c
b/libavdevice/v4l2.c
index
d2707e6
..
3631c1f
100644
(file)
--- 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 },
{ 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)
};
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 (s->pixel_format) {
AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
- if (codec)
+ if (codec)
{
s1->video_codec_id = codec->id;
s1->video_codec_id = codec->id;
+ st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ }
pix_fmt = av_get_pix_fmt(s->pixel_format);
pix_fmt = av_get_pix_fmt(s->pixel_format);