[libcamera-devel,2/2,DNI] apps: cam: Print require properties
diff mbox series

Message ID 20231221150157.584264-3-jacopo.mondi@ideasonboard.com
State New
Headers show
Series
  • libcamera: Add support for required controls
Related show

Commit Message

Jacopo Mondi Dec. 21, 2023, 3:01 p.m. UTC
Do not include, only to validate the implementation.

When run on a VIMC camera:

$ ./build/src/apps/cam/cam -c1 -p
  Using camera platform/vimc.0 Sensor B as cam0
  Property: SystemDevices = [ 20740, 20741, 20742 ]
  Property: PixelArrayActiveAreas = [ (0, 0)/4096x2160 ]
  Property: PixelArraySize = 4096x2160
  Property: Rotation = 0 [REQUIRED]
  Property: Model = Sensor B

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/apps/cam/camera_session.cpp      | 3 ++-
 src/libcamera/property_ids_core.yaml | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp
index 8447f932dfc7..d78ab2c1834c 100644
--- a/src/apps/cam/camera_session.cpp
+++ b/src/apps/cam/camera_session.cpp
@@ -165,7 +165,8 @@  void CameraSession::listProperties() const
 		const ControlId *id = properties::properties.at(key);
 
 		std::cout << "Property: " << id->name() << " = "
-			  << value.toString() << std::endl;
+			  << value.toString()
+			  << (id->required() ? " [REQUIRED]" : "") << std::endl;
 	}
 }
 
diff --git a/src/libcamera/property_ids_core.yaml b/src/libcamera/property_ids_core.yaml
index 834454a4e087..f9e82c421693 100644
--- a/src/libcamera/property_ids_core.yaml
+++ b/src/libcamera/property_ids_core.yaml
@@ -8,6 +8,7 @@  vendor: libcamera
 controls:
   - Location:
       type: int32_t
+      required: true
       description: |
         Camera mounting location
       enum:
@@ -29,6 +30,7 @@  controls:
 
   - Rotation:
       type: int32_t
+      required: true
       description: |
         The camera physical mounting rotation. It is expressed as the angular
         difference in degrees between two reference systems, one relative to the