From 9da27d5d844fa1378a4897a637c45ade275cc7e5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 14 Mar 2020 16:14:27 +0200 Subject: libcamera: pipeline_handler: Decouple buffer import and export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the V4L2 buffer orphaning feature, exposed through V4L2VideoDevice::exportBuffers(), to decouple buffer import and export. The PipelineHandler::importFrameBuffers() function is now called for all streams regardless of whether exportFrameBuffers() has been called or not. This simplifies the Camera implementation slightly, and opens the door to additional simplifications. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/framebuffer_allocator.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/libcamera/framebuffer_allocator.cpp') diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp index e79f4a8f..6f7a2e90 100644 --- a/src/libcamera/framebuffer_allocator.cpp +++ b/src/libcamera/framebuffer_allocator.cpp @@ -87,11 +87,6 @@ FrameBufferAllocator::FrameBufferAllocator(std::shared_ptr camera) FrameBufferAllocator::~FrameBufferAllocator() { - for (auto &value : buffers_) { - Stream *stream = value.first; - camera_->freeFrameBuffers(stream); - } - buffers_.clear(); camera_->allocator_ = nullptr; @@ -148,10 +143,6 @@ int FrameBufferAllocator::free(Stream *stream) if (iter == buffers_.end()) return -EINVAL; - int ret = camera_->freeFrameBuffers(stream); - if (ret < 0) - return ret; - std::vector> &buffers = iter->second; buffers.clear(); buffers_.erase(iter); -- cgit v1.2.1