gstreamermm 1.10.0

Public Member Functions | Static Public Member Functions | Protected Attributes | Related Functions | List of all members
Gst::CapsFeatures Class Reference

A set of features in caps. More...

`#include <gstreamermm/capsfeatures.h>`

## Public Member Functions
| CapsFeatures ()
| CapsFeatures (GstCapsFeatures* gobject, bool make_a_copy=true)
| CapsFeatures (const CapsFeatures& other)
CapsFeatures& | operator= (const CapsFeatures& other)
| CapsFeatures (CapsFeatures&& other) noexcept
CapsFeatures& | operator= (CapsFeatures&& other) noexcept
| ~CapsFeatures () noexcept
void | swap (CapsFeatures& other) noexcept
GstCapsFeatures* | gobj ()
| Provides access to the underlying C instance. More...
const GstCapsFeatures* | gobj () const
| Provides access to the underlying C instance. More...
GstCapsFeatures* | 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...
| CapsFeatures (std::initializer_list< Glib::ustring > features)
| Creates a new Gst::CapsFeatures with the given features. More...
Glib::ustring | to_string () const
| Converts features to a human-readable string representation. More...
bool | set_parent_refcount (gint* refcount)
| Sets the parent_refcount field of Gst::CapsFeatures. More...
bool | is_equal (const Gst::CapsFeatures& features2) const
| Check if features1 and features2 are equal. More...
bool | is_any () const
| Check if features is Gst::CAPS_FEATURES_ANY. More...
bool | contains (const Glib::ustring& feature) const
| Check if features contains feature. More...
bool | contains (GQuark feature) const
| Check if features contains feature. More...
guint | get_size () const
| Returns the number of features in features. More...
Glib::ustring | get_nth (guint i) const
| Returns the i-th feature of features. More...
GQuark | get_nth_id (guint i) const
| Returns the i-th feature of features. More...
void | add (const Glib::ustring& feature)
| Adds feature to features. More...
void | add (GQuark feature)
| Adds feature to features. More...
void | remove (const Glib::ustring& feature)
| Removes feature from features. More...
void | remove (GQuark feature)
| Removes feature from features. More...

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Gst::CapsFeatures | create_any ()
| Creates a new, ANY Gst::CapsFeatures. More...
static Gst::CapsFeatures | create_from_string (const Glib::ustring& features)
| Creates a Gst::CapsFeatures from a string representation. More...
static Glib::ustring | memory_system_memory ()
| Constant for system memory feature name. More...

## Protected Attributes
GstCapsFeatures* | gobject_

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

## Detailed Description

A set of features in caps.

Gst::CapsFeatures can optionally be set on a Gst::Caps to add requirements for additional features for a specific Gst::Structure. Caps structures with the same name but with a non-equal set of caps features are not compatible. If a pad supports multiple sets of features it has to add multiple equal structures with different feature sets to the caps.

Empty Gst::CapsFeatures are equivalent with the Gst::CapsFeatures that only contain Gst::CapsFeatures::memory_system_memory(). ANY Gst::CapsFeatures as created by Gst::CapsFeatures::create_any() are equal to any other Gst::CapsFeatures and can be used to specify that any Gst::CapsFeatures would be supported, e.g. for elements that don't touch buffer memory. Gst::Caps with ANY Gst::CapsFeatures are considered non-fixed and during negotiation some Gst::CapsFeatures have to be selected.

Examples for caps features would be the requirement of a specific Gst::Memory types or the requirement of having a specific Gst::Meta on the buffer. Features are given as a string of the format "memory:GstMemoryTypeName" or "meta:GstMetaAPIName".

Last reviewed on 2016-05-16 (1.8.0)

Since: 1.2

## Constructor & Destructor Documentation

## ◆ CapsFeatures() [1/5]

Gst::CapsFeatures::CapsFeatures | ( |  | ) |

## ◆ CapsFeatures() [2/5]

Gst::CapsFeatures::CapsFeatures | ( | GstCapsFeatures * | gobject,
|  | bool | make_a_copy = `true`
| ) |  |
| explicit

## ◆ CapsFeatures() [3/5]

Gst::CapsFeatures::CapsFeatures | ( | const CapsFeatures& | other | ) |

## ◆ CapsFeatures() [4/5]

Gst::CapsFeatures::CapsFeatures | ( | CapsFeatures&& | other | ) |
| noexcept

## ◆ ~CapsFeatures()

Gst::CapsFeatures::~CapsFeatures | ( |  | ) |
| noexcept

## ◆ CapsFeatures() [5/5]

Gst::CapsFeatures::CapsFeatures | ( | std::initializer_list< Glib::ustring > | features | ) |
| explicit

Creates a new Gst::CapsFeatures with the given features.

Parameters

  features | name of features to set.

## Member Function Documentation

## ◆ add() [1/2]

void Gst::CapsFeatures::add | ( | const Glib::ustring & | feature | ) |

Adds feature to features.

Parameters

  feature | A feature.

## ◆ add() [2/2]

void Gst::CapsFeatures::add | ( | GQuark | feature | ) |

