Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- canIntersect
- copy
- filterAndMapInPlace
- fixate
- fixateField
- fixateFieldBoolean
- fixateFieldNearestDouble
- fixateFieldNearestFraction
- fixateFieldNearestInt
- fixateFieldString
- foreach
- free
- fromString
- getBoolean
- getClockTime
- getDate
- getDateTime
- getDouble
- getEnum
- getFieldType
- getFlagset
- getFraction
- getInt
- getInt64
- getName
- getNameId
- getString
- getUint
- getUint64
- getValue
- hasField
- hasFieldTyped
- hasName
- idGetValue
- idHasField
- idHasFieldTyped
- idSetValue
- idTakeValue
- intersect
- isEqual
- isSubset
- mapInPlace
- nFields
- newEmpty
- newFromString
- newIdEmpty
- nthFieldName
- removeAllFields
- removeField
- setName
- setParentRefcount
- setValue
- takeValue
- toString
- Properties
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 filled 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
,
Message
, Event
, Query
. It provides a means to enforce mutability
using the refcount of the parent with the structureSetParentRefcount
method.
A Structure
can be created with structureNewEmpty
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 structureSetValue
or
gst_structure_set()
.
Field values can be retrieved with structureGetValue
or the more
convenient gst_structure_get_*() functions.
Fields can be removed with structureRemoveField
or
gst_structure_remove_fields()
.
Strings in structures must be ASCII or UTF-8 encoded. Other encodings are
not allowed. Strings may be Nothing
however.
Be aware that the current Caps
/ Structure
serialization into string
has limited support for nested Caps
/ Structure
fields. It can only
support one level of nesting. Using more levels will lead to unexpected
behavior when using serialization features, such as capsToString
or
valueSerialize
and their counterparts.
- newtype Structure = Structure (ManagedPtr Structure)
- newZeroStructure :: MonadIO m => m Structure
- noStructure :: Maybe Structure
- data StructureCanIntersectMethodInfo
- structureCanIntersect :: (HasCallStack, MonadIO m) => Structure -> Structure -> m Bool
- data StructureCopyMethodInfo
- structureCopy :: (HasCallStack, MonadIO m) => Structure -> m Structure
- data StructureFilterAndMapInPlaceMethodInfo
- structureFilterAndMapInPlace :: (HasCallStack, MonadIO m) => Structure -> StructureFilterMapFunc -> m ()
- data StructureFixateMethodInfo
- structureFixate :: (HasCallStack, MonadIO m) => Structure -> m ()
- data StructureFixateFieldMethodInfo
- structureFixateField :: (HasCallStack, MonadIO m) => Structure -> Text -> m Bool
- data StructureFixateFieldBooleanMethodInfo
- structureFixateFieldBoolean :: (HasCallStack, MonadIO m) => Structure -> Text -> Bool -> m Bool
- data StructureFixateFieldNearestDoubleMethodInfo
- structureFixateFieldNearestDouble :: (HasCallStack, MonadIO m) => Structure -> Text -> Double -> m Bool
- data StructureFixateFieldNearestFractionMethodInfo
- structureFixateFieldNearestFraction :: (HasCallStack, MonadIO m) => Structure -> Text -> Int32 -> Int32 -> m Bool
- data StructureFixateFieldNearestIntMethodInfo
- structureFixateFieldNearestInt :: (HasCallStack, MonadIO m) => Structure -> Text -> Int32 -> m Bool
- data StructureFixateFieldStringMethodInfo
- structureFixateFieldString :: (HasCallStack, MonadIO m) => Structure -> Text -> Text -> m Bool
- data StructureForeachMethodInfo
- structureForeach :: (HasCallStack, MonadIO m) => Structure -> StructureForeachFunc -> m Bool
- data StructureFreeMethodInfo
- structureFree :: (HasCallStack, MonadIO m) => Structure -> m ()
- structureFromString :: (HasCallStack, MonadIO m) => Text -> m (Maybe Structure, Text)
- data StructureGetBooleanMethodInfo
- structureGetBoolean :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Bool)
- data StructureGetClockTimeMethodInfo
- structureGetClockTime :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Word64)
- data StructureGetDateMethodInfo
- structureGetDate :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Date)
- data StructureGetDateTimeMethodInfo
- structureGetDateTime :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, DateTime)
- data StructureGetDoubleMethodInfo
- structureGetDouble :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Double)
- data StructureGetEnumMethodInfo
- structureGetEnum :: (HasCallStack, MonadIO m) => Structure -> Text -> GType -> m (Bool, Int32)
- data StructureGetFieldTypeMethodInfo
- structureGetFieldType :: (HasCallStack, MonadIO m) => Structure -> Text -> m GType
- data StructureGetFlagsetMethodInfo
- structureGetFlagset :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Word32, Word32)
- data StructureGetFractionMethodInfo
- structureGetFraction :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Int32, Int32)
- data StructureGetIntMethodInfo
- structureGetInt :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Int32)
- data StructureGetInt64MethodInfo
- structureGetInt64 :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Int64)
- data StructureGetNameMethodInfo
- structureGetName :: (HasCallStack, MonadIO m) => Structure -> m Text
- data StructureGetNameIdMethodInfo
- structureGetNameId :: (HasCallStack, MonadIO m) => Structure -> m Word32
- data StructureGetStringMethodInfo
- structureGetString :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Maybe Text)
- data StructureGetUintMethodInfo
- structureGetUint :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Word32)
- data StructureGetUint64MethodInfo
- structureGetUint64 :: (HasCallStack, MonadIO m) => Structure -> Text -> m (Bool, Word64)
- data StructureGetValueMethodInfo
- structureGetValue :: (HasCallStack, MonadIO m) => Structure -> Text -> m GValue
- data StructureHasFieldMethodInfo
- structureHasField :: (HasCallStack, MonadIO m) => Structure -> Text -> m Bool
- data StructureHasFieldTypedMethodInfo
- structureHasFieldTyped :: (HasCallStack, MonadIO m) => Structure -> Text -> GType -> m Bool
- data StructureHasNameMethodInfo
- structureHasName :: (HasCallStack, MonadIO m) => Structure -> Text -> m Bool
- data StructureIdGetValueMethodInfo
- structureIdGetValue :: (HasCallStack, MonadIO m) => Structure -> Word32 -> m GValue
- data StructureIdHasFieldMethodInfo
- structureIdHasField :: (HasCallStack, MonadIO m) => Structure -> Word32 -> m Bool
- data StructureIdHasFieldTypedMethodInfo
- structureIdHasFieldTyped :: (HasCallStack, MonadIO m) => Structure -> Word32 -> GType -> m Bool
- data StructureIdSetValueMethodInfo
- structureIdSetValue :: (HasCallStack, MonadIO m) => Structure -> Word32 -> GValue -> m ()
- data StructureIdTakeValueMethodInfo
- structureIdTakeValue :: (HasCallStack, MonadIO m) => Structure -> Word32 -> GValue -> m ()
- data StructureIntersectMethodInfo
- structureIntersect :: (HasCallStack, MonadIO m) => Structure -> Structure -> m Structure
- data StructureIsEqualMethodInfo
- structureIsEqual :: (HasCallStack, MonadIO m) => Structure -> Structure -> m Bool
- data StructureIsSubsetMethodInfo
- structureIsSubset :: (HasCallStack, MonadIO m) => Structure -> Structure -> m Bool
- data StructureMapInPlaceMethodInfo
- structureMapInPlace :: (HasCallStack, MonadIO m) => Structure -> StructureMapFunc -> m Bool
- data StructureNFieldsMethodInfo
- structureNFields :: (HasCallStack, MonadIO m) => Structure -> m Int32
- structureNewEmpty :: (HasCallStack, MonadIO m) => Text -> m Structure
- structureNewFromString :: (HasCallStack, MonadIO m) => Text -> m (Maybe Structure)
- structureNewIdEmpty :: (HasCallStack, MonadIO m) => Word32 -> m Structure
- data StructureNthFieldNameMethodInfo
- structureNthFieldName :: (HasCallStack, MonadIO m) => Structure -> Word32 -> m Text
- data StructureRemoveAllFieldsMethodInfo
- structureRemoveAllFields :: (HasCallStack, MonadIO m) => Structure -> m ()
- data StructureRemoveFieldMethodInfo
- structureRemoveField :: (HasCallStack, MonadIO m) => Structure -> Text -> m ()
- data StructureSetNameMethodInfo
- structureSetName :: (HasCallStack, MonadIO m) => Structure -> Text -> m ()
- data StructureSetParentRefcountMethodInfo
- structureSetParentRefcount :: (HasCallStack, MonadIO m) => Structure -> Int32 -> m Bool
- data StructureSetValueMethodInfo
- structureSetValue :: (HasCallStack, MonadIO m) => Structure -> Text -> GValue -> m ()
- data StructureTakeValueMethodInfo
- structureTakeValue :: (HasCallStack, MonadIO m) => Structure -> Text -> GValue -> m ()
- data StructureToStringMethodInfo
- structureToString :: (HasCallStack, MonadIO m) => Structure -> m Text
- getStructureType :: MonadIO m => Structure -> m GType
- setStructureType :: MonadIO m => Structure -> GType -> m ()
- structure_type :: AttrLabelProxy "type"
Exported types
newZeroStructure :: MonadIO m => m Structure Source #
Construct a Structure
struct initialized to zero.
Methods
canIntersect
data StructureCanIntersectMethodInfo Source #
((~) * signature (Structure -> m Bool), MonadIO m) => MethodInfo * StructureCanIntersectMethodInfo Structure signature Source # | |
structureCanIntersect Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Structure |
|
-> m Bool | Returns: |
Tries intersecting struct1
and struct2
and reports whether the result
would not be empty.
copy
data StructureCopyMethodInfo Source #
((~) * signature (m Structure), MonadIO m) => MethodInfo * StructureCopyMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> m Structure | Returns: a new |
Duplicates a Structure
and all its fields and values.
Free-function: gst_structure_free
filterAndMapInPlace
data StructureFilterAndMapInPlaceMethodInfo Source #
((~) * signature (StructureFilterMapFunc -> m ()), MonadIO m) => MethodInfo * StructureFilterAndMapInPlaceMethodInfo Structure signature Source # | |
structureFilterAndMapInPlace Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> StructureFilterMapFunc |
|
-> m () |
Calls the provided function once for each field in the Structure
. In
contrast to structureForeach
, the function may modify the fields.
In contrast to structureMapInPlace
, the field is removed from
the structure if False
is returned from the function.
The structure must be mutable.
Since: 1.6
fixate
data StructureFixateMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * StructureFixateMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> m () |
Fixate all values in structure
using valueFixate
.
structure
will be modified in-place and should be writable.
fixateField
data StructureFixateFieldMethodInfo Source #
((~) * signature (Text -> m Bool), MonadIO m) => MethodInfo * StructureFixateFieldMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m Bool | Returns: |
Fixates a Structure
by changing the given field with its fixated value.
fixateFieldBoolean
structureFixateFieldBoolean Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> Bool |
|
-> m Bool | Returns: |
Fixates a Structure
by changing the given fieldName
field to the given
target
boolean if that field is not fixed yet.
fixateFieldNearestDouble
structureFixateFieldNearestDouble Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> Double |
|
-> m Bool | Returns: |
Fixates a Structure
by changing the given field to the nearest
double to target
that is a subset of the existing field.
fixateFieldNearestFraction
structureFixateFieldNearestFraction Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> Int32 |
|
-> Int32 |
|
-> m Bool | Returns: |
Fixates a Structure
by changing the given field to the nearest
fraction to targetNumerator
/targetDenominator
that is a subset
of the existing field.
fixateFieldNearestInt
structureFixateFieldNearestInt Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> Int32 |
|
-> m Bool | Returns: |
Fixates a Structure
by changing the given field to the nearest
integer to target
that is a subset of the existing field.
fixateFieldString
structureFixateFieldString Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> Text |
|
-> m Bool | Returns: |
Fixates a Structure
by changing the given fieldName
field to the given
target
string if that field is not fixed yet.
foreach
data StructureForeachMethodInfo Source #
((~) * signature (StructureForeachFunc -> m Bool), MonadIO m) => MethodInfo * StructureForeachMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> StructureForeachFunc |
|
-> m Bool | Returns: |
Calls the provided function once for each field in the Structure
. The
function must not modify the fields. Also see structureMapInPlace
and structureFilterAndMapInPlace
.
free
data StructureFreeMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * StructureFreeMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> m () |
Frees a Structure
and all its fields and values. The structure must not
have a parent when this function is called.
fromString
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Maybe Structure, Text) | Returns: a new |
getBoolean
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Bool) | Returns: |
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.
getClockTime
structureGetClockTime Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Word64) | Returns: |
Sets the clock time pointed to by value
corresponding to the clock time
of the given field. Caller is responsible for making sure the field exists
and has the correct type.
getDate
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Date) | Returns: |
Sets the date pointed to by 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
should be freed with dateFree
when no longer needed (note: this is
inconsistent with e.g. structureGetString
which doesn't return a
copy of the string).
getDateTime
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, DateTime) | Returns: |
Sets the datetime pointed to by 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 dateTimeUnref
when no longer needed
(note: this is inconsistent with e.g. structureGetString
which doesn't return a copy of the string).
getDouble
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Double) | Returns: |
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.
getEnum
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> GType |
|
-> m (Bool, Int32) | Returns: |
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.
getFieldType
data StructureGetFieldTypeMethodInfo Source #
((~) * signature (Text -> m GType), MonadIO m) => MethodInfo * StructureGetFieldTypeMethodInfo Structure signature Source # | |
structureGetFieldType Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m GType | Returns: the |
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.
getFlagset
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Word32, Word32) | Returns: |
Read the GstFlagSet flags and mask out of the structure into the provided pointers.
Since: 1.6
getFraction
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Int32, Int32) | Returns: |
Sets the integers pointed to by valueNumerator
and valueDenominator
corresponding to the value of the given field. Caller is responsible
for making sure the field exists and has the correct type.
getInt
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Int32) | Returns: |
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.
getInt64
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Int64) | Returns: |
Sets the gint64
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.
Since: 1.4
getName
data StructureGetNameMethodInfo Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * StructureGetNameMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> m Text | Returns: the name of the structure. |
Get the name of structure
as a string.
getNameId
data StructureGetNameIdMethodInfo Source #
((~) * signature (m Word32), MonadIO m) => MethodInfo * StructureGetNameIdMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> m Word32 | Returns: the quark representing the name of the structure. |
Get the name of structure
as a GQuark.
getString
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Maybe Text) | Returns: a pointer to the string or |
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.
getUint
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Word32) | Returns: |
Sets the uint 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.
getUint64
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m (Bool, Word64) | Returns: |
Sets the guint64
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.
Since: 1.4
getValue
data StructureGetValueMethodInfo Source #
((~) * signature (Text -> m GValue), MonadIO m) => MethodInfo * StructureGetValueMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m GValue | Returns: the |
Get the value of the field with name fieldname
.
hasField
data StructureHasFieldMethodInfo Source #
((~) * signature (Text -> m Bool), MonadIO m) => MethodInfo * StructureHasFieldMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m Bool | Returns: |
Check if structure
contains a field named fieldname
.
hasFieldTyped
structureHasFieldTyped Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> GType |
|
-> m Bool | Returns: |
Check if structure
contains a field named fieldname
and with GType type
.
hasName
data StructureHasNameMethodInfo Source #
((~) * signature (Text -> m Bool), MonadIO m) => MethodInfo * StructureHasNameMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m Bool | Returns: |
Checks if the structure has the given name
idGetValue
data StructureIdGetValueMethodInfo Source #
((~) * signature (Word32 -> m GValue), MonadIO m) => MethodInfo * StructureIdGetValueMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Word32 |
|
-> m GValue | Returns: the |
Get the value of the field with GQuark field
.
idHasField
data StructureIdHasFieldMethodInfo Source #
((~) * signature (Word32 -> m Bool), MonadIO m) => MethodInfo * StructureIdHasFieldMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Word32 |
|
-> m Bool | Returns: |
Check if structure
contains a field named field
.
idHasFieldTyped
structureIdHasFieldTyped Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Word32 |
|
-> GType |
|
-> m Bool | Returns: |
Check if structure
contains a field named field
and with GType type
.
idSetValue
data StructureIdSetValueMethodInfo Source #
((~) * signature (Word32 -> GValue -> m ()), MonadIO m) => MethodInfo * StructureIdSetValueMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Word32 |
|
-> GValue |
|
-> m () |
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.
idTakeValue
data StructureIdTakeValueMethodInfo Source #
((~) * signature (Word32 -> GValue -> m ()), MonadIO m) => MethodInfo * StructureIdTakeValueMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Word32 |
|
-> GValue |
|
-> m () |
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.
intersect
data StructureIntersectMethodInfo Source #
((~) * signature (Structure -> m Structure), MonadIO m) => MethodInfo * StructureIntersectMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Structure |
|
-> m Structure | Returns: Intersection of |
Intersects struct1
and struct2
and returns the intersection.
isEqual
data StructureIsEqualMethodInfo Source #
((~) * signature (Structure -> m Bool), MonadIO m) => MethodInfo * StructureIsEqualMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Structure |
|
-> m Bool | Returns: |
Tests if the two Structure
are equal.
isSubset
data StructureIsSubsetMethodInfo Source #
((~) * signature (Structure -> m Bool), MonadIO m) => MethodInfo * StructureIsSubsetMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Structure |
|
-> m Bool | Returns: |
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
.
mapInPlace
data StructureMapInPlaceMethodInfo Source #
((~) * signature (StructureMapFunc -> m Bool), MonadIO m) => MethodInfo * StructureMapInPlaceMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> StructureMapFunc |
|
-> m Bool | Returns: |
Calls the provided function once for each field in the Structure
. In
contrast to structureForeach
, the function may modify but not delete the
fields. The structure must be mutable.
nFields
data StructureNFieldsMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * StructureNFieldsMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> m Int32 | Returns: the number of fields in the structure |
Get the number of fields in the structure.
newEmpty
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Structure | Returns: a new, empty |
Creates a new, empty Structure
with the given name
.
See structureSetName
for constraints on the name
parameter.
Free-function: gst_structure_free
newFromString
structureNewFromString Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Maybe Structure) | Returns: a new |
Creates a Structure
from a string representation.
If end is not Nothing
, 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 Caps
/ Structure
deeper than one level.
Free-function: gst_structure_free
Since: 1.2
newIdEmpty
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m Structure | Returns: a new, empty |
Creates a new, empty Structure
with the given name as a GQuark.
Free-function: gst_structure_free
nthFieldName
data StructureNthFieldNameMethodInfo Source #
((~) * signature (Word32 -> m Text), MonadIO m) => MethodInfo * StructureNthFieldNameMethodInfo Structure signature Source # | |
structureNthFieldName Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Word32 |
|
-> m Text | Returns: the name of the given field number |
Get the name of the given field number, counting from 0 onwards.
removeAllFields
data StructureRemoveAllFieldsMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * StructureRemoveAllFieldsMethodInfo Structure signature Source # | |
structureRemoveAllFields Source #
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> m () |
Removes all fields in a GstStructure.
removeField
data StructureRemoveFieldMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * StructureRemoveFieldMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m () |
Removes the field with the given name. If the field with the given name does not exist, the structure is unchanged.
setName
data StructureSetNameMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * StructureSetNameMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> m () |
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 "/-_.:".
setParentRefcount
data StructureSetParentRefcountMethodInfo Source #
((~) * signature (Int32 -> m Bool), MonadIO m) => MethodInfo * StructureSetParentRefcountMethodInfo Structure signature Source # | |
setValue
data StructureSetValueMethodInfo Source #
((~) * signature (Text -> GValue -> m ()), MonadIO m) => MethodInfo * StructureSetValueMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> GValue |
|
-> m () |
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.
takeValue
data StructureTakeValueMethodInfo Source #
((~) * signature (Text -> GValue -> m ()), MonadIO m) => MethodInfo * StructureTakeValueMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> Text |
|
-> GValue |
|
-> m () |
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
.
toString
data StructureToStringMethodInfo Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * StructureToStringMethodInfo Structure signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Structure |
|
-> m Text | Returns: a pointer to string allocated by |
Converts structure
to a human-readable string representation.
For debugging purposes its easier to do something like this:
C code
GST_LOG ("structure is %" GST_PTR_FORMAT, structure);
This prints the structure in human readable form.
The current implementation of serialization will lead to unexpected results
when there are nested Caps
/ Structure
deeper than one level.
Free-function: g_free
Properties
type
structure_type :: AttrLabelProxy "type" Source #