gstreamermm: Gst::Object Class Reference

# Gst::Object Class Reference

Gst::Object - Base class for the GStreamer object hierarchy. More...

`#include <object.h>`

Inheritance diagram for Gst::Object:

List of all members.

## Public Member Functions
virtual | ~Object ()
GstObject* | gobj ()
| Provides access to the underlying C GObject.
const GstObject* | gobj () const
| Provides access to the underlying C GObject.
GstObject* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void | reference () const
void | unreference () const
bool | set_name (const Glib::ustring& name)
| Sets the name of object.
bool | set_name ()
| Gives object a guaranteed unique name.
Glib::ustring | get_name () const
| Returns a copy of the name of object.
bool | set_parent (const Glib::RefPtr<Object>& parent)
| Sets the parent of object to parent.
Glib::RefPtr<Object> | get_parent ()
| Returns the parent of object.
Glib::RefPtr<const Object> | get_parent () const
| Returns the parent of object.
void | unparent ()
| Clear the parent of object, removing the associated reference.
Glib::ustring | get_name_prefix () const
| Returns a copy of the name prefix of object.
void | set_name_prefix (const Glib::ustring& prefix)
| Sets the name prefix of object to name_prefix.
xmlpp::Node* | save (xmlpp::Node* parent) const
| Saves object into the parent XML node.
void | restore (xmlpp::Node* self)
| Restores the Gst::Object with the data from the parent XML node.
Glib::PropertyProxy <Glib::ustring> | property_name ()
| The name of the object.
Glib::PropertyProxy_ReadOnly <Glib::ustring> | property_name () const
| The name of the object.
## Protected Member Functions
| Object ()
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr<Gst::Object> | wrap (GstObject* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Gst::Object - Base class for the GStreamer object hierarchy.

Gst::Object provides a root for the object hierarchy tree filed in by the GStreamer library. It is currently a thin wrapper on top of Glib::Object. It is an abstract class that is not very usable on its own.

Gst::Object gives us basic refcounting, parenting functionality and locking. Most of the function are just extended for special GStreamer needs and can be found under the same name in the base class of Gst::Object which is Glib::Object (e.g. Glib::Object::reference() becomes Gst:Object::reference().

In contrast to Glib::Object instances, Gst::Object adds a name property. The functions set_name() and get_name() are used to set/get the name of the object.

Last reviewed on 2005-11-09 (0.9.4)

## Constructor & Destructor Documentation

virtual Gst::Object::~Object | ( |  | ) | `[virtual]`

Gst::Object::Object | ( |  | ) | `[protected]`

## Member Function Documentation

GstObject* Gst::Object::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented in Gst::Adder, Gst::AlsaMixer, Gst::AlsaSink, Gst::AlsaSrc, Gst::AudioClock, Gst::AudioConvert, Gst::AudioFilter, Gst::AudioResample, Gst::AudioSink, Gst::AudioSrc, Gst::AudioTestSrc, Gst::BaseAudioSink, Gst::BaseAudioSrc, Gst::BaseSink, Gst::BaseSrc, Gst::BaseTransform, Gst::Bin, Gst::Bus, Gst::CapsFilter, Gst::CddaBaseSrc, Gst::CdParanoiaSrc, Gst::Clock, Gst::ClockOverlay, Gst::DecodeBin, Gst::Element, Gst::ElementInterfaced<T_Interface>, Gst::ElementFactory, Gst::FakeSink, Gst::FakeSrc, Gst::FdSink, Gst::FdSrc, Gst::FfmpegColorSpace, Gst::FileSink, Gst::FileSrc, Gst::GDPDepay, Gst::GDPPay, Gst::GhostPad, Gst::GioSink, Gst::GioSrc, Gst::GioStreamSink, Gst::GioStreamSrc, Gst::Identity, Gst::Index, Gst::IndexFactory, Gst::MultiQueue, Gst::OggDemux, Gst::OggMux, Gst::Pad, Gst::PadTemplate, Gst::Pipeline, Gst::PlayBin2, Gst::Plugin, Gst::PluginFeature, Gst::PushSrc, Gst::Queue, Gst::Registry, Gst::SystemClock, Gst::Task, Gst::Tee, Gst::TextOverlay, Gst::TextRender, Gst::TheoraDec, Gst::TheoraEnc, Gst::TimeOverlay, Gst::TypeFind, Gst::VideoRate, Gst::VideoScale, Gst::VideoSink, Gst::VideoTestSrc, Gst::Volume, Gst::VorbisDec, Gst::VorbisEnc, Gst::VorbisParse, Gst::VorbisTag, Gst::XImageSink, Gst::XML, and Gst::XvImageSink.

const GstObject* Gst::Object::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented in Gst::Adder, Gst::AlsaMixer, Gst::AlsaSink, Gst::AlsaSrc, Gst::AudioClock, Gst::AudioConvert, Gst::AudioFilter, Gst::AudioResample, Gst::AudioSink, Gst::AudioSrc, Gst::AudioTestSrc, Gst::BaseAudioSink, Gst::BaseAudioSrc, Gst::BaseSink, Gst::BaseSrc, Gst::BaseTransform, Gst::Bin, Gst::Bus, Gst::CapsFilter, Gst::CddaBaseSrc, Gst::CdParanoiaSrc, Gst::Clock, Gst::ClockOverlay, Gst::DecodeBin, Gst::Element, Gst::ElementInterfaced<T_Interface>, Gst::ElementFactory, Gst::FakeSink, Gst::FakeSrc, Gst::FdSink, Gst::FdSrc, Gst::FfmpegColorSpace, Gst::FileSink, Gst::FileSrc, Gst::GDPDepay, Gst::GDPPay, Gst::GhostPad, Gst::GioSink, Gst::GioSrc, Gst::GioStreamSink, Gst::GioStreamSrc, Gst::Identity, Gst::Index, Gst::IndexFactory, Gst::MultiQueue, Gst::OggDemux, Gst::OggMux, Gst::Pad, Gst::PadTemplate, Gst::Pipeline, Gst::PlayBin2, Gst::Plugin, Gst::PluginFeature, Gst::PushSrc, Gst::Queue, Gst::Registry, Gst::SystemClock, Gst::Task, Gst::Tee, Gst::TextOverlay, Gst::TextRender, Gst::TheoraDec, Gst::TheoraEnc, Gst::TimeOverlay, Gst::TypeFind, Gst::VideoRate, Gst::VideoScale, Gst::VideoSink, Gst::VideoTestSrc, Gst::Volume, Gst::VorbisDec, Gst::VorbisEnc, Gst::VorbisParse, Gst::VorbisTag, Gst::XImageSink, Gst::XML, and Gst::XvImageSink.

GstObject* Gst::Object::gobj_copy | ( |  | ) |

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

Reimplemented in Gst::Adder, Gst::AlsaMixer, Gst::AlsaSink, Gst::AlsaSrc, Gst::AudioClock, Gst::AudioConvert, Gst::AudioFilter, Gst::AudioResample, Gst::AudioSink, Gst::AudioSrc, Gst::AudioTestSrc, Gst::BaseAudioSink, Gst::BaseAudioSrc, Gst::BaseSink, Gst::BaseSrc, Gst::BaseTransform, Gst::Bin, Gst::Bus, Gst::CapsFilter, Gst::CddaBaseSrc, Gst::CdParanoiaSrc, Gst::Clock, Gst::ClockOverlay, Gst::DecodeBin, Gst::Element, Gst::ElementInterfaced<T_Interface>, Gst::ElementFactory, Gst::FakeSink, Gst::FakeSrc, Gst::FdSink, Gst::FdSrc, Gst::FfmpegColorSpace, Gst::FileSink, Gst::FileSrc, Gst::GDPDepay, Gst::GDPPay, Gst::GhostPad, Gst::GioSink, Gst::GioSrc, Gst::GioStreamSink, Gst::GioStreamSrc, Gst::Identity, Gst::Index, Gst::IndexFactory, Gst::MultiQueue, Gst::OggDemux, Gst::OggMux, Gst::Pad, Gst::PadTemplate, Gst::Pipeline, Gst::PlayBin2, Gst::Plugin, Gst::PluginFeature, Gst::PushSrc, Gst::Queue, Gst::Registry, Gst::SystemClock, Gst::Task, Gst::Tee, Gst::TextOverlay, Gst::TextRender, Gst::TheoraDec, Gst::TheoraEnc, Gst::TimeOverlay, Gst::TypeFind, Gst::VideoRate, Gst::VideoScale, Gst::VideoSink, Gst::VideoTestSrc, Gst::Volume, Gst::VorbisDec, Gst::VorbisEnc, Gst::VorbisParse, Gst::VorbisTag, Gst::XImageSink, Gst::XML, and Gst::XvImageSink.

void Gst::Object::reference | ( |  | ) | const

void Gst::Object::unreference | ( |  | ) | const

bool Gst::Object::set_name | ( | const Glib::ustring & | name | ) |

Sets the name of object.

For setting an arbitrary name, use set_name() with no argument. This function makes a copy of the provided name, so the caller retains ownership of the name it sent.

Parameters:

  | name | New name of object.

Returns:
  true if the name could be set. Since Objects that have a parent cannot be renamed, this function returns false in those cases. MT safe. This function grabs and releases object's LOCK.

Reimplemented in Gst::PluginFeature.

bool Gst::Object::set_name | ( |  | ) |

Gives object a guaranteed unique name.

Returns:
  true if the name could be set. Since Objects that have a parent cannot be renamed, this function returns false in those cases. MT safe. This function grabs and releases object's LOCK.

Glib::ustring Gst::Object::get_name | ( |  | ) | const

Returns a copy of the name of object.

For a nameless object, this returns NULL.

Returns:
  The name of object. MT safe. This function grabs and releases object's LOCK.

Reimplemented in Gst::Plugin, and Gst::PluginFeature.

bool Gst::Object::set_parent | ( | const Glib::RefPtr<Object>& | parent | ) |

Sets the parent of object to parent.

The object's reference count will be incremented.

This function causes the parent-set signal to be emitted when the parent was successfully set.

Parameters:

  | parent | New parent of object.

Returns:
  true if parent could be set or false when object already had a parent or object and parent are the same. MT safe. Grabs and releases object's LOCK.

Glib::RefPtr<Object> Gst::Object::get_parent | ( |  | ) |

Returns the parent of object.

Returns:
  Parent of object, this can be NULL if object has no parent. MT safe. Grabs and releases object's LOCK.

Glib::RefPtr<const Object> Gst::Object::get_parent | ( |  | ) | const

Returns the parent of object.

Returns:
  Parent of object, this can be NULL if object has no parent. MT safe. Grabs and releases object's LOCK.

void Gst::Object::unparent | ( |  | ) |

Clear the parent of object, removing the associated reference.

This function decreases the refcount of object.

MT safe. Grabs and releases object's lock.

Glib::ustring Gst::Object::get_name_prefix | ( |  | ) | const

Returns a copy of the name prefix of object.

For a prefixless object, this returns NULL.

Returns:
  The name prefix of object. MT safe. This function grabs and releases object's LOCK.

void Gst::Object::set_name_prefix | ( | const Glib::ustring & | prefix | ) |

Sets the name prefix of object to name_prefix.

This function makes a copy of the provided name prefix, so the caller retains ownership of the name prefix it sent.

MT safe. This function grabs and releases object's LOCK.

Parameters:

  | name_prefix | New name prefix of object.

xmlpp::Node* Gst::Object::save | ( | xmlpp::Node * | parent | ) | const

Saves object into the parent XML node.

Parameters:

  | parent | The parent XML node to save object into.

Returns:
  The new xmlpp::Node pointer with the saved object.

void Gst::Object::restore | ( | xmlpp::Node * | self | ) |

Restores the Gst::Object with the data from the parent XML node.

Parameters:

  | self | The XML node to load object from.

Glib::PropertyProxy<Glib::ustring> Gst::Object::property_name | ( |  | ) |

The name of the object.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gst::Object::property_name | ( |  | ) | const

The name of the object.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

## Friends And Related Function Documentation

Glib::RefPtr<Gst::Object> wrap | ( | GstObject * | 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.

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

- object.h