Updated for the new plugin loading code
[platform/upstream/gst-plugins-good.git] / gst / effectv / gsteffectv.c
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * EffecTV:
5  * Copyright (C) 2001 FUKUCHI Kentarou
6  *
7  * EffecTV is free software. This library is free software;
8  * you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  * 
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  * 
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27
28 #include <string.h>
29 #include <gst/gst.h>
30 #include <gst/video/video.h>
31 #include "gsteffectv.h"
32
33
34 struct _elements_entry {
35   gchar *name;
36   GType (*type) (void);
37 };
38
39 static struct _elements_entry _elements[] = {
40   { "edgeTV",           gst_edgetv_get_type }, 
41   { "agingTV",          gst_agingtv_get_type },
42   { "diceTV",           gst_dicetv_get_type },
43   { "warpTV",           gst_warptv_get_type },
44   { "shagadelicTV",     gst_shagadelictv_get_type },
45   { "vertigoTV",        gst_vertigotv_get_type },
46   { "revTV",            gst_revtv_get_type },
47   { "quarkTV",          gst_quarktv_get_type },
48   { NULL, 0 },
49 };
50
51
52 GstPadTemplate* 
53 gst_effectv_src_factory (void)
54 {
55   static GstPadTemplate *templ = NULL;
56   if (!templ) {
57     templ = GST_PAD_TEMPLATE_NEW ( 
58                 "src",
59                 GST_PAD_SRC,
60                 GST_PAD_ALWAYS,
61                 gst_caps_new (
62                   "effectv_src",
63                   "video/x-raw-rgb",
64                   GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
65                 )
66              );
67   }
68   return templ;
69 }
70
71 GstPadTemplate* 
72 gst_effectv_sink_factory (void)
73 {
74   static GstPadTemplate *templ = NULL;
75   if (!templ) {
76     templ = GST_PAD_TEMPLATE_NEW ( 
77                 "sink",
78                 GST_PAD_SINK,
79                 GST_PAD_ALWAYS,
80                 gst_caps_new (
81                   "effectv_sink",
82                   "video/x-raw-rgb",
83                   GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
84                 )
85              );
86   }
87   return templ;
88 }
89
90 static gboolean
91 plugin_init (GstPlugin * plugin)
92 {
93   gint i = 0;
94
95   while (_elements[i].name) {
96     if (!gst_element_register (plugin, _elements[i].name,
97                                GST_RANK_NONE, (_elements[i].type) ()))
98       return FALSE;
99     i++;
100   }
101
102   return TRUE;
103 }
104
105 GST_PLUGIN_DEFINE (
106   GST_VERSION_MAJOR,
107   GST_VERSION_MINOR,
108   "effectv",
109   "effect plugins from the effectv project",
110   plugin_init,
111   VERSION,
112   "LGPL",
113   "Wim Taymans <wim.taymans@chello.be>, (c) 2001 FUKUCHI Kentarou, (c) 2001 Sam Mertens, (c) 2002 Ed Tannenbaum",
114   GST_PACKAGE,
115   GST_ORIGIN
116 );