[PATCH 1/3] gstreamer: Add GST_PARAM_CONDITIONALLY_AVAILABLE flag to properties

Jaslo Ziska jaslo at ziska.de
Wed Apr 23 10:30:19 CEST 2025


Hi Nicolas,

Nicolas Dufresne <nicolas at ndufresne.ca> writes:
> Hi,
>
> Le mardi 22 avril 2025 à 16:25 +0200, Jaslo Ziska a écrit :
>> Add the GST_PARAM_CONDITIONALLY_AVAILABLE flag to the camera 
>> properties
>> to mark the property as conditionally available, i.e. it might 
>> only be
>> present depending on the camera / pipeline.
>
> This is a slight miss-match. GST_PARAM_CONDITIONALLY_AVAILABLE 
> was only
> indented to endup in generated documentation, since when the 
> property
> is not available its actually not installed at all. The ideal 
> was to
> tell developers to never systematically set these properties.
>
> Since we don't have GStreamer elements per-camera, and that 
> properties
> cannot be included / removed per instance, doing the GOBject
> introspection to figure-out if the property is installed will 
> always
> succeed.
>
> In that sense, this change does not have a lot of value to me.

I see, then I will drop this patch.

>
> Nicolas
>
>>
>> Signed-off-by: Jaslo Ziska <jaslo at ziska.de>
>> ---
>>  src/gstreamer/gstlibcamera-controls.cpp.in | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in 
>> b/src/gstreamer/gstlibcamera-controls.cpp.in
>> index 89c530da..28604a3c 100644
>> --- a/src/gstreamer/gstlibcamera-controls.cpp.in
>> +++ b/src/gstreamer/gstlibcamera-controls.cpp.in
>> @@ -124,7 +124,9 @@ g_param_spec_{{ ctrl.gtype }}(
>>  {%- elif ctrl.gtype in ['float', 'int', 'int64', 'uchar'] %}
>>  	{{ ctrl.min }}, {{ ctrl.max }}, {{ ctrl.default }},
>>  {%- endif %}
>> -	(GParamFlags) (GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE 
>> |
>> +	(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
>> +		       GST_PARAM_CONTROLLABLE |
>> +		       G_PARAM_READWRITE |
>>  		       G_PARAM_STATIC_STRINGS)
>>  )
>>  {%- endset %}
>> @@ -138,7 +140,8 @@ g_param_spec_{{ ctrl.gtype }}(
>>  			"{{ ctrl.name }}",
>>  			{{ 
>> ctrl.description|format_description|indent_str('\t\t\t') }},
>>  			{{ spec|indent_str('\t\t\t') }},
>> -			(GParamFlags) (GST_PARAM_CONTROLLABLE |
>> +			(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
>> +				       GST_PARAM_CONTROLLABLE |
>>  				       G_PARAM_READWRITE |
>>  				       G_PARAM_STATIC_STRINGS)
>>  		)


More information about the libcamera-devel mailing list