summaryrefslogtreecommitdiff
path: root/src/cam/buffer_writer.cpp
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-11-22 16:22:56 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:38 +0100
commit9217f274f64f690b768d332663e1731a3ee5ef15 (patch)
treeee152928be1eaea656c929e56e27e97b175de435 /src/cam/buffer_writer.cpp
parenteb4030f6c07174a520be1ebd73628e9ae4789569 (diff)
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>
Diffstat (limited to 'src/cam/buffer_writer.cpp')
-rw-r--r--src/cam/buffer_writer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cam/buffer_writer.cpp b/src/cam/buffer_writer.cpp
index 41ef4b0a..1d7366c8 100644
--- a/src/cam/buffer_writer.cpp
+++ b/src/cam/buffer_writer.cpp
@@ -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);