![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
#include <gst/gst.h> GstStructure; gboolean (*GstStructureForeachFunc) (GQuark field_id, const GValue *value, gpointer user_data); gboolean (*GstStructureMapFunc) (GQuark field_id, GValue *value, gpointer user_data); GstStructure* gst_structure_empty_new (const gchar *name); GstStructure* gst_structure_id_empty_new (GQuark quark); GstStructure* gst_structure_new (const gchar *name, const gchar *firstfield, ...); GstStructure* gst_structure_new_valist (const gchar *name, const gchar *firstfield, va_list varargs); GstStructure* gst_structure_copy (const GstStructure *structure); void gst_structure_free (GstStructure *structure); const gchar* gst_structure_get_name (const GstStructure *structure); gboolean gst_structure_has_name (const GstStructure *structure, const gchar *name); void gst_structure_set_name (GstStructure *structure, const gchar *name); GQuark gst_structure_get_name_id (const GstStructure *structure); const GValue* gst_structure_id_get_value (const GstStructure *structure, GQuark field); void gst_structure_id_set_value (GstStructure *structure, GQuark field, const GValue *value); const GValue* gst_structure_get_value (const GstStructure *structure, const gchar *fieldname); void gst_structure_set_value (GstStructure *structure, const gchar *fieldname, const GValue *value); void gst_structure_set (GstStructure *structure, const gchar *fieldname, ...); void gst_structure_set_valist (GstStructure *structure, const gchar *fieldname, va_list varargs); void gst_structure_id_set (GstStructure *structure, GQuark fieldname, ...); void gst_structure_id_set_valist (GstStructure *structure, GQuark fieldname, va_list varargs); void gst_structure_remove_field (GstStructure *structure, const gchar *fieldname); void gst_structure_remove_fields (GstStructure *structure, const gchar *fieldname, ...); void gst_structure_remove_fields_valist (GstStructure *structure, const gchar *fieldname, va_list varargs); void gst_structure_remove_all_fields (GstStructure *structure); GType gst_structure_get_field_type (const GstStructure *structure, const gchar *fieldname); gboolean gst_structure_foreach (const GstStructure *structure, GstStructureForeachFunc func, gpointer user_data); gint gst_structure_n_fields (const GstStructure *structure); gboolean gst_structure_has_field (const GstStructure *structure, const gchar *fieldname); gboolean gst_structure_has_field_typed (const GstStructure *structure, const gchar *fieldname, GType type); gboolean gst_structure_get_boolean (const GstStructure *structure, const gchar *fieldname, gboolean *value); gboolean gst_structure_get_int (const GstStructure *structure, const gchar *fieldname, gint *value); gboolean gst_structure_get_fourcc (const GstStructure *structure, const gchar *fieldname, guint32 *value); gboolean gst_structure_get_double (const GstStructure *structure, const gchar *fieldname, gdouble *value); const gchar* gst_structure_get_string (const GstStructure *structure, const gchar *fieldname); gboolean gst_structure_get_date (const GstStructure *structure, const gchar *fieldname, GDate **value); gboolean gst_structure_get_clock_time (const GstStructure *structure, const gchar *fieldname, GstClockTime *value); gboolean gst_structure_get_enum (const GstStructure *structure, const gchar *fieldname, GType enumtype, gint *value); gboolean gst_structure_get_fraction (const GstStructure *structure, const gchar *fieldname, gint *value_numerator, gint *value_denominator); gboolean gst_structure_map_in_place (GstStructure *structure, GstStructureMapFunc func, gpointer user_data); const gchar* gst_structure_nth_field_name (const GstStructure *structure, guint index); void gst_structure_set_parent_refcount (GstStructure *structure, gint *refcount); gchar* gst_structure_to_string (const GstStructure *structure); GstStructure* gst_structure_from_string (const gchar *string, gchar **end); gboolean gst_structure_fixate_field_nearest_int (GstStructure *structure, const char *field_name, int target); gboolean gst_structure_fixate_field_nearest_double (GstStructure *structure, const char *field_name, double target); gboolean gst_structure_fixate_field_nearest_fraction (GstStructure *structure, const char *field_name, const gint target_numerator, const gint target_denominator); gboolean gst_structure_fixate_field_boolean (GstStructure *structure, const char *field_name, gboolean target);
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.
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. 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_empty_new()
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()
.
Last reviewed on 2005-11-09 (0.9.4)
typedef struct { GType type; } GstStructure;
The GstStructure object. Most fields are private.
type
;GTypetype
the GType of a structure
the GType of a structure
GType type ; |
the GType of a structure |
gboolean (*GstStructureForeachFunc) (GQuark field_id, const GValue *value, gpointer user_data);
A function that will be called in gst_structure_foreach()
. The function may
not modify value
.
field_id
:field_id
the GQuark of the field name
the GQuark of the field name
GQuarkGQuarkvalue
:value
the GValue of the field
the GValue of the field
GValueGValueuser_data
:user_data
user data
user data
Returns :Returns TRUE if the foreach operation should continue, FALSE if
the foreach operation should stop with FALSE.
TRUE if the foreach operation should continue, FALSE if
the foreach operation should stop with FALSE.
field_id : |
the GQuark of the field name |
value : |
the GValue of the field |
user_data : |
user data |
Returns : | TRUE if the foreach operation should continue, FALSE if the foreach operation should stop with FALSE. |
gboolean (*GstStructureMapFunc) (GQuark field_id, GValue *value, gpointer user_data);
A function that will be called in gst_structure_map_in_place()
. The function
may modify value
.
field_id
:field_id
the GQuark of the field name
the GQuark of the field name
GQuarkGQuarkvalue
:value
the GValue of the field
the GValue of the field
GValueGValueuser_data
:user_data
user data
user data
Returns :Returns TRUE if the map operation should continue, FALSE if
the map operation should stop with FALSE.
TRUE if the map operation should continue, FALSE if
the map operation should stop with FALSE.
field_id : |
the GQuark of the field name |
value : |
the GValue of the field |
user_data : |
user data |
Returns : | TRUE if the map operation should continue, FALSE if the map operation should stop with FALSE. |
GstStructure* gst_structure_empty_new (const gchar *name);
Creates a new, empty GstStructure with the given name.
name
:name
name of new structure
name of new structure
Returns :Returns a new, empty GstStructure
a new, empty GstStructure
GstStructureGstStructure
name : |
name of new structure |
Returns : | a new, empty GstStructure |
GstStructure* gst_structure_id_empty_new (GQuark quark);
Creates a new, empty GstStructure with the given name as a GQuark.
quark
:quark
name of new structure
name of new structure
Returns :Returns a new, empty GstStructure
a new, empty GstStructure
GstStructureGstStructure
quark : |
name of new structure |
Returns : | a new, empty GstStructure |
GstStructure* gst_structure_new (const gchar *name, const gchar *firstfield, ...);
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
:name
name of new structure
name of new structure
firstfield
:firstfield
name of first field to set
name of first field to set
...
:...
additional arguments
additional arguments
Returns :Returns a new GstStructure
a new GstStructure
GstStructureGstStructure
name : |
name of new structure |
firstfield : |
name of first field to set |
... : |
additional arguments |
Returns : | a new GstStructure |
GstStructure* gst_structure_new_valist (const gchar *name, const gchar *firstfield, va_list varargs);
Creates a new GstStructure with the given name. Structure fields
are set according to the varargs in a manner similar to
gst_structure_new
.
name
:name
name of new structure
name of new structure
firstfield
:firstfield
name of first field to set
name of first field to set
varargs
:varargs
variable argument list
variable argument list
Returns :Returns a new GstStructure
a new GstStructure
GstStructureGstStructure
name : |
name of new structure |
firstfield : |
name of first field to set |
varargs : |
variable argument list |
Returns : | a new GstStructure |
GstStructure* gst_structure_copy (const GstStructure *structure);
Duplicates a GstStructure and all its fields and values.
structure
:structure
a GstStructure to duplicate
a GstStructure to duplicate
GstStructureGstStructureReturns :Returns a new GstStructure.
a new GstStructure.
GstStructureGstStructure
structure : |
a GstStructure to duplicate |
Returns : | a new GstStructure. |
void gst_structure_free (GstStructure *structure);
Frees a GstStructure and all its fields and values. The structure must not have a parent when this function is called.
structure
:structure
the GstStructure to free
the GstStructure to free
GstStructureGstStructure
structure : |
the GstStructure to free |
const gchar* gst_structure_get_name (const GstStructure *structure);
Get the name of structure
as a string.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructureReturns :Returns the name of the structure.
the name of the structure.
structure : |
a GstStructure |
Returns : | the name of the structure. |
gboolean gst_structure_has_name (const GstStructure *structure, const gchar *name);
Checks if the structure has the given name
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurename
:name
structure name to check for
structure name to check for
Returns :Returns TRUE if name
matches the name of the structure.
TRUE if name
matches the name of the structure.
name
structure : |
a GstStructure |
name : |
structure name to check for |
Returns : | TRUE if name matches the name of the structure.
|
void gst_structure_set_name (GstStructure *structure, const gchar *name);
Sets the name of the structure to the given name. The string provided is copied before being used.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurename
:name
the new name of the structure
the new name of the structure
structure : |
a GstStructure |
name : |
the new name of the structure |
GQuark gst_structure_get_name_id (const GstStructure *structure);
Get the name of structure
as a GQuark.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructureReturns :Returns the quark representing the name of the structure.
the quark representing the name of the structure.
structure : |
a GstStructure |
Returns : | the quark representing the name of the structure. |
const GValue* gst_structure_id_get_value (const GstStructure *structure, GQuark field);
Get the value of the field with GQuark field
.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefield
:field
the GQuark of the field to get
the GQuark of the field to get
GQuarkGQuarkReturns :Returns the GValue corresponding to the field with the given name
identifier.
the GValue corresponding to the field with the given name
identifier.
GValueGValue
structure : |
a GstStructure |
field : |
the GQuark of the field to get |
Returns : | the GValue corresponding to the field with the given name identifier. |
void gst_structure_id_set_value (GstStructure *structure, GQuark field, const GValue *value);
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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefield
:field
a GQuark representing a field
a GQuark representing a field
GQuarkGQuarkvalue
:value
the new value of the field
the new value of the field
structure : |
a GstStructure |
field : |
a GQuark representing a field |
value : |
the new value of the field |
const GValue* gst_structure_get_value (const GstStructure *structure, const gchar *fieldname);
Get the value of the field with name fieldname
.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field to get
the name of the field to get
Returns :Returns the GValue corresponding to the field with the given name.
the GValue corresponding to the field with the given name.
GValueGValue
structure : |
a GstStructure |
fieldname : |
the name of the field to get |
Returns : | the GValue corresponding to the field with the given name. |
void gst_structure_set_value (GstStructure *structure, const gchar *fieldname, const GValue *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field to set
the name of the field to set
value
:value
the new value of the field
the new value of the field
structure : |
a GstStructure |
fieldname : |
the name of the field to set |
value : |
the new value of the field |
void gst_structure_set (GstStructure *structure, const gchar *fieldname, ...);
Parses the variable arguments and sets fields accordingly. Variable arguments should be in the form field name, field type (as a GType), value(s). The last variable argument should be NULL.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field to set
the name of the field to set
...
:...
variable arguments
variable arguments
structure : |
a GstStructure |
fieldname : |
the name of the field to set |
... : |
variable arguments |
void gst_structure_set_valist (GstStructure *structure, const gchar *fieldname, va_list varargs);
va_list form of gst_structure_set()
.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field to set
the name of the field to set
varargs
:varargs
variable arguments
variable arguments
structure : |
a GstStructure |
fieldname : |
the name of the field to set |
varargs : |
variable arguments |
void gst_structure_id_set (GstStructure *structure, GQuark fieldname, ...);
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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the GQuark for the name of the field to set
the GQuark for the name of the field to set
...
:...
variable arguments
variable arguments
structure : |
a GstStructure |
fieldname : |
the GQuark for the name of the field to set |
... : |
variable arguments |
Since 0.10.10
void gst_structure_id_set_valist (GstStructure *structure, GQuark fieldname, va_list varargs);
va_list form of gst_structure_id_set()
.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field to set
the name of the field to set
varargs
:varargs
variable arguments
variable arguments
structure : |
a GstStructure |
fieldname : |
the name of the field to set |
varargs : |
variable arguments |
Since 0.10.10
void gst_structure_remove_field (GstStructure *structure, const gchar *fieldname);
Removes the field with the given name. If the field with the given name does not exist, the structure is unchanged.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field to remove
the name of the field to remove
structure : |
a GstStructure |
fieldname : |
the name of the field to remove |
void gst_structure_remove_fields (GstStructure *structure, const gchar *fieldname, ...);
Removes the fields with the given names. If a field does not exist, the argument is ignored.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field to remove
the name of the field to remove
...
:...
NULL-terminated list of more fieldnames to remove
NULL-terminated list of more fieldnames to remove
structure : |
a GstStructure |
fieldname : |
the name of the field to remove |
... : |
NULL-terminated list of more fieldnames to remove |
void gst_structure_remove_fields_valist (GstStructure *structure, const gchar *fieldname, va_list varargs);
va_list form of gst_structure_remove_fields()
.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field to remove
the name of the field to remove
varargs
:varargs
NULL-terminated list of more fieldnames to remove
NULL-terminated list of more fieldnames to remove
structure : |
a GstStructure |
fieldname : |
the name of the field to remove |
varargs : |
NULL-terminated list of more fieldnames to remove |
void gst_structure_remove_all_fields (GstStructure *structure);
Removes all fields in a GstStructure.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructure
structure : |
a GstStructure |
GType gst_structure_get_field_type (const GstStructure *structure, const gchar *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of the field
the name of the field
Returns :Returns the GValue of the field
the GValue of the field
GValueGValue
structure : |
a GstStructure |
fieldname : |
the name of the field |
Returns : | the GValue of the field |
gboolean gst_structure_foreach (const GstStructure *structure, GstStructureForeachFunc func, gpointer 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()
.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefunc
:func
a function to call for each field
a function to call for each field
user_data
:user_data
private data
private data
Returns :Returns TRUE if the supplied function returns TRUE For each of the fields,
FALSE otherwise.
TRUE if the supplied function returns TRUE For each of the fields,
FALSE otherwise.
structure : |
a GstStructure |
func : |
a function to call for each field |
user_data : |
private data |
Returns : | TRUE if the supplied function returns TRUE For each of the fields, FALSE otherwise. |
gint gst_structure_n_fields (const GstStructure *structure);
Get the number of fields in the structure.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructureReturns :Returns the number of fields in the structure
the number of fields in the structure
structure : |
a GstStructure |
Returns : | the number of fields in the structure |
gboolean gst_structure_has_field (const GstStructure *structure, const gchar *fieldname);
Check if structure
contains a field named fieldname
.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
Returns :Returns TRUE if the structure contains a field with the given name
TRUE if the structure contains a field with the given name
structure : |
a GstStructure |
fieldname : |
the name of a field |
Returns : | TRUE if the structure contains a field with the given name |
gboolean gst_structure_has_field_typed (const GstStructure *structure, const gchar *fieldname, GType type);
Check if structure
contains a field named fieldname
and with GType type
.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
type
:type
the type of a value
the type of a value
Returns :Returns TRUE if the structure contains a field with the given name and type
TRUE if the structure contains a field with the given name and type
structure : |
a GstStructure |
fieldname : |
the name of a field |
type : |
the type of a value |
Returns : | TRUE if the structure contains a field with the given name and type |
gboolean gst_structure_get_boolean (const GstStructure *structure, const gchar *fieldname, gboolean *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
value
:value
a pointer to a gboolean to set
a pointer to a gboolean to set
gbooleangbooleanReturns :Returns 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.
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.
fieldname
structure : |
a GstStructure |
fieldname : |
the name of a field |
value : |
a pointer to a gboolean to set |
Returns : | 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.
|
gboolean gst_structure_get_int (const GstStructure *structure, const gchar *fieldname, gint *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.
Returns: 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
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
value
:value
a pointer to an int to set
a pointer to an int to set
Returns :ReturnsFALSE.
FALSE.
structure : |
a GstStructure |
fieldname : |
the name of a field |
value : |
a pointer to an int to set |
Returns : | FALSE. |
gboolean gst_structure_get_fourcc (const GstStructure *structure, const gchar *fieldname, guint32 *value);
Sets the GstFourcc 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.
Returns: TRUE if the value could be set correctly. If there was no field
with fieldname
or the existing field did not contain a fourcc, this function
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
value
:value
a pointer to a GstFourcc to set
a pointer to a GstFourcc to set
GstFourccGstFourccReturns :ReturnsFALSE.
FALSE.
structure : |
a GstStructure |
fieldname : |
the name of a field |
value : |
a pointer to a GstFourcc to set |
Returns : | FALSE. |
gboolean gst_structure_get_double (const GstStructure *structure, const gchar *fieldname, gdouble *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
value
:value
a pointer to a GstFourcc to set
a pointer to a GstFourcc to set
GstFourccGstFourccReturns :Returns 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.
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.
fieldname
structure : |
a GstStructure |
fieldname : |
the name of a field |
value : |
a pointer to a GstFourcc to set |
Returns : | 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.
|
const gchar* gst_structure_get_string (const GstStructure *structure, const gchar *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
Returns :Returns a pointer to the string or NULL when the field did not exist
or did not contain a string.
a pointer to the string or NULL when the field did not exist
or did not contain a string.
structure : |
a GstStructure |
fieldname : |
the name of a field |
Returns : | a pointer to the string or NULL when the field did not exist or did not contain a string. |
gboolean gst_structure_get_date (const GstStructure *structure, const gchar *fieldname, GDate **value);
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.
Returns: TRUE if the value could be set correctly. If there was no field
with fieldname
or the existing field did not contain a data, this function
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
value
:value
a pointer to a GDate to set
a pointer to a GDate to set
GDateGDateReturns :ReturnsFALSE.
FALSE.
structure : |
a GstStructure |
fieldname : |
the name of a field |
value : |
a pointer to a GDate to set |
Returns : | FALSE. |
gboolean gst_structure_get_clock_time (const GstStructure *structure, const gchar *fieldname, GstClockTime *value);
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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
value
:value
a pointer to a GstClockTime to set
a pointer to a GstClockTime to set
GstClockTimeGstClockTimeReturns :Returns TRUE if the value could be set correctly. If there was no field
with fieldname
or the existing field did not contain a GstClockTime, this
function returns FALSE.
TRUE if the value could be set correctly. If there was no field
with fieldname
or the existing field did not contain a GstClockTime, this
function returns FALSE.
fieldname
GstClockTimeGstClockTime
structure : |
a GstStructure |
fieldname : |
the name of a field |
value : |
a pointer to a GstClockTime to set |
Returns : | TRUE if the value could be set correctly. If there was no field
with fieldname or the existing field did not contain a GstClockTime, this
function returns FALSE.
|
gboolean gst_structure_get_enum (const GstStructure *structure, const gchar *fieldname, GType enumtype, gint *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
enumtype
:enumtype
the enum type of a field
the enum type of a field
value
:value
a pointer to an int to set
a pointer to an int to set
Returns :Returns 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.
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.
fieldname
structure : |
a GstStructure |
fieldname : |
the name of a field |
enumtype : |
the enum type of a field |
value : |
a pointer to an int to set |
Returns : | 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.
|
gboolean gst_structure_get_fraction (const GstStructure *structure, const gchar *fieldname, gint *value_numerator, gint *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefieldname
:fieldname
the name of a field
the name of a field
value_numerator
:value_numerator
a pointer to an int to set
a pointer to an int to set
value_denominator
:value_denominator
a pointer to an int to set
a pointer to an int to set
Returns :Returns 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.
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.
fieldname
structure : |
a GstStructure |
fieldname : |
the name of a field |
value_numerator : |
a pointer to an int to set |
value_denominator : |
a pointer to an int to set |
Returns : | 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.
|
gboolean gst_structure_map_in_place (GstStructure *structure, GstStructureMapFunc func, gpointer user_data);
Calls the provided function once for each field in the GstStructure. In
contrast to gst_structure_foreach()
, the function may modify the fields. The
structure must be mutable.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefunc
:func
a function to call for each field
a function to call for each field
user_data
:user_data
private data
private data
Returns :Returns TRUE if the supplied function returns TRUE For each of the fields,
FALSE otherwise.
TRUE if the supplied function returns TRUE For each of the fields,
FALSE otherwise.
structure : |
a GstStructure |
func : |
a function to call for each field |
user_data : |
private data |
Returns : | TRUE if the supplied function returns TRUE For each of the fields, FALSE otherwise. |
const gchar* gst_structure_nth_field_name (const GstStructure *structure, guint index);
Get the name of the given field number, counting from 0 onwards.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructureindex
:index
the index to get the name of
the index to get the name of
Returns :Returns the name of the given field number
the name of the given field number
structure : |
a GstStructure |
index : |
the index to get the name of |
Returns : | the name of the given field number |
void gst_structure_set_parent_refcount (GstStructure *structure, gint *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurerefcount
:refcount
a pointer to the parent's refcount
a pointer to the parent's refcount
structure : |
a GstStructure |
refcount : |
a pointer to the parent's refcount |
gchar* gst_structure_to_string (const GstStructure *structure);
Converts structure
to a human-readable string representation.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructureReturns :Returns a pointer to string allocated by g_malloc()
. g_free()
after
usage.
a pointer to string allocated by g_malloc()
. g_free()
after
usage.
g_malloc()
g_malloc()
g_free()
g_free()
structure : |
a GstStructure |
Returns : | a pointer to string allocated by g_malloc() . g_free() after
usage.
|
GstStructure* gst_structure_from_string (const gchar *string, gchar **end);
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.
string
:string
a string representation of a GstStructure.
a string representation of a GstStructure.
GstStructureGstStructureend
:end
pointer to store the end of the string in.
pointer to store the end of the string in.
Returns :Returns a new GstStructure or NULL when the string could not
be parsed. Free after usage.
a new GstStructure or NULL when the string could not
be parsed. Free after usage.
GstStructureGstStructure
string : |
a string representation of a GstStructure. |
end : |
pointer to store the end of the string in. |
Returns : | a new GstStructure or NULL when the string could not be parsed. Free after usage. |
gboolean gst_structure_fixate_field_nearest_int (GstStructure *structure, const char *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefield_name
:field_name
a field in structure
a field in structure
structure
target
:target
the target value of the fixation
the target value of the fixation
Returns :Returns TRUE if the structure could be fixated
TRUE if the structure could be fixated
structure : |
a GstStructure |
field_name : |
a field in structure
|
target : |
the target value of the fixation |
Returns : | TRUE if the structure could be fixated |
gboolean gst_structure_fixate_field_nearest_double (GstStructure *structure, const char *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.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefield_name
:field_name
a field in structure
a field in structure
structure
target
:target
the target value of the fixation
the target value of the fixation
Returns :Returns TRUE if the structure could be fixated
TRUE if the structure could be fixated
structure : |
a GstStructure |
field_name : |
a field in structure
|
target : |
the target value of the fixation |
Returns : | TRUE if the structure could be fixated |
gboolean gst_structure_fixate_field_nearest_fraction (GstStructure *structure, const char *field_name, const gint target_numerator, const gint target_denominator);
Fixates a GstStructure by changing the given field to the nearest
fraction to target_numerator
/target_denominator
that is a subset
of the existing field.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefield_name
:field_name
a field in structure
a field in structure
structure
target_numerator
:target_numerator
The numerator of the target value of the fixation
The numerator of the target value of the fixation
target_denominator
:target_denominator
The denominator of the target value of the fixation
The denominator of the target value of the fixation
Returns :Returns TRUE if the structure could be fixated
TRUE if the structure could be fixated
structure : |
a GstStructure |
field_name : |
a field in structure
|
target_numerator : |
The numerator of the target value of the fixation |
target_denominator : |
The denominator of the target value of the fixation |
Returns : | TRUE if the structure could be fixated |
gboolean gst_structure_fixate_field_boolean (GstStructure *structure, const char *field_name, gboolean target);
Fixates a GstStructure by changing the given field_name
field to the given
target
boolean if that field is not fixed yet.
structure
:structure
a GstStructure
a GstStructure
GstStructureGstStructurefield_name
:field_name
a field in structure
a field in structure
structure
target
:target
the target value of the fixation
the target value of the fixation
Returns :Returns TRUE if the structure could be fixated
TRUE if the structure could be fixated
structure : |
a GstStructure |
field_name : |
a field in structure
|
target : |
the target value of the fixation |
Returns : | TRUE if the structure could be fixated |