gstvalue: expose gst_value_deserialize_with_pspec()
authorMathieu Duponchelle <mathieu@centricular.com>
Thu, 17 Sep 2020 18:44:43 +0000 (20:44 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Fri, 2 Oct 2020 23:02:55 +0000 (01:02 +0200)
commitacdb4ce03d525a18f6c351a040b8446c7bbd98bd
tree200e9b6885b2d6e4469c64d1b4ca8c30f0383b9d
parent220ce9c3fdcc8d85a87936c2a6696044064ecbed
gstvalue: expose gst_value_deserialize_with_pspec()

Typing hints can only be passed to gst_value_deserialize()
through the type of the passed-in value. This means deserialization
can only target the desired type for the top-level elements,
making it for example impossible to deserialize an array of
flags to the expected type.

This commit exposes a new function, gst_value_deserialize_full(),
that takes an optional pspec as the extra parameter, and updates
the deserialization code to pass around that pspec, or the
element_spec when recursively parsing the elements of a list-type
value.

This allows for example passing arrays of flags through the
command line or gst_util_set_object_arg, eg:

foo="<bar,bar+baz>"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/629>
gst/gst_private.h
gst/gststructure.c
gst/gstutils.c
gst/gstvalue.c
gst/gstvalue.h
gst/parse/grammar.y.in
tests/check/gst/gstvalue.c