libcamera: camera: Remove the prepared state
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 <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
6cd505ac89
commit
a1c5450be5
10 changed files with 22 additions and 223 deletions
|
@ -174,11 +174,6 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
if (camera_->allocateBuffers()) {
|
||||
std::cout << "Failed to allocate buffers" << std::endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
Stream *stream = cfg.stream();
|
||||
|
||||
BufferSource source;
|
||||
|
@ -244,11 +239,6 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
if (camera_->freeBuffers()) {
|
||||
std::cout << "Failed to free buffers" << std::endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
return TestPass;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,11 +87,6 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
if (camera_->allocateBuffers()) {
|
||||
cout << "Failed to allocate buffers" << endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
Stream *stream = cfg.stream();
|
||||
|
||||
int ret = allocator_->allocate(stream);
|
||||
|
@ -158,11 +153,6 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
if (camera_->freeBuffers()) {
|
||||
cout << "Failed to free buffers" << endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
return TestPass;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,12 +29,6 @@ protected:
|
|||
if (camera_->configure(defconf_.get()) != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->allocateBuffers() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->freeBuffers() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->createRequest())
|
||||
return TestFail;
|
||||
|
||||
|
@ -65,12 +59,6 @@ protected:
|
|||
if (camera_->acquire() != -EBUSY)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->allocateBuffers() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->freeBuffers() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->createRequest())
|
||||
return TestFail;
|
||||
|
||||
|
@ -103,57 +91,6 @@ protected:
|
|||
if (camera_->acquire() != -EBUSY)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->freeBuffers() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->createRequest())
|
||||
return TestFail;
|
||||
|
||||
Request request(camera_.get());
|
||||
if (camera_->queueRequest(&request) != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->start() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->stop() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
/* Test operations which should pass. */
|
||||
if (camera_->configure(defconf_.get()))
|
||||
return TestFail;
|
||||
|
||||
/* Test valid state transitions, end in Prepared state. */
|
||||
if (camera_->release())
|
||||
return TestFail;
|
||||
|
||||
if (camera_->acquire())
|
||||
return TestFail;
|
||||
|
||||
if (camera_->configure(defconf_.get()))
|
||||
return TestFail;
|
||||
|
||||
if (camera_->allocateBuffers())
|
||||
return TestFail;
|
||||
|
||||
return TestPass;
|
||||
}
|
||||
|
||||
int testPrepared()
|
||||
{
|
||||
/* Test operations which should fail. */
|
||||
if (camera_->acquire() != -EBUSY)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->release() != -EBUSY)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->configure(defconf_.get()) != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->allocateBuffers() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
Request request1(camera_.get());
|
||||
if (camera_->queueRequest(&request1) != -EACCES)
|
||||
return TestFail;
|
||||
|
@ -170,9 +107,6 @@ protected:
|
|||
delete request2;
|
||||
|
||||
/* Test valid state transitions, end in Running state. */
|
||||
if (camera_->freeBuffers())
|
||||
return TestFail;
|
||||
|
||||
if (camera_->release())
|
||||
return TestFail;
|
||||
|
||||
|
@ -182,9 +116,6 @@ protected:
|
|||
if (camera_->configure(defconf_.get()))
|
||||
return TestFail;
|
||||
|
||||
if (camera_->allocateBuffers())
|
||||
return TestFail;
|
||||
|
||||
/* Use internally allocated buffers. */
|
||||
allocator_ = FrameBufferAllocator::create(camera_);
|
||||
Stream *stream = *camera_->streams().begin();
|
||||
|
@ -209,12 +140,6 @@ protected:
|
|||
if (camera_->configure(defconf_.get()) != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->allocateBuffers() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->freeBuffers() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
if (camera_->start() != -EACCES)
|
||||
return TestFail;
|
||||
|
||||
|
@ -236,9 +161,6 @@ protected:
|
|||
|
||||
delete allocator_;
|
||||
|
||||
if (camera_->freeBuffers())
|
||||
return TestFail;
|
||||
|
||||
if (camera_->release())
|
||||
return TestFail;
|
||||
|
||||
|
@ -276,11 +198,6 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
if (testPrepared() != TestPass) {
|
||||
cout << "State machine in Prepared state failed" << endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
if (testRuning() != TestPass) {
|
||||
cout << "State machine in Running state failed" << endl;
|
||||
return TestFail;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue