[libcamera-devel,2/2] DNI: How to use a draft control
diff mbox series

Message ID 20201007185719.3208272-3-kieran.bingham@ideasonboard.com
State Superseded
Delegated to: Kieran Bingham
Headers show
Series
  • draft controls and properties support
Related show

Commit Message

Kieran Bingham Oct. 7, 2020, 6:57 p.m. UTC
This just shows how the draft state can be used on a control or
property.
Expressing a draft key on the property_ids or control_ids yaml
descriptions will automatically move the entrys to the draft namespace.


---
 src/libcamera/camera_sensor.cpp                    | 2 +-
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-
 src/libcamera/property_ids.yaml                    | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 78c7ceec7c44..4e899d180d95 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -249,7 +249,7 @@  int CameraSensor::init()
 		propertyValue = rotationControl->second.def().get<int32_t>();
 	else
 		propertyValue = 0;
-	properties_.set(properties::Rotation, propertyValue);
+	properties_.set(properties::draft::Rotation, propertyValue);
 
 	/* Enumerate, sort and cache media bus codes and sizes. */
 	formats_ = subdev_->formats(pad_);
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 26dbd2573e04..c1468178f163 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -270,7 +270,7 @@  CameraConfiguration::Status RPiCameraConfiguration::validate()
 	 * error means the platform can never run. Let's just print a warning
 	 * and continue regardless; the rotation is effectively set to zero.
 	 */
-	int32_t rotation = data_->sensor_->properties().get(properties::Rotation);
+	int32_t rotation = data_->sensor_->properties().get(properties::draft::Rotation);
 	bool success;
 	Transform rotationTransform = transformFromRotation(rotation, &success);
 	if (!success)
diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml
index 7261263a9ba3..e3400cc9d469 100644
--- a/src/libcamera/property_ids.yaml
+++ b/src/libcamera/property_ids.yaml
@@ -28,6 +28,7 @@  controls:
 
   - Rotation:
       type: int32_t
+      draft: true
       description: |
         The camera rotation is expressed as the angular difference in degrees
         between two reference systems, one relative to the camera module, and