gstreamermm: Gst::Structure Class Reference
A generic class containing fields of names and values. More...
Public Types | |
| typedef sigc::slot< bool, const Glib::ustring &, const Glib::ValueBase& > | SlotForeach |
| For example, bool on_foreach(const Glib::ustring& id, const Glib::ValueBase& value);. More... | |
| typedef sigc::slot< bool, const Glib::ustring &, Glib::ValueBase& > | SlotMap |
| For example, bool on_map(const Glib::ustring& id, Glib::ValueBase& value);. More... | |
Public Member Functions | |
| Structure () | |
| Structure (GstStructure* gobject, bool make_a_copy=true) | |
| Structure (const Structure& other) | |
| Structure& | operator= (const Structure& other) |
| ~Structure () | |
| void | swap (Structure& other) |
| GstStructure* | gobj () |
| Provides access to the underlying C instance. More... | |
| const GstStructure* | gobj () const |
| Provides access to the underlying C instance. More... | |
| GstStructure* | gobj_copy () const |
| Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. More... | |
| Structure (const Glib::ustring& name) | |
| Creates a Structure with the given name. More... | |
| operator bool () const | |
| Use this to discover if the Structure is a valid object. More... | |
| Glib::ustring | get_name () const |
| Get the name of structure as a string. More... | |
| bool | has_name (const Glib::ustring& name) const |
| Checks if the structure has the given name. More... | |
| void | set_name (const Glib::ustring& name) |
| Sets the name of the structure to the given name. More... | |
| Glib::QueryQuark | get_name_id () const |
| Get the name of structure as a GQuark. More... | |
| void | get_field (const Glib::ustring& fieldname, Glib::ValueBase& value) const |
| Get the value of the field with name fieldname. More... | |
| void | set_field (const Glib::ustring& fieldname, const Glib::ValueBase& value) |
| Sets the field with name fieldname to value. More... | |
| void | set_field (const Glib::ustring& fieldname, bool value) |
| Sets the field with name fieldname to the boolean value. More... | |
| void | set_field (const Glib::ustring& fieldname, int value) |
| Sets the field with name fieldname to the int value. More... | |
| void | set_field (const Glib::ustring& fieldname, guint value) |
| Sets the field with name fieldname to the guint value. More... | |
| void | set_field (const Glib::ustring& fieldname, double value) |
| Sets the field with name fieldname to the double value. More... | |
| void | set_field (const Glib::ustring& fieldname, const std::string& value) |
| Sets the field with name fieldname to the std::string value. More... | |
| void | set_field (const Glib::ustring& fieldname, const char* value) |
| Sets the field with name fieldname to the string constant value. More... | |
| void | set_field (const Glib::ustring& fieldname, const Glib::Date& value) |
| Sets the field with name fieldname to the Glib::Date value. More... | |
| void | set_field (const Glib::ustring& fieldname, guint64 value) |
| Sets the field with name fieldname to the value. More... | |
| void | set_field (const Glib::ustring& fieldname, gint64 value) |
| Sets the field with name fieldname to the value. More... | |
| void | set_field (const Glib::ustring& fieldname, GType enumtype, int value) |
| Sets the field with name fieldname to the value value of the enum type enum_type. More... | |
| void | set_field (const Glib::ustring& fieldname, const Gst::Fraction& value) |
| Sets the field with name fieldname to the Gst::Fraction value. More... | |
| void | set_field (const Glib::ustring& fieldname, const Gst::IntRange& value) |
| Sets the field with name fieldname field to the Gst::IntRange value. More... | |
| void | set_field (const Glib::ustring& fieldname, const Gst::DoubleRange& value) |
| Sets the field with name fieldname field to the Gst::DoubleRange value. More... | |
| void | set_field (const Glib::ustring& fieldname, const Gst::FractionRange& value) |
| Sets the field with name fieldname field to the Gst::FractionRange value. More... | |
| void | remove_field (const Glib::ustring& fieldname) |
| Removes the field with name fieldname. More... | |
| void | remove_all_fields () |
| Removes all fields in a GstStructure. More... | |
| GType | get_field_type (const Glib::ustring& fieldname) const |
| Finds the field with the given name, and returns the type of the value it contains. More... | |
| bool | foreach (const SlotForeach& slot) |
| Calls the provided slot once for each field in the Gst::Structure. More... | |
| int | size () const |
| Get the number of fields in the structure. More... | |
| bool | has_field (const Glib::ustring& fieldname) const |
| Check if structure contains a field named fieldname. More... | |
| bool | has_field (const Glib::ustring& fieldname, GType type) const |
| Check if structure contains a field named fieldname and with GType type. More... | |
| bool | get_field (const Glib::ustring& fieldname, bool& value) const |
| Gets the value of field fieldname into boolean value. More... | |
| bool | get_field (const Glib::ustring& fieldname, int& value) const |
| Gets the value of field fieldname into integer value. More... | |
| bool | get_field (const Glib::ustring& fieldname, guint& value) const |
| Gets the value of field fieldname into guint value. More... | |
| bool | get_field (const Glib::ustring& fieldname, double& value) const |
| Gets the value of field fieldname into double value. More... | |
| bool | get_field (const Glib::ustring& fieldname, Glib::ustring& value) const |
| Gets the value of field fieldname into Glib::ustring value. More... | |
| bool | get_field (const Glib::ustring& fieldname, std::string& value) const |
| Gets the value of field fieldname into std::string value. More... | |
| bool | get_field (const Glib::ustring& fieldname, Glib::Date& value) const |
| Gets the value of field fieldname into Glib::Date value. More... | |
| bool | get_field (const Glib::ustring& fieldname, ClockTime& value) const |
| Gets the value of field fieldname into Gst::ClockTime value. More... | |
| bool | get_field (const Glib::ustring& fieldname, GType enumtype, int& value) const |
| Gets the value of field fieldname with GType enum type enumtype into integer value. More... | |
| bool | get_field (const Glib::ustring& fieldname, Gst::Fraction& value) const |
| Gets the value of field fieldname into Gst::Fraction value. More... | |
| bool | get_field (const Glib::ustring& fieldname, Gst::IntRange& value) const |
| Gets the value of field fieldname into Gst::IntRange value. More... | |
| bool | get_field (const Glib::ustring& fieldname, Gst::DoubleRange& value) const |
| Gets the value of field fieldname into Gst::DoubleRange value. More... | |
| bool | get_field (const Glib::ustring& fieldname, Gst::FractionRange& value) const |
| Gets the value of field fieldname into Gst::FractionRange value. More... | |
| bool | map_in_place (const SlotMap& slot) |
| Calls the provided slot once for each field in the Gst::Structure. More... | |
| Glib::ustring | get_nth_field_name (guint index) const |
| Get the name of the given field number, counting from 0 onwards. More... | |
| Glib::ustring | to_string () const |
| Converts structure to a human-readable string representation. More... | |
| bool | fixate_field_nearest_int (const Glib::ustring& name, int target) |
| Fixates a Gst::Structure by changing the given field to the nearest integer to target that is a subset of the existing field. More... | |
| bool | fixate_field_nearest_double (const Glib::ustring& name, double target) |
| Fixates a Gst::Structure by changing the given field to the nearest double to target that is a subset of the existing field. More... | |
| bool | fixate_nearest_fraction (const Glib::ustring& name, const Gst::Fraction& target) |
| Fixates a Gst::Structure by changing the given field to the nearest fraction to given Gst::Fraction that is a subset of the existing field. More... | |
| bool | fixate_field_boolean (const Glib::ustring& name, bool target) |
| Fixates a Gst::Structure by changing the given field_name field to the given target boolean if that field is not fixed yet. More... | |
Static Public Member Functions | |
| static GType | get_type () |
| Get the GType for this class, for use with the underlying GObject type system. More... | |
| static Structure | create_from_string (const Glib::ustring& the_string) |
| Creates a Gst::Structure from a string representation. More... | |
Protected Attributes | |
| GstStructure* | gobject_ |
Related Functions | |
(Note that these are not member functions.) | |
| void | swap (Structure& lhs, Structure& rhs) |
| Gst::Structure | wrap (GstStructure* object, bool take_copy=false) |
| A Glib::wrap() method for this object. More... | |
Detailed Description
A generic class containing fields of names and values.
A Gst::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 Gst::Structure also has a name. The name starts with a letter and can be folled by letters, numbers and any of "/-_.:".
Gst::Structure is used by various GStreamer subsystems to store information in a flexible and extensible way. A Gst::Structure does not have a refcount because it usually is part of a higher level object such as Gst::Caps. It provides a means to enforce mutability using the refcount of the parent.
Last reviewed on 2007-10-16 (0.10.15)
Member Typedef Documentation
| typedef sigc::slot<bool, const Glib::ustring&, const Glib::ValueBase&> Gst::Structure::SlotForeach |
For example, bool on_foreach(const Glib::ustring& id, const Glib::ValueBase& value);.
The foreach function should return true if the foreach operation should continue, or false if the operation should stop with false.
| typedef sigc::slot<bool, const Glib::ustring&, Glib::ValueBase&> Gst::Structure::SlotMap |
For example, bool on_map(const Glib::ustring& id, Glib::ValueBase& value);.
The map function should return true if the map operation should continue, or false if the operation should stop with false.
Constructor & Destructor Documentation
| Gst::Structure::Structure | ( | ) |
|
explicit |
| Gst::Structure::Structure | ( | const Structure& | other | ) |
| Gst::Structure::~Structure | ( | ) |
|
explicit |
Creates a Structure with the given name.
You should then use set_field() to set field values.
Member Function Documentation
|
static |
Creates a Gst::Structure from a string representation.
- Parameters
-
the_string A string representation of a Gst::Structure. See to_string().
- Returns
- A Structure. This will be invalid (see operator=) when the string could not be parsed.
| bool Gst::Structure::fixate_field_boolean | ( | const Glib::ustring & | name, |
| bool | target | ||
| ) |
Fixates a Gst::Structure by changing the given field_name field to the given target boolean if that field is not fixed yet.
- Parameters
-
field_name A field in structure. target The target value of the fixation.
- Returns
trueif the structure could be fixated.
| bool Gst::Structure::fixate_field_nearest_double | ( | const Glib::ustring & | name, |
| double | target | ||
| ) |
Fixates a Gst::Structure by changing the given field to the nearest double to target that is a subset of the existing field.
- Parameters
-
field_name A field in structure. target The target value of the fixation.
- Returns
trueif the structure could be fixated.
| bool Gst::Structure::fixate_field_nearest_int | ( | const Glib::ustring & | name, |
| int | target | ||
| ) |
Fixates a Gst::Structure by changing the given field to the nearest integer to target that is a subset of the existing field.
- Parameters
-
field_name A field in structure. target The target value of the fixation.
- Returns
trueif the structure could be fixated.
| bool Gst::Structure::fixate_nearest_fraction | ( | const Glib::ustring & | name, |
| const Gst::Fraction& | target | ||
| ) |
Fixates a Gst::Structure by changing the given field to the nearest fraction to given Gst::Fraction that is a subset of the existing field.
- Parameters
-
field_name A field in structure. target The target value of the fixation.
- Returns
- true If the structure could be fixated.
| bool Gst::Structure::foreach | ( | const SlotForeach& | slot | ) |
Calls the provided slot once for each field in the Gst::Structure.
The slot must not modify the fields. See also map_in_place().
- Parameters
-
slot A slot to call for each field.
- Returns
- true if the supplied slot returns true For each of the fields, false otherwise.
| void Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| Glib::ValueBase & | value | ||
| ) | const |
Get the value of the field with name fieldname.
- Parameters
-
fieldname The name of the field to get. value The Value class in which to store the value.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| bool & | value | ||
| ) | const |
Gets the value of field fieldname into boolean value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value An output parameter that will be set with the value.
- Returns
- true if 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.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| int & | value | ||
| ) | const |
Gets the value of field fieldname into integer value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value An output parameter that will be set with the value.
- Returns
- true if 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.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| guint & | value | ||
| ) | const |
Gets the value of field fieldname into guint value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value An output parameter that will be set with the value.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain an guint, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| double & | value | ||
| ) | const |
Gets the value of field fieldname into double value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value An output parameter that will be set with the value.
- Returns
- true if 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.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| Glib::ustring & | value | ||
| ) | const |
Gets the value of field fieldname into Glib::ustring value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value An output parameter that will be set with the value.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain a string, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| std::string & | value | ||
| ) | const |
Gets the value of field fieldname into std::string value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value An output parameter that will be set with the value.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain a string, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| Glib::Date & | value | ||
| ) | const |
Gets the value of field fieldname into Glib::Date value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. date The Glib::Date to set.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain a Glib::Date, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| ClockTime& | value | ||
| ) | const |
Gets the value of field fieldname into Gst::ClockTime value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value An output parameter that will be set with the value.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain a Gst::ClockTime, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| GType | enumtype, | ||
| int & | value | ||
| ) | const |
Gets the value of field fieldname with GType enum type enumtype into integer value.
Caller is responsible for making sure the field exists and has the correct type. A call to this method would look like so:
- Parameters
-
fieldname The name of a field. enumtype The enum GType of the field. value An output parameter that will be set with the value.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain an enum, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| Gst::Fraction& | value | ||
| ) | const |
Gets the value of field fieldname into Gst::Fraction value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value The Gst::Fraction to set.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain a Gst::Fraction, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| Gst::IntRange& | value | ||
| ) | const |
Gets the value of field fieldname into Gst::IntRange value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value The Gst::IntRange to set.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain a Gst::IntRange, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| Gst::DoubleRange& | value | ||
| ) | const |
Gets the value of field fieldname into Gst::DoubleRange value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value The Gst::DoubleRange to set.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain a Gst::DoubleRange, this function returns false.
| bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
| Gst::FractionRange& | value | ||
| ) | const |
Gets the value of field fieldname into Gst::FractionRange value.
The caller is responsible for making sure the field exists and has the correct type.
- Parameters
-
fieldname The name of a field. value The Gst::FractionRange to set.
- Returns
- true if value could be set correctly. If there was no field with fieldname or the existing field did not contain a Gst::FractionRange, this function returns false.
| GType Gst::Structure::get_field_type | ( | const Glib::ustring & | fieldname | ) | const |
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.
- Parameters
-
fieldname The name of the field.
- Returns
- The Value of the field.
| Glib::ustring Gst::Structure::get_name | ( | ) | const |
Get the name of structure as a string.
- Returns
- The name of the structure.
| Glib::QueryQuark Gst::Structure::get_name_id | ( | ) | const |
Get the name of structure as a GQuark.
- Returns
- The quark representing the name of the structure.
| Glib::ustring Gst::Structure::get_nth_field_name | ( | guint | index | ) | const |
Get the name of the given field number, counting from 0 onwards.
- Parameters
-
index The index to get the name of.
- Returns
- The name of the given field number.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C instance.
|
inline |
Provides access to the underlying C instance.
| GstStructure* Gst::Structure::gobj_copy | ( | ) | const |
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
| bool Gst::Structure::has_field | ( | const Glib::ustring & | fieldname | ) | const |
Check if structure contains a field named fieldname.
- Parameters
-
fieldname The name of a field.
- Returns
trueif the structure contains a field with the given name.
| bool Gst::Structure::has_field | ( | const Glib::ustring & | fieldname, |
| GType | type | ||
| ) | const |
Check if structure contains a field named fieldname and with GType type.
- Parameters
-
fieldname The name of a field. type The type of a value.
- Returns
trueif the structure contains a field with the given name and type.
| bool Gst::Structure::has_name | ( | const Glib::ustring & | name | ) | const |
Checks if the structure has the given name.
- Parameters
-
name Structure name to check for.
- Returns
trueif name matches the name of the structure.
| bool Gst::Structure::map_in_place | ( | const SlotMap& | slot | ) |
Calls the provided slot once for each field in the Gst::Structure.
In contrast to foreach(), the function may modify but not delete the fields. The structure must be mutable.
- Parameters
-
slot A slot to call for each field.
- Returns
- true if the supplied slot returns true For each of the fields, false otherwise.
| Gst::Structure::operator bool | ( | ) | const |
Use this to discover if the Structure is a valid object.
| void Gst::Structure::remove_all_fields | ( | ) |
Removes all fields in a GstStructure.
| void Gst::Structure::remove_field | ( | const Glib::ustring & | fieldname | ) |
Removes the field with name fieldname.
If the field with the given name does not exist, the structure is unchanged.
- Parameters
-
fieldname The name of the field to remove.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| const Glib::ValueBase & | value | ||
| ) |
Sets the field with name fieldname to value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| bool | value | ||
| ) |
Sets the field with name fieldname to the boolean value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| int | value | ||
| ) |
Sets the field with name fieldname to the int value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| guint | value | ||
| ) |
Sets the field with name fieldname to the guint value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| double | value | ||
| ) |
Sets the field with name fieldname to the double value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| const std::string & | value | ||
| ) |
Sets the field with name fieldname to the std::string value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| const char * | value | ||
| ) |
Sets the field with name fieldname to the string constant value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| const Glib::Date & | value | ||
| ) |
Sets the field with name fieldname to the Glib::Date value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed. Please note that when setting fields to special types such as Gst::Fourcc and Gst::Fraction and Glib::Date they are converted to the GStreamer GTypes and thus when attempting to get these fields back as GValues, they will have the GStreamer GType.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| guint64 | value | ||
| ) |
Sets the field with name fieldname to the value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| gint64 | value | ||
| ) |
Sets the field with name fieldname to the value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| GType | enumtype, | ||
| int | value | ||
| ) |
Sets the field with name fieldname to the value value of the enum type enum_type.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed. Caller is responsible for making sure that value is a valid enumtype. A call to this method would look like so:
- Parameters
-
fieldname The name of the field to set. enumtype The enum GType that value should be treated as. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| const Gst::Fraction& | value | ||
| ) |
Sets the field with name fieldname to the Gst::Fraction value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed. Please note that when setting fields to special types such as Gst::Fourcc and Gst::Fraction and Glib::Date they are converted to the GStreamer GTypes and thus when attempting to get these fields back as GValues, they will have the GStreamer GType.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| const Gst::IntRange& | value | ||
| ) |
Sets the field with name fieldname field to the Gst::IntRange value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed. Please note that when setting fields to special types such as Gst::Fourcc and Gst::Fraction and Glib::Date they are converted to the GStreamer GTypes and thus when attempting to get these fields back as GValues, they will have the GStreamer GType.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| const Gst::DoubleRange& | value | ||
| ) |
Sets the field with name fieldname field to the Gst::DoubleRange value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed. Please note that when setting fields to special types such as Gst::Fourcc and Gst::Fraction and Glib::Date they are converted to the GStreamer GTypes and thus when attempting to get these fields back as GValues, they will have the GStreamer GType.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_field | ( | const Glib::ustring & | fieldname, |
| const Gst::FractionRange& | value | ||
| ) |
Sets the field with name fieldname field to the Gst::FractionRange value.
If the field does not exist, it is created. If the field exists, the previous value is replaced and freed. Please note that when setting fields to special types such as Gst::Fourcc and Gst::Fraction and Glib::Date they are converted to the GStreamer GTypes and thus when attempting to get these fields back as GValues, they will have the GStreamer GType.
- Parameters
-
fieldname The name of the field to set. value The value to set the field to.
| void Gst::Structure::set_name | ( | const Glib::ustring & | 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 "/-_.:".
- Parameters
-
name The new name of the structure.
| int Gst::Structure::size | ( | ) | const |
Get the number of fields in the structure.
- Returns
- The number of fields in the structure.
| void Gst::Structure::swap | ( | Structure& | other | ) |
| Glib::ustring Gst::Structure::to_string | ( | ) | const |
Converts structure to a human-readable string representation.
For debugging purposes its easier to do something like this:
[C example ellipted] This prints the structure in human readble form.
Free-function: g_free
- Returns
- A pointer to string allocated by Glib::malloc(). Glib::free() after usage.
Friends And Related Function Documentation
- Parameters
-
lhs The left-hand side rhs The right-hand side
|
related |
A Glib::wrap() method for this object.
- Parameters
-
object The C instance. take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
- Returns
- A C++ instance that wraps this C instance.
Member Data Documentation
|
protected |
The documentation for this class was generated from the following file:
- gstreamermm/structure.h
