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>
This commit is contained in:
Hans de Goede
2024-08-20 21:50:13 +02:00
committed by Laurent Pinchart
parent a3fb0b3d0a
commit 3186a0eb54

View File

@@ -205,11 +205,11 @@ void PipelineHandler::release(Camera *camera)
ASSERT(useCount_);
releaseDevice(camera);
if (useCount_ == 1)
unlockMediaDevices();
releaseDevice(camera);
--useCount_;
}