[libcamera-devel,2/2] libcamera: pipeline_handler: Update request usage comment
diff mbox series

Message ID 20210302122341.83985-3-kieran.bingham@ideasonboard.com
State Accepted
Commit 8c81ab298eb19541bb7a37db5a34434c23a8a18d
Headers show
Series
  • libcamera: Request: Catch double completions
Related show

Commit Message

Kieran Bingham March 2, 2021, 12:23 p.m. UTC
When a pipeline handler completes a request, the request itself is not
deleted by libcamera, and the application regains control over the
object. It may choose to delete the Request, or re-use it.

Clarify this in the comment by removing the declaration that the Request
is deleted, but state that it is no longer managed by the pipeline
handler and must not be accessed further after this function returns.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/pipeline_handler.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart March 2, 2021, 12:29 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Tue, Mar 02, 2021 at 12:23:41PM +0000, Kieran Bingham wrote:
> When a pipeline handler completes a request, the request itself is not
> deleted by libcamera, and the application regains control over the
> object. It may choose to delete the Request, or re-use it.
> 
> Clarify this in the comment by removing the declaration that the Request
> is deleted, but state that it is no longer managed by the pipeline
> handler and must not be accessed further after this function returns.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Thank you for the patch.

> ---
>  src/libcamera/pipeline_handler.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index aff83af2e90e..0255d9476de0 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -432,8 +432,8 @@ bool PipelineHandler::completeBuffer(Request *request, FrameBuffer *buffer)
>   * \param[in] request The request that has completed
>   *
>   * The pipeline handler shall call this method to notify the \a camera that the
> - * request has completed. The request is deleted and shall not be accessed once
> - * this method returns.
> + * request has completed. The request is no longer managed by the pipeline
> + * handler and shall not be accessed once this method returns.
>   *
>   * This method ensures that requests will be returned to the application in
>   * submission order, the pipeline handler may call it on any complete request
Kieran Bingham March 2, 2021, 12:41 p.m. UTC | #2
On 02/03/2021 12:29, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Thank you for the patch.

You're welcome.


> On Tue, Mar 02, 2021 at 12:23:41PM +0000, Kieran Bingham wrote:
>> When a pipeline handler completes a request, the request itself is not
>> deleted by libcamera, and the application regains control over the
>> object. It may choose to delete the Request, or re-use it.
>>
>> Clarify this in the comment by removing the declaration that the Request
>> is deleted, but state that it is no longer managed by the pipeline
>> handler and must not be accessed further after this function returns.
>>
>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> Thank you for the patch.

You're welcome.

Anything else to add?



>> ---
>>  src/libcamera/pipeline_handler.cpp | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
>> index aff83af2e90e..0255d9476de0 100644
>> --- a/src/libcamera/pipeline_handler.cpp
>> +++ b/src/libcamera/pipeline_handler.cpp
>> @@ -432,8 +432,8 @@ bool PipelineHandler::completeBuffer(Request *request, FrameBuffer *buffer)
>>   * \param[in] request The request that has completed
>>   *
>>   * The pipeline handler shall call this method to notify the \a camera that the
>> - * request has completed. The request is deleted and shall not be accessed once
>> - * this method returns.
>> + * request has completed. The request is no longer managed by the pipeline
>> + * handler and shall not be accessed once this method returns.
>>   *
>>   * This method ensures that requests will be returned to the application in
>>   * submission order, the pipeline handler may call it on any complete request
>
Umang Jain March 2, 2021, 12:44 p.m. UTC | #3
Hi Kieran

On 3/2/21 5:53 PM, Kieran Bingham wrote:
> When a pipeline handler completes a request, the request itself is not
> deleted by libcamera, and the application regains control over the
> object. It may choose to delete the Request, or re-use it.
>
> Clarify this in the comment by removing the declaration that the Request
> is deleted, but state that it is no longer managed by the pipeline
> handler and must not be accessed further after this function returns.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
> ---
>   src/libcamera/pipeline_handler.cpp | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index aff83af2e90e..0255d9476de0 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -432,8 +432,8 @@ bool PipelineHandler::completeBuffer(Request *request, FrameBuffer *buffer)
>    * \param[in] request The request that has completed
>    *
>    * The pipeline handler shall call this method to notify the \a camera that the
> - * request has completed. The request is deleted and shall not be accessed once
> - * this method returns.
> + * request has completed. The request is no longer managed by the pipeline
> + * handler and shall not be accessed once this method returns.
>    *
>    * This method ensures that requests will be returned to the application in
>    * submission order, the pipeline handler may call it on any complete request
Laurent Pinchart March 2, 2021, 2:04 p.m. UTC | #4
Hi Kieran,

On Tue, Mar 02, 2021 at 12:41:40PM +0000, Kieran Bingham wrote:
> On 02/03/2021 12:29, Laurent Pinchart wrote:
> > On Tue, Mar 02, 2021 at 12:23:41PM +0000, Kieran Bingham wrote:
> >> When a pipeline handler completes a request, the request itself is not
> >> deleted by libcamera, and the application regains control over the
> >> object. It may choose to delete the Request, or re-use it.
> >>
> >> Clarify this in the comment by removing the declaration that the Request
> >> is deleted, but state that it is no longer managed by the pipeline
> >> handler and must not be accessed further after this function returns.
> >>
> >> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > 
> > Thank you for the patch.
> 
> You're welcome.
> 
> Anything else to add?

Maybe... After a nap :-)

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> >> ---
> >>  src/libcamera/pipeline_handler.cpp | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> >> index aff83af2e90e..0255d9476de0 100644
> >> --- a/src/libcamera/pipeline_handler.cpp
> >> +++ b/src/libcamera/pipeline_handler.cpp
> >> @@ -432,8 +432,8 @@ bool PipelineHandler::completeBuffer(Request *request, FrameBuffer *buffer)
> >>   * \param[in] request The request that has completed
> >>   *
> >>   * The pipeline handler shall call this method to notify the \a camera that the
> >> - * request has completed. The request is deleted and shall not be accessed once
> >> - * this method returns.
> >> + * request has completed. The request is no longer managed by the pipeline
> >> + * handler and shall not be accessed once this method returns.
> >>   *
> >>   * This method ensures that requests will be returned to the application in
> >>   * submission order, the pipeline handler may call it on any complete request
Niklas Söderlund March 6, 2021, 11:01 p.m. UTC | #5
Hi Kieran,

On 2021-03-02 12:23:41 +0000, Kieran Bingham wrote:
> When a pipeline handler completes a request, the request itself is not
> deleted by libcamera, and the application regains control over the
> object. It may choose to delete the Request, or re-use it.
> 
> Clarify this in the comment by removing the declaration that the Request
> is deleted, but state that it is no longer managed by the pipeline
> handler and must not be accessed further after this function returns.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/pipeline_handler.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index aff83af2e90e..0255d9476de0 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -432,8 +432,8 @@ bool PipelineHandler::completeBuffer(Request *request, FrameBuffer *buffer)
>   * \param[in] request The request that has completed
>   *
>   * The pipeline handler shall call this method to notify the \a camera that the
> - * request has completed. The request is deleted and shall not be accessed once
> - * this method returns.
> + * request has completed. The request is no longer managed by the pipeline
> + * handler and shall not be accessed once this method returns.
>   *
>   * This method ensures that requests will be returned to the application in
>   * submission order, the pipeline handler may call it on any complete request
> -- 
> 2.25.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index aff83af2e90e..0255d9476de0 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -432,8 +432,8 @@  bool PipelineHandler::completeBuffer(Request *request, FrameBuffer *buffer)
  * \param[in] request The request that has completed
  *
  * The pipeline handler shall call this method to notify the \a camera that the
- * request has completed. The request is deleted and shall not be accessed once
- * this method returns.
+ * request has completed. The request is no longer managed by the pipeline
+ * handler and shall not be accessed once this method returns.
  *
  * This method ensures that requests will be returned to the application in
  * submission order, the pipeline handler may call it on any complete request