summaryrefslogtreecommitdiffstats
path: root/libavcodec/v4l2_m2m.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2019-08-27 17:21:36 -0700
committerAman Gupta <aman@tmm1.net>2019-09-10 18:52:37 -0700
commit7bb6898b16f3c5b1cd5c4c15ca96278df569ccd2 (patch)
treead14565005692c9de754e0318187102a50ff1750 /libavcodec/v4l2_m2m.c
parentac52e06e56fd0232f13c0da74177181e04172e00 (diff)
downloadffmpeg-streaming-7bb6898b16f3c5b1cd5c4c15ca96278df569ccd2.zip
ffmpeg-streaming-7bb6898b16f3c5b1cd5c4c15ca96278df569ccd2.tar.gz
avcodec/v4l2_m2m: fix av_pix_fmt changing when multiple /dev/video* devices are probed
On the RPI, three different /dev/video devices exist (decoder, scaler, encoder). When probing the devices in order, the originally requested pix fmt would be mutated causing the wrong one to be chosen when a matching device was finally found. Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/v4l2_m2m.c')
-rw-r--r--libavcodec/v4l2_m2m.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c
index 0cf5db2..827662b 100644
--- a/libavcodec/v4l2_m2m.c
+++ b/libavcodec/v4l2_m2m.c
@@ -108,13 +108,13 @@ static int v4l2_probe_driver(V4L2m2mContext* s)
if (ret < 0)
goto done;
- ret = ff_v4l2_context_get_format(&s->output);
+ ret = ff_v4l2_context_get_format(&s->output, 1);
if (ret) {
av_log(s->avctx, AV_LOG_DEBUG, "v4l2 output format not supported\n");
goto done;
}
- ret = ff_v4l2_context_get_format(&s->capture);
+ ret = ff_v4l2_context_get_format(&s->capture, 1);
if (ret) {
av_log(s->avctx, AV_LOG_DEBUG, "v4l2 capture format not supported\n");
goto done;
@@ -222,7 +222,7 @@ int ff_v4l2_m2m_codec_reinit(V4L2m2mContext* s)
ff_v4l2_context_release(&s->capture);
/* 3. get the new capture format */
- ret = ff_v4l2_context_get_format(&s->capture);
+ ret = ff_v4l2_context_get_format(&s->capture, 0);
if (ret) {
av_log(s->avctx, AV_LOG_ERROR, "query the new capture format\n");
return ret;
@@ -273,13 +273,13 @@ int ff_v4l2_m2m_codec_full_reinit(V4L2m2mContext *s)
s->draining = 0;
s->reinit = 0;
- ret = ff_v4l2_context_get_format(&s->output);
+ ret = ff_v4l2_context_get_format(&s->output, 0);
if (ret) {
av_log(log_ctx, AV_LOG_DEBUG, "v4l2 output format not supported\n");
goto error;
}
- ret = ff_v4l2_context_get_format(&s->capture);
+ ret = ff_v4l2_context_get_format(&s->capture, 0);
if (ret) {
av_log(log_ctx, AV_LOG_DEBUG, "v4l2 capture format not supported\n");
goto error;
OpenPOWER on IntegriCloud