libcamera: pipeline_handler: Allow to limit the number of queued requests

Add a maxQueuedRequestsDevice constructor parameter to allow pipeline
handler classes to limit the maximum number of requests that get queued
to the device in queueRequestDevice().

The default value is set to an arbitrary number of 32 which is big
enough for all currently known use cases.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Umang Jain <uajain@igalia.com>
Tested-by: Sven Püschel <s.pueschel@pengutronix.de>
This commit is contained in:
Stefan Klug
2025-07-17 14:59:22 +02:00
parent 0c5523c908
commit bfd325608d
2 changed files with 50 additions and 12 deletions

View File

@@ -33,7 +33,8 @@ class PipelineHandler : public std::enable_shared_from_this<PipelineHandler>,
public Object
{
public:
PipelineHandler(CameraManager *manager);
PipelineHandler(CameraManager *manager,
unsigned int maxQueuedRequestsDevice = 32);
virtual ~PipelineHandler();
virtual bool match(DeviceEnumerator *enumerator) = 0;
@@ -80,6 +81,7 @@ protected:
virtual void releaseDevice(Camera *camera);
CameraManager *manager_;
const unsigned int maxQueuedRequestsDevice_;
private:
void unlockMediaDevices();