remove copyright field from plugins
[platform/upstream/gst-plugins-good.git] / ext / ladspa / gstladspa.c
index 4ed8b88..6ecb3ce 100644 (file)
@@ -1,6 +1,7 @@
 /* GStreamer
  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
  *               <2001> Steve Baker <stevebaker_org@yahoo.co.uk>
+ *               2003 Andy Wingo <wingo at pobox.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -18,6 +19,9 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include <string.h>
 #include <math.h>
 #include <gst/control/control.h>
 #include <ladspa.h>     /* main ladspa sdk include file */
 #include "utils.h"      /* ladspa sdk utility functions */
 
+/* 1.0 and the 1.1 preliminary headers don't define a version, but 1.1 final
+   does */
+#ifndef LADSPA_VERSION
+#define LADSPA_VERSION "1.0"
+#endif
 
 /* takes ownership of the name */
 static GstPadTemplate*
@@ -109,11 +118,14 @@ gst_ladspa_base_init (GstLADSPAClass *klass)
 
   desc = g_hash_table_lookup(ladspa_descriptors,
                GINT_TO_POINTER(G_TYPE_FROM_CLASS(klass)));
+  if (!desc)
+    desc = g_hash_table_lookup(ladspa_descriptors, GINT_TO_POINTER(0));
+  g_assert (desc);
 
   /* construct the element details struct */
   details = g_new0(GstElementDetails,1);
   details->longname = g_strdup(desc->Name);
-  details->klass = "Filter/Audio/LADSPA";
+  details->klass = "Filter/Effect/Audio/LADSPA";
   details->description = details->longname;
   details->author = g_strdup(desc->Maker);
   gst_element_class_set_details (element_class, details);
@@ -181,6 +193,9 @@ gst_ladspa_class_init (GstLADSPAClass *klass)
   /* look up and store the ladspa descriptor */
   desc = g_hash_table_lookup(ladspa_descriptors,
                GINT_TO_POINTER(G_TYPE_FROM_CLASS(klass)));
+  if (!desc)
+    desc = g_hash_table_lookup(ladspa_descriptors, GINT_TO_POINTER(0));
+  g_assert (desc);
 
   klass->numcontrols = 0;
 
@@ -983,6 +998,12 @@ ladspa_describe_plugin(const char *pcFullFilename,
       g_free(type_name);
       continue;
     }
+
+    /* base-init temp alloc */
+    g_hash_table_insert(ladspa_descriptors,
+                        GINT_TO_POINTER(0),
+                        (gpointer)desc);
+
     /* create the type now */
     type = g_type_register_static(GST_TYPE_ELEMENT, type_name, &typeinfo, 0);
     if (!gst_element_register (ladspa_plugin, type_name, GST_RANK_NONE, type))
@@ -993,6 +1014,8 @@ ladspa_describe_plugin(const char *pcFullFilename,
                         GINT_TO_POINTER(type),
                         (gpointer)desc);
   }
+
+  g_hash_table_remove (ladspa_descriptors, GINT_TO_POINTER (0));
 }
 
 static gboolean
@@ -1021,9 +1044,8 @@ GST_PLUGIN_DEFINE (
   "ladspa",
   "All LADSPA plugins",
   plugin_init,
-  LADSPA_VERSION,
-  "LGPL",
-  "(c) 2003 The LADSPA team",
-  "LADSPA",
-  "http://www.ladspa.org/"
+  VERSION,
+  GST_LICENSE,
+  GST_PACKAGE,
+  GST_ORIGIN
 )