[farsight2/master] Remove the now useless unload callback (modules are no longer unloadable)

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


---
 gst-libs/gst/farsight/fs-plugin.c                 |   17 -----------------
 gst-libs/gst/farsight/fs-plugin.h                 |   16 +++++++---------
 transmitters/multicast/fs-multicast-transmitter.c |   13 +------------
 transmitters/rawudp/fs-rawudp-transmitter.c       |   12 +-----------
 4 files changed, 9 insertions(+), 49 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-plugin.c b/gst-libs/gst/farsight/fs-plugin.c
index b72b15c..9fd296c 100644
--- a/gst-libs/gst/farsight/fs-plugin.c
+++ b/gst-libs/gst/farsight/fs-plugin.c
@@ -50,7 +50,6 @@
    (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_PLUGIN, FsPluginPrivate))
 
 static gboolean fs_plugin_load (GTypeModule *module);
-static void fs_plugin_unload (GTypeModule *module);
 
 
 static gchar **search_paths = NULL;
@@ -109,7 +108,6 @@ fs_plugin_class_init (FsPluginClass * klass)
   parent_class = g_type_class_peek_parent (klass);
 
   module_class->load = fs_plugin_load;
-  module_class->unload = fs_plugin_unload;
 
   g_type_class_add_private (klass, sizeof (FsPluginPrivate));
 
@@ -208,21 +206,6 @@ static gboolean fs_plugin_load (GTypeModule *module)
 
 }
 
-static void
-fs_plugin_unload (GTypeModule *module)
-{
-  FsPlugin *plugin = NULL;
-
-  g_return_if_fail (module != NULL);
-
-  plugin = FS_PLUGIN (module);
-
-  GST_INFO("Unloading plugin %s", plugin->name);
-
-  if (plugin->unload != NULL)
-    plugin->unload (plugin);
-}
-
 static FsPlugin *
 fs_plugin_get_by_name (const gchar * name, const gchar * type_suffix)
 {
diff --git a/gst-libs/gst/farsight/fs-plugin.h b/gst-libs/gst/farsight/fs-plugin.h
index 04a0207..b7b289a 100644
--- a/gst-libs/gst/farsight/fs-plugin.h
+++ b/gst-libs/gst/farsight/fs-plugin.h
@@ -65,19 +65,20 @@ struct _FsPlugin
 
   gchar *name;                  /* name of the plugin */
 
-  /* callbacks */
-  /* This function is called when the last instance of the plugin is
-   * unloaded. It can be useful to deallocate resources common for all
-   * instances of the plugin. */
-  void (*unload) (FsPlugin * plugin);
+  /*< private >*/
 
   FsPluginPrivate *priv;
+
+  gpointer unused[4];
 };
 
 struct _FsPluginClass
 {
   GTypeModuleClass parent_class;
 
+  /*< private >*/
+
+  gpointer unused[4];
 };
 
 GType fs_plugin_get_type (void);
@@ -97,17 +98,14 @@ GObject *fs_plugin_create (const gchar *name,
 /**
  * FS_INIT_PLUGIN:
  * @type_register_func: A function that register a #GType and returns it
- * @inunload: a function of type void (*unload) (FsPlugin * plugin) to be
- * called when the plugin is unloaded
  *
  * This macro is used to declare Farsight plugins and must be used once
  * in any farsight plugin.
  */
 
-#define FS_INIT_PLUGIN(type_register_func, inunload)            \
+#define FS_INIT_PLUGIN(type_register_func)            \
     G_MODULE_EXPORT void fs_init_plugin (FsPlugin *plugin) {    \
       plugin->type = (type_register_func (plugin));             \
-      plugin->unload = (inunload);                              \
     }
 
 
diff --git a/transmitters/multicast/fs-multicast-transmitter.c b/transmitters/multicast/fs-multicast-transmitter.c
index 9d447e9..de0a4a9 100644
--- a/transmitters/multicast/fs-multicast-transmitter.c
+++ b/transmitters/multicast/fs-multicast-transmitter.c
@@ -163,18 +163,7 @@ fs_multicast_transmitter_register_type (FsPlugin *module)
   return type;
 }
 
-static void
-fs_multicast_transmitter_unload (FsPlugin *plugin)
-{
-  if (fs_multicast_transmitter_debug)
-  {
-    gst_debug_category_free (fs_multicast_transmitter_debug);
-    fs_multicast_transmitter_debug = NULL;
-  }
-}
-
-FS_INIT_PLUGIN (fs_multicast_transmitter_register_type,
-    fs_multicast_transmitter_unload)
+FS_INIT_PLUGIN (fs_multicast_transmitter_register_type)
 
 static void
 fs_multicast_transmitter_class_init (FsMulticastTransmitterClass *klass)
diff --git a/transmitters/rawudp/fs-rawudp-transmitter.c b/transmitters/rawudp/fs-rawudp-transmitter.c
index e1b6f7b..3c22018 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-transmitter.c
@@ -166,18 +166,8 @@ fs_rawudp_transmitter_register_type (FsPlugin *module)
   return type;
 }
 
-static void
-fs_rawudp_transmitter_unload (FsPlugin *plugin)
-{
-  if (fs_rawudp_transmitter_debug)
-  {
-    gst_debug_category_free (fs_rawudp_transmitter_debug);
-    fs_rawudp_transmitter_debug = NULL;
-  }
-}
 
-FS_INIT_PLUGIN (fs_rawudp_transmitter_register_type,
-    fs_rawudp_transmitter_unload)
+FS_INIT_PLUGIN (fs_rawudp_transmitter_register_type)
 
 static void
 fs_rawudp_transmitter_class_init (FsRawUdpTransmitterClass *klass)
-- 
1.5.6.5




More information about the farsight-commits mailing list