@@ -1270,6 +1270,16 @@ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer)
Request *request = info->request;
+ /*
+ * The ImgU processes the first frame after starting with parameters
+ * left over from the previous configuration. After a change of the
+ * output size, this produces horizontal bars of random colours. Report
+ * the first frame as an error so that applications drop it.
+ */
+ if (request->sequence() == 0 &&
+ buffer->metadata().status == FrameMetadata::FrameSuccess)
+ buffer->_d()->metadata().status = FrameMetadata::FrameError;
+
pipe()->completeBuffer(request, buffer);
request->_d()->metadata().set(controls::draft::PipelineDepth, 3);
After the output size of the ImgU changes, the first frame it produces is processed with parameters left over from the previous configuration and contains horizontal bars of random colours. Applications show this frame, for instance as a flash of pink and blue bars when a video call preview opens. On an OV9734, alternating between 1280x704, 640x360 and 1024x576 with v4l2-ctl through the V4L2 compatibility layer, the first frame after each size change has a strong colour cast (an average V offset of +24 to -41 against 0 to 3 for the following frames), and the following frames are correct. Report the ImgU output buffers of the first request as FrameError, so that applications drop them. The V4L2 compatibility layer passes this on as V4L2_BUF_FLAG_ERROR. Signed-off-by: GuyliandeJong <guyliandejong@proton.me> --- src/libcamera/pipeline/ipu3/ipu3.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+)