diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2022-03-25 09:08:57 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-03-28 02:16:30 +0300 |
commit | 73c07bf2895e2cb3a40a4d80d6572d3bd4ae6969 (patch) | |
tree | c3c605e96f187d2c42bd5409456b75ab033a57bf /src | |
parent | e96e9e6e1d3df1c6a7a6d8395f0b573535e11be7 (diff) |
pipeline: raspberrypi: Move freeBuffers() to the RPiCameraData class
This function used to clear the camera buffers does not belong in the
PipelineHandlerRPi class as it only access members of the RPiCameraData,
so move it.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 43e87a40..2281b43f 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -189,6 +189,7 @@ public: { } + void freeBuffers(); void frameStarted(uint32_t sequence); int loadIPA(ipa::RPi::SensorConfig *sensorConfig); @@ -330,7 +331,6 @@ private: int registerCamera(MediaDevice *unicam, MediaDevice *isp, MediaEntity *sensorEntity); int queueAllBuffers(Camera *camera); int prepareBuffers(Camera *camera); - void freeBuffers(Camera *camera); void mapBuffers(Camera *camera, const RPi::BufferMap &buffers, unsigned int mask); }; @@ -1056,7 +1056,7 @@ void PipelineHandlerRPi::stopDevice(Camera *camera) /* Stop the IPA. */ data->ipa_->stop(); - freeBuffers(camera); + data->freeBuffers(); } int PipelineHandlerRPi::queueRequestDevice(Camera *camera, Request *request) @@ -1452,16 +1452,14 @@ void PipelineHandlerRPi::mapBuffers(Camera *camera, const RPi::BufferMap &buffer data->ipa_->mapBuffers(ipaBuffers); } -void PipelineHandlerRPi::freeBuffers(Camera *camera) +void RPiCameraData::freeBuffers() { - RPiCameraData *data = cameraData(camera); - /* Copy the buffer ids from the unordered_set to a vector to pass to the IPA. */ - std::vector<unsigned int> ipaBuffers(data->ipaBuffers_.begin(), data->ipaBuffers_.end()); - data->ipa_->unmapBuffers(ipaBuffers); - data->ipaBuffers_.clear(); + std::vector<unsigned int> ipaBuffers(ipaBuffers_.begin(), ipaBuffers_.end()); + ipa_->unmapBuffers(ipaBuffers); + ipaBuffers_.clear(); - for (auto const stream : data->streams_) + for (auto const stream : streams_) stream->releaseBuffers(); } |