[FFmpeg-devel] [PATCH] lavd/v4l2: allow devices not implementing VIDIOC_G_PARM

Michael Niedermayer michael at niedermayer.cc
Thu Jun 16 16:32:14 CEST 2016


On Thu, Jun 16, 2016 at 10:16:54AM +0200, Benoit Fouet wrote:
> Hi,
> 
> 
> On 15/06/2016 17:21, Niklas Söderlund wrote:
> >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 at ragnatech.se>
> >---
> >  libavdevice/v4l2.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> >
> >diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> >index 103fb10..c8915e0 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;
> 
> LGTM

applied

thx

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160616/1613be1a/attachment.sig>


More information about the ffmpeg-devel mailing list