summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2024-08-20 21:50:13 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-08-25 03:27:17 +0300
commit3186a0eb546d405aca2b3554d951ea7b78490465 (patch)
treef67b4c5bcf2a836badb2459b1f1c2dc0dce3e7a6
parenta3fb0b3d0aec6477c205e7300dd19e54fee20d54 (diff)
libcamera: pipeline_handler: Call releaseDevice() before unlocking media devices
It is better / more logical to call releaseDevice() before unlocking the devices. At the moment the only pipeline handler implementing releaseDevice() is the rpi pipeline handler which releases buffers from its releaseDevice() implementation. Releasing buffers before unlocking the media devices is ok to do and arguably it is better to release the buffers before unlocking. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline_handler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index a20cd27d..1fc22d6a 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -205,11 +205,11 @@ void PipelineHandler::release(Camera *camera)
ASSERT(useCount_);
+ releaseDevice(camera);
+
if (useCount_ == 1)
unlockMediaDevices();
- releaseDevice(camera);
-
--useCount_;
}