[FFmpeg-devel] [PATCH] allow v4l2 to capture mjpeg streams
Thu Dec 10 09:49:43 CET 2009
On Wed, 2009-12-09 at 22:40 -0800, klchxbec wrote:
> Thanks for the comments. Attaching a revised patch.
Thanks; it looks good now. I am waiting few days so that other people
can comment... Then, if there are no objections from other people I'll
commit your patch.
> >I think the code following these lines will end up by setting a wrong
> >st->codec->bit_rate in case of compressed formats.
> Ok, mjpegdec.c seems to cope fine with this. I can't notice anything
> wrong. Looked at v4l2 api as well as luvcview sources for any clues,
> but don't see what should be done here.
I think the application will see the wrong bit_rate for the stream
(unless something else sets it to the correct value). In my opinion, the
st->codec->bit_rate = s->frame_size * 1/av_q2d(st->codec->time_base) * 8;
should be conditional to s->frame_size > 0. Anyway, I can do it after
committing your patch.
More information about the ffmpeg-devel