diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2019-12-22 02:35:12 -0600 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2020-01-03 19:53:17 -0500 |
commit | a3b80f3af87198b97f11f0694ff4d7ddde63fc30 (patch) | |
tree | 720c9d41a9d43f1678635f6eb6fe745771cde450 | |
parent | effe4d6ced881486ef1d17448c7a53aa36ef41eb (diff) |
libcamera: pipeline_handler: uvcvideo: register all Cameras along with a devnum
Register all UVC Cameras along with their device numbers, to eventually
allow the V4L2 compatibility layer to match against it.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r-- | src/libcamera/pipeline/uvcvideo.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index fcc1c011..ce38445d 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -7,6 +7,7 @@ #include <algorithm> #include <iomanip> +#include <sys/sysmacros.h> #include <tuple> #include <libcamera/camera.h> @@ -309,10 +310,12 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator) if (data->init(*entity)) return false; + dev_t devnum = makedev((*entity)->deviceMajor(), (*entity)->deviceMinor()); + /* Create and register the camera. */ std::set<Stream *> streams{ &data->stream_ }; std::shared_ptr<Camera> camera = Camera::create(this, media->model(), streams); - registerCamera(std::move(camera), std::move(data)); + registerCamera(std::move(camera), std::move(data), devnum); /* Enable hot-unplug notifications. */ hotplugMediaDevice(media); |