summaryrefslogtreecommitdiff
path: root/src/cam
diff options
context:
space:
mode:
Diffstat (limited to 'src/cam')
-rw-r--r--src/cam/buffer_writer.cpp4
-rw-r--r--src/cam/buffer_writer.h3
-rw-r--r--src/cam/capture.cpp3
3 files changed, 4 insertions, 6 deletions
diff --git a/src/cam/buffer_writer.cpp b/src/cam/buffer_writer.cpp
index b7f2ed4f..1c044b06 100644
--- a/src/cam/buffer_writer.cpp
+++ b/src/cam/buffer_writer.cpp
@@ -19,8 +19,7 @@ BufferWriter::BufferWriter(const std::string &pattern)
{
}
-int BufferWriter::write(libcamera::Buffer *buffer, libcamera::BufferMemory *mem,
- const std::string &streamName)
+int BufferWriter::write(libcamera::Buffer *buffer, const std::string &streamName)
{
std::string filename;
size_t pos;
@@ -41,6 +40,7 @@ int BufferWriter::write(libcamera::Buffer *buffer, libcamera::BufferMemory *mem,
if (fd == -1)
return -errno;
+ libcamera::BufferMemory *mem = buffer->mem();
for (libcamera::Plane &plane : mem->planes()) {
void *data = plane.mem();
unsigned int length = plane.length();
diff --git a/src/cam/buffer_writer.h b/src/cam/buffer_writer.h
index 9bea205f..7bf785d1 100644
--- a/src/cam/buffer_writer.h
+++ b/src/cam/buffer_writer.h
@@ -16,8 +16,7 @@ class BufferWriter
public:
BufferWriter(const std::string &pattern = "frame-#.bin");
- int write(libcamera::Buffer *buffer, libcamera::BufferMemory *mem,
- const std::string &streamName);
+ int write(libcamera::Buffer *buffer, const std::string &streamName);
private:
std::string pattern_;
diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp
index 5ffa4ae2..df9602de 100644
--- a/src/cam/capture.cpp
+++ b/src/cam/capture.cpp
@@ -154,7 +154,6 @@ void Capture::requestComplete(Request *request, const std::map<Stream *, Buffer
for (auto it = buffers.begin(); it != buffers.end(); ++it) {
Stream *stream = it->first;
Buffer *buffer = it->second;
- BufferMemory *mem = &stream->buffers()[buffer->index()];
const std::string &name = streamName_[stream];
info << " " << name
@@ -163,7 +162,7 @@ void Capture::requestComplete(Request *request, const std::map<Stream *, Buffer
<< " bytesused: " << buffer->bytesused();
if (writer_)
- writer_->write(buffer, mem, name);
+ writer_->write(buffer, name);
}
std::cout << info.str() << std::endl;