]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/v4l2.c
Merge commit 'ad8aa8e6c648b61f01b9f106f27b9d4f3d094345'
[ffmpeg] / libavdevice / v4l2.c
index 383033e738936590cb918a784733d768fe297bda..103fb105f2789c53b484a45ec7dc79fcf3fc52fd 100644 (file)
@@ -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;