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>
This commit is contained in:
Naushir Patuck
2020-09-18 10:42:30 +01:00
committed by Niklas Söderlund
parent b752c57c33
commit f22ffc0ebe
3 changed files with 40 additions and 36 deletions
@@ -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);