If bytesperline > width * bpp, then qv4l2 can't handle that situation correctly,
partially due to missing support for this in qv4l2, partially due to missing
support for this in libv4lconvert.
So before starting capturing, call s_fmt with bytesperline 0 and use whatever
the driver returns.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
m_frame = m_lastFrame = m_fps = 0;
m_capMethod = m_genTab->capMethod();
g_fmt_cap(m_capSrcFormat);
+ s_fmt(m_capSrcFormat);
m_mustConvert = m_showFrames;
if (m_showFrames) {
bool v4l2::try_fmt(v4l2_format &fmt)
{
fmt.fmt.pix.field = V4L2_FIELD_ANY;
+ fmt.fmt.pix.bytesperline = 0;
return ioctl("Try Capture Format", VIDIOC_TRY_FMT, &fmt);
}
bool v4l2::s_fmt(v4l2_format &fmt)
{
+ fmt.fmt.pix.bytesperline = 0;
return ioctl("Set Capture Format", VIDIOC_S_FMT, &fmt);
}