[libcamera-devel] [PATCH 6/9] libcamera: pipeline: vimc: Align camera name

Niklas Söderlund niklas.soderlund at ragnatech.se
Sat Jul 18 15:23:21 CEST 2020


In preparation to aligning how cameras are named drop the VIMC prefix
from the camera name and use the sensor entity name instead of the
sensor model.

For the sensors in VIMC pipeline the model and entity name are the same
as model is derived from entity name with the i2c information (if any)
removed.  As the VIMC sensors are not attached to a i2c bus there is
nothing to remove and the two are the same.

Before this change the camera name was

'VIMC Sensor B'

After this change the camera name is

'Sensor B'

Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
 src/libcamera/pipeline/vimc/vimc.cpp  | 4 ++--
 test/camera/buffer_import.cpp         | 2 +-
 test/camera/capture.cpp               | 2 +-
 test/camera/configuration_default.cpp | 2 +-
 test/camera/configuration_set.cpp     | 2 +-
 test/camera/statemachine.cpp          | 2 +-
 test/controls/control_info_map.cpp    | 2 +-
 test/controls/control_list.cpp        | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
index 38656d28b357dd1b..6560b632ae55b304 100644
--- a/src/libcamera/pipeline/vimc/vimc.cpp
+++ b/src/libcamera/pipeline/vimc/vimc.cpp
@@ -432,10 +432,10 @@ 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, data->sensor_->id(),
-							name, streams);
+							data->sensor_->entity()->name(),
+							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 ad680a83f9187213..04d3bb37a653e7e4 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("Sensor B")
 	{
 	}
 
diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp
index f6b2f348bda52752..6a0e0e456e321a71 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("Sensor B")
 	{
 	}
 
diff --git a/test/camera/configuration_default.cpp b/test/camera/configuration_default.cpp
index 31c908d2449eafe7..b8612134e4bcf497 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("Sensor B")
 	{
 	}
 
diff --git a/test/camera/configuration_set.cpp b/test/camera/configuration_set.cpp
index b4b5968115e81f59..35597f4452b18dad 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("Sensor B")
 	{
 	}
 
diff --git a/test/camera/statemachine.cpp b/test/camera/statemachine.cpp
index 325b4674bcc958d8..2816db7b99446549 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("Sensor B")
 	{
 	}
 
diff --git a/test/controls/control_info_map.cpp b/test/controls/control_info_map.cpp
index e4305f132db7952f..da49553ab41ca996 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("Sensor B")
 	{
 	}
 
diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp
index 5c8485b5dcc31499..25bcf6edc4cbaa82 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("Sensor B")
 	{
 	}
 
-- 
2.27.0



More information about the libcamera-devel mailing list