Klasse Structure

Alle implementierten Schnittstellen:
PointerInterface

public class Structure extends Record
A #GstStructure 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 #GstStructure also has a name. The name
starts with a letter and can be filled by letters, numbers and any of
"/-_.:".

#GstStructure is used by various GStreamer subsystems to store information in
a flexible and extensible way. A #GstStructure does not have a refcount
because it usually is part of a higher level object such as #GstCaps,
#GstMessage, #GstEvent, #GstQuery. It provides a means to enforce mutability
using the refcount of the parent with the gst_structure_set_parent_refcount()
method.

A #GstStructure can be created with gst_structure_new_empty() or
gst_structure_new(), 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 gst_structure_set_value() or
gst_structure_set().

Field values can be retrieved with gst_structure_get_value() or the more
convenient gst_structure_get_*() functions.

Fields can be removed with gst_structure_remove_field() or
gst_structure_remove_fields().

Strings in structures must be ASCII or UTF-8 encoded. Other encodings are not
allowed. Strings may be %NULL however.

## The serialization format

GstStructure serialization format serialize the GstStructure name,
keys/GType/values in a comma separated list with the structure name as first
field without value followed by separated key/value pairs in the form
`key=value`, for example:

```
a-structure, key=value
````

The values type will be inferred if not explicitly specified with the
`(GTypeName)value` syntax, for example the following struct will have one
field called 'is-string' which has the string 'true' as a value:

```
a-struct, field-is-string=(string)true, field-is-boolean=true
```

*Note*: without specifying `(string), `field-is-string` type would have been
inferred as boolean.

*Note*: we specified `(string)` as a type even if `gchararray` is the actual
GType name as for convenience some well known types have been aliased or
abbreviated.

To avoid specifying the type, you can give some hints to the "type system".
For example to specify a value as a double, you should add a decimal (ie. `1`
is an `int` while `1.0` is a `double`).

*Note*: when a structure is serialized with #gst_structure_to_string, all
values are explicitly typed.

Some types have special delimiters:

