[Bug 773090] paramspecs: Add int range

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Nov 14 10:50:05 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=773090

--- Comment #4 from Stian Selnes (stianse) <stian.selnes at gmail.com> ---
I think we need to clear up how the validate function is supposed to work.

>From the docs of GParamSpecTypeInfo::value_validate:
"Ensures that the contents of @value comply with the specifications set out by
this type (optional), see g_param_value_validate()".

>From the other implementations (e.g param_int_validate(), except
_gst_param_fraction_validate()) the value will be clamped to a valid value, and
it will return TRUE if the value had to be changed, FALSE if the value was
already valid.

So the intent for _gst_param_int_range_validate is to modify value contents in
the least destructive way, so that it complies with the requirements. In this
case I think that would be to make sure the value's range lies within the
allowed range.

The patch does not do this correctly, and I will fix that if we agree that this
is the desired behavior?

I'm sure a common macro can be defined for int_range, int64_range and
double_range, but probably not fraction_range. And it's not like the macro will
make the code any easier to read. I'll wait with that until at least we've
agreed on how int_range should be implemented.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list