update for meta api change
[platform/upstream/gst-plugins-good.git] / gst / effectv / gsteffectv.c
index 5097908..1615fd7 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-#include <string.h>
-#include <gst/gst.h>
-#include <gst/video/video.h>
-#include "gsteffectv.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
+#include "gsteffectv.h"
+#include "gstaging.h"
+#include "gstdice.h"
+#include "gstedge.h"
+#include "gstquark.h"
+#include "gstrev.h"
+#include "gstshagadelic.h"
+#include "gstvertigo.h"
+#include "gstwarp.h"
+#include "gstop.h"
+#include "gstradioac.h"
+#include "gststreak.h"
+#include "gstripple.h"
 
-struct _elements_entry {
-  gchar *name;
-  GType (*type) (void);
-  GstElementDetails *details;
-  gboolean (*factoryinit) (GstElementFactory *factory);
+struct _elements_entry
+{
+  const gchar *name;
+    GType (*type) (void);
 };
 
-static struct _elements_entry _elements[] = {
-  { "edgeTV",                  gst_edgetv_get_type,            &gst_edgetv_details,            NULL },
-  { "agingTV",                 gst_agingtv_get_type,           &gst_agingtv_details,           NULL },
-  { "diceTV",                  gst_dicetv_get_type,            &gst_dicetv_details,            NULL },
-  { "warpTV",                  gst_warptv_get_type,            &gst_warptv_details,            NULL },
-  { "shagadelicTV",    gst_shagadelictv_get_type,      &gst_shagadelictv_details,      NULL },
-  { "vertigoTV",       gst_vertigotv_get_type,         &gst_vertigotv_details,         NULL },
-  { "revTV",           gst_revtv_get_type,             &gst_revtv_details,             NULL },
-  { "quarkTV",                 gst_quarktv_get_type,           &gst_quarktv_details,           NULL },
-  { NULL, 0 },
+static const struct _elements_entry _elements[] = {
+  {"edgetv", gst_edgetv_get_type},
+  {"agingtv", gst_agingtv_get_type},
+  {"dicetv", gst_dicetv_get_type},
+  {"warptv", gst_warptv_get_type},
+  {"shagadelictv", gst_shagadelictv_get_type},
+  {"vertigotv", gst_vertigotv_get_type},
+  {"revtv", gst_revtv_get_type},
+  {"quarktv", gst_quarktv_get_type},
+  {"optv", gst_optv_get_type},
+  {"radioactv", gst_radioactv_get_type},
+  {"streaktv", gst_streaktv_get_type},
+  {"rippletv", gst_rippletv_get_type},
+  {NULL, 0},
 };
 
-
-GstPadTemplate* 
-gst_effectv_src_factory (void)
-{
-  static GstPadTemplate *templ = NULL;
-  if (!templ) {
-    templ = GST_PAD_TEMPLATE_NEW ( 
-               "src",
-               GST_PAD_SRC,
-               GST_PAD_ALWAYS,
-               gst_caps_new (
-                 "effectv_src",
-                 "video/x-raw-rgb",
-                 GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
-               )
-            );
-  }
-  return templ;
-}
-
-GstPadTemplate* 
-gst_effectv_sink_factory (void)
-{
-  static GstPadTemplate *templ = NULL;
-  if (!templ) {
-    templ = GST_PAD_TEMPLATE_NEW ( 
-               "sink",
-               GST_PAD_SINK,
-               GST_PAD_ALWAYS,
-               gst_caps_new (
-                 "effectv_sink",
-                 "video/x-raw-rgb",
-                 GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
-               )
-            );
-  }
-  return templ;
-}
-
 static gboolean
-plugin_init (GModule * module, GstPlugin * plugin)
+plugin_init (GstPlugin * plugin)
 {
-  GstElementFactory *factory;
   gint i = 0;
 
   while (_elements[i].name) {
-    factory = gst_element_factory_new (_elements[i].name,
-                                      (_elements[i].type) (),
-                                       _elements[i].details);
-
-    if (!factory) {
-      g_warning ("gst_effecttv_new failed for `%s'",
-                 _elements[i].name);
-      continue;
-    }
-    gst_element_factory_add_pad_template (factory, gst_effectv_src_factory ());
-    gst_element_factory_add_pad_template (factory, gst_effectv_sink_factory ());
-
-    gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-    if (_elements[i].factoryinit) {
-      _elements[i].factoryinit (factory);
-    }
+    if (!gst_element_register (plugin, _elements[i].name,
+            GST_RANK_NONE, (_elements[i].type) ()))
+      return FALSE;
     i++;
   }
 
   return TRUE;
 }
 
-GstPluginDesc plugin_desc = {
-  GST_VERSION_MAJOR,
-  GST_VERSION_MINOR,
-  "effectv",
-  plugin_init
-};
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+    GST_VERSION_MINOR,
+    "effectv",
+    "effect plugins from the effectv project",
+    plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);