libcamera: pipeline_handler: Decouple buffer import and export
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -87,11 +87,6 @@ FrameBufferAllocator::FrameBufferAllocator(std::shared_ptr<Camera> 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<std::unique_ptr<FrameBuffer>> &buffers = iter->second;
|
||||
buffers.clear();
|
||||
buffers_.erase(iter);
|
||||
|
||||
Reference in New Issue
Block a user