Port all elements that can be ported to videofilter, and fix up the caps.
[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 GstStaticPadTemplate gst_effectv_src_template =
53 GST_STATIC_PAD_TEMPLATE (
54     "src",
55     GST_PAD_SRC,
56     GST_PAD_ALWAYS,
57     GST_STATIC_CAPS ( 
58                         GST_VIDEO_CAPS_BGRx "; "
59                         GST_VIDEO_CAPS_RGBx
60                     )
61 );
62
63 GstStaticPadTemplate gst_effectv_sink_template =
64 GST_STATIC_PAD_TEMPLATE (
65     "sink",
66     GST_PAD_SINK,
67     GST_PAD_ALWAYS,
68     GST_STATIC_CAPS ( 
69                         GST_VIDEO_CAPS_BGRx "; "
70                         GST_VIDEO_CAPS_RGBx
71                     )
72 );
73
74 static gboolean
75 plugin_init (GstPlugin * plugin)
76 {
77   gint i = 0;
78
79   if (!gst_library_load ("gstvideofilter"))
80     return FALSE;
81
82   while (_elements[i].name) {
83     if (!gst_element_register (plugin, _elements[i].name,
84           GST_RANK_NONE, (_elements[i].type) ()))
85       return FALSE;
86     i++;
87   }
88
89   return TRUE;
90 }
91
92 GST_PLUGIN_DEFINE (
93   GST_VERSION_MAJOR,
94   GST_VERSION_MINOR,
95   "effectv",
96   "effect plugins from the effectv project",
97   plugin_init,
98   VERSION,
99   "LGPL",
100   GST_PACKAGE,
101   GST_ORIGIN
102 );