[MPlayer-dev-eng] MJPEG camera support for v4l2 driver

Trent Piepho xyzzy at speakeasy.org
Fri May 25 17:37:49 CEST 2007


On Fri, 25 May 2007, [iso-8859-1] Juuso Räsänen wrote:

>
> > Aurel made some comments regarding this patch:
> > http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2006-February/040796.html
> > The patch has to be changed accordingly to be included.
> > Please do that and resend the patch if you are interested in it.
>
> The patch should be "fixed" now and updated to match with the current SVN-version.

     int h = priv->format.fmt.pix.height;
     int d = pixfmt2depth(priv->format.fmt.pix.pixelformat);
     int bytesperline = w*d/8;
+    int sizeimage = priv->format.fmt.pix.sizeimage ? priv->format.fmt.pix.sizeimage : (bytesperline * h);

The existing code to calculate the image size shouldn't even be necessary.
sizeimage is suppose to already contain it.

For the copy frame function, it's not quite right either.  sizeimage in the
pixel format is the maximum size of a frame.  jpeg compressed frames will
not all be the same size and some will be smaller.  The "bytesused" field
in the v4l2_buffer returned by DQBUF should contain the actual frame size.



More information about the MPlayer-dev-eng mailing list