From 4ff18e95063bbb70f6e0971774fcd2a1b0ad2b58 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 15 Mar 2020 01:27:43 +0200 Subject: libcamera: framebuffer_allocator: Lift camera restrictions on allocator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Camera class currently requires the allocator to have no allocated buffer before the camera is reconfigured, and the allocator to be destroyed before the camera is released. There's no basis for these restrictions anymore, remove them. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/framebuffer_allocator.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src/libcamera/framebuffer_allocator.cpp') diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp index 6f7a2e90..a37b564c 100644 --- a/src/libcamera/framebuffer_allocator.cpp +++ b/src/libcamera/framebuffer_allocator.cpp @@ -53,29 +53,6 @@ LOG_DEFINE_CATEGORY(Allocator) * are provided externally applications shall not use this class. */ -/** - * \brief Create a FrameBuffer allocator - * \param[in] camera The camera the allocator serves - * - * A single allocator may be created for a Camera instance. - * - * The caller is responsible for deleting the allocator before the camera is - * released. - * - * \return A pointer to the newly created allocator object or nullptr on error - */ -FrameBufferAllocator * -FrameBufferAllocator::create(std::shared_ptr camera) -{ - if (camera->allocator_) { - LOG(Allocator, Error) << "Camera already has an allocator"; - return nullptr; - } - - camera->allocator_ = new FrameBufferAllocator(camera); - return camera->allocator_; -} - /** * \brief Construct a FrameBufferAllocator serving a camera * \param[in] camera The camera @@ -88,8 +65,6 @@ FrameBufferAllocator::FrameBufferAllocator(std::shared_ptr camera) FrameBufferAllocator::~FrameBufferAllocator() { buffers_.clear(); - - camera_->allocator_ = nullptr; } /** -- cgit v1.2.1