From a1c5450be573ebcb1a5acc6453b5fcfdaa9593a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Mon, 25 Nov 2019 17:51:06 +0100 Subject: libcamera: camera: Remove the prepared state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the FrameBuffer rework completed there is no reason to keep the camera prepared state around as buffer allocations are now decoupled from the camera state. Remove the camera state simplifying the API. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/framebuffer_allocator.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libcamera/framebuffer_allocator.cpp') diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp index 57789b24..207a13bd 100644 --- a/src/libcamera/framebuffer_allocator.cpp +++ b/src/libcamera/framebuffer_allocator.cpp @@ -116,8 +116,7 @@ FrameBufferAllocator::~FrameBufferAllocator() */ int FrameBufferAllocator::allocate(Stream *stream) { - if (camera_->state_ != Camera::CameraConfigured && - camera_->state_ != Camera::CameraPrepared) { + if (camera_->state_ != Camera::CameraConfigured) { LOG(Allocator, Error) << "Camera must be in the configured state to allocate buffers"; return -EACCES; @@ -163,7 +162,7 @@ int FrameBufferAllocator::allocate(Stream *stream) */ int FrameBufferAllocator::free(Stream *stream) { - if (camera_->state_ != Camera::CameraConfigured && camera_->state_ != Camera::CameraPrepared) { + if (camera_->state_ != Camera::CameraConfigured) { LOG(Allocator, Error) << "Camera must be in the configured state to free buffers"; return -EACCES; -- cgit v1.2.1