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)
AudioInfo& | operator= (const AudioInfo& other)
| AudioInfo (AudioInfo&& other) noexcept
AudioInfo& | operator= (AudioInfo&& other) noexcept
| ~AudioInfo () noexcept
void | swap (AudioInfo& other) noexcept
GstAudioInfo* | gobj ()
| Provides access to the underlying C instance. More...
const GstAudioInfo* | gobj () const
| Provides access to the underlying C instance. More...
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. More...
| AudioInfo (const Glib::RefPtr< const Gst::Caps >& caps)
| Create AudioInfo from caps. More...
bool | is_equal (const Gst::AudioInfo& other) const
| Compares two Gst::AudioInfo and returns whether they are equal or not. More...
void | init ()
| Initialize info with default values. More...
bool | from_caps (const Glib::RefPtr< const Gst::Caps >& caps)
| Parse caps and update info. More...
Glib::RefPtr< Gst::Caps > | to_caps () const
| Convert the values of info into a Gst::Caps. More...
bool | convert (Gst::Format fmt, gint64 src_val, Gst::Format dest_fmt, gint64& dest_val) const
| Converts among various Gst::Format types. More...
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. More...
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. More...

## Protected Attributes

GstAudioInfo* | gobject_

## Related Functions

(Note that these are not member functions.)
void | swap (AudioInfo& lhs, AudioInfo& rhs) noexcept
Gst::AudioInfo | wrap (GstAudioInfo* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## 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

  caps | A Gst::Caps.

Exceptions

  std::runtime_error | if 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

  fmt | Gst::Format of the src_val.
  src_val | Value to convert.
  dest_fmt | Gst::Format of the dest_val.
  dest_val | Pointer 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

  caps | A 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()

static 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

  other | A Gst::AudioInfo.

Returns
  `true` if info and other are equal, else `false`.

## operator=() [1/2]

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

## operator=() [2/2]

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

noexcept

## 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

  format | The format.
  rate | The samplerate.
  channels | The number of channels.
  position | The 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.

## Friends And Related Function Documentation

## swap()

void swap | ( | AudioInfo& | lhs,
|  | AudioInfo& | rhs
| ) |  |

related

Parameters

  lhs | The left-hand side
  rhs | The right-hand side

## wrap()

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

related

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

Parameters

  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.

Returns
  A C++ instance that wraps this C instance.

## Member Data Documentation

## gobject_

GstAudioInfo* Gst::AudioInfo::gobject_

protected