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 <hans.verkuil@cisco.com>
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