A Structure is a collection of key/value pairs. The keys are expressed as GQuarks and the values can be of any GType. In addition to the key/value pairs, a Structure also has a name. The name starts with a letter and can be folled by letters, numbers and any of "/-_.:". Structure is used by various GStreamer subsystems to store information in a flexible and extensible way. A Structure does not have a refcount because it usually is part of a higher level object such as Caps. It provides a means to enforce mutability using the refcount of the parent with the set_parent_refcount method. A Structure can be created with Structure.empty or Structure, which both take a name and an optional set of key/value pairs along with the types of the values. Field values can be changed with set_value or set. Field values can be retrieved with get_value or the more convenient gst_structure_get_*() functions. Fields can be removed with remove_field or remove_fields. Strings in structures must be ASCII or UTF-8 encoded. Other encodings are not allowed. Strings must not be empty either, but may be NULL. Last reviewed on 2009-06-08 (0.10.23)
gst_structure_free after use.
field_name field to the given
target that is a subset of the existing field.
target_numerator/@target_denominator that is a subset of the existing field.
target that is a subset of the existing field.
field_name field to the given
structure accordingly. Variable
arguments should be in the form field name, field type (as a GType), pointer(s) to a variable(s) to hold the return value(s). The last
variable argument should be NULL. For refcounted (mini)objects you will acquire your own reference which you must release with a
suitable _unref() when no longer needed. For strings and boxed types you will acquire a copy which you will need to release with
either g_free or the suiteable function for the boxed type. because the field
requested did not exist, or was of a type other than the type specified), otherwise TRUE.
value corresponding to the value of the given field. Caller
is responsible for making sure the field exists and has the correct type. with fieldname or the existing field did not
contain a boolean, this function returns FALSE.
value corresponding to the clock time of the given field.
Caller is responsible for making sure the field exists and has the correct type. with fieldname or the existing field did
not contain a ClockTime, this function returns FALSE.
value corresponding to the date of the given field. Caller is
responsible for making sure the field exists and has the correct type. On success value will point to a newly-allocated
copy of the date which inconsistent with e.g. get_string which doesn't
return a copy of the string). with fieldname or the existing field did not contain a data, this function returns FALSE.
value corresponding to the datetime of the given field.
Caller is responsible for making sure the field exists and has the correct type. On success value will point to a
reference of the datetime which should be unreffed with gst_date_time_unref when no longer needed (note: this is
inconsistent with e.g. get_string which doesn't return a copy of the
string). with fieldname or the existing field did not contain a data, this function returns FALSE.
value corresponding to the value of the given field. Caller
is responsible for making sure the field exists and has the correct type. with fieldname or the existing field did not
contain a double, this function returns FALSE.
value corresponding to the value of the given field. Caller is
responsible for making sure the field exists, has the correct type and that the enumtype is correct. with fieldname or
the existing field did not contain an enum of the given type, this function returns FALSE.
value corresponding to the value of the given field. Caller
is responsible for making sure the field exists and has the correct type. with fieldname or the existing field did not
contain a fourcc, this function returns FALSE.
value_numerator and value_denominator
corresponding to the value of the given field. Caller is responsible for making sure the field exists and has the correct type. with
fieldname or the existing field did not contain a GstFraction, this function returns FALSE.
value corresponding to the value of the given field. Caller is
responsible for making sure the field exists and has the correct type. with fieldname or the existing field did not
contain an int, this function returns false.
structure as a string.
structure as a GQuark.
fieldname, and returns the string contained in the field's
value. Caller is responsible for making sure the field exists and has the correct type. The string should not be modified, and remains
valid until the next call to a gst_structure_*() function with the given structure. or did not contain a string.
value corresponding to the value of the given field. Caller is
responsible for making sure the field exists and has the correct type. with fieldname or the existing field did not
contain a uint, this function returns false.
fieldname.
structure contains a field named fieldname.
structure contains a field named fieldname and with GType type
.
structure accordingly. Variable
arguments should be in the form field id quark, field type (as a GType), pointer(s) to a variable(s) to hold the return value(s). The
last variable argument should be NULL (technically it should be a 0 quark, but we require NULL so compilers that support it can check
for the NULL terminator and warn if it's not there). This function is just like get
only that it is slightly more efficient since it saves the string-to-quark lookup in the global quark hashtable. For refcounted
(mini)objects you will acquire your own reference which you must release with a suitable _unref() when no longer needed. For strings
and boxed types you will acquire a copy which you will need to release with either
g_free or the suiteable function for the boxed type. because the field
requested did not exist, or was of a type other than the type specified), otherwise TRUE.
field. identifier.
structure contains a field named field.
structure contains a field named field and with GType type
.
field to value. If the field does not
exist, it is created. If the field exists, the previous value is replaced and freed.
field to value. If the field does not
exist, it is created. If the field exists, the previous value is replaced and freed.
name. The string provided is copied before
being used. It must not be empty, start with a letter and can be followed by letters, numbers and any of "/-_.:".
field to value. If the field does not
exist, it is created. If the field exists, the previous value is replaced and freed.
field to value. If the field does not
exist, it is created. If the field exists, the previous value is replaced and freed. The function will take ownership of value
.
structure to a human-readable string representation. For debugging purposes its
easier to do something like this:
