summaryrefslogtreecommitdiff
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
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;