gstreamermm
1.4.3
|
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 const void* () 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, const Glib::DateTime& value) |
Sets the field with name fieldname to the Glib::DateTime 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, Glib::DateTime& value) const |
Gets the value of field fieldname into Glib::DateTime 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_field_string (const Glib::ustring& name, const Glib::ustring& target) |
Fixates a Gst::Structure by changing the given field_name field to the given target string if that field is not fixed yet. More... | |
bool | fixate_field (const Glib::ustring& name) |
Fixates a Gst::Structure by changing the given field with its fixated value. 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... | |
Gst::Structure | intersect (const Gst::Structure& struct2) const |
Interesects struct1 and struct2 and returns the intersection. More... | |
bool | is_equal (const Gst::Structure& struct2) const |
Tests if the two Gst::Structure are equal. More... | |
bool | is_subset (const Gst::Structure& superset) const |
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. More... | |
bool | can_intersect (const Gst::Structure& struct2) const |
Tries intersecting struct1 and struct2 and reports whether the result would not be empty. More... | |
void | fixate () |
Fixate all values in structure using gst_value_fixate(). 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... | |
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)
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.
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.
bool Gst::Structure::can_intersect | ( | const Gst::Structure& | struct2 | ) | const |
Tries intersecting struct1 and struct2 and reports whether the result would not be empty.
struct2 | A Gst::Structure. |
true
if intersection would not be empty.
|
static |
Creates a Gst::Structure from a string representation.
the_string | A string representation of a Gst::Structure. See to_string(). |
void Gst::Structure::fixate | ( | ) |
Fixate all values in structure using gst_value_fixate().
structure will be modified in-place and should be writable.
bool Gst::Structure::fixate_field | ( | const Glib::ustring & | name | ) |
Fixates a Gst::Structure by changing the given field with its fixated value.
field_name | A field in structure. |
true
if the structure field could be fixated. 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.
field_name | A field in structure. |
target | The target value of the fixation. |
true
if 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.
field_name | A field in structure. |
target | The target value of the fixation. |
true
if 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.
field_name | A field in structure. |
target | The target value of the fixation. |
true
if the structure could be fixated. bool Gst::Structure::fixate_field_string | ( | const Glib::ustring & | name, |
const Glib::ustring & | target | ||
) |
Fixates a Gst::Structure by changing the given field_name field to the given target string if that field is not fixed yet.
field_name | A field in structure. |
target | The target value of the fixation. |
true
if 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.
field_name | A field in structure. |
target | The target value of the fixation. |
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().
slot | A slot to call for each field. |
void Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
Glib::ValueBase & | value | ||
) | const |
Get the value of the field with name fieldname.
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.
fieldname | The name of a field. |
value | An output parameter that will be set with the value. |
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.
fieldname | The name of a field. |
value | An output parameter that will be set with the value. |
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.
fieldname | The name of a field. |
value | An output parameter that will be set with the value. |
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.
fieldname | The name of a field. |
value | An output parameter that will be set with the value. |
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.
fieldname | The name of a field. |
value | An output parameter that will be set with the value. |
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.
fieldname | The name of a field. |
value | An output parameter that will be set with the value. |
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.
fieldname | The name of a field. |
date | The Glib::Date to set. |
bool Gst::Structure::get_field | ( | const Glib::ustring & | fieldname, |
Glib::DateTime & | value | ||
) | const |
Gets the value of field fieldname into Glib::DateTime value.
The caller is responsible for making sure the field exists and has the correct type.
fieldname | The name of a field. |
value | The Glib::DateTime to set. |
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.
fieldname | The name of a field. |
value | An output parameter that will be set with the value. |
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:
fieldname | The name of a field. |
enumtype | The enum GType of the field. |
value | An output parameter that will be set with the value. |
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.
fieldname | The name of a field. |
value | The Gst::Fraction to set. |
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.
fieldname | The name of a field. |
value | The Gst::IntRange to set. |
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.
fieldname | The name of a field. |
value | The Gst::DoubleRange to set. |
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.
fieldname | The name of a field. |
value | The Gst::FractionRange to set. |
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.
fieldname | The name of the field. |
Glib::ustring Gst::Structure::get_name | ( | ) | const |
Get the name of structure as a string.
Glib::QueryQuark Gst::Structure::get_name_id | ( | ) | const |
Get the name of structure as a GQuark.
Glib::ustring Gst::Structure::get_nth_field_name | ( | guint | index | ) | const |
Get the name of the given field number, counting from 0 onwards.
index | The index to get the name of. |
|
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.
fieldname | The name of a field. |
true
if 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.
fieldname | The name of a field. |
type | The type of a value. |
true
if 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.
name | Structure name to check for. |
true
if name matches the name of the structure. Gst::Structure Gst::Structure::intersect | ( | const Gst::Structure& | struct2 | ) | const |
Interesects struct1 and struct2 and returns the intersection.
struct2 | A Gst::Structure. |
bool Gst::Structure::is_equal | ( | const Gst::Structure& | struct2 | ) | const |
Tests if the two Gst::Structure are equal.
structure2 | A Gst::Structure. |
true
if the two structures have the same name and field. bool Gst::Structure::is_subset | ( | const Gst::Structure& | superset | ) | const |
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.
superset | A potentially greater Gst::Structure. |
true
if subset is a subset of superset. 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.
slot | A slot to call for each field. |
Gst::Structure::operator const void * | ( | ) | 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.
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.
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.
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.
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.
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.
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.
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.
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.
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::DateTime & | value | ||
) |
Sets the field with name fieldname to the Glib::DateTime 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.
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.
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.
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:
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.
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.
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.
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.
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 "/-_.:".
name | The new name of the structure. |
int Gst::Structure::size | ( | ) | const |
Get 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
lhs | The left-hand side |
rhs | The right-hand side |
|
related |
A Glib::wrap() method for this object.
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. |
|
protected |