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

Vladimir Voroshilov voroshil at gmail.com
Fri May 25 19:43:44 CEST 2007


2007/5/25, Trent Piepho <xyzzy at speakeasy.org>:
> 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.
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?


> 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.


-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719



More information about the MPlayer-dev-eng mailing list