# Gst::Object Class Reference
[gstreamermm Base Classes]

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.
guint32 | get_flags () const
| Returns the entire set of flags for the object.
bool | set_name (const Glib::ustring& name)
| Sets the name of object, or gives object a guaranteed unique name (if name is `0`).
Glib::ustring | get_name () const
| Returns: the name of object.
bool | set_parent (const Glib::RefPtr<Gst::Object>& parent)
| Sets the parent of object to parent.
Glib::RefPtr<Gst::Object> | get_parent ()
| Returns: parent of object, this can be `0` if object has no.
Glib::RefPtr<const Gst::Object> | get_parent () const
| Returns: parent of object, this can be `0` if object has no.
void | unparent ()
| Clear the parent of object, removing the associated reference.
Glib::ustring | get_name_prefix () const
| Returns: the name prefix of object.
void | set_name_prefix (const Glib::ustring& name_prefix)
| Sets the name prefix of object to name_prefix.
bool | has_ancestor (const Glib::RefPtr<const Gst::Object>& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy.
xmlpp::Node* | save (xmlpp::Node* parent)
| Saves object into the parent XML node.
const xmlpp::Node* | save (const xmlpp::Node* parent) const
| Saves object into the parent XML node.
void | restore (xmlpp::Node* self)
| Restores object with the data from the parent XML node.
Glib::ustring | get_path_string ()
| Generates a string describing the path of object in the object hierarchy.
Glib::SignalProxy2< void, const Glib::RefPtr<Object> &, GParamSpec* > | signal_deep_notify ()
| The deep notify signal is used to be notified of property changes.
Glib::SignalProxy1< void, GstXmlNodePtr > | signal_object_saved ()
| Trigered whenever a new object is saved to XML.
Glib::SignalProxy1< void, const Glib::RefPtr<Object >&> | signal_parent_set ()
| Emitted when the parent of an object is set.
Glib::SignalProxy1< void, const Glib::RefPtr<Object >&> | signal_parent_unset ()
| Emitted when the parent of an object is unset.
virtual xmlpp::Node* | save_vfunc (xmlpp::Node* parent)
virtual void | restore_vfunc (xmlpp::Node* self_node)
## Static Public Member Functions
static bool | check_uniqueness (const Glib::ListHandle<const Gst::Object>& list, const Glib::ustring& name)
| Checks to see if there is any object named name in list.
## Protected Member Functions
virtual void | on_deep_notify (const Glib::RefPtr<Object>& prop_object, GParamSpec* prop)
virtual void | on_object_saved (GstXmlNodePtr xml_node)
virtual void | on_parent_set (const Glib::RefPtr<Object>& parent)
virtual void | on_parent_unset (const Glib::RefPtr<Object>& parent)
## 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]`

## Member Function Documentation

static bool Gst::Object::check_uniqueness | ( | const Glib::ListHandle<const Gst::Object>& | list,
|  | const Glib::ustring & | name |
| ) |  |  | `[static]`

Checks to see if there is any object named name in list.

This function does not do any locking of any kind. You might want to protect the provided list with the lock of the owner of the list. This function will lock each Gst::Object in the list to compare the name, so be carefull when passing a list with a locked object.

Parameters:

  | list | A list of Gst::Object to check through.
  | name | The name to search for.

Returns:
  `true` if a Gst::Object named name does not appear in list, `false` if it does.

MT safe. Grabs and releases the LOCK of each object in the list.

guint32 Gst::Object::get_flags | ( |  | ) | const

Returns the entire set of flags for the object.

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

Returns: the name of object.

Glib::free() after usage.

Returns:
  The name of object. Glib::free() after usage.

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

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

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

Returns: the name prefix of object.

Glib::free() after usage.

Returns:
  The name prefix of object. Glib::free() after usage.

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

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

Returns: parent of object, this can be `0` if object has no.

Returns:
  Parent of object, this can be `0` if object has no parent. unref after usage.

MT safe. Grabs and releases object's LOCK.

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

Returns: parent of object, this can be `0` if object has no.

Returns:
  Parent of object, this can be `0` if object has no parent. unref after usage.

MT safe. Grabs and releases object's LOCK.

Glib::ustring Gst::Object::get_path_string | ( |  | ) |

Generates a string describing the path of object in the object hierarchy.

Only useful (or used) for debugging.

Returns:
  A string describing the path of object. You must Glib::free() the string after usage.

MT safe. Grabs and releases the Gst::Object's LOCK for all objects in the hierarchy.

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::RingBuffer, Gst::SystemClock, Gst::Task, Gst::TCPClientSink, Gst::TCPClientSrc, Gst::TCPServerSrc, Gst::Tee, Gst::TextOverlay, Gst::TextRender, Gst::TheoraDec, Gst::TheoraEnc, Gst::TimeOverlay, Gst::TypeFindElement, 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 | ( |  | ) | `[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::RingBuffer, Gst::SystemClock, Gst::Task, Gst::TCPClientSink, Gst::TCPClientSrc, Gst::TCPServerSrc, Gst::Tee, Gst::TextOverlay, Gst::TextRender, Gst::TheoraDec, Gst::TheoraEnc, Gst::TimeOverlay, Gst::TypeFindElement, 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::RingBuffer, Gst::SystemClock, Gst::Task, Gst::TCPClientSink, Gst::TCPClientSrc, Gst::TCPServerSrc, Gst::Tee, Gst::TextOverlay, Gst::TextRender, Gst::TheoraDec, Gst::TheoraEnc, Gst::TimeOverlay, Gst::TypeFindElement, 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.

bool Gst::Object::has_ancestor | ( | const Glib::RefPtr<const Gst::Object>& | ancestor | ) | const

Check if object has an ancestor ancestor somewhere up in the hierarchy.

Parameters:

  | ancestor | A Gst::Object to check as ancestor.

Returns:
  `true` if ancestor is an ancestor of object.

MT safe. Grabs and releases object's locks.

virtual void Gst::Object::on_deep_notify | ( | const Glib::RefPtr<Object>& | prop_object,
|  | GParamSpec * | prop |
| ) |  |  | `[protected, virtual]`

virtual void Gst::Object::on_object_saved | ( | GstXmlNodePtr | xml_node | ) | `[protected, virtual]`

virtual void Gst::Object::on_parent_set | ( | const Glib::RefPtr<Object>& | parent | ) | `[protected, virtual]`

virtual void Gst::Object::on_parent_unset | ( | const Glib::RefPtr<Object>& | parent | ) | `[protected, virtual]`

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

Restores object with the data from the parent XML node.

Parameters:

  | self | The XML node to load object from.

virtual void Gst::Object::restore_vfunc | ( | xmlpp::Node * | self_node | ) | `[virtual]`

const xmlpp::Node* Gst::Object::save | ( | const 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.

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

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.

virtual xmlpp::Node* Gst::Object::save_vfunc | ( | xmlpp::Node * | parent | ) | `[virtual]`

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

Sets the name of object, or gives object a guaranteed unique name (if name is `0`).

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.

void Gst::Object::set_name_prefix | ( | const Glib::ustring & | name_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.

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

Sets the parent of object to parent.

The object's reference count will be incremented, and any floating reference will be removed (see sink()).

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::SignalProxy2<void,const Glib::RefPtr<Object>&,GParamSpec*> Gst::Object::signal_deep_notify | ( |  | ) |

The deep notify signal is used to be notified of property changes.

It is typically attached to the toplevel bin to receive notifications from all the elements contained in that bin.

Prototype:
  `void on_my_deep_notify(const Glib::RefPtr<Object>& prop_object, GParamSpec* prop)`

Glib::SignalProxy1< void,GstXmlNodePtr > Gst::Object::signal_object_saved | ( |  | ) |

Trigered whenever a new object is saved to XML.

You can connect to this signal to insert custom XML tags into the core XML.

Prototype:
  `void on_my_object_saved(GstXmlNodePtr xml_node)`

Glib::SignalProxy1<void,const Glib::RefPtr<Object>&> Gst::Object::signal_parent_set | ( |  | ) |

Emitted when the parent of an object is set.

Prototype:
  `void on_my_parent_set(const Glib::RefPtr<Object>& parent)`

Glib::SignalProxy1<void,const Glib::RefPtr<Object>&> Gst::Object::signal_parent_unset | ( |  | ) |

Emitted when the parent of an object is unset.

Prototype:
  `void on_my_parent_unset(const Glib::RefPtr<Object>& parent)`

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.

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