#include <value.h>
Public Member Functions | |
Fraction () | |
Constructs a zero Gst::Fraction (0/1). | |
Fraction (const Fraction& src) | |
Constructs a Gst::Fraction from another. | |
Fraction (int num, int denom) | |
Constructs a Gst::Fraction (num/denom). | |
Fraction (const Glib::ValueBase& gst_fraction_value) | |
Constructs a Gst::Fraction from a GST_TYPE_FRACTION. | |
Fraction& | operator= (const Fraction& src) |
Public Attributes | |
int | num |
int | denom |
Gst::Fraction is used to store a fraction in Gst::Structures of Gst::Caps as a value representing a property (see GStreamer Application Development Manual section 8.2.2 and GstValue docs). When the value is set, it is transformed to a GStreamer GType so retrieving the value is a bit different. The class can be used in setting and getting a Gst::Structure field like so:
Glib::Value<Gst::Fraction> value; value.init(Glib::Value<Gst::Fraction>::value_type()); value.set(Gst::Fraction(25,1)); Gst::Structure structure("my-structure"); structure.set_field("framerate", value); ... Glib::ValueBase gst_value; structure.get_field("framerate", gst_value); Gst::Fraction fract(gst_value); int numerator = fract.num; ...
Gst::Fraction::Fraction | ( | ) |
Constructs a zero Gst::Fraction (0/1).
Gst::Fraction::Fraction | ( | const Fraction& | src | ) |
Constructs a Gst::Fraction from another.
Gst::Fraction::Fraction | ( | int | num, | |
int | denom | |||
) | [explicit] |
Constructs a Gst::Fraction (num/denom).
Gst::Fraction::Fraction | ( | const Glib::ValueBase & | gst_fraction_value | ) | [explicit] |
Constructs a Gst::Fraction from a GST_TYPE_FRACTION.