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:
@@ -22,7 +22,7 @@ BufferWriter::BufferWriter(const std::string &pattern)
|
||||
{
|
||||
}
|
||||
|
||||
int BufferWriter::write(Buffer *buffer, const std::string &streamName)
|
||||
int BufferWriter::write(FrameBuffer *buffer, const std::string &streamName)
|
||||
{
|
||||
std::string filename;
|
||||
size_t pos;
|
||||
@@ -43,8 +43,7 @@ int BufferWriter::write(Buffer *buffer, const std::string &streamName)
|
||||
if (fd == -1)
|
||||
return -errno;
|
||||
|
||||
BufferMemory *mem = buffer->mem();
|
||||
for (const FrameBuffer::Plane &plane : mem->planes()) {
|
||||
for (const FrameBuffer::Plane &plane : buffer->planes()) {
|
||||
/* \todo Once the FrameBuffer is done cache mapped memory. */
|
||||
void *data = mmap(NULL, plane.length, PROT_READ, MAP_SHARED,
|
||||
plane.fd.fd(), 0);
|
||||
|
||||
Reference in New Issue
Block a user