[0.11] gst-plugins-ugly: port to new gthread API

Wim Taymans wtay at kemper.freedesktop.org
Thu Jan 19 02:38:24 PST 2012


Module: gst-plugins-ugly
Branch: 0.11
Commit: a95015dcfd8a83ca9f66ccd55f87569193038ae3
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=a95015dcfd8a83ca9f66ccd55f87569193038ae3

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Jan 19 11:34:41 2012 +0100

port to new gthread API

---

 gst/asfdemux/gstasfdemux.c |    4 ----
 gst/realmedia/rademux.c    |    4 ----
 gst/realmedia/rdtmanager.c |   20 ++++++++++----------
 gst/realmedia/rmdemux.c    |    4 ----
 4 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index 6f110c8..fbac7d7 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -32,10 +32,6 @@
 #include "config.h"
 #endif
 
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
 #include <gst/gstutils.h>
 #include <gst/base/gstbytereader.h>
 #include <gst/riff/riff-media.h>
diff --git a/gst/realmedia/rademux.c b/gst/realmedia/rademux.c
index 9551c2e..82fc3a2 100644
--- a/gst/realmedia/rademux.c
+++ b/gst/realmedia/rademux.c
@@ -41,10 +41,6 @@
 #include "config.h"
 #endif
 
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
 #include "rademux.h"
 #include "rmdemux.h"
 #include "rmutils.h"
diff --git a/gst/realmedia/rdtmanager.c b/gst/realmedia/rdtmanager.c
index 6bce4db..e2b2d0f 100644
--- a/gst/realmedia/rdtmanager.c
+++ b/gst/realmedia/rdtmanager.c
@@ -147,7 +147,7 @@ static void gst_rdt_manager_loop (GstPad * pad);
 
 static guint gst_rdt_manager_signals[LAST_SIGNAL] = { 0 };
 
-#define JBUF_LOCK(sess)   (g_mutex_lock ((sess)->jbuf_lock))
+#define JBUF_LOCK(sess)   (g_mutex_lock (&(sess)->jbuf_lock))
 
 #define JBUF_LOCK_CHECK(sess,label) G_STMT_START {    \
   JBUF_LOCK (sess);                                   \
@@ -155,8 +155,8 @@ static guint gst_rdt_manager_signals[LAST_SIGNAL] = { 0 };
     goto label;                                       \
 } G_STMT_END
 
-#define JBUF_UNLOCK(sess) (g_mutex_unlock ((sess)->jbuf_lock))
-#define JBUF_WAIT(sess)   (g_cond_wait ((sess)->jbuf_cond, (sess)->jbuf_lock))
+#define JBUF_UNLOCK(sess) (g_mutex_unlock (&(sess)->jbuf_lock))
+#define JBUF_WAIT(sess)   (g_cond_wait (&(sess)->jbuf_cond, &(sess)->jbuf_lock))
 
 #define JBUF_WAIT_CHECK(sess,label) G_STMT_START {    \
   JBUF_WAIT(sess);                                    \
@@ -164,7 +164,7 @@ static guint gst_rdt_manager_signals[LAST_SIGNAL] = { 0 };
     goto label;                                       \
 } G_STMT_END
 
-#define JBUF_SIGNAL(sess) (g_cond_signal ((sess)->jbuf_cond))
+#define JBUF_SIGNAL(sess) (g_cond_signal (&(sess)->jbuf_cond))
 
 /* Manages the receiving end of the packets.
  *
@@ -210,8 +210,8 @@ struct _GstRDTManagerSession
 
   /* jitterbuffer, lock and cond */
   RDTJitterBuffer *jbuf;
-  GMutex *jbuf_lock;
-  GCond *jbuf_cond;
+  GMutex jbuf_lock;
+  GCond jbuf_cond;
 
   /* some accounting */
   guint64 num_late;
@@ -243,8 +243,8 @@ create_session (GstRDTManager * rdtmanager, gint id)
   sess->id = id;
   sess->dec = rdtmanager;
   sess->jbuf = rdt_jitter_buffer_new ();
-  sess->jbuf_lock = g_mutex_new ();
-  sess->jbuf_cond = g_cond_new ();
+  g_mutex_init (&sess->jbuf_lock);
+  g_cond_init (&sess->jbuf_cond);
   rdtmanager->sessions = g_slist_prepend (rdtmanager->sessions, sess);
 
   return sess;
@@ -316,8 +316,8 @@ static void
 free_session (GstRDTManagerSession * session)
 {
   g_object_unref (session->jbuf);
-  g_cond_free (session->jbuf_cond);
-  g_mutex_free (session->jbuf_lock);
+  g_cond_clear (&session->jbuf_cond);
+  g_mutex_clear (&session->jbuf_lock);
   g_free (session);
 }
 
diff --git a/gst/realmedia/rmdemux.c b/gst/realmedia/rmdemux.c
index 0fbdee2..2e6abe5 100644
--- a/gst/realmedia/rmdemux.c
+++ b/gst/realmedia/rmdemux.c
@@ -28,10 +28,6 @@
 #  include "config.h"
 #endif
 
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
 #include "rmdemux.h"
 #include "rmutils.h"
 



More information about the gstreamer-commits mailing list