aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2016-06-15 17:21:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-06-16 16:27:35 +0200
commit6fd4145a1e6b918f0cd1dc268fa703c1cec6fd96 (patch)
tree6f2ddcc90fa40b69202c2e9f6aba5627b90f314a
parenteaa11437a47ec5240b19226456e63a015a2efa01 (diff)
downloadffmpeg-6fd4145a1e6b918f0cd1dc268fa703c1cec6fd96.tar.gz
lavd/v4l2: allow devices not implementing VIDIOC_G_PARM
Not all v4l2 devices implement the VIDIOC_G_PARM ioctl. This patch allow ffmpeg to open such device and treat it the same as devices that do implement the ioctl but returns that it do not implement the V4L2_CAP_TIMEPERFRAME capability. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Benoit Fouet <benoit.fouet@free.fr> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavdevice/v4l2.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 103fb105f2..c8915e0067 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -715,11 +715,8 @@ static int v4l2_set_parameters(AVFormatContext *ctx)
streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (v4l2_ioctl(s->fd, VIDIOC_G_PARM, &streamparm) < 0) {
ret = AVERROR(errno);
- av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_G_PARM): %s\n", av_err2str(ret));
- return ret;
- }
-
- if (framerate_q.num && framerate_q.den) {
+ av_log(ctx, AV_LOG_WARNING, "ioctl(VIDIOC_G_PARM): %s\n", av_err2str(ret));
+ } else if (framerate_q.num && framerate_q.den) {
if (streamparm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME) {
tpf = &streamparm.parm.capture.timeperframe;