[FFmpeg-devel] [PATCH] Set frame rate on v4l2 devices

Reimar Döffinger Reimar.Doeffinger
Thu Sep 23 20:55:31 CEST 2010

On Thu, Sep 23, 2010 at 08:28:21AM +0200, Luca Abeni wrote:
> On 09/22/2010 05:11 PM, Jos? Miguel Gon?alves wrote:
> [...]
> >>This patch seems to assume that after calling the VIDIOC_S_PARM
> >>ioctl, the v4l2_streamparm structure is updated by the driver with
> >>the parameters that have actually been set...
> >>However, my tests with a logitech webcam seem to show that this
> >>is not the case. I think you should call VIDIOC_G_PARM after
> >>VIDIOC_S_PARM, to check which parameters have actually been set.
> >>
> >
> >I've also used a Logitech webcam (the QuickCam Sphere AF) with uvcvideo
> >driver, and it works without the VIDIOC_G_PARM call. When I try to set a
> >rate different from the supported ones, the VIDIOC_S_PARM call already
> >returns the modified value.
> >But if the get call is needed for some other devices and/or drivers,
> >let's put it.
> Ok, with VIDIOC_G_PARM things are even worse: the time base is changed to
> 0... :(
> This looks like a driver's bug (I am using something called "gspca_zc3xx",
> I think). So, no need for the VIDIOC_G_PARM thing... I'll run some
> other tests, and then I'll commit your first patch.

Please, please add a comment when you commit such "hacks" that contain
also bug workarounds, otherwise nobody will remember in a few years
why the code is so strange and probably try to "fix" it.

More information about the ffmpeg-devel mailing list