From: Hans Verkuil Date: Sun, 6 Jul 2014 20:57:04 +0000 (+0200) Subject: qv4l2: make the destination sizeimage large enough X-Git-Tag: v4l-utils-1.3.90~169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d15b4dfb2a191371910a5d72b14fdf7570bb053f;p=platform%2Fupstream%2Fv4l-utils.git qv4l2: make the destination sizeimage large enough Normally v4lconvert_try_format() will make sure that sizeimage is large enough by calling try_fmt(). But if the multiplanar plugin is in use, then v4lconvert_try_format() bypasses that plugin and try_fmt() will fail since the driver expects the _MPLANE buffer types. Normal programs won't use this function, so it won't be a problem there. But in our case the solution is fairly simple: just calculate sizeimage ourselves. Signed-off-by: Hans Verkuil --- diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp index d8a3b6c..29c767f 100644 --- a/utils/qv4l2/qv4l2.cpp +++ b/utils/qv4l2/qv4l2.cpp @@ -1151,6 +1151,9 @@ void ApplicationWindow::capStart(bool start) m_mustConvert = true; dstPix.pixelformat = V4L2_PIX_FMT_RGB24; + // Make sure sizeimage is large enough. This is necessary if the mplane + // plugin is in use since v4lconvert_try_format() bypasses the plugin. + dstPix.sizeimage = dstPix.width * dstPix.height * 3; v4l2_format copy = m_capSrcFormat; v4lconvert_try_format(m_convertData, &m_capDestFormat, &m_capSrcFormat); // v4lconvert_try_format sometimes modifies the source format if it thinks