diff --git a/include/libcamera/request.h b/include/libcamera/request.h index e214a9d1..0c5939f7 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -53,7 +53,7 @@ public: ControlList &metadata() { return *metadata_; } const BufferMap &buffers() const { return bufferMap_; } int addBuffer(const Stream *stream, FrameBuffer *buffer, - std::unique_ptr fence = nullptr); + std::unique_ptr &&fence = {}); FrameBuffer *findBuffer(const Stream *stream) const; uint32_t sequence() const; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 7f1e11e8..26bba8f2 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -452,7 +452,9 @@ void Request::reuse(ReuseFlag flags) * * When a valid Fence is provided to this function, \a fence is moved to \a * buffer and this Request will only be queued to the device once the - * fences of all its buffers have been correctly signalled. + * fences of all its buffers have been correctly signalled. Ownership of the + * fence will only be taken in case of success, otherwise the fence will + * be left unmodified. * * If the \a fence associated with \a buffer isn't signalled, the request will * fail after a timeout. The buffer will still contain the fence, which @@ -468,7 +470,7 @@ void Request::reuse(ReuseFlag flags) * \retval -EINVAL The buffer does not reference a valid Stream */ int Request::addBuffer(const Stream *stream, FrameBuffer *buffer, - std::unique_ptr fence) + std::unique_ptr &&fence) { if (!stream) { LOG(Request, Error) << "Invalid stream reference";