[PATCH 2/3] gstreamer: Add support for read- and write-only controls

Jaslo Ziska jaslo at ziska.de
Tue Apr 22 16:25:20 CEST 2025


Signed-off-by: Jaslo Ziska <jaslo at ziska.de>
---
 src/gstreamer/gstlibcamera-controls.cpp.in | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in
index 28604a3c..b38038ca 100644
--- a/src/gstreamer/gstlibcamera-controls.cpp.in
+++ b/src/gstreamer/gstlibcamera-controls.cpp.in
@@ -126,7 +126,13 @@ g_param_spec_{{ ctrl.gtype }}(
 {%- endif %}
 	(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
 		       GST_PARAM_CONTROLLABLE |
+{%- if ctrl.direction == 'ControlId::Direction::In' %}
+		       G_PARAM_WRITABLE |
+{%- elif ctrl.direction == 'ControlId::Direction::Out' %}
+		       G_PARAM_READABLE |
+{%- else %}
 		       G_PARAM_READWRITE |
+{%- endif %}
 		       G_PARAM_STATIC_STRINGS)
 )
 {%- endset %}
@@ -142,7 +148,13 @@ g_param_spec_{{ ctrl.gtype }}(
 			{{ spec|indent_str('\t\t\t') }},
 			(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
 				       GST_PARAM_CONTROLLABLE |
+{%- if ctrl.direction == 'ControlId::Direction::In' %}
+				       G_PARAM_WRITABLE |
+{%- elif ctrl.direction == 'ControlId::Direction::Out' %}
+				       G_PARAM_READABLE |
+{%- else %}
 				       G_PARAM_READWRITE |
+{%- endif %}
 				       G_PARAM_STATIC_STRINGS)
 		)
 {%- else %}
-- 
2.49.0



More information about the libcamera-devel mailing list