gstreamermm  1.10.0
Public Member Functions | Public Attributes | List of all members
Gst::Range< T > Class Template Reference

A class that represents a range (min - max). More...

#include <gstreamermm/value.h>

Public Member Functions

 Range ()
 Constructs a zero Gst::Range. More...
 
 Range (T min, T max)
 Constructs a Gst::Range (min - max). More...
 
 Range (const Range& src)
 Constructs an Gst::Range from another range. More...
 
 Range (const Glib::Value< Range< T >>& range_value)
 Constructs an Gst::Range from a Glib::ValueBase. More...
 
 Range (const GValue& range_value)
 Constructs an Gst::Range from a GValue. More...
 
Rangeoperator= (const Range& src)
 

Public Attributes

min
 
max
 

Detailed Description

template<typename T>
class Gst::Range< T >

A class that represents a range (min - max).

Gst::Range is used to store a range 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::Range<int>> value;
value.init(Glib::Value<Gst::Range<int>>::value_type());
value.set(Gst::Range<int>(8000, 50000));
Gst::Structure structure("my-structure");
structure.set_field("rate", value);
...
Glib::ValueBase gst_value;
structure.get_field("rate", gst_value);
Gst::Range<int> range(gst_value);
int max = range.max;
...

Gst::Range should be used with following types: int, double, Gst::Fraction.

Last reviewed on 2016-08-27 (1.8.0)

Constructor & Destructor Documentation

◆ Range() [1/5]

template <typename T>
Gst::Range< T >::Range ( )
inline

Constructs a zero Gst::Range.

◆ Range() [2/5]

template <typename T>
Gst::Range< T >::Range ( min,
max 
)
inline

Constructs a Gst::Range (min - max).

◆ Range() [3/5]

template <typename T>
Gst::Range< T >::Range ( const Range< T >&  src)
inline

Constructs an Gst::Range from another range.

◆ Range() [4/5]

template <typename T>
Gst::Range< T >::Range ( const Glib::Value< Range< T >>&  range_value)
inlineexplicit

Constructs an Gst::Range from a Glib::ValueBase.

◆ Range() [5/5]

template <typename T>
Gst::Range< T >::Range ( const GValue &  range_value)
inlineexplicit

Constructs an Gst::Range from a GValue.

Member Function Documentation

◆ operator=()

template <typename T>
Range& Gst::Range< T >::operator= ( const Range< T >&  src)
inline

Member Data Documentation

◆ max

template <typename T>
T Gst::Range< T >::max

◆ min

template <typename T>
T Gst::Range< T >::min