Fixed license statements in EffectTv plugins so they now state LGPL.
[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 "gsteffectv.h"
27
28
29 struct _elements_entry {
30   gchar *name;
31   GType (*type) (void);
32   GstElementDetails *details;
33   gboolean (*factoryinit) (GstElementFactory *factory);
34 };
35
36 static struct _elements_entry _elements[] = {
37   { "edgeTV",           gst_edgetv_get_type,            &gst_edgetv_details,            NULL },
38   { "agingTV",          gst_agingtv_get_type,           &gst_agingtv_details,           NULL },
39   { "diceTV",           gst_dicetv_get_type,            &gst_dicetv_details,            NULL },
40   { "warpTV",           gst_warptv_get_type,            &gst_warptv_details,            NULL },
41   { "shagadelicTV",     gst_shagadelictv_get_type,      &gst_shagadelictv_details,      NULL },
42   { "vertigoTV",        gst_vertigotv_get_type,         &gst_vertigotv_details,         NULL },
43   { "revTV",            gst_revtv_get_type,             &gst_revtv_details,             NULL },
44   { "quarkTV",          gst_quarktv_get_type,           &gst_quarktv_details,           NULL },
45   { NULL, 0 },
46 };
47
48
49 GstPadTemplate* 
50 gst_effectv_src_factory (void)
51 {
52   static GstPadTemplate *templ = NULL;
53   if (!templ) {
54     templ = GST_PAD_TEMPLATE_NEW ( 
55                 "src",
56                 GST_PAD_SRC,
57                 GST_PAD_ALWAYS,
58                 GST_CAPS_NEW (
59                   "effectv_src",
60                   "video/raw",
61                     "format",         GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")),
62                     "bpp",            GST_PROPS_INT (32),
63                     "depth",          GST_PROPS_INT (32),
64                     "endianness",     GST_PROPS_INT (G_BYTE_ORDER),
65                     "red_mask",       GST_PROPS_INT (0xff0000),
66                     "green_mask",     GST_PROPS_INT (0xff00),
67                     "blue_mask",      GST_PROPS_INT (0xff),
68                     "width",          GST_PROPS_INT_RANGE (16, 4096),
69                     "height",         GST_PROPS_INT_RANGE (16, 4096)
70                 )
71              );
72   }
73   return templ;
74 }
75
76 GstPadTemplate* 
77 gst_effectv_sink_factory (void)
78 {
79   static GstPadTemplate *templ = NULL;
80   if (!templ) {
81     templ = GST_PAD_TEMPLATE_NEW ( 
82                 "sink",
83                 GST_PAD_SINK,
84                 GST_PAD_ALWAYS,
85                 GST_CAPS_NEW (
86                   "effectv_sink",
87                   "video/raw",
88                     "format",         GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")),
89                     "bpp",            GST_PROPS_INT (32),
90                     "depth",          GST_PROPS_INT (32),
91                     "endianness",     GST_PROPS_INT (G_BYTE_ORDER),
92                     "red_mask",       GST_PROPS_INT (0xff0000),
93                     "green_mask",     GST_PROPS_INT (0xff00),
94                     "blue_mask",      GST_PROPS_INT (0xff),
95                     "width",          GST_PROPS_INT_RANGE (16, 4096),
96                     "height",         GST_PROPS_INT_RANGE (16, 4096)
97                 )
98              );
99   }
100   return templ;
101 }
102
103 static gboolean
104 plugin_init (GModule * module, GstPlugin * plugin)
105 {
106   GstElementFactory *factory;
107   gint i = 0;
108
109   while (_elements[i].name) {
110     factory = gst_element_factory_new (_elements[i].name,
111                                       (_elements[i].type) (),
112                                        _elements[i].details);
113
114     if (!factory) {
115       g_warning ("gst_effecttv_new failed for `%s'",
116                  _elements[i].name);
117       continue;
118     }
119     gst_element_factory_add_pad_template (factory, gst_effectv_src_factory ());
120     gst_element_factory_add_pad_template (factory, gst_effectv_sink_factory ());
121
122     gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
123     if (_elements[i].factoryinit) {
124       _elements[i].factoryinit (factory);
125     }
126     i++;
127   }
128
129   return TRUE;
130 }
131
132 GstPluginDesc plugin_desc = {
133   GST_VERSION_MAJOR,
134   GST_VERSION_MINOR,
135   "effectv",
136   plugin_init
137 };