diff options
author | David Plowman <david.plowman@raspberrypi.com> | 2022-11-11 13:30:25 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-11-14 11:03:32 +0000 |
commit | d2636d59644fd6c597ac1705836e8a8406f22d90 (patch) | |
tree | 6b5c42a98f3ffc482528e9f24323d56b53e95587 /src | |
parent | a5fdf63e90d8e9559f53f7bf5b0504f30ce69656 (diff) |
libcamera: pipeline: raspberrypi: Free buffers when a camera is released
Implement the PipelineHandlerRPi::releaseDevice method which allows
us to free any allocated buffers when a camera is released.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 7c545500..087c71b6 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -337,6 +337,8 @@ public: bool match(DeviceEnumerator *enumerator) override; + void releaseDevice(Camera *camera) override; + private: RPiCameraData *cameraData(Camera *camera) { @@ -1193,6 +1195,12 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator) return !!numCameras; } +void PipelineHandlerRPi::releaseDevice(Camera *camera) +{ + RPiCameraData *data = cameraData(camera); + data->freeBuffers(); +} + int PipelineHandlerRPi::registerCamera(MediaDevice *unicam, MediaDevice *isp, MediaEntity *sensorEntity) { std::unique_ptr<RPiCameraData> data = std::make_unique<RPiCameraData>(this); |