From 70b8838b95d47c1e80a60e659ef87820e117b5ae Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 18 Nov 2011 14:48:07 +0100 Subject: [PATCH] qv4l2: make sure to reset bytesperline. 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 --- utils/qv4l2/qv4l2.cpp | 1 + utils/qv4l2/v4l2-api.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp index bde1329..cdf6a50 100644 --- a/utils/qv4l2/qv4l2.cpp +++ b/utils/qv4l2/qv4l2.cpp @@ -467,6 +467,7 @@ void ApplicationWindow::capStart(bool start) 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) { diff --git a/utils/qv4l2/v4l2-api.cpp b/utils/qv4l2/v4l2-api.cpp index c2ec98f..074070a 100644 --- a/utils/qv4l2/v4l2-api.cpp +++ b/utils/qv4l2/v4l2-api.cpp @@ -274,11 +274,13 @@ bool v4l2::g_fmt_out(v4l2_format &fmt) 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); } -- 2.7.4