[libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process pending messages

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Mar 13 22:33:59 CET 2021


Hi Kieran,

Thank you for the (my ;-)) patch.

On Fri, Mar 12, 2021 at 05:47:21AM +0000, Kieran Bingham wrote:
> From: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> 
> Events may be queued to the pipeline handler between the pipeline
> handler entering the ::stop() function, and before the call to stop the
> IPA has completed.
> 
> Handle these events by dispatching all pending messages at the proxy
> after the IPA has fully stopped.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

This can go in a follow-up patch, but we need to document the fact that
pipeline handlers shall expect events to be delivered while they're
blocked on stop().

> ---
>  utils/ipc/generators/libcamera_templates/proxy_functions.tmpl | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
> index 13dc8fdcab6e..8addc2fad0a8 100644
> --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
> @@ -31,6 +31,8 @@
>  	thread_.exit();
>  	thread_.wait();
>  
> +	Thread::current()->dispatchMessages(Message::Type::InvokeMessage);
> +
>  	running_ = false;
>  {%- endmacro -%}
>  

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list