summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline/raspberrypi/rpi_stream.cpp')
-rw-r--r--src/libcamera/pipeline/raspberrypi/rpi_stream.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
index aee0aa2d..2dcf96ca 100644
--- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
+++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
@@ -68,6 +68,20 @@ int RPiStream::getBufferId(FrameBuffer *buffer) const
return it->first;
}
+void RPiStream::setExternalBuffer(FrameBuffer *buffer)
+{
+ bufferMap_.emplace(RPiBufferMask::EXTERNAL_BUFFER | id_.get(), buffer);
+}
+
+void RPiStream::removeExternalBuffer(FrameBuffer *buffer)
+{
+ int id = getBufferId(buffer);
+
+ /* Ensure we have this buffer in the stream, and it is marked external. */
+ ASSERT(id != -1 && (id & RPiBufferMask::EXTERNAL_BUFFER));
+ bufferMap_.erase(id);
+}
+
int RPiStream::prepareBuffers(unsigned int count)
{
int ret;