summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-02-07 15:12:12 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-02-10 09:45:33 +0200
commit73e5102ad4ce3e8984115c5e1f524f34fa645ed5 (patch)
tree0f00a317087c8cee9f9bf03960518261173c64da /src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
parent110c26b317c783a48c97badd93c006f6c2ae834b (diff)
pipeline: raspberrypi: Allow Stream::returnBuffer() to handle internal buffers
If Stream::returnBuffer() gets passed an internally allocated buffer, it now simply re-queues it back to the device. With this change, the pipeline handler code can be simplified slightly as it does not need multiple code paths for internally allocated and non-internally allocated buffers. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/raspberrypi/rpi_stream.cpp')
-rw-r--r--src/libcamera/pipeline/raspberrypi/rpi_stream.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
index a421ad09..f446e1ce 100644
--- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
+++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
@@ -163,8 +163,11 @@ int Stream::queueBuffer(FrameBuffer *buffer)
void Stream::returnBuffer(FrameBuffer *buffer)
{
- /* This can only be called for external streams. */
- ASSERT(external_);
+ if (!external_) {
+ /* For internal buffers, simply requeue back to the device. */
+ queueToDevice(buffer);
+ return;
+ }
/* Push this buffer back into the queue to be used again. */
availableBuffers_.push(buffer);