- [GstValueArray](GST_TYPE_ARRAY) are inside "less and greater than" (`<` and
`>`). For example `a-structure, array=<1, 2, 3>
- Ranges are inside brackets (`[` and `]`). For example `a-structure,
range=[1, 6, 2]` 1 being the min value, 6 the maximum and 2 the step. To
specify a #GST_TYPE_INT64_RANGE you need to explicitly specify it like:
`a-structure, a-int64-range=(gint64) [1, 5]`
- [GstValueList](GST_TYPE_LIST) are inside curly brackets (`{` and `}`).
For example `a-structure, list={1, 2, 3}`
- [GStrv](G_TYPE_STRV) are inside "less and greater than" (`<` and
`>`) and each string is double-quoted.
For example `a-structure, strv=(GStrv)<"foo", "bar">`. Since 1.26.0.

Structures are delimited either by a null character `\0` or a semicolon `;`
the latter allowing to store multiple structures in the same string (see
#GstCaps).

Quotes are used as "default" delimiters and can be used around any types that
don't use other delimiters (for example `a-struct, i=(int)"1"`). They are use
to allow adding spaces or special characters (such as delimiters,
semicolumns, etc..) inside strings and you can use backslashes `\` to escape
characters inside them, for example:

```
a-struct, special="\"{[(;)]}\" can be used inside quotes"
```

They also allow for nested structure, such as:

```
a-struct, nested=(GstStructure)"nested-struct, nested=true"
```

Since 1.20, nested structures and caps can be specified using brackets (`[`
and `]`), for example:

```
a-struct, nested=[nested-struct, nested=true]
```

> *note*: gst_structure_to_string() won't use that syntax for backward
> compatibility reason, gst_structure_serialize_full() has been added for
> that purpose.

https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html

  • Felddetails

  • Konstruktordetails

    • Structure

      public Structure(PointerContainer pointer)
    • Structure

      public Structure()
    • Structure

      public Structure(@Nonnull Str name, @Nonnull Str firstfield, Object... _ellipsis)
      Creates a new #GstStructure with the given name. Parses the
      list of variable arguments and sets fields to the values listed.
      Variable arguments should be passed as field name, field type,
      and value. Last variable argument should be %NULL.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      firstfield - name of first field to set
      _ellipsis - additional arguments
    • Structure

      public Structure(String name, String firstfield, Object... _ellipsis)
      Creates a new #GstStructure with the given name. Parses the
      list of variable arguments and sets fields to the values listed.
      Variable arguments should be passed as field name, field type,
      and value. Last variable argument should be %NULL.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      firstfield - name of first field to set
      _ellipsis - additional arguments
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • setFieldType

      public void setFieldType(long type)
      the GType of a structure
    • getFieldType

      public long getFieldType()
      the GType of a structure
    • getFieldName

      public int getFieldName()
    • newEmptyStructure

      public static Structure newEmptyStructure(@Nonnull Str name)
      Creates a new, empty #GstStructure with the given @name.

      See gst_structure_set_name() for constraints on the @name parameter.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      Gibt zurück:
      a new, empty #GstStructure
    • newEmptyStructure

      public static Structure newEmptyStructure(String name)
      Creates a new, empty #GstStructure with the given @name.

      See gst_structure_set_name() for constraints on the @name parameter.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      Gibt zurück:
      a new, empty #GstStructure
    • newFromStringStructure

      public static Structure newFromStringStructure(@Nonnull Str string)
      Creates a #GstStructure from a string representation.
      If end is not %NULL, a pointer to the place inside the given string
      where parsing ended will be returned.

      The current implementation of serialization will lead to unexpected results
      when there are nested #GstCaps / #GstStructure deeper than one level unless
      the gst_structure_serialize() function is used (without
      #GST_SERIALIZE_FLAG_BACKWARD_COMPAT)

      Free-function: gst_structure_free
      Parameter:
      string - a string representation of a #GstStructure
      Gibt zurück:
      a new #GstStructure or %NULL when the string could not be parsed. Free with gst_structure_free() after use.
    • newFromStringStructure

      public static Structure newFromStringStructure(String string)
      Creates a #GstStructure from a string representation.
      If end is not %NULL, a pointer to the place inside the given string
      where parsing ended will be returned.

      The current implementation of serialization will lead to unexpected results
      when there are nested #GstCaps / #GstStructure deeper than one level unless
      the gst_structure_serialize() function is used (without
      #GST_SERIALIZE_FLAG_BACKWARD_COMPAT)

      Free-function: gst_structure_free
      Parameter:
      string - a string representation of a #GstStructure
      Gibt zurück:
      a new #GstStructure or %NULL when the string could not be parsed. Free with gst_structure_free() after use.
    • newIdStructure

      @Deprecated public static Structure newIdStructure(int name_quark, int field_quark, Object... _ellipsis)
      Veraltet.
      Creates a new #GstStructure with the given name as a GQuark, followed by
      fieldname quark, GType, argument(s) "triplets" in the same format as
      gst_structure_id_set(). Basically a convenience wrapper around
      gst_structure_new_id_empty() and gst_structure_id_set().

      The last variable argument must be %NULL (or 0).

      Free-function: gst_structure_free
      Parameter:
      name_quark - name of new structure
      field_quark - the GQuark for the name of the field to set
      _ellipsis - variable arguments
      Gibt zurück:
      a new #GstStructure
    • newIdEmptyStructure

      @Deprecated public static Structure newIdEmptyStructure(int quark)
      Veraltet.
      Creates a new, empty #GstStructure with the given name as a GQuark.

      Free-function: gst_structure_free
      Parameter:
      quark - name of new structure
      Gibt zurück:
      a new, empty #GstStructure
    • newIdStrStructure

      public static Structure newIdStrStructure(@Nonnull IdStr name, @Nonnull IdStr fieldname, Object... _ellipsis)
      Creates a new #GstStructure with the given name as a GQuark, followed by
      fieldname GstIdStr, GType, argument(s) "triplets" in the same format as
      gst_structure_id_str_set(). Basically a convenience wrapper around
      gst_structure_new_id_str_empty() and gst_structure_id_str_set().

      The last variable argument must be %NULL (or 0).

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      fieldname - the GstIdStr for the name of the field to set
      _ellipsis - variable arguments
      Gibt zurück:
      a new #GstStructure
    • newIdStrEmptyStructure

      public static Structure newIdStrEmptyStructure(@Nonnull IdStr name)
      Creates a new, empty #GstStructure with the given name.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      Gibt zurück:
      a new, empty #GstStructure
    • newStaticStrStructure

      public static Structure newStaticStrStructure(@Nonnull Str name, @Nonnull Str firstfield, Object... _ellipsis)
      Creates a new #GstStructure with the given name. Parses the
      list of variable arguments and sets fields to the values listed.
      Variable arguments should be passed as field name, field type,
      and value. Last variable argument should be %NULL.

      @name, @firstfield and all field names need to be valid for the remaining
      lifetime of the process, e.g. have to be a static string.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      firstfield - name of first field to set
      _ellipsis - additional arguments
      Gibt zurück:
      a new #GstStructure
    • newStaticStrStructure

      public static Structure newStaticStrStructure(String name, String firstfield, Object... _ellipsis)
      Creates a new #GstStructure with the given name. Parses the
      list of variable arguments and sets fields to the values listed.
      Variable arguments should be passed as field name, field type,
      and value. Last variable argument should be %NULL.

      @name, @firstfield and all field names need to be valid for the remaining
      lifetime of the process, e.g. have to be a static string.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      firstfield - name of first field to set
      _ellipsis - additional arguments
      Gibt zurück:
      a new #GstStructure
    • newStaticStrEmptyStructure

      public static Structure newStaticStrEmptyStructure(@Nonnull Str name)
      Creates a new, empty #GstStructure with the given @name.

      See gst_structure_set_name() for constraints on the @name parameter.

      @name needs to be valid for the remaining lifetime of the process, e.g. has
      to be a static string.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      Gibt zurück:
      a new, empty #GstStructure
    • newStaticStrEmptyStructure

      public static Structure newStaticStrEmptyStructure(String name)
      Creates a new, empty #GstStructure with the given @name.

      See gst_structure_set_name() for constraints on the @name parameter.

      @name needs to be valid for the remaining lifetime of the process, e.g. has
      to be a static string.

      Free-function: gst_structure_free
      Parameter:
      name - name of new structure
      Gibt zurück:
      a new, empty #GstStructure
    • canIntersect

      public boolean canIntersect(@Nonnull Structure struct2)
      Tries intersecting @struct1 and @struct2 and reports whether the result
      would not be empty.
      Parameter:
      struct2 - a #GstStructure
      Gibt zurück:
      %TRUE if intersection would not be empty
    • copy

      public Structure copy()
      Duplicates a #GstStructure and all its fields and values.

      Free-function: gst_structure_free
      Gibt zurück:
      a new #GstStructure.
    • filterAndMapInPlace

      @Deprecated public void filterAndMapInPlace(Structure.OnStructureFilterMapFunc func, @Nullable Pointer user_data)
      Veraltet.
      Calls the provided function once for each field in the #GstStructure. In
      contrast to gst_structure_foreach(), the function may modify the fields.
      In contrast to gst_structure_map_in_place(), the field is removed from
      the structure if %FALSE is returned from the function.
      The structure must be mutable.
      Parameter:
      func - a function to call for each field
      user_data - private data
    • filterAndMapInPlaceIdStr

      public void filterAndMapInPlaceIdStr(Structure.OnStructureFilterMapIdStrFunc func, @Nullable Pointer user_data)
      Calls the provided function once for each field in the #GstStructure. In
      contrast to gst_structure_foreach_id_str(), the function may modify the fields.
      In contrast to gst_structure_map_in_place_id_str(), the field is removed from
      the structure if %FALSE is returned from the function.
      The structure must be mutable.
      Parameter:
      func - a function to call for each field
      user_data - private data
    • fixate

      public void fixate()
      Fixate all values in @structure using gst_value_fixate().
      @structure will be modified in-place and should be writable.
    • fixateField

      public boolean fixateField(@Nonnull Str field_name)
      Fixates a #GstStructure by changing the given field with its fixated value.
      Parameter:
      field_name - a field in @structure
      Gibt zurück:
      %TRUE if the structure field could be fixated
    • fixateField

      public boolean fixateField(String field_name)
      Fixates a #GstStructure by changing the given field with its fixated value.
      Parameter:
      field_name - a field in @structure
      Gibt zurück:
      %TRUE if the structure field could be fixated
    • fixateFieldBoolean

      public boolean fixateFieldBoolean(@Nonnull Str field_name, boolean target)
      Fixates a #GstStructure by changing the given @field_name field to the given
      @target boolean if that field is not fixed yet.
      Parameter:
      field_name - a field in @structure
      target - the target value of the fixation
      Gibt zurück:
      %TRUE if the structure could be fixated
    • fixateFieldBoolean

      public boolean fixateFieldBoolean(String field_name, boolean target)
      Fixates a #GstStructure by changing the given @field_name field to the given
      @target boolean if that field is not fixed yet.
      Parameter:
      field_name - a field in @structure
      target - the target value of the fixation
      Gibt zurück:
      %TRUE if the structure could be fixated
    • fixateFieldNearestDouble

      public boolean fixateFieldNearestDouble(@Nonnull Str field_name, double target)
      Fixates a #GstStructure by changing the given field to the nearest
      double to @target that is a subset of the existing field.
      Parameter:
      field_name - a field in @structure
      target - the target value of the fixation
      Gibt zurück:
      %TRUE if the structure could be fixated
    • fixateFieldNearestDouble

      public boolean fixateFieldNearestDouble(String field_name, double target)
      Fixates a #GstStructure by changing the given field to the nearest
      double to @target that is a subset of the existing field.
      Parameter:
      field_name - a field in @structure
      target - the target value of the fixation
      Gibt zurück:
      %TRUE if the structure could be fixated
    • fixateFieldNearestInt

      public boolean fixateFieldNearestInt(@Nonnull Str field_name, int target)
      Fixates a #GstStructure by changing the given field to the nearest
      integer to @target that is a subset of the existing field.
      Parameter:
      field_name - a field in @structure
      target - the target value of the fixation
      Gibt zurück:
      %TRUE if the structure could be fixated
    • fixateFieldNearestInt

      public boolean fixateFieldNearestInt(String field_name, int target)
      Fixates a #GstStructure by changing the given field to the nearest
      integer to @target that is a subset of the existing field.
      Parameter:
      field_name - a field in @structure
      target - the target value of the fixation
      Gibt zurück:
      %TRUE if the structure could be fixated
    • fixateFieldString

      public boolean fixateFieldString(@Nonnull Str field_name, @Nonnull Str target)
      Fixates a #GstStructure by changing the given @field_name field to the given
      @target string if that field is not fixed yet.
      Parameter:
      field_name - a field in @structure
      target - the target value of the fixation
      Gibt zurück:
      %TRUE if the structure could be fixated
    • fixateFieldString

      public boolean fixateFieldString(String field_name, String target)
      Fixates a #GstStructure by changing the given @field_name field to the given
      @target string if that field is not fixed yet.
      Parameter:
      field_name - a field in @structure
      target - the target value of the fixation
      Gibt zurück:
      %TRUE if the structure could be fixated
    • foreach

      @Deprecated public boolean foreach(Structure.OnStructureForeachFunc func, @Nullable Pointer user_data)
      Veraltet.
      Calls the provided function once for each field in the #GstStructure. The
      function must not modify the fields. Also see gst_structure_map_in_place()
      and gst_structure_filter_and_map_in_place().
      Parameter:
      func - a function to call for each field
      user_data - private data
      Gibt zurück:
      %TRUE if the supplied function returns %TRUE For each of the fields, %FALSE otherwise.
    • foreachIdStr

      public boolean foreachIdStr(Structure.OnStructureForeachIdStrFunc func, @Nullable Pointer user_data)
      Calls the provided function once for each field in the #GstStructure. The
      function must not modify the fields. Also see gst_structure_map_in_place_id_str()
      and gst_structure_filter_and_map_in_place_id_str().
      Parameter:
      func - a function to call for each field
      user_data - private data
      Gibt zurück:
      %TRUE if the supplied function returns %TRUE For each of the fields, %FALSE otherwise.
    • free

      public void free()
      Frees a #GstStructure and all its fields and values. The structure must not
      have a parent when this function is called.
    • get

      public boolean get(@Nonnull Str first_fieldname, Object... _ellipsis)
      Parses the variable arguments and reads fields from @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 receive a new reference which
      you must release with a suitable _unref\() when no longer needed. For
      strings and boxed types you will receive a copy which you will need to
      release with either g_free() or the suitable function for the boxed type.
      Parameter:
      first_fieldname - the name of the first field to read
      _ellipsis - variable arguments
      Gibt zurück:
      %FALSE if there was a problem reading any of the fields (e.g. because the field requested did not exist, or was of a type other than the type specified), otherwise %TRUE.
    • get

      public boolean get(String first_fieldname, Object... _ellipsis)
      Parses the variable arguments and reads fields from @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 receive a new reference which
      you must release with a suitable _unref\() when no longer needed. For
      strings and boxed types you will receive a copy which you will need to
      release with either g_free() or the suitable function for the boxed type.
      Parameter:
      first_fieldname - the name of the first field to read
      _ellipsis - variable arguments
      Gibt zurück:
      %FALSE if there was a problem reading any of the fields (e.g. because the field requested did not exist, or was of a type other than the type specified), otherwise %TRUE.
    • getBoolean

      public boolean getBoolean(@Nonnull Str fieldname, @Nonnull Int value)
      Sets the boolean pointed to by @value corresponding to the value of the
      given field. Caller is responsible for making sure the field exists
      and has the correct type.
      Parameter:
      fieldname - the name of a field
      value - a pointer to a #gboolean to set
      Gibt zurück:
      %TRUE if the value could be set correctly. If there was no field with @fieldname or the existing field did not contain a boolean, this function returns %FALSE.
    • getBoolean

      public boolean getBoolean(String fieldname, @Nonnull Int value)
      Sets the boolean pointed to by @value corresponding to the value of the
      given field. Caller is responsible for making sure the field exists
      and has the correct type.
      Parameter:
      fieldname - the name of a field
      value - a pointer to a #gboolean to set
      Gibt zurück:
      %TRUE if the value could be set correctly. If there was no field with @fieldname or the existing field did not contain a boolean, this function returns %FALSE.
    • getDouble

      public boolean getDouble(@Nonnull Str fieldname, @Nonnull Dbl value)
      Sets the double pointed to by @value corresponding to the value of the
      given field. Caller is responsible for making sure the field exists
      and has the correct type.
      Parameter:
      fieldname - the name of a field
      value - a pointer to a gdouble to set
      Gibt zurück:
      %TRUE if the value could be set correctly. If there was no field with @fieldname or the existing field did not contain a double, this function returns %FALSE.
    • getDouble

      public boolean getDouble(String fieldname, @Nonnull Dbl value)
      Sets the double pointed to by @value corresponding to the value of the
      given field. Caller is responsible for making sure the field exists
      and has the correct type.
      Parameter:
      fieldname - the name of a field
      value - a pointer to a gdouble to set
      Gibt zurück:
      %TRUE if the value could be set correctly. If there was no field with @fieldname or the existing field did not contain a double, this function returns %FALSE.
    • getEnum

      public boolean getEnum(@Nonnull Str fieldname, long enumtype, @Nonnull Int value)
      Sets the int pointed to by @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.
      Parameter:
      fieldname - the name of a field
      enumtype - the enum type of a field
      value - a pointer to an int to set
      Gibt zurück:
      %TRUE if the value could be set correctly. If there was no field with @fieldname or the existing field did not contain an enum of the given type, this function returns %FALSE.
    • getEnum

      public boolean getEnum(String fieldname, long enumtype, @Nonnull Int value)
      Sets the int pointed to by @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.
      Parameter:
      fieldname - the name of a field
      enumtype - the enum type of a field
      value - a pointer to an int to set
      Gibt zurück:
      %TRUE if the value could be set correctly. If there was no field with @fieldname or the existing field did not contain an enum of the given type, this function returns %FALSE.
    • getFieldType

      public long getFieldType(@Nonnull Str fieldname)
      Finds the field with the given name, and returns the type of the
      value it contains. If the field is not found, G_TYPE_INVALID is
      returned.
      Parameter:
      fieldname - the name of the field
      Gibt zurück:
      the #GValue of the field
    • getFieldType

      public long getFieldType(String fieldname)
      Finds the field with the given name, and returns the type of the
      value it contains. If the field is not found, G_TYPE_INVALID is
      returned.
      Parameter:
      fieldname - the name of the field
      Gibt zurück:
      the #GValue of the field
    • getFraction

      public boolean getFraction(@Nonnull Str fieldname, @Nonnull Int value_numerator, @Nonnull Int value_denominator)
      Sets the integers pointed to by @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.
      Parameter:
      fieldname - the name of a field
      value_numerator - a pointer to an int to set
      value_denominator - a pointer to an int to set
      Gibt zurück:
      %TRUE if the values could be set correctly. If there was no field with @fieldname or the existing field did not contain a GstFraction, this function returns %FALSE.
    • getFraction

      public boolean getFraction(String fieldname, @Nonnull Int value_numerator, @Nonnull Int value_denominator)
      Sets the integers pointed to by @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.
      Parameter:
      fieldname - the name of a field
      value_numerator - a pointer to an int to set
      value_denominator - a pointer to an int to set
      Gibt zurück:
      %TRUE if the values could be set correctly. If there was no field with @fieldname or the existing field did not contain a GstFraction, this function returns %FALSE.
    • getInt

      public boolean getInt(@Nonnull Str fieldname, @Nonnull Int value)
      Sets the int pointed to by @value corresponding to the value of the
      given field. Caller is responsible for making sure the field exists
      and has the correct type.
      Parameter:
      fieldname - the name of a field
      value - a pointer to an int to set
      Gibt zurück:
      %TRUE if the value could be set correctly. If there was no field with @fieldname or the existing field did not contain an int, this function returns %FALSE.
    • getInt

      public boolean getInt(String fieldname, @Nonnull Int value)
      Sets the int pointed to by @value corresponding to the value of the
      given field. Caller is responsible for making sure the field exists
      and has the correct type.
      Parameter:
      fieldname - the name of a field
      value - a pointer to an int to set
      Gibt zurück:
      %TRUE if the value could be set correctly. If there was no field with @fieldname or the existing field did not contain an int, this function returns %FALSE.
    • getName

      public Str getName()
      Get the name of @structure as a string.
      Gibt zurück:
      the name of the structure.
    • getNameId

      @Deprecated public int getNameId()
      Veraltet.
      Get the name of @structure as a GQuark.
      Gibt zurück:
      the quark representing the name of the structure.
    • getNameIdStr

      public IdStr getNameIdStr()
      Get the name of @structure as a GstIdStr.
      Gibt zurück:
      the name of the structure.
    • getString

      public Str getString(@Nonnull Str fieldname)
      Finds the field corresponding to @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.
      Parameter:
      fieldname - the name of a field
      Gibt zurück:
      a pointer to the string or %NULL when the field did not exist or did not contain a string.
    • getString

      public Str getString(String fieldname)
      Finds the field corresponding to @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.
      Parameter:
      fieldname - the name of a field
      Gibt zurück:
      a pointer to the string or %NULL when the field did not exist or did not contain a string.
    • getValue

      public Value getValue(@Nonnull Str fieldname)
      Get the value of the field with name @fieldname.
      Parameter:
      fieldname - the name of the field to get
      Gibt zurück:
      the #GValue corresponding to the field with the given name.
    • getValue

      public Value getValue(String fieldname)
      Get the value of the field with name @fieldname.
      Parameter:
      fieldname - the name of the field to get
      Gibt zurück:
      the #GValue corresponding to the field with the given name.
    • hasField

      public boolean hasField(@Nonnull Str fieldname)
      Check if @structure contains a field named @fieldname.
      Parameter:
      fieldname - the name of a field
      Gibt zurück:
      %TRUE if the structure contains a field with the given name
    • hasField

      public boolean hasField(String fieldname)
      Check if @structure contains a field named @fieldname.
      Parameter:
      fieldname - the name of a field
      Gibt zurück:
      %TRUE if the structure contains a field with the given name
    • hasFieldTyped

      public boolean hasFieldTyped(@Nonnull Str fieldname, long type)
      Check if @structure contains a field named @fieldname and with GType @type.
      Parameter:
      fieldname - the name of a field
      type - the type of a value
      Gibt zurück:
      %TRUE if the structure contains a field with the given name and type
    • hasFieldTyped

      public boolean hasFieldTyped(String fieldname, long type)
      Check if @structure contains a field named @fieldname and with GType @type.
      Parameter:
      fieldname - the name of a field
      type - the type of a value
      Gibt zurück:
      %TRUE if the structure contains a field with the given name and type
    • hasName

      public boolean hasName(@Nonnull Str name)
      Checks if the structure has the given name
      Parameter:
      name - structure name to check for
      Gibt zurück:
      %TRUE if @name matches the name of the structure.
    • hasName

      public boolean hasName(String name)
      Checks if the structure has the given name
      Parameter:
      name - structure name to check for
      Gibt zurück:
      %TRUE if @name matches the name of the structure.
    • idGet

      @Deprecated public boolean idGet(int first_field_id, Object... _ellipsis)
      Veraltet.
      Parses the variable arguments and reads fields from @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 gst_structure_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 receive a new reference which
      you must release with a suitable _unref\() when no longer needed. For
      strings and boxed types you will receive a copy which you will need to
      release with either g_free() or the suitable function for the boxed type.
      Parameter:
      first_field_id - the quark of the first field to read
      _ellipsis - variable arguments
      Gibt zurück:
      %FALSE if there was a problem reading any of the fields (e.g. because the field requested did not exist, or was of a type other than the type specified), otherwise %TRUE.
    • idGetValue

      public Value idGetValue(int field)
      Get the value of the field with GQuark @field.
      Parameter:
      field - the #GQuark of the field to get
      Gibt zurück:
      the #GValue corresponding to the field with the given name identifier.
    • idHasField

      @Deprecated public boolean idHasField(int field)
      Veraltet.
      Check if @structure contains a field named @field.
      Parameter:
      field - #GQuark of the field name
      Gibt zurück:
      %TRUE if the structure contains a field with the given name
    • idHasFieldTyped

      @Deprecated public boolean idHasFieldTyped(int field, long type)
      Veraltet.
      Check if @structure contains a field named @field and with GType @type.
      Parameter:
      field - #GQuark of the field name
      type - the type of a value
      Gibt zurück:
      %TRUE if the structure contains a field with the given name and type
    • idSet

      @Deprecated public void idSet(int fieldname, Object... _ellipsis)
      Veraltet.
      Identical to gst_structure_set, except that field names are
      passed using the GQuark for the field name. This allows more efficient
      setting of the structure if the caller already knows the associated
      quark values.
      The last variable argument must be %NULL.
      Parameter:
      fieldname - the GQuark for the name of the field to set
      _ellipsis - variable arguments
    • idSetValue

      @Deprecated public void idSetValue(int field, @Nonnull Value value)
      Veraltet.
      Sets the field with the given GQuark @field to @value. If the field
      does not exist, it is created. If the field exists, the previous
      value is replaced and freed.
      Parameter:
      field - a #GQuark representing a field
      value - the new value of the field
    • idStrGet

      public boolean idStrGet(@Nonnull IdStr first_fieldname, Object... _ellipsis)
      Parses the variable arguments and reads fields from @structure accordingly.
      Variable arguments should be in the form field name (as GstIdStr), 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 receive a new reference which
      you must release with a suitable _unref\() when no longer needed. For
      strings and boxed types you will receive a copy which you will need to
      release with either g_free() or the suitable function for the boxed type.
      Parameter:
      first_fieldname - the name of the first field to read
      _ellipsis - variable arguments
      Gibt zurück:
      %FALSE if there was a problem reading any of the fields (e.g. because the field requested did not exist, or was of a type other than the type specified), otherwise %TRUE.
    • idStrGetFieldType

      public long idStrGetFieldType(@Nonnull IdStr fieldname)
      Finds the field with the given name, and returns the type of the
      value it contains. If the field is not found, G_TYPE_INVALID is
      returned.
      Parameter:
      fieldname - the name of the field
      Gibt zurück:
      the #GValue of the field
    • idStrGetValue

      public Value idStrGetValue(@Nonnull IdStr fieldname)
      Get the value of the field with name @fieldname.
      Parameter:
      fieldname - the name of the field to get
      Gibt zurück:
      the #GValue corresponding to the field with the given name.
    • idStrHasField

      public boolean idStrHasField(@Nonnull IdStr fieldname)
      Check if @structure contains a field named @fieldname.
      Parameter:
      fieldname - the name of a field
      Gibt zurück:
      %TRUE if the structure contains a field with the given name
    • idStrHasFieldTyped

      public boolean idStrHasFieldTyped(@Nonnull IdStr fieldname, long type)
      Check if @structure contains a field named @fieldname and with GType @type.
      Parameter:
      fieldname - the name of a field
      type - the type of a value
      Gibt zurück:
      %TRUE if the structure contains a field with the given name and type
    • idStrNthFieldName

      public IdStr idStrNthFieldName(int index)
      Get the name (as a GstIdStr) of the given field number,
      counting from 0 onwards.
      Parameter:
      index - the index to get the name of
      Gibt zurück:
      the name of the given field number
    • idStrRemoveField

      public void idStrRemoveField(@Nonnull IdStr fieldname)
      Removes the field with the given name. If the field with the given
      name does not exist, the structure is unchanged.
      Parameter:
      fieldname - the name of the field to remove
    • idStrRemoveFields

      public void idStrRemoveFields(@Nonnull IdStr fieldname, Object... _ellipsis)
      Removes the fields with the given names. If a field does not exist, the
      argument is ignored.
      Parameter:
      fieldname - the name of the field to remove
      _ellipsis - %NULL-terminated list of more fieldnames to remove
    • idStrSet

      public void idStrSet(@Nonnull IdStr fieldname, Object... _ellipsis)
      Identical to gst_structure_set, except that field names are
      passed using a GstIdStr for the field name. This allows more efficient
      setting of the structure if the caller already owns the associated
      GstIdStr values or if they can be built from static literals.
      The last variable argument must be %NULL.
      Parameter:
      fieldname - the the name of the field to set
      _ellipsis - variable arguments
    • idStrSetValue

      public void idStrSetValue(@Nonnull IdStr fieldname, @Nonnull Value value)
      Sets the field with the given name @field to @value. If the field
      does not exist, it is created. If the field exists, the previous
      value is replaced and freed.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • idStrTakeValue

      public void idStrTakeValue(@Nonnull IdStr fieldname, @Nonnull Value value)
      Sets the field with the given GstIdStr @field to @value. If the field
      does not exist, it is created. If the field exists, the previous
      value is replaced and freed.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • idTakeValue

      @Deprecated public void idTakeValue(int field, @Nonnull Value value)
      Veraltet.
      Sets the field with the given GQuark @field to @value. If the field
      does not exist, it is created. If the field exists, the previous
      value is replaced and freed.
      Parameter:
      field - a #GQuark representing a field
      value - the new value of the field
    • intersect

      public Structure intersect(@Nonnull Structure struct2)
      Intersects @struct1 and @struct2 and returns the intersection.
      Parameter:
      struct2 - a #GstStructure
      Gibt zurück:
      Intersection of @struct1 and @struct2
    • isEqual

      public boolean isEqual(@Nonnull Structure structure2)
      Tests if the two #GstStructure are equal.
      Parameter:
      structure2 - a #GstStructure.
      Gibt zurück:
      %TRUE if the two structures have the same name and field.
    • isSubset

      public boolean isSubset(@Nonnull Structure superset)
      Checks if @subset is a subset of @superset, i.e. has the same
      structure name and for all fields that are existing in @superset,
      @subset has a value that is a subset of the value in @superset.
      Parameter:
      superset - a potentially greater #GstStructure
      Gibt zurück:
      %TRUE if @subset is a subset of @superset
    • mapInPlace

      @Deprecated public boolean mapInPlace(Structure.OnStructureMapFunc func, @Nullable Pointer user_data)
      Veraltet.
      Calls the provided function once for each field in the #GstStructure. In
      contrast to gst_structure_foreach(), the function may modify but not delete the
      fields. The structure must be mutable.
      Parameter:
      func - a function to call for each field
      user_data - private data
      Gibt zurück:
      %TRUE if the supplied function returns %TRUE For each of the fields, %FALSE otherwise.
    • mapInPlaceIdStr

      public boolean mapInPlaceIdStr(Structure.OnStructureMapIdStrFunc func, @Nullable Pointer user_data)
      Calls the provided function once for each field in the #GstStructure. In
      contrast to gst_structure_foreach_id_str(), the function may modify but not delete the
      fields. The structure must be mutable.
      Parameter:
      func - a function to call for each field
      user_data - private data
      Gibt zurück:
      %TRUE if the supplied function returns %TRUE For each of the fields, %FALSE otherwise.
    • nFields

      public int nFields()
      Get the number of fields in the structure.
      Gibt zurück:
      the number of fields in the structure
    • nthFieldName

      public Str nthFieldName(int index)
      Get the name of the given field number, counting from 0 onwards.
      Parameter:
      index - the index to get the name of
      Gibt zurück:
      the name of the given field number
    • removeAllFields

      public void removeAllFields()
      Removes all fields in a GstStructure.
    • removeField

      public void removeField(@Nonnull Str fieldname)
      Removes the field with the given name. If the field with the given
      name does not exist, the structure is unchanged.
      Parameter:
      fieldname - the name of the field to remove
    • removeField

      public void removeField(String fieldname)
      Removes the field with the given name. If the field with the given
      name does not exist, the structure is unchanged.
      Parameter:
      fieldname - the name of the field to remove
    • removeFields

      public void removeFields(@Nonnull Str fieldname, Object... _ellipsis)
      Removes the fields with the given names. If a field does not exist, the
      argument is ignored.
      Parameter:
      fieldname - the name of the field to remove
      _ellipsis - %NULL-terminated list of more fieldnames to remove
    • removeFields

      public void removeFields(String fieldname, Object... _ellipsis)
      Removes the fields with the given names. If a field does not exist, the
      argument is ignored.
      Parameter:
      fieldname - the name of the field to remove
      _ellipsis - %NULL-terminated list of more fieldnames to remove
    • serialize

      @Deprecated public Str serialize(int flags)
      Veraltet.
      Converts @structure to a human-readable string representation.

      This version of the caps serialization function introduces support for nested
      structures and caps but the resulting strings won't be parsable with
      GStreamer prior to 1.20 unless #GST_SERIALIZE_FLAG_BACKWARD_COMPAT is passed
      as @flag.

      %GST_SERIALIZE_FLAG_STRICT flags is not allowed because it would make this
      function nullable which is an API break for bindings.
      Use gst_structure_serialize_full() instead.

      Free-function: g_free
      Parameter:
      flags - The flags to use to serialize structure
      Gibt zurück:
      a pointer to string allocated by g_malloc(). g_free() after usage.
    • serializeFull

      public Str serializeFull(int flags)
      Alias for gst_structure_serialize() but with nullable annotation because it
      can return %NULL when %GST_SERIALIZE_FLAG_STRICT flag is set.
      Parameter:
      flags - The flags to use to serialize structure
      Gibt zurück:
      a pointer to string allocated by g_malloc(). g_free() after usage.
    • set

      public void set(@Nonnull Str fieldname, Object... _ellipsis)
      Parses the variable arguments and sets fields accordingly. Fields that
      weren't already part of the structure are added as needed.
      Variable arguments should be in the form field name, field type
      (as a GType), value(s). The last variable argument should be %NULL.
      Parameter:
      fieldname - the name of the field to set
      _ellipsis - variable arguments
    • set

      public void set(String fieldname, Object... _ellipsis)
      Parses the variable arguments and sets fields accordingly. Fields that
      weren't already part of the structure are added as needed.
      Variable arguments should be in the form field name, field type
      (as a GType), value(s). The last variable argument should be %NULL.
      Parameter:
      fieldname - the name of the field to set
      _ellipsis - variable arguments
    • setArray

      public void setArray(@Nonnull Str fieldname, @Nonnull ValueArray array)
      This is useful in language bindings where unknown GValue types are not
      supported. This function will convert a @array to %GST_TYPE_ARRAY and set
      the field specified by @fieldname. Be aware that this is slower then using
      %GST_TYPE_ARRAY in a #GValue directly.
      Parameter:
      fieldname - the name of a field
      array - a pointer to a #GValueArray
    • setArray

      public void setArray(String fieldname, @Nonnull ValueArray array)
      This is useful in language bindings where unknown GValue types are not
      supported. This function will convert a @array to %GST_TYPE_ARRAY and set
      the field specified by @fieldname. Be aware that this is slower then using
      %GST_TYPE_ARRAY in a #GValue directly.
      Parameter:
      fieldname - the name of a field
      array - a pointer to a #GValueArray
    • setList

      public void setList(@Nonnull Str fieldname, @Nonnull ValueArray array)
      This is useful in language bindings where unknown GValue types are not
      supported. This function will convert a @array to %GST_TYPE_LIST and set
      the field specified by @fieldname. Be aware that this is slower then using
      %GST_TYPE_LIST in a #GValue directly.
      Parameter:
      fieldname - the name of a field
      array - a pointer to a #GValueArray
    • setList

      public void setList(String fieldname, @Nonnull ValueArray array)
      This is useful in language bindings where unknown GValue types are not
      supported. This function will convert a @array to %GST_TYPE_LIST and set
      the field specified by @fieldname. Be aware that this is slower then using
      %GST_TYPE_LIST in a #GValue directly.
      Parameter:
      fieldname - the name of a field
      array - a pointer to a #GValueArray
    • setName

      public void setName(@Nonnull Str name)
      Sets the name of the structure to the given @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 "/-_.:".
      Parameter:
      name - the new name of the structure
    • setName

      public void setName(String name)
      Sets the name of the structure to the given @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 "/-_.:".
      Parameter:
      name - the new name of the structure
    • setNameIdStr

      public void setNameIdStr(@Nonnull IdStr name)
      Sets the name of the structure to the given @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 "/-_.:".
      Parameter:
      name - the new name of the structure
    • setNameStaticStr

      public void setNameStaticStr(@Nonnull Str name)
      Sets the name of the structure to the given @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 "/-_.:".

      @name needs to be valid for the remaining lifetime of the process, e.g. has
      to be a static string.
      Parameter:
      name - the new name of the structure
    • setNameStaticStr

      public void setNameStaticStr(String name)
      Sets the name of the structure to the given @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 "/-_.:".

      @name needs to be valid for the remaining lifetime of the process, e.g. has
      to be a static string.
      Parameter:
      name - the new name of the structure
    • setParentRefcount

      public boolean setParentRefcount(@Nonnull Int refcount)
      Sets the parent_refcount field of #GstStructure. This field is used to
      determine whether a structure is mutable or not. This function should only be
      called by code implementing parent objects of #GstStructure, as described in
      the MT Refcounting section of the design documents.
      Parameter:
      refcount - a pointer to the parent's refcount
      Gibt zurück:
      %TRUE if the parent refcount could be set.
    • setStaticStr

      public void setStaticStr(@Nonnull Str fieldname, Object... _ellipsis)
      Parses the variable arguments and sets fields accordingly. Fields that
      weren't already part of the structure are added as needed.
      Variable arguments should be in the form field name, field type
      (as a GType), value(s). The last variable argument should be %NULL.

      @fieldname and all other field names needs to be valid for the remaining
      lifetime of the process, e.g. has to be a static string.
      Parameter:
      fieldname - the name of the field to set
      _ellipsis - variable arguments
    • setStaticStr

      public void setStaticStr(String fieldname, Object... _ellipsis)
      Parses the variable arguments and sets fields accordingly. Fields that
      weren't already part of the structure are added as needed.
      Variable arguments should be in the form field name, field type
      (as a GType), value(s). The last variable argument should be %NULL.

      @fieldname and all other field names needs to be valid for the remaining
      lifetime of the process, e.g. has to be a static string.
      Parameter:
      fieldname - the name of the field to set
      _ellipsis - variable arguments
    • setValue

      public void setValue(@Nonnull Str fieldname, @Nonnull Value value)
      Sets the field with the given name @field to @value. If the field
      does not exist, it is created. If the field exists, the previous
      value is replaced and freed.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • setValue

      public void setValue(String fieldname, @Nonnull Value value)
      Sets the field with the given name @field to @value. If the field
      does not exist, it is created. If the field exists, the previous
      value is replaced and freed.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • setValueStaticStr

      public void setValueStaticStr(@Nonnull Str fieldname, @Nonnull Value value)
      Sets the field with the given name @field to @value. If the field
      does not exist, it is created. If the field exists, the previous
      value is replaced and freed.

      @fieldname needs to be valid for the remaining lifetime of the process, e.g.
      has to be a static string.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • setValueStaticStr

      public void setValueStaticStr(String fieldname, @Nonnull Value value)
      Sets the field with the given name @field to @value. If the field
      does not exist, it is created. If the field exists, the previous
      value is replaced and freed.

      @fieldname needs to be valid for the remaining lifetime of the process, e.g.
      has to be a static string.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • takeValue

      public void takeValue(@Nonnull Str fieldname, @Nonnull Value value)
      Sets the field with the given name @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.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • takeValue

      public void takeValue(String fieldname, @Nonnull Value value)
      Sets the field with the given name @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.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • takeValueStaticStr

      public void takeValueStaticStr(@Nonnull Str fieldname, @Nonnull Value value)
      Sets the field with the given name @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.

      @fieldname needs to be valid for the remaining lifetime of the process, e.g.
      has to be a static string.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • takeValueStaticStr

      public void takeValueStaticStr(String fieldname, @Nonnull Value value)
      Sets the field with the given name @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.

      @fieldname needs to be valid for the remaining lifetime of the process, e.g.
      has to be a static string.
      Parameter:
      fieldname - the name of the field to set
      value - the new value of the field
    • toStr

      public Str toStr()
      Converts @structure to a human-readable string representation.
      For debugging purposes its easier to do something like this:
      <!--
       language="C" --> GST_LOG ("structure is %" GST_PTR_FORMAT, structure);
       

      This prints the structure in human readable form.

      This function will lead to unexpected results when there are nested #GstCaps
      / #GstStructure deeper than one level, you should user
      gst_structure_serialize_full() instead for those cases.

      Free-function: g_free
      Gibt zurück:
      a pointer to string allocated by g_malloc(). g_free() after usage.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()