summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-07-27 20:08:13 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-05 20:07:13 +0200
commit75a9aebee593e5fe824a09bd9682c1571aa0e4ab (patch)
treebb337c2723b77fe77acee488653ec1461e179e92
parent082a5b2dfe43d2b325a7ea470e46ee2f1f560993 (diff)
libcamera: pipelines: Use sensor ID as camera name
Use the CameraSensor ID as the camera name in pipelines that uses a CameraSensors, this is done in preparation of turning the camera name into an ID. The CameraSensor ID meets the requirements that will be put on camera ID. Before this change example of camera names: * OF based systems ov5695 7-0036 ov2685 7-003c * ACPI based systems ov13858 8-0010 ov5670 10-0036 * VIMC VIMC Sensor B After this change the same cameras are: * OF based systems /base/i2c@ff160000/camera@36 /base/i2c@ff160000/camera@36 * ACPI based systems \_SB_.PCI0.I2C2.CAM0 \_SB_.PCI0.I2C4.CAM1 * VIMC platform/vimc.0 Sensor B Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp9
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp3
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp2
-rw-r--r--src/libcamera/pipeline/simple/simple.cpp2
-rw-r--r--src/libcamera/pipeline/vimc/vimc.cpp4
-rw-r--r--test/camera/buffer_import.cpp2
-rw-r--r--test/camera/capture.cpp2
-rw-r--r--test/camera/configuration_default.cpp2
-rw-r--r--test/camera/configuration_set.cpp2
-rw-r--r--test/camera/statemachine.cpp2
-rw-r--r--test/controls/control_info_map.cpp2
-rw-r--r--test/controls/control_list.cpp2
-rw-r--r--test/serialization/serialization_test.h2
13 files changed, 18 insertions, 18 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index c1f9fdf1..cfee178a 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -805,16 +805,15 @@ int PipelineHandlerIPU3::registerCameras()
&IPU3CameraData::imguOutputBufferReady);
/* Create and register the Camera instance. */
- std::string cameraName = cio2->sensor()->entity()->name();
- std::shared_ptr<Camera> camera = Camera::create(this,
- cameraName,
- streams);
+ std::string cameraId = cio2->sensor()->id();
+ std::shared_ptr<Camera> camera =
+ Camera::create(this, cameraId, streams);
registerCamera(std::move(camera), std::move(data));
LOG(IPU3, Info)
<< "Registered Camera[" << numCameras << "] \""
- << cameraName << "\""
+ << cameraId << "\""
<< " connected to CSI-2 receiver " << id;
numCameras++;
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 82a0a4df..c55d7325 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -972,7 +972,8 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
streams.insert(&data->isp_[Isp::Stats]);
/* Create and register the camera. */
- std::shared_ptr<Camera> camera = Camera::create(this, data->sensor_->model(), streams);
+ std::shared_ptr<Camera> camera =
+ Camera::create(this, data->sensor_->id(), streams);
registerCamera(std::move(camera), std::move(data));
return true;
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 52a0d862..94561062 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -971,7 +971,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)
std::set<Stream *> streams{ &data->stream_ };
std::shared_ptr<Camera> camera =
- Camera::create(this, sensor->name(), streams);
+ Camera::create(this, data->sensor_->id(), streams);
registerCamera(std::move(camera), std::move(data));
return 0;
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 0bab5af8..eb72e3b8 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -815,7 +815,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)
continue;
std::shared_ptr<Camera> camera =
- Camera::create(this, data->sensor_->entity()->name(),
+ Camera::create(this, data->sensor_->id(),
data->streams());
registerCamera(std::move(camera), std::move(data));
}
diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
index 4f461b92..cf244f11 100644
--- a/src/libcamera/pipeline/vimc/vimc.cpp
+++ b/src/libcamera/pipeline/vimc/vimc.cpp
@@ -432,9 +432,9 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)
return false;
/* Create and register the camera. */
- std::string name{ "VIMC " + data->sensor_->model() };
std::set<Stream *> streams{ &data->stream_ };
- std::shared_ptr<Camera> camera = Camera::create(this, name, streams);
+ std::shared_ptr<Camera> camera =
+ Camera::create(this, data->sensor_->id(), streams);
registerCamera(std::move(camera), std::move(data));
return true;
diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp
index ad680a83..46e03746 100644
--- a/test/camera/buffer_import.cpp
+++ b/test/camera/buffer_import.cpp
@@ -28,7 +28,7 @@ class BufferImportTest : public CameraTest, public Test
{
public:
BufferImportTest()
- : CameraTest("VIMC Sensor B")
+ : CameraTest("platform/vimc.0 Sensor B")
{
}
diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp
index f6b2f348..ea84daee 100644
--- a/test/camera/capture.cpp
+++ b/test/camera/capture.cpp
@@ -18,7 +18,7 @@ class Capture : public CameraTest, public Test
{
public:
Capture()
- : CameraTest("VIMC Sensor B")
+ : CameraTest("platform/vimc.0 Sensor B")
{
}
diff --git a/test/camera/configuration_default.cpp b/test/camera/configuration_default.cpp
index 31c908d2..cdd6cb97 100644
--- a/test/camera/configuration_default.cpp
+++ b/test/camera/configuration_default.cpp
@@ -18,7 +18,7 @@ class ConfigurationDefault : public CameraTest, public Test
{
public:
ConfigurationDefault()
- : CameraTest("VIMC Sensor B")
+ : CameraTest("platform/vimc.0 Sensor B")
{
}
diff --git a/test/camera/configuration_set.cpp b/test/camera/configuration_set.cpp
index b4b59681..30f19ba9 100644
--- a/test/camera/configuration_set.cpp
+++ b/test/camera/configuration_set.cpp
@@ -18,7 +18,7 @@ class ConfigurationSet : public CameraTest, public Test
{
public:
ConfigurationSet()
- : CameraTest("VIMC Sensor B")
+ : CameraTest("platform/vimc.0 Sensor B")
{
}
diff --git a/test/camera/statemachine.cpp b/test/camera/statemachine.cpp
index 325b4674..0bda6fe4 100644
--- a/test/camera/statemachine.cpp
+++ b/test/camera/statemachine.cpp
@@ -18,7 +18,7 @@ class Statemachine : public CameraTest, public Test
{
public:
Statemachine()
- : CameraTest("VIMC Sensor B")
+ : CameraTest("platform/vimc.0 Sensor B")
{
}
diff --git a/test/controls/control_info_map.cpp b/test/controls/control_info_map.cpp
index e4305f13..db95945a 100644
--- a/test/controls/control_info_map.cpp
+++ b/test/controls/control_info_map.cpp
@@ -24,7 +24,7 @@ class ControlInfoMapTest : public CameraTest, public Test
{
public:
ControlInfoMapTest()
- : CameraTest("VIMC Sensor B")
+ : CameraTest("platform/vimc.0 Sensor B")
{
}
diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp
index 5c8485b5..b5a49dc1 100644
--- a/test/controls/control_list.cpp
+++ b/test/controls/control_list.cpp
@@ -24,7 +24,7 @@ class ControlListTest : public CameraTest, public Test
{
public:
ControlListTest()
- : CameraTest("VIMC Sensor B")
+ : CameraTest("platform/vimc.0 Sensor B")
{
}
diff --git a/test/serialization/serialization_test.h b/test/serialization/serialization_test.h
index fe77221e..f51ae546 100644
--- a/test/serialization/serialization_test.h
+++ b/test/serialization/serialization_test.h
@@ -20,7 +20,7 @@ class SerializationTest : public CameraTest, public Test
{
public:
SerializationTest()
- : CameraTest("VIMC Sensor B")
+ : CameraTest("platform/vimc.0 Sensor B")
{
}