[gstreamermm] Object: Add getter methods for the GMutex lock member.



commit 62c3ff2d9af2e378b0cf843805f6e377ada24201
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Mon Jul 30 23:37:52 2012 -0400

    Object: Add getter methods for the GMutex lock member.
    
    	* gstreamer/src/object.hg: Use _MEMBER_GET_PTR() to provide getter
    	methods for the GMutex lock member.
    	* gstreamer/src/object.ccg: Adapt the callbacks to use the new Thread
    	classes in Glib::Threads and not Glib::Thread which have been
    	deprecated.
    	* gstreamer/src/task.{ccg,hg}: Also use the new thread classes in
    	these files where possible.

 ChangeLog                |   12 ++++++++++++
 gstreamer/src/object.ccg |    1 +
 gstreamer/src/object.hg  |    6 +++++-
 gstreamer/src/task.ccg   |    4 ++--
 gstreamer/src/task.hg    |   15 ++++++++++-----
 5 files changed, 30 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a648bd9..33a35c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2012-07-30  Josà Alburquerque  <jaalburquerque gmail com>
 
+	Object: Add getter methods for the GMutex lock member.
+
+	* gstreamer/src/object.hg: Use _MEMBER_GET_PTR() to provide getter
+	methods for the GMutex lock member.
+	* gstreamer/src/object.ccg: Adapt the callbacks to use the new Thread
+	classes in Glib::Threads and not Glib::Thread which have been
+	deprecated.
+	* gstreamer/src/task.{ccg,hg}: Also use the new thread classes in
+	these files where possible.
+
+2012-07-30  Josà Alburquerque  <jaalburquerque gmail com>
+
 	ElementFactory: Add register_element() wrapping gst_element_register().
 
 	* gstreamer/src/elementfactory.hg: Add the register_element() static
diff --git a/gstreamer/src/object.ccg b/gstreamer/src/object.ccg
index 994454d..33a02b8 100644
--- a/gstreamer/src/object.ccg
+++ b/gstreamer/src/object.ccg
@@ -18,6 +18,7 @@
  */
 
 #include <gst/gstenumtypes.h>
+#include <glibmm/threads.h>
 _PINCLUDE(glibmm/private/object_p.h)
 
 namespace Gst
diff --git a/gstreamer/src/object.hg b/gstreamer/src/object.hg
index af99c01..14a8aef 100644
--- a/gstreamer/src/object.hg
+++ b/gstreamer/src/object.hg
@@ -20,6 +20,7 @@
 #include <gst/gstobject.h>
 #include <glibmm/object.h>
 #include <glibmm/listhandle.h>
+#include <glibmm/threads.h>
 #include <libxml++/nodes/node.h>
 
 _DEFS(gstreamermm,gst)
@@ -64,7 +65,10 @@ public:
    */
   _MEMBER_GET(flags, flags, guint32, guint32)
 
-  //TODO: _MEMBER_GET(lock, lock, Glib::Mutex, GMutex)
+//TODO: These conversions should probably be in the glibmm conversion files.
+#m4 _CONVERSION(`GMutex*',`Glib::Threads::Mutex*',`Glib::Threads::wrap($3)')
+#m4 _CONVERSION(`GMutex*',`const Glib::Threads::Mutex*',`Glib::Threads::wrap($3)')
+  _MEMBER_GET_PTR(lock, lock, Glib::Threads::Mutex*, GMutex*)
 
   _WRAP_METHOD(bool set_name(const Glib::ustring& name), gst_object_set_name)
   _WRAP_METHOD(Glib::ustring get_name() const, gst_object_get_name)
diff --git a/gstreamer/src/task.ccg b/gstreamer/src/task.ccg
index bd97f92..97f4e45 100644
--- a/gstreamer/src/task.ccg
+++ b/gstreamer/src/task.ccg
@@ -56,7 +56,7 @@ static void Task_Enter_gstreamermm_callback(GstTask* task, GThread* thread, gpoi
 
   try
   {
-    (*the_slot)(Glib::wrap(task, true), Glib::wrap(thread));
+    (*the_slot)(Glib::wrap(task, true), Glib::Threads::wrap(thread));
   }
   catch(...)
   {
@@ -71,7 +71,7 @@ static void Task_Leave_gstreamermm_callback(GstTask *task, GThread *thread, gpoi
 
   try
   {
-    (*the_slot)(Glib::wrap(task, true), Glib::wrap(thread));
+    (*the_slot)(Glib::wrap(task, true), Glib::Threads::wrap(thread));
   }
   catch(...)
   {
diff --git a/gstreamer/src/task.hg b/gstreamer/src/task.hg
index b459cbc..6b2386c 100644
--- a/gstreamer/src/task.hg
+++ b/gstreamer/src/task.hg
@@ -19,6 +19,7 @@
 
 #include <gst/gsttask.h>
 #include <gstreamermm/object.h>
+#include <glibmm/threads.h>
 #include <glibmm/thread.h>
 #include <memory>
 
@@ -72,18 +73,22 @@ public:
   typedef sigc::slot<void> SlotTask;
 
   /** For example,
-   * void on_enter(const Glib::RefPtr<Gst::Task>& task, Glib::Thread& thread);.
+   * void on_enter(const Glib::RefPtr<Gst::Task>& task, Glib::Threads::Thread&
+   * thread);.
    * A thread is entered, this slot is called when the new thread enters its
    * function.
    */
-  typedef sigc::slot<void, const Glib::RefPtr<Gst::Task>&, Glib::Thread*> SlotEnter;
+  typedef sigc::slot<void, const Glib::RefPtr<Gst::Task>&,
+    Glib::Threads::Thread*> SlotEnter;
 
   /** For example,
-   * void on_leave(const Glib::RefPtr<Gst::Task>& task, Glib::Thread& thread);.
+   * void on_leave(const Glib::RefPtr<Gst::Task>& task, Glib::Threads::Thread&
+   * thread);.
    * A thread is exiting, this is called when the thread is about to leave its
    * function.
    */
-    typedef sigc::slot<void, const Glib::RefPtr<Gst::Task>&, Glib::Thread*> SlotLeave;
+    typedef sigc::slot<void, const Glib::RefPtr<Gst::Task>&,
+      Glib::Threads::Thread*> SlotLeave;
 
 protected:
   explicit Task(const SlotTask& task_slot);
@@ -112,7 +117,7 @@ public:
    * By default a thread for the task will be created from a default thread
    * pool.
    *
-   * Objects can use custom Glib::Threads or can perform additional
+   * Objects can use custom Glib::Threads::Thread or can perform additional
    * configuration of the threads (such as changing the thread priority) by
    * installing slots.
    *



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