[gstreamermm] Gst::Object: implemented easy accecss to an object's refcount.



commit 858adfe45176a26b16f3f0d303cf81b3dee9ea73
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Thu Aug 14 14:29:14 2014 +0200

    Gst::Object: implemented easy accecss to an object's refcount.
    
    Sometimes (especially, in tests) we need to check refcount of an object.
    This change gives developer simple access to a refcount number.
    User had to use 'GST_OBJECT_REFCOUNT(GST_OBJECT(obj->gobj()))' to get a
    refcount. Now it is much easier, just use 'obj->get_refcount()'.
    
        * gstreamer/src/object.[ccg|hg]: added get_refcount method to an
        Gst::Object class.

 gstreamer/src/object.ccg |    5 +++++
 gstreamer/src/object.hg  |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gstreamer/src/object.ccg b/gstreamer/src/object.ccg
index f4af36b..5519aee 100644
--- a/gstreamer/src/object.ccg
+++ b/gstreamer/src/object.ccg
@@ -69,4 +69,9 @@ bool Object::is_bin() const
   return GST_IS_BIN(gobj());
 }
 
+int Object::get_refcount() const
+{
+  return GST_OBJECT_REFCOUNT(gobj());
+}
+
 } // namespace Gst
diff --git a/gstreamer/src/object.hg b/gstreamer/src/object.hg
index fe64ee0..061d571 100644
--- a/gstreamer/src/object.hg
+++ b/gstreamer/src/object.hg
@@ -99,6 +99,8 @@ public:
 
 #m4 _CONVERSION(`GstObject*', `const Glib::RefPtr<Object>&', `Glib::wrap($3, true)')
 #m4 _CONVERSION(`const Glib::RefPtr<Object>&', `GstObject*', `Glib::unwrap($3)')
+
+  int get_refcount() const;
 };
 
 } // namespace Gst


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]