aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:58:15 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:59:55 +0100
commit6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch)
tree0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavdevice/v4l2.c
parent60b75186b2c878b6257b43c8fcc0b1356ada218e (diff)
parent9200514ad8717c63f82101dc394f4378854325bf (diff)
downloadffmpeg-6f69f7a8bf6a0d013985578df2ef42ee6b1c7994.tar.gz
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 383033e738..103fb105f2 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -938,8 +938,8 @@ static int v4l2_read_header(AVFormatContext *ctx)
if ((res = v4l2_set_parameters(ctx)) < 0)
goto fail;
- st->codec->pix_fmt = ff_fmt_v4l2ff(desired_format, codec_id);
- s->frame_size = av_image_get_buffer_size(st->codec->pix_fmt,
+ st->codecpar->format = ff_fmt_v4l2ff(desired_format, codec_id);
+ s->frame_size = av_image_get_buffer_size(st->codecpar->format,
s->width, s->height, 1);
if ((res = mmap_init(ctx)) ||
@@ -948,22 +948,22 @@ static int v4l2_read_header(AVFormatContext *ctx)
s->top_field_first = first_field(s);
- st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
- st->codec->codec_id = codec_id;
+ st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+ st->codecpar->codec_id = codec_id;
if (codec_id == AV_CODEC_ID_RAWVIDEO)
- st->codec->codec_tag =
- avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
+ st->codecpar->codec_tag =
+ avcodec_pix_fmt_to_codec_tag(st->codecpar->format);
else if (codec_id == AV_CODEC_ID_H264) {
st->need_parsing = AVSTREAM_PARSE_FULL_ONCE;
}
if (desired_format == V4L2_PIX_FMT_YVU420)
- st->codec->codec_tag = MKTAG('Y', 'V', '1', '2');
+ st->codecpar->codec_tag = MKTAG('Y', 'V', '1', '2');
else if (desired_format == V4L2_PIX_FMT_YVU410)
- st->codec->codec_tag = MKTAG('Y', 'V', 'U', '9');
- st->codec->width = s->width;
- st->codec->height = s->height;
+ st->codecpar->codec_tag = MKTAG('Y', 'V', 'U', '9');
+ st->codecpar->width = s->width;
+ st->codecpar->height = s->height;
if (st->avg_frame_rate.den)
- st->codec->bit_rate = s->frame_size * av_q2d(st->avg_frame_rate) * 8;
+ st->codecpar->bit_rate = s->frame_size * av_q2d(st->avg_frame_rate) * 8;
return 0;