Re: [MPlayer-dev-eng] MJPEG camera support for v4l2 driver
Aurel made some comments regarding this patch: http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2006-February/040796.htm... 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. - Juuso Räsänen _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
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.htm... 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.
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.htm... 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.
2007/5/25, Trent Piepho <xyzzy@speakeasy.org>: 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@gmail.com JID: voroshil@gmail.com, voroshil@jabber.ru ICQ: 95587719
On Sat, 26 May 2007, Vladimir Voroshilov wrote:
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.
2007/5/25, Trent Piepho <xyzzy@speakeasy.org>: 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?
2007/5/26, Trent Piepho <xyzzy@speakeasy.org>:
On Sat, 26 May 2007, Vladimir Voroshilov wrote:
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.
2007/5/25, Trent Piepho <xyzzy@speakeasy.org>: 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? I decided to use similar, but smaller struct for video ringbuffer data.
Updated patch is attached. It was tested with analog capture card (no mjpeg support) with yuy2,yv12,i420 and uyvy format and no regressions were found. Please test it with mjpeg capable card. Any comments are also welcome. -- Regards, Vladimir Voroshilov mailto:voroshil@gmail.com JID: voroshil@gmail.com, voroshil@jabber.ru ICQ: 95587719
2007/5/30, Vladimir Voroshilov <voroshil@gmail.com>:
Updated patch is attached. It was tested with analog capture card (no mjpeg support) with yuy2,yv12,i420 and uyvy format and no regressions were found. Please test it with mjpeg capable card. Any comments are also welcome.
attached patch is synced with r23440. -- Regards, Vladimir Voroshilov mailto:voroshil@gmail.com JID: voroshil@gmail.com, voroshil@jabber.ru ICQ: 95587719
participants (3)
-
Juuso Räsänen -
Trent Piepho -
Vladimir Voroshilov