libcamera: Switch to FrameBuffer interface

Switch to the FrameBuffer interface where all buffers are treated as
external buffers and are allocated outside the camera. Applications
allocating buffers using libcamera are switched to use the
FrameBufferAllocator helper.

Follow-up changes to this one will finalize the transition to the new
FrameBuffer interface by removing code that is left unused after this
change.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund 2019-11-22 16:22:56 +01:00
parent eb4030f6c0
commit 9217f274f6
23 changed files with 267 additions and 368 deletions

View file

@ -185,6 +185,12 @@ protected:
if (camera_->allocateBuffers())
return TestFail;
/* Use internally allocated buffers. */
allocator_ = FrameBufferAllocator::create(camera_);
Stream *stream = *camera_->streams().begin();
if (allocator_->allocate(stream) < 0)
return TestFail;
if (camera_->start())
return TestFail;
@ -218,8 +224,7 @@ protected:
return TestFail;
Stream *stream = *camera_->streams().begin();
std::unique_ptr<Buffer> buffer = stream->createBuffer(0);
if (request->addBuffer(stream, std::move(buffer)))
if (request->addBuffer(stream, allocator_->buffers(stream)[0].get()))
return TestFail;
if (camera_->queueRequest(request))
@ -229,6 +234,8 @@ protected:
if (camera_->stop())
return TestFail;
delete allocator_;
if (camera_->freeBuffers())
return TestFail;
@ -283,6 +290,7 @@ protected:
}
std::unique_ptr<CameraConfiguration> defconf_;
FrameBufferAllocator *allocator_;
};
} /* namespace */