gstreamermm  1.4.3
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gst::Object Class Reference

A base class for the GStreamer object hierarchy. More...

Inheritance diagram for Gst::Object:
Inheritance graph
[legend]
Collaboration diagram for Gst::Object:
Collaboration graph
[legend]

Public Member Functions

virtual ~Object ()
 
GstObject* gobj ()
 Provides access to the underlying C GObject. More...
 
const GstObject* gobj () const
 Provides access to the underlying C GObject. More...
 
GstObject* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
bool is_element () const
 
bool is_element_factory () const
 
bool is_pad () const
 
bool is_pad_template () const
 
bool is_bin () const
 
guint32 get_flags () const
 Returns the entire set of flags for the object. More...
 
bool set_name (const Glib::ustring& name)
 Sets the name of object, or gives object a guaranteed unique name (if name is 0). More...
 
Glib::ustring get_name () const
 Returns a copy of the name of object. More...
 
bool set_parent (const Glib::RefPtr< Gst::Object >& parent)
 Sets the parent of object to parent. More...
 
Glib::RefPtr< Gst::Objectget_parent ()
 Returns the parent of object. More...
 
Glib::RefPtr< const Gst::Objectget_parent () const
 Returns the parent of object. More...
 
void unparent ()
 Clear the parent of object, removing the associated reference. More...
 
bool has_ancestor (const Glib::RefPtr< const Gst::Object >& ancestor) const
 Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
 
Glib::ustring get_path_string ()
 Generates a string describing the path of object in the object hierarchy. More...
 
Glib::PropertyProxy
< Glib::ustring
property_name ()
 The name of the object. More...
 
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_name () const
 The name of the object. More...
 
Glib::SignalProxy2< void,
const Glib::RefPtr< Object >
&, GParamSpec* > 
signal_deep_notify ()
 
int get_refcount () const
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
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. More...
 

Protected Member Functions

virtual void on_deep_notify (const Glib::RefPtr< Object >& prop_object, GParamSpec* prop)
 This is a default handler for the signal signal_deep_notify(). More...
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gst::Objectwrap (GstObject* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

A 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
listA list of Gst::Object to check through.
nameThe 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 a copy of the name of object.

Caller should Glib::free() the return value after usage. For a nameless object, this returns 0, which you can safely Glib::free() as well.

Free-function: g_free

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

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

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

Returns the parent of object.

This function increases the refcount of the parent object so you should unref() it after usage.

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<const Gst::Object> Gst::Object::get_parent ( ) const

Returns the parent of object.

This function increases the refcount of the parent object so you should unref() it after usage.

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.

Free-function: g_free

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.

int Gst::Object::get_refcount ( ) const
static GType Gst::Object::get_type ( )
static

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

GstObject* Gst::Object::gobj ( )
inline

Provides access to the underlying C GObject.

const GstObject* Gst::Object::gobj ( ) const
inline

Provides access to the underlying C GObject.

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.

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.

One can e.g. check if a Gst::Element is inside a Gst::Pipeline.

Parameters
ancestorA Gst::Object to check as ancestor.
Returns
true if ancestor is an ancestor of object.

MT safe. Grabs and releases object's locks.

bool Gst::Object::is_bin ( ) const
bool Gst::Object::is_element ( ) const
bool Gst::Object::is_element_factory ( ) const
bool Gst::Object::is_pad ( ) const
bool Gst::Object::is_pad_template ( ) const
virtual void Gst::Object::on_deep_notify ( const Glib::RefPtr< Object >&  prop_object,
GParamSpec *  prop 
)
protectedvirtual

This is a default handler for the signal signal_deep_notify().

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 value of the property, 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_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
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
nameNew 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.

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 ref_sink()).

Parameters
parentNew 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 ( )
Slot Prototype:
void on_my_deep_notify(const Glib::RefPtr<Object>& prop_object, GParamSpec* prop)

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.

Parameters
prop_objectThe object that originated the signal.
propThe property that changed.
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
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.

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