gstreamermm 1.10.0
Gst::AudioInfo Class Reference

Information describing audio properties. More...

#include <gstreamermm/audioinfo.h>

Public Member Functions

 AudioInfo ()
 AudioInfo (GstAudioInfo* gobject, bool make_a_copy=true)
 AudioInfo (const AudioInfo& other)
AudioInfooperator= (const AudioInfo& other)
 AudioInfo (AudioInfo&& other) noexcept
AudioInfooperator= (AudioInfo&& other) noexcept
 ~AudioInfo () noexcept
void swap (AudioInfo& other) noexcept
GstAudioInfo* gobj ()
 Provides access to the underlying C instance.
const GstAudioInfo* gobj () const
 Provides access to the underlying C instance.
GstAudioInfo* gobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
 AudioInfo (const Glib::RefPtr< const Gst::Caps >& caps)
 Create AudioInfo from caps.
bool is_equal (const Gst::AudioInfo& other) const
 Compares two Gst::AudioInfo and returns whether they are equal or not.
void init ()
 Initialize info with default values.
bool from_caps (const Glib::RefPtr< const Gst::Caps >& caps)
 Parse caps and update info.
Glib::RefPtr< Gst::Capsto_caps () const
 Convert the values of info into a Gst::Caps.
bool convert (Gst::Format fmt, gint64 src_val, Gst::Format dest_fmt, gint64& dest_val) const
 Converts among various Gst::Format types.
void set_format (Gst::AudioFormat format, int rate, int channels, const Gst::AudioChannelPosition* position)
 Set the default info for the audio info of format and rate and channels.
Gst::AudioFlags get_flags () const
void set_flags (const Gst::AudioFlags& value)
Gst::AudioLayout get_layout () const
void set_layout (const Gst::AudioLayout& value)
int get_rate () const
void set_rate (const int& value)
int get_channels () const
void set_channels (const int& value)
int get_bpf () const
void set_bpf (const int& value)
const Gst::AudioFormatInfo get_finfo () const

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.

Protected Attributes

GstAudioInfo* gobject_

(Note that these are not member symbols.)

void swap (AudioInfo& lhs, AudioInfo& rhs) noexcept
Gst::AudioInfo wrap (GstAudioInfo* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

Information describing audio properties.

This information can be filled in from Gst::Caps with from_caps() or Gst::AudioInfo() constructor.

Last reviewed on 2016-04-23 (1.8.0).

Constructor & Destructor Documentation

◆ AudioInfo() [1/5]

Gst::AudioInfo::AudioInfo ( )

◆ AudioInfo() [2/5]

Gst::AudioInfo::AudioInfo ( GstAudioInfo * gobject,
bool make_a_copy = true )
explicit

◆ AudioInfo() [3/5]

Gst::AudioInfo::AudioInfo ( const AudioInfo & other)

◆ AudioInfo() [4/5]

Gst::AudioInfo::AudioInfo ( AudioInfo && other)
noexcept

◆ ~AudioInfo()

Gst::AudioInfo::~AudioInfo ( )
noexcept

◆ AudioInfo() [5/5]

Gst::AudioInfo::AudioInfo ( const Glib::RefPtr< const Gst::Caps >& caps)

Create AudioInfo from caps.

Parameters
capsA Gst::Caps.
Exceptions
std::runtime_errorif caps could not be parsed.

Member Function Documentation

◆ convert()

bool Gst::AudioInfo::convert ( Gst::Format fmt,
gint64 src_val,
Gst::Format dest_fmt,
gint64 & dest_val ) const

Converts among various Gst::Format types.

This function handles GST_FORMAT_BYTES, GST_FORMAT_TIME, and GST_FORMAT_DEFAULT. For raw audio, GST_FORMAT_DEFAULT corresponds to audio frames. This function can be used to handle pad queries of the type GST_QUERY_CONVERT.

Since gstreamermm 1.8
Parameters
fmtGst::Format of the src_val.
src_valValue to convert.
dest_fmtGst::Format of the dest_val.
dest_valPointer to destination value.
Returns
true if the conversion was successful.

◆ from_caps()

bool Gst::AudioInfo::from_caps ( const Glib::RefPtr< const Gst::Caps >& caps)

Parse caps and update info.

Parameters
capsA Gst::Caps.
Returns
true if caps could be parsed.

◆ get_bpf()

int Gst::AudioInfo::get_bpf ( ) const

◆ get_channels()

int Gst::AudioInfo::get_channels ( ) const

◆ get_finfo()

const Gst::AudioFormatInfo Gst::AudioInfo::get_finfo ( ) const

◆ get_flags()

Gst::AudioFlags Gst::AudioInfo::get_flags ( ) const

◆ get_layout()

Gst::AudioLayout Gst::AudioInfo::get_layout ( ) const

◆ get_rate()

int Gst::AudioInfo::get_rate ( ) const

◆ get_type()

GType Gst::AudioInfo::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GstAudioInfo * Gst::AudioInfo::gobj ( )
inline

Provides access to the underlying C instance.

◆ gobj() [2/2]

const GstAudioInfo * Gst::AudioInfo::gobj ( ) const
inline

Provides access to the underlying C instance.

◆ gobj_copy()

GstAudioInfo * Gst::AudioInfo::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.

◆ init()

void Gst::AudioInfo::init ( )

Initialize info with default values.

◆ is_equal()

bool Gst::AudioInfo::is_equal ( const Gst::AudioInfo& other) const

Compares two Gst::AudioInfo and returns whether they are equal or not.

Parameters
otherA Gst::AudioInfo.
Returns
true if info and other are equal, else false.

◆ operator=() [1/2]

AudioInfo& Gst::AudioInfo::operator= ( AudioInfo&& other)
noexcept

◆ operator=() [2/2]

AudioInfo& Gst::AudioInfo::operator= ( const AudioInfo& other)

◆ set_bpf()

void Gst::AudioInfo::set_bpf ( const int & value)

◆ set_channels()

void Gst::AudioInfo::set_channels ( const int & value)

◆ set_flags()

void Gst::AudioInfo::set_flags ( const Gst::AudioFlags& value)

◆ set_format()

void Gst::AudioInfo::set_format ( Gst::AudioFormat format,
int rate,
int channels,
const Gst::AudioChannelPosition* position )

Set the default info for the audio info of format and rate and channels.

Note
This initializes info first, no values are preserved.
Since gstreamermm 1.8
Parameters
formatThe format.
rateThe samplerate.
channelsThe number of channels.
positionThe channel positions.

◆ set_layout()

void Gst::AudioInfo::set_layout ( const Gst::AudioLayout& value)

◆ set_rate()

void Gst::AudioInfo::set_rate ( const int & value)

◆ swap()

void Gst::AudioInfo::swap ( AudioInfo& other)
noexcept

◆ to_caps()

Glib::RefPtr< Gst::Caps > Gst::AudioInfo::to_caps ( ) const

Convert the values of info into a Gst::Caps.

Returns
The new Gst::Caps containing the info of info.

◆ swap()

void swap ( AudioInfo& lhs,
AudioInfo& rhs )
related
Parameters
lhsThe left-hand side
rhsThe right-hand side

◆ wrap()

Gst::AudioInfo wrap ( GstAudioInfo * object,
bool take_copy = false )
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse 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

◆ gobject_

GstAudioInfo* Gst::AudioInfo::gobject_
protected