summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2020-09-18 10:42:30 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-09-21 13:10:48 +0200
commitf22ffc0ebec40e718325922edc3422bf0c487390 (patch)
tree724646514e5c4852eeaf684a145c0d0fe0f43f0e /src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
parentb752c57c33151eff5b0e003a24f05a4e05465b1f (diff)
libcamera: pipeline: ipa: raspberrypi: Remove use of FrameBuffer cookie
The FrameBuffer cookie may be set by the application, so this cannot be set by the pipeline handler as well. Revert to using a simple index into the buffer list to identify buffers passing to and from the IPA. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/pipeline/raspberrypi/rpi_stream.cpp')
-rw-r--r--src/libcamera/pipeline/raspberrypi/rpi_stream.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
index b2a5dfa7..80170d64 100644
--- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
+++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
@@ -53,15 +53,17 @@ const std::vector<FrameBuffer *> &RPiStream::getBuffers() const
return bufferList_;
}
-bool RPiStream::findFrameBuffer(FrameBuffer *buffer) const
+int RPiStream::getBufferIndex(FrameBuffer *buffer) const
{
if (importOnly_)
- return false;
+ return -1;
- if (std::find(bufferList_.begin(), bufferList_.end(), buffer) != bufferList_.end())
- return true;
+ /* Find the buffer in the list, and return the index position. */
+ auto it = std::find(bufferList_.begin(), bufferList_.end(), buffer);
+ if (it != bufferList_.end())
+ return std::distance(bufferList_.begin(), it);
- return false;
+ return -1;
}
int RPiStream::prepareBuffers(unsigned int count)
@@ -199,7 +201,7 @@ void RPiStream::clearBuffers()
int RPiStream::queueToDevice(FrameBuffer *buffer)
{
- LOG(RPISTREAM, Debug) << "Queuing buffer " << buffer->cookie()
+ LOG(RPISTREAM, Debug) << "Queuing buffer " << getBufferIndex(buffer)
<< " for " << name_;
int ret = dev_->queueBuffer(buffer);