@@ -40,7 +40,7 @@ public:
unsigned int maxQueuedRequestsDevice = 32);
virtual ~PipelineHandler();
- virtual bool match(DeviceEnumerator *enumerator) = 0;
+ virtual bool match(DeviceEnumerator *enumerator);
virtual int survey(const DeviceEnumerator *enumerator,
std::vector<std::shared_ptr<CameraDescriptor>> *descriptors);
virtual int createCamera(const CameraDescriptor *descriptor);
@@ -109,11 +109,20 @@ PipelineHandler::~PipelineHandler()
* If this function returns true, a new instance of the pipeline handler will
* be created and its match() function called.
*
+ * Pipeline handlers that report their cameras through survey() have them
+ * created by the camera manager without this function being called, and
+ * therefore do not need to implement it. The default implementation matches
+ * no device.
+ *
* \context This function is called from the CameraManager thread.
*
* \return true if media devices have been acquired and camera instances
* created, or false otherwise
*/
+bool PipelineHandler::match([[maybe_unused]] DeviceEnumerator *enumerator)
+{
+ return false;
+}
/**
* \brief Survey the media devices for cameras this pipeline handler supports
The camera manager creates the cameras of pipeline handlers that support surveying without ever calling their match(), which leaves the match() implementations of those handlers unreachable. Give match() a default implementation matching no device, so that pipeline handlers supporting enumeration can implement survey() and createCamera() only. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> --- include/libcamera/internal/pipeline_handler.h | 2 +- src/libcamera/pipeline_handler.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)