[FFmpeg-devel] Fwd: framebuffer device demuxer

Stefano Sabatini stefano.sabatini-lala
Mon Feb 22 19:30:37 CET 2010

On date Monday 2010-02-22 13:18:27 +0100, Luca Abeni encoded:
> Stefano Sabatini wrote:
> [...]
> >>From a quick look at the patch, the code implementing
> >>the timing seems to be overly complex (and looks wrong
> >>- but I did not completely check). Anyway, this seems
> >>to be the cause for the wrong frame rate I obtain.
> >>Moreover, I believe that support for the NONBLOCK flag
> >>should be implemented before the patch is ready for svn.
> >
> >I vaguely remember the discussion about the NONBLOCK flag when the
> >jackdev input was added, but no more than that. Can you provide some
> >pointers to the discussion?
> I have no pointers to the discussion, but basically every input
> device should support the AVFMT_FLAG_NONBLOCK flag (yes, I know
> there are some input devices that do not support it, but this
> is because they are old input devices that have not been updated
> yet; new code should support AVFMT_FLAG_NONBLOCK).
> There was some discussion about supporting it for output
> devices, but I do not remember the conclusion.
> Anyway, for input devices, it is pretty simple: if
> AVFMT_FLAG_NONBLOCK is set, the input device should never block
> (but return AVERROR(EAGAIN) if no data is available).
> You can look at v4l2.c, alsa input, or vfwcap.c for examples.

Thanks this clarifies.

> >>Finally, a warning: are your sure about the license?
> >>The code claims to be LGPL, but seems to be based on
> >>GPLed code.
> >
> >fbgrab.c is GPLed, at a quick glance doesn't seem they're sharing a
> >significant part of code, while the framebuffer_read_packet() code
> >mostly comes from x11grab.c.
> Exactly. The potential problem is that the comments say:
>  * This file contains code from fbgrab.c:
> (which is release under GPL, as far as I can see)
> [...]
>  * This file contains code from the x11grab.c:
> (which is GPLed too, I think).
> [...]
>  * FFmpeg is free software; you can redistribute it and/or
>  * modify it under the terms of the GNU Lesser General Public
>  * License as published by the Free Software Foundation; either
>  * version 2.1 of the License, or (at your option) any later version.
> [...]
>  * You should have received a copy of the GNU Lesser General Public
>  * License along with FFmpeg; if not, write to the Free Software
> Which looks like a contraddiction (contains code from GPLed, but
> is released under LGPL).
> I did not check which part of the comment is wrong, but I
> think that something has to be fixed, there :)

I removed the attributions which are IMO wrong, as I can't see much
similarity between fbgrab.c and the new code.

As for what regards x11grab.c, the part in read_header() which
computes the timestamp looks just wrong or at least badly obfuscated,
I'm trying to understand it in the meaningwhile if you have some
insight on it please share :).

BTW there is some particular reason for which both in v4l.c and v4l2.c
we open the fd using O_RDWR, rather than just O_RDONLY?

Patch attached is clearly yet missing the non-blocking/EAGAIN

FFmpeg = Fundamental Free Merciful Pitiless Erotic Gnome
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-fb-indev.patch
Type: text/x-diff
Size: 8670 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/ac330c46/attachment.patch>

More information about the ffmpeg-devel mailing list