From d09838ef3e83abc2ad37752b64c91267d7309d95 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Sat, 8 May 2021 10:41:02 +0200 Subject: libcamera: request: Add Request::cancel() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a cancel() function to the Request class that allows to forcefully complete the request and its associated buffers in error state. Only pending requests can be forcefully cancelled. Enforce that by asserting the request state to be RequestPending. Signed-off-by: Jacopo Mondi Reviewed-by: Hirokazu Honda Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- include/libcamera/internal/tracepoints/request.tp | 8 ++++++++ include/libcamera/request.h | 1 + 2 files changed, 9 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp index 9e872951..9c841b97 100644 --- a/include/libcamera/internal/tracepoints/request.tp +++ b/include/libcamera/internal/tracepoints/request.tp @@ -66,6 +66,14 @@ TRACEPOINT_EVENT_INSTANCE( ) ) +TRACEPOINT_EVENT_INSTANCE( + libcamera, + request, + request_cancel, + TP_ARGS( + libcamera::Request *, req + ) +) TRACEPOINT_EVENT( libcamera, diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 4cf5ff3f..5596901d 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -65,6 +65,7 @@ private: friend class PipelineHandler; void complete(); + void cancel(); bool completeBuffer(FrameBuffer *buffer); -- cgit v1.2.1