Browse Source

Read h264 headers from v4l2 to allow stream-copying.

Fixes ticket #2882.
Analyzed and tested by William C Bonner.
tags/n2.1
Carl Eugen Hoyos 12 years ago
parent
commit
e337c9d564
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavdevice/v4l2.c

+ 3
- 0
libavdevice/v4l2.c View File

@@ -931,6 +931,9 @@ static int v4l2_read_header(AVFormatContext *s1)
if (codec_id == AV_CODEC_ID_RAWVIDEO) if (codec_id == AV_CODEC_ID_RAWVIDEO)
st->codec->codec_tag = st->codec->codec_tag =
avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
else if (codec_id == AV_CODEC_ID_H264) {
st->need_parsing = AVSTREAM_PARSE_HEADERS;
}
if (desired_format == V4L2_PIX_FMT_YVU420) if (desired_format == V4L2_PIX_FMT_YVU420)
st->codec->codec_tag = MKTAG('Y', 'V', '1', '2'); st->codec->codec_tag = MKTAG('Y', 'V', '1', '2');
else if (desired_format == V4L2_PIX_FMT_YVU410) else if (desired_format == V4L2_PIX_FMT_YVU410)


Loading…
Cancel
Save