New mimetypes gone into effect today - this commit changes all old mimetypes over...
[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 #include <string.h>
25 #include <gst/gst.h>
26 #include <gst/video/video.h>
27 #include "gsteffectv.h"
28
29
30 struct _elements_entry {
31   gchar *name;
32   GType (*type) (void);
33   GstElementDetails *details;
34   gboolean (*factoryinit) (GstElementFactory *factory);
35 };
36
37 static struct _elements_entry _elements[] = {
38   { "edgeTV",           gst_edgetv_get_type,            &gst_edgetv_details,            NULL },
39   { "agingTV",          gst_agingtv_get_type,           &gst_agingtv_details,           NULL },
40   { "diceTV",           gst_dicetv_get_type,            &gst_dicetv_details,            NULL },
41   { "warpTV",           gst_warptv_get_type,            &gst_warptv_details,            NULL },
42   { "shagadelicTV",     gst_shagadelictv_get_type,      &gst_shagadelictv_details,      NULL },
43   { "vertigoTV",        gst_vertigotv_get_type,         &gst_vertigotv_details,         NULL },
44   { "revTV",            gst_revtv_get_type,             &gst_revtv_details,             NULL },
45   { "quarkTV",          gst_quarktv_get_type,           &gst_quarktv_details,           NULL },
46   { NULL, 0 },
47 };
48
49
50 GstPadTemplate* 
51 gst_effectv_src_factory (void)
52 {
53   static GstPadTemplate *templ = NULL;
54   if (!templ) {
55     templ = GST_PAD_TEMPLATE_NEW ( 
56                 "src",
57                 GST_PAD_SRC,
58                 GST_PAD_ALWAYS,
59                 gst_caps_new (
60                   "effectv_src",
61                   "video/x-raw-rgb",
62                   GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
63                 )
64              );
65   }
66   return templ;
67 }
68
69 GstPadTemplate* 
70 gst_effectv_sink_factory (void)
71 {
72   static GstPadTemplate *templ = NULL;
73   if (!templ) {
74     templ = GST_PAD_TEMPLATE_NEW ( 
75                 "sink",
76                 GST_PAD_SINK,
77                 GST_PAD_ALWAYS,
78                 gst_caps_new (
79                   "effectv_sink",
80                   "video/x-raw-rgb",
81                   GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
82                 )
83              );
84   }
85   return templ;
86 }
87
88 static gboolean
89 plugin_init (GModule * module, GstPlugin * plugin)
90 {
91   GstElementFactory *factory;
92   gint i = 0;
93
94   while (_elements[i].name) {
95     factory = gst_element_factory_new (_elements[i].name,
96                                       (_elements[i].type) (),
97                                        _elements[i].details);
98
99     if (!factory) {
100       g_warning ("gst_effecttv_new failed for `%s'",
101                  _elements[i].name);
102       continue;
103     }
104     gst_element_factory_add_pad_template (factory, gst_effectv_src_factory ());
105     gst_element_factory_add_pad_template (factory, gst_effectv_sink_factory ());
106
107     gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
108     if (_elements[i].factoryinit) {
109       _elements[i].factoryinit (factory);
110     }
111     i++;
112   }
113
114   return TRUE;
115 }
116
117 GstPluginDesc plugin_desc = {
118   GST_VERSION_MAJOR,
119   GST_VERSION_MINOR,
120   "effectv",
121   plugin_init
122 };