<div dir="ltr"><div dir="ltr">Hi Jacopo,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 27, 2024 at 6:06 PM Jacopo Mondi <<a href="mailto:jacopo.mondi@ideasonboard.com">jacopo.mondi@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Han-Lin<br>
<br>
On Mon, Aug 26, 2024 at 01:46:30PM GMT, Harvey Yang wrote:<br>
> From: Han-Lin Chen <<a href="mailto:hanlinchen@chromium.org" target="_blank">hanlinchen@chromium.org</a>><br>
><br>
> There seems to be an assumption that a FrameBuffer is success unless<br>
> the pipeline handler canceled the frame, or there is a failure<br>
> processing the FrameBuffer.<br>
<br>
I'm not sure this is actually assumed anywhere.<br>
<br>
The FrameMetadata status is set by the V4L2VideoDevice class at<br>
dequeue buffer time<br>
<br>
src/libcamera/v4l2_videodevice.cpp- metadata.status = buf.flags & V4L2_BUF_FLAG_ERROR<br>
src/libcamera/v4l2_videodevice.cpp- ? FrameMetadata::FrameError<br>
src/libcamera/v4l2_videodevice.cpp: : FrameMetadata::FrameSuccess;<br></blockquote><div> </div><div>Thanks!</div><div>The patch was a temporary workaround in our branch, and accidentally copied here. Sorry for the confusion.</div><div>There was a time when the platform was not following the V4L2 spec and some buffers may not go through the V4L2VideoDevice class, and the status remains undefined, causing some problems during development.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
> Make the assumption specific.<br>
><br>
> Signed-off-by: Han-Lin Chen <<a href="mailto:hanlinchen@chromium.org" target="_blank">hanlinchen@chromium.org</a>><br>
> ---<br>
> include/libcamera/framebuffer.h | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h<br>
> index 5ae2270b3..71202a1d2 100644<br>
> --- a/include/libcamera/framebuffer.h<br>
> +++ b/include/libcamera/framebuffer.h<br>
> @@ -33,7 +33,7 @@ struct FrameMetadata {<br>
> unsigned int bytesused;<br>
> };<br>
><br>
> - Status status;<br>
> + Status status = FrameSuccess;<br>
> unsigned int sequence;<br>
> uint64_t timestamp;<br>
<br>
However, I don't think this hurts but I wonder why sequence or<br>
timestamp are any different.<br></blockquote><div> </div><div>We should re-format the patch to simply add default values to all fields, with a clearer description. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
><br>
> --<br>
> 2.46.0.295.g3b9ea8a38a-goog<br>
><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Cheers.<div>Hanlin Chen</div></div></div></div></div></div></div></div></div></div>