summaryrefslogtreecommitdiff
path: root/test/v4l2_videodevice/v4l2_videodevice_test.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-12-17 12:47:51 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-04-24 20:44:24 +0300
commitaa9a1eef2106383e965004c9ceeba9ed4746b78d (patch)
tree94cbbf1235e6fc3efa590a5ddedc1c2e209c6a69 /test/v4l2_videodevice/v4l2_videodevice_test.cpp
parent0fd7d941955dee55be2104c8143b5fbe42178fd3 (diff)
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@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> --- Changes since combined RFC: - Fix indentation in REGISTER_CAMERA_SENSOR() macro
Diffstat (limited to 'test/v4l2_videodevice/v4l2_videodevice_test.cpp')
-rw-r--r--test/v4l2_videodevice/v4l2_videodevice_test.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.cpp b/test/v4l2_videodevice/v4l2_videodevice_test.cpp
index 1113cf5b..9fbd24cc 100644
--- a/test/v4l2_videodevice/v4l2_videodevice_test.cpp
+++ b/test/v4l2_videodevice/v4l2_videodevice_test.cpp
@@ -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_;
}