Commit 6fd4145a authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Michael Niedermayer

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: 's avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: 's avatarBenoit Fouet <benoit.fouet@free.fr>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent eaa11437
...@@ -715,11 +715,8 @@ static int v4l2_set_parameters(AVFormatContext *ctx) ...@@ -715,11 +715,8 @@ static int v4l2_set_parameters(AVFormatContext *ctx)
streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (v4l2_ioctl(s->fd, VIDIOC_G_PARM, &streamparm) < 0) { if (v4l2_ioctl(s->fd, VIDIOC_G_PARM, &streamparm) < 0) {
ret = AVERROR(errno); ret = AVERROR(errno);
av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_G_PARM): %s\n", av_err2str(ret)); av_log(ctx, AV_LOG_WARNING, "ioctl(VIDIOC_G_PARM): %s\n", av_err2str(ret));
return ret; } else if (framerate_q.num && framerate_q.den) {
}
if (framerate_q.num && framerate_q.den) {
if (streamparm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME) { if (streamparm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME) {
tpf = &streamparm.parm.capture.timeperframe; tpf = &streamparm.parm.capture.timeperframe;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment