[MPlayer-dev-eng] MJPEG camera support for v4l2 driver
Trent Piepho
xyzzy at speakeasy.org
Sat May 26 15:07:43 CEST 2007
On Sat, 26 May 2007, Vladimir Voroshilov wrote:
> 2007/5/25, Trent Piepho <xyzzy at speakeasy.org>:
> > > 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.
> priv->format.fmt.pix.sizeimage will always have nonzero value. Thus
> sizeimage variable will be always equal to
> priv->format.fmt.pix.sizeimage. Did i undestand right?
Yes, sizeimage should never be zero, or it's a bug in the driver.
> > 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.
> This will require another ringbuffer to store "bytesused" values for
> each frame for future return in get_video_frame_size.
Wouldn't it be simpler to just have one ring buffer of v4l2_buffer structs?
More information about the MPlayer-dev-eng
mailing list