mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-16 00:45:07 +03:00
libcamera: camera_sensor: Introduce CameraSensorFactory
Introduce a factory to create CameraSensor derived classes instances by inspecting the sensor media entity name and provide a convenience macro to register specialized sensor handlers. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
27cece6653
commit
6ba23735b9
12 changed files with 233 additions and 40 deletions
|
@ -64,8 +64,8 @@ int V4L2VideoDeviceTest::init()
|
|||
format.size.height = 480;
|
||||
|
||||
if (driver_ == "vimc") {
|
||||
sensor_ = new CameraSensor(media_->getEntityByName("Sensor A"));
|
||||
if (sensor_->init())
|
||||
sensor_ = CameraSensorFactoryBase::create(media_->getEntityByName("Sensor A"));
|
||||
if (!sensor_)
|
||||
return TestFail;
|
||||
|
||||
debayer_ = new V4L2Subdevice(media_->getEntityByName("Debayer A"));
|
||||
|
@ -98,6 +98,5 @@ void V4L2VideoDeviceTest::cleanup()
|
|||
capture_->close();
|
||||
|
||||
delete debayer_;
|
||||
delete sensor_;
|
||||
delete capture_;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue