[FFmpeg-devel] [PATCH] V4L2 wait for new frames
samuli.valo at picturall.com
Wed Aug 10 16:09:58 CEST 2011
On 08/10/2011 03:57 PM, Nicolas George wrote:
> Le tridi 23 thermidor, an CCXIX, Samuli Valo a écrit :
> Attached patch adds poll() call before DQBUF to wait until filled
> buffers become available as suggested on v4l2 specs.
> This does not seem correct. The documentation says:
> # By default<constant>VIDIOC_DQBUF</constant> blocks when no buffer is in
> # the outgoing queue. When the<constant>O_NONBLOCK</constant> flag was
> # given to the&func-open; function,<constant>VIDIOC_DQBUF</constant>
> # returns immediately with an&EAGAIN; when no buffer is available.
> And the code surrounding the call to VIDIOC_DQBUF in libavdevice seems
> correct regarding the handling of EAGAIN.
Missed that part and got mislead by 184.108.40.206: "Filled buffers are
dequeued from the outgoing queue with the |VIDIOC_DQBUF|
<http://v4l2spec.bytesex.org/spec-single/v4l2.html#VIDIOC-QBUF> ioctl. To
wait until filled buffers become available this function, |select()|
can be used."
> Did you investigate further? When you get incomplete frames, did ioctl
> return successfully? If so, it could be a kernel bug rather than a ffmpeg
Yes, ioctl returned successfully.
So this seems to be driver problem. At least that poll() patch fixes our
problem until driver is fixed...
With best regards,
* Samuli Valo samuli.valo at picturall.com
* Picturall Ltd. gsm: +358 40 582 9016
More information about the ffmpeg-devel