Gst::Fraction Class Reference

Represents a fraction. More...

#include <value.h>

List of all members.

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.
Fractionoperator= (const Fraction& src)

Public Attributes

int num
int denom


Detailed Description

Represents a fraction.

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;
 ...

Constructor & Destructor Documentation

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.


Member Function Documentation

Fraction& Gst::Fraction::operator= ( const Fraction src  ) 


Member Data Documentation


The documentation for this class was generated from the following file:

Generated on Thu Jan 15 09:33:13 2009 for gstreamermm by  doxygen 1.5.7.1