Adds feature to features.

Parameters

  feature | A feature.

## ◆ contains() [1/2]

bool Gst::CapsFeatures::contains | ( | const Glib::ustring & | feature | ) | const

Check if features contains feature.

Parameters

  feature | A feature.

Returns
  `true` if features contains feature.

## ◆ contains() [2/2]

bool Gst::CapsFeatures::contains | ( | GQuark | feature | ) | const

Check if features contains feature.

Parameters

  feature | A feature.

Returns
  `true` if features contains feature.

## ◆ create_any()

static Gst::CapsFeatures Gst::CapsFeatures::create_any | ( |  | ) |
| static

Creates a new, ANY Gst::CapsFeatures.

This will be equal to any other Gst::CapsFeatures but caps with these are unfixed.

Free-function: gst_caps_features_free

Returns
  A new, ANY Gst::CapsFeatures.

## ◆ create_from_string()

static Gst::CapsFeatures Gst::CapsFeatures::create_from_string | ( | const Glib::ustring & | features | ) |
| static

Creates a Gst::CapsFeatures from a string representation.

Free-function: gst_caps_features_free

Parameters

  features | A string representation of a Gst::CapsFeatures.

Returns
  A new Gst::CapsFeatures or `nullptr` when the string could not be parsed. Free with free() after use.

## ◆ get_nth()

Glib::ustring Gst::CapsFeatures::get_nth | ( | guint | i | ) | const

Returns the i-th feature of features.

Parameters

  i | Index of the feature.

Returns
  The i-th feature of features.

## ◆ get_nth_id()

GQuark Gst::CapsFeatures::get_nth_id | ( | guint | i | ) | const

Returns the i-th feature of features.

Parameters

  i | Index of the feature.

Returns
  The i-th feature of features.

## ◆ get_size()

guint Gst::CapsFeatures::get_size | ( |  | ) | const

Returns the number of features in features.

Returns
  The number of features in features.

## ◆ get_type()

static GType Gst::CapsFeatures::get_type | ( |  | ) |
| static

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

## ◆ gobj() [1/2]

GstCapsFeatures* Gst::CapsFeatures::gobj | ( |  | ) |
| inline

Provides access to the underlying C instance.

## ◆ gobj() [2/2]

const GstCapsFeatures* Gst::CapsFeatures::gobj | ( |  | ) | const
| inline

Provides access to the underlying C instance.

## ◆ gobj_copy()

GstCapsFeatures* Gst::CapsFeatures::gobj_copy | ( |  | ) | const

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

## ◆ is_any()

bool Gst::CapsFeatures::is_any | ( |  | ) | const

Check if features is Gst::CAPS_FEATURES_ANY.

Returns
  `true` if features is Gst::CAPS_FEATURES_ANY.

## ◆ is_equal()

bool Gst::CapsFeatures::is_equal | ( | const Gst::CapsFeatures& | features2 | ) | const

Check if features1 and features2 are equal.

Parameters

  features2 | A Gst::CapsFeatures.

Returns
  `true` if features1 and features2 are equal.

## ◆ memory_system_memory()

static Glib::ustring Gst::CapsFeatures::memory_system_memory | ( |  | ) |
| static

Constant for system memory feature name.

## ◆ operator=() [1/2]

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

## ◆ operator=() [2/2]

CapsFeatures& Gst::CapsFeatures::operator= | ( | CapsFeatures&& | other | ) |
| noexcept

## ◆ remove() [1/2]

void Gst::CapsFeatures::remove | ( | const Glib::ustring & | feature | ) |

Removes feature from features.

Parameters

  feature | A feature.

## ◆ remove() [2/2]

void Gst::CapsFeatures::remove | ( | GQuark | feature | ) |

Removes feature from features.

Parameters

  feature | A feature.

## ◆ set_parent_refcount()

bool Gst::CapsFeatures::set_parent_refcount | ( | gint * | refcount | ) |

Sets the parent_refcount field of Gst::CapsFeatures.

This field is used to determine whether a caps features is mutable or not. This function should only be called by code implementing parent objects of Gst::CapsFeatures, as described in the MT Refcounting section of the design documents.

Parameters

  refcount | A pointer to the parent's refcount.

Returns
  `true` if the parent refcount could be set.

## ◆ swap()

void Gst::CapsFeatures::swap | ( | CapsFeatures& | other | ) |
| noexcept

## ◆ to_string()

Glib::ustring Gst::CapsFeatures::to_string | ( |  | ) | const

Converts features to a human-readable string representation.

For debugging purposes its easier to do something like this:

[C example ellipted] This prints the features in human readable form.

Returns
  A pointer to string allocated by Glib::malloc().

## Friends And Related Function Documentation

## ◆ swap()

void swap | ( | CapsFeatures& | lhs,
|  | CapsFeatures& | rhs
| ) |  |
| related

Parameters

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

## ◆ wrap()

Gst::CapsFeatures wrap | ( | GstCapsFeatures * | 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_

GstCapsFeatures* Gst::CapsFeatures::gobject_
| protected