[farsight2/master] Rename FsNiceThread into FsNiceAgent

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:26:28 PST 2008


---
 transmitters/nice/fs-nice-agent.c              |  106 ++++++++++++------------
 transmitters/nice/fs-nice-agent.h              |   70 ++++++++--------
 transmitters/nice/fs-nice-stream-transmitter.c |    8 +-
 transmitters/nice/fs-nice-transmitter.c        |    2 +-
 4 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/transmitters/nice/fs-nice-agent.c b/transmitters/nice/fs-nice-agent.c
index 45d32e5..b18e5ee 100644
--- a/transmitters/nice/fs-nice-agent.c
+++ b/transmitters/nice/fs-nice-agent.c
@@ -1,11 +1,11 @@
 /*
- * Farsight2 - Farsight libnice Transmitter thread object
+ * Farsight2 - Farsight libnice Transmitter agent object
  *
  * Copyright 2007-2008 Collabora Ltd.
  *  @author: Olivier Crete <olivier.crete at collabora.co.uk>
  * Copyright 2007-2008 Nokia Corp.
  *
- * fs-nice-thread.c - A Farsight libnice transmitter thread object
+ * fs-nice-agent.c - A Farsight libnice transmitter agent object
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -23,8 +23,8 @@
  */
 
 /**
- * SECTION:fs-nice-thread
- * @short_description: A transmitter for threads for libnice
+ * SECTION:fs-nice-agent
+ * @short_description: A transmitter for agents for libnice
  *
  */
 
@@ -55,7 +55,7 @@ enum
   PROP_COMPATIBILITY_MODE
 };
 
-struct _FsNiceThreadPrivate
+struct _FsNiceAgentPrivate
 {
   GMainContext *main_context;
   GMainLoop *main_loop;
@@ -72,22 +72,22 @@ struct _FsNiceThreadPrivate
   GThread *thread;
 };
 
-#define FS_NICE_THREAD_GET_PRIVATE(o)  \
-  (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_NICE_THREAD, \
-    FsNiceThreadPrivate))
+#define FS_NICE_AGENT_GET_PRIVATE(o)  \
+  (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_NICE_AGENT, \
+    FsNiceAgentPrivate))
 
 
-#define FS_NICE_THREAD_LOCK(o)   g_mutex_lock ((o)->priv->mutex)
-#define FS_NICE_THREAD_UNLOCK(o) g_mutex_unlock ((o)->priv->mutex)
+#define FS_NICE_AGENT_LOCK(o)   g_mutex_lock ((o)->priv->mutex)
+#define FS_NICE_AGENT_UNLOCK(o) g_mutex_unlock ((o)->priv->mutex)
 
-static void fs_nice_thread_class_init (
-    FsNiceThreadClass *klass);
-static void fs_nice_thread_init (FsNiceThread *self);
-static void fs_nice_thread_finalize (GObject *object);
-static void fs_nice_thread_stop_thread (FsNiceThread *self);
+static void fs_nice_agent_class_init (
+    FsNiceAgentClass *klass);
+static void fs_nice_agent_init (FsNiceAgent *self);
+static void fs_nice_agent_finalize (GObject *object);
+static void fs_nice_agent_stop_thread (FsNiceAgent *self);
 
 static void
-fs_nice_thread_set_property (GObject *object,
+fs_nice_agent_set_property (GObject *object,
     guint prop_id,
     const GValue *value,
     GParamSpec *pspec);
@@ -103,44 +103,44 @@ static GObjectClass *parent_class = NULL;
 static GType type = 0;
 
 GType
-fs_nice_thread_get_type (void)
+fs_nice_agent_get_type (void)
 {
   g_assert (type);
   return type;
 }
 
 GType
-fs_nice_thread_register_type (FsPlugin *module)
+fs_nice_agent_register_type (FsPlugin *module)
 {
   static const GTypeInfo info = {
-    sizeof (FsNiceThreadClass),
+    sizeof (FsNiceAgentClass),
     NULL,
     NULL,
-    (GClassInitFunc) fs_nice_thread_class_init,
+    (GClassInitFunc) fs_nice_agent_class_init,
     NULL,
     NULL,
-    sizeof (FsNiceThread),
+    sizeof (FsNiceAgent),
     0,
-    (GInstanceInitFunc) fs_nice_thread_init
+    (GInstanceInitFunc) fs_nice_agent_init
   };
 
   type = g_type_module_register_type (G_TYPE_MODULE (module),
-      G_TYPE_OBJECT, "FsNiceThread", &info, 0);
+      G_TYPE_OBJECT, "FsNiceAgent", &info, 0);
 
   return type;
 }
 
 static void
-fs_nice_thread_class_init (FsNiceThreadClass *klass)
+fs_nice_agent_class_init (FsNiceAgentClass *klass)
 {
   GObjectClass *gobject_class = (GObjectClass *) klass;
 
   parent_class = g_type_class_peek_parent (klass);
 
-  gobject_class->set_property = fs_nice_thread_set_property;
-  gobject_class->finalize = fs_nice_thread_finalize;
+  gobject_class->set_property = fs_nice_agent_set_property;
+  gobject_class->finalize = fs_nice_agent_finalize;
 
-  g_type_class_add_private (klass, sizeof (FsNiceThreadPrivate));
+  g_type_class_add_private (klass, sizeof (FsNiceAgentPrivate));
 
   g_object_class_install_property (gobject_class, PROP_COMPATIBILITY_MODE,
       g_param_spec_uint (
@@ -153,11 +153,11 @@ fs_nice_thread_class_init (FsNiceThreadClass *klass)
 }
 
 static void
-fs_nice_thread_init (FsNiceThread *self)
+fs_nice_agent_init (FsNiceAgent *self)
 {
 
   /* member init */
-  self->priv = FS_NICE_THREAD_GET_PRIVATE (self);
+  self->priv = FS_NICE_AGENT_GET_PRIVATE (self);
 
   nice_udp_bsd_socket_factory_init (&self->priv->udpfactory);
 
@@ -170,11 +170,11 @@ fs_nice_thread_init (FsNiceThread *self)
 }
 
 static void
-fs_nice_thread_finalize (GObject *object)
+fs_nice_agent_finalize (GObject *object)
 {
-  FsNiceThread *self = FS_NICE_THREAD (object);
+  FsNiceAgent *self = FS_NICE_AGENT (object);
 
-  fs_nice_thread_stop_thread (self);
+  fs_nice_agent_stop_thread (self);
 
   if (self->priv->main_context)
   {
@@ -196,12 +196,12 @@ fs_nice_thread_finalize (GObject *object)
 }
 
 static void
-fs_nice_thread_set_property (GObject *object,
+fs_nice_agent_set_property (GObject *object,
     guint prop_id,
     const GValue *value,
     GParamSpec *pspec)
 {
-  FsNiceThread *self = FS_NICE_THREAD (object);
+  FsNiceAgent *self = FS_NICE_AGENT (object);
 
   switch (prop_id)
   {
@@ -219,7 +219,7 @@ fs_nice_thread_set_property (GObject *object,
 static gboolean
 thread_unlock_idler (gpointer data)
 {
-  FsNiceThread *self = FS_NICE_THREAD (data);
+  FsNiceAgent *self = FS_NICE_AGENT (data);
 
   g_main_loop_quit (self->priv->main_loop);
 
@@ -227,18 +227,18 @@ thread_unlock_idler (gpointer data)
 }
 
 static void
-fs_nice_thread_stop_thread (FsNiceThread *self)
+fs_nice_agent_stop_thread (FsNiceAgent *self)
 {
   GSource *idle_source;
 
-  FS_NICE_THREAD_LOCK(self);
+  FS_NICE_AGENT_LOCK(self);
 
   if (self->priv->thread == NULL)
   {
-    FS_NICE_THREAD_UNLOCK (self);
+    FS_NICE_AGENT_UNLOCK (self);
     return;
   }
-  FS_NICE_THREAD_UNLOCK (self);
+  FS_NICE_AGENT_UNLOCK (self);
 
   g_main_loop_quit (self->priv->main_loop);
 
@@ -252,20 +252,20 @@ fs_nice_thread_stop_thread (FsNiceThread *self)
   g_source_destroy (idle_source);
   g_source_unref (idle_source);
 
-  FS_NICE_THREAD_LOCK (self);
+  FS_NICE_AGENT_LOCK (self);
   self->priv->thread = NULL;
-  FS_NICE_THREAD_UNLOCK (self);
+  FS_NICE_AGENT_UNLOCK (self);
 }
 
 GMainContext *
-fs_nice_thread_get_context (FsNiceThread *self)
+fs_nice_agent_get_context (FsNiceAgent *self)
 {
   return self->priv->main_context;
 }
 
 
 void
-fs_nice_thread_add_weak_object (FsNiceThread *self,
+fs_nice_agent_add_weak_object (FsNiceAgent *self,
     GObject *object)
 {
   g_object_weak_ref (G_OBJECT (object), (GWeakNotify) g_object_unref, self);
@@ -276,33 +276,33 @@ fs_nice_thread_add_weak_object (FsNiceThread *self,
 
 
 static gpointer
-fs_nice_thread_main_thread (gpointer data)
+fs_nice_agent_main_thread (gpointer data)
 {
-  FsNiceThread *self = FS_NICE_THREAD (data);
+  FsNiceAgent *self = FS_NICE_AGENT (data);
 
   g_main_loop_run (self->priv->main_loop);
 
   return NULL;
 }
 
-FsNiceThread *
-fs_nice_thread_new (GError **error)
+FsNiceAgent *
+fs_nice_agent_new (GError **error)
 {
-  FsNiceThread *self = NULL;
+  FsNiceAgent *self = NULL;
 
-  self = g_object_new (FS_TYPE_NICE_THREAD, NULL);
+  self = g_object_new (FS_TYPE_NICE_AGENT, NULL);
 
-  FS_NICE_THREAD_LOCK (self);
-  self->priv->thread = g_thread_create (fs_nice_thread_main_thread,
+  FS_NICE_AGENT_LOCK (self);
+  self->priv->thread = g_thread_create (fs_nice_agent_main_thread,
       self, TRUE, error);
 
   if (!self->priv->thread)
   {
-    FS_NICE_THREAD_UNLOCK (self);
+    FS_NICE_AGENT_UNLOCK (self);
     g_object_unref (self);
     return NULL;
   }
-  FS_NICE_THREAD_UNLOCK (self);
+  FS_NICE_AGENT_UNLOCK (self);
 
   return self;
 }
diff --git a/transmitters/nice/fs-nice-agent.h b/transmitters/nice/fs-nice-agent.h
index e858fb5..64fd3c3 100644
--- a/transmitters/nice/fs-nice-agent.h
+++ b/transmitters/nice/fs-nice-agent.h
@@ -1,11 +1,11 @@
 /*
- * Farsight2 - Farsight libnice Transmitter thread object
+ * Farsight2 - Farsight libnice Transmitter agent object
  *
  * Copyright 2007-2008 Collabora Ltd.
  *  @author: Olivier Crete <olivier.crete at collabora.co.uk>
  * Copyright 2007-2008 Nokia Corp.
  *
- * fs-nice-thread.h - A Farsight libnice transmitter thread object
+ * fs-nice-agent.h - A Farsight libnice transmitter agent object
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -22,8 +22,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef __FS_NICE_THREAD_H__
-#define __FS_NICE_THREAD_H__
+#ifndef __FS_NICE_AGENT_H__
+#define __FS_NICE_AGENT_H__
 
 #include <glib-object.h>
 #include <gst-libs/gst/farsight/fs-plugin.h>
@@ -32,67 +32,67 @@
 G_BEGIN_DECLS
 
 /* TYPE MACROS */
-#define FS_TYPE_NICE_THREAD \
-  (fs_nice_thread_get_type ())
-#define FS_NICE_THREAD(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_NICE_THREAD, \
-    FsNiceThread))
-#define FS_NICE_THREAD_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_NICE_THREAD, \
-    FsNiceThreadClass))
-#define FS_IS_NICE_THREAD(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_NICE_THREAD))
-#define FS_IS_NICE_THREAD_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_NICE_THREAD))
-#define FS_NICE_THREAD_GET_CLASS(obj) \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj), FS_TYPE_NICE_THREAD, \
-    FsNiceThreadClass))
-#define FS_NICE_THREAD_CAST(obj) ((FsNiceThread *) (obj))
-
-typedef struct _FsNiceThread FsNiceThread;
-typedef struct _FsNiceThreadClass FsNiceThreadClass;
-typedef struct _FsNiceThreadPrivate FsNiceThreadPrivate;
+#define FS_TYPE_NICE_AGENT \
+  (fs_nice_agent_get_type ())
+#define FS_NICE_AGENT(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_NICE_AGENT, \
+    FsNiceAgent))
+#define FS_NICE_AGENT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_NICE_AGENT, \
+    FsNiceAgentClass))
+#define FS_IS_NICE_AGENT(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_NICE_AGENT))
+#define FS_IS_NICE_AGENT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_NICE_AGENT))
+#define FS_NICE_AGENT_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), FS_TYPE_NICE_AGENT, \
+    FsNiceAgentClass))
+#define FS_NICE_AGENT_CAST(obj) ((FsNiceAgent *) (obj))
+
+typedef struct _FsNiceAgent FsNiceAgent;
+typedef struct _FsNiceAgentClass FsNiceAgentClass;
+typedef struct _FsNiceAgentPrivate FsNiceAgentPrivate;
 
 /**
- * FsNiceThreadClass:
+ * FsNiceAgentClass:
  * @parent_class: Our parent
  *
  * The class structure
  */
 
-struct _FsNiceThreadClass
+struct _FsNiceAgentClass
 {
   GObjectClass parent_class;
 };
 
 /**
- * FsNiceThread:
+ * FsNiceAgent:
  *
  * All members are private, access them using methods and properties
  */
-struct _FsNiceThread
+struct _FsNiceAgent
 {
   GObject parent;
 
   /*< private >*/
-  FsNiceThreadPrivate *priv;
+  FsNiceAgentPrivate *priv;
 };
 
 
-GType fs_nice_thread_get_type (void);
+GType fs_nice_agent_get_type (void);
 
 GMainContext *
-fs_nice_thread_get_context (FsNiceThread *self);
+fs_nice_agent_get_context (FsNiceAgent *self);
 
-void fs_nice_thread_add_weak_object (FsNiceThread *self,
+void fs_nice_agent_add_weak_object (FsNiceAgent *self,
     GObject *object);
 
-FsNiceThread *fs_nice_thread_new (GError **error);
+FsNiceAgent *fs_nice_agent_new (GError **error);
 
 
 GType
-fs_nice_thread_register_type (FsPlugin *module);
+fs_nice_agent_register_type (FsPlugin *module);
 
 G_END_DECLS
 
-#endif /* __FS_NICE_THREAD_H__ */
+#endif /* __FS_NICE_AGENT_H__ */
diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index a1e3dca..fabc89e 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -862,7 +862,7 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
   GList *item;
   gboolean set = FALSE;
   GList *agents  = NULL;
-  FsNiceThread *thread = NULL;
+  FsNiceAgent *thread = NULL;
   NiceAgent *agent = NULL;
 
   /* Before going any further, check that the list of candidates are ok */
@@ -961,12 +961,12 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
     /* If we don't have a thread, build one */
     if (thread == NULL)
     {
-      thread = fs_nice_thread_new (error);
+      thread = fs_nice_agent_new (error);
       if (!thread)
         return FALSE;
     }
 
-    ctx = fs_nice_thread_get_context (thread);
+    ctx = fs_nice_agent_get_context (thread);
 
     agent = nice_agent_new (&udpfactory, ctx, self->priv->compatibility_mode);
 
@@ -979,7 +979,7 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
       return FALSE;
     }
 
-    fs_nice_thread_add_weak_object (thread, G_OBJECT (agent));
+    fs_nice_agent_add_weak_object (thread, G_OBJECT (agent));
 
     g_object_set_data (G_OBJECT (thread), "nice-thread", thread);
 
diff --git a/transmitters/nice/fs-nice-transmitter.c b/transmitters/nice/fs-nice-transmitter.c
index 0cdf95a..43fd5bf 100644
--- a/transmitters/nice/fs-nice-transmitter.c
+++ b/transmitters/nice/fs-nice-transmitter.c
@@ -144,7 +144,7 @@ fs_nice_transmitter_register_type (FsPlugin *module)
         "Farsight libnice transmitter");
 
   fs_nice_stream_transmitter_register_type (module);
-  fs_nice_thread_register_type (module);
+  fs_nice_agent_register_type (module);
 
   type = g_type_module_register_type (G_TYPE_MODULE (module),
     FS_TYPE_TRANSMITTER, "FsNiceTransmitter", &info, 0);
-- 
1.5.6.5




More information about the farsight-commits mailing list