commit to make gstreamer follow the gtk function/macro naming conventions:
[platform/upstream/gstreamer.git] / plugins / elements / gstelements.c
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wtay@chello.be>
4  *
5  * gstelements.c:
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23
24 #include <gst/gst.h>
25
26 #include "gstdisksink.h"
27 #include "gstidentity.h"
28 #include "gstfakesink.h"
29 #include "gstfakesrc.h"
30 #include "gstfdsink.h"
31 #include "gstfdsrc.h"
32 #include "gstmultidisksrc.h"
33 #include "gstpipefilter.h"
34 #include "gsttee.h"
35 #include "gstaggregator.h"
36 #include "gststatistics.h"
37 #include "gstmd5sink.h"
38
39
40 struct _elements_entry {
41   gchar *name;
42   GType (*type) (void);
43   GstElementDetails *details;
44   gboolean (*factoryinit) (GstElementFactory *factory);
45 };
46
47
48 extern GType gst_filesrc_get_type(void);
49 extern GstElementDetails gst_filesrc_details;
50
51 static struct _elements_entry _elements[] = {
52   { "fakesrc",      gst_fakesrc_get_type,       &gst_fakesrc_details,           gst_fakesrc_factory_init },
53   { "fakesink",     gst_fakesink_get_type,      &gst_fakesink_details,          gst_fakesink_factory_init },
54   { "filesrc",      gst_filesrc_get_type,       &gst_filesrc_details,           NULL },
55   { "disksink",     gst_disksink_get_type,      &gst_disksink_details,          NULL },
56   { "identity",     gst_identity_get_type,      &gst_identity_details,          NULL },
57   { "fdsink",       gst_fdsink_get_type,        &gst_fdsink_details,            NULL },
58   { "fdsrc",        gst_fdsrc_get_type,         &gst_fdsrc_details,             NULL },
59   { "multidisksrc", gst_multidisksrc_get_type,  &gst_multidisksrc_details,      NULL },
60   { "pipefilter",   gst_pipefilter_get_type,    &gst_pipefilter_details,        NULL },
61   { "tee",          gst_tee_get_type,           &gst_tee_details,               gst_tee_factory_init },
62   { "aggregator",   gst_aggregator_get_type,    &gst_aggregator_details,        gst_aggregator_factory_init },
63   { "statistics",   gst_statistics_get_type,    &gst_statistics_details,        NULL },
64   { "md5sink",      gst_md5sink_get_type,       &gst_md5sink_details,           gst_md5sink_factory_init },
65   { NULL, 0 },
66 };
67
68 static gboolean
69 plugin_init (GModule *module, GstPlugin *plugin)
70 {
71   GstElementFactory *factory;
72   gint i = 0;
73
74   gst_plugin_set_longname (plugin, "Standard GST Elements");
75
76   while (_elements[i].name) {
77     factory = gst_element_factory_new (_elements[i].name,
78                                       (_elements[i].type) (),
79                                       _elements[i].details);
80
81     if (!factory)
82       {
83         g_warning ("gst_element_factory_new failed for `%s'",
84                    _elements[i].name);
85         continue;
86       }
87
88     gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
89     if (_elements[i].factoryinit) {
90       _elements[i].factoryinit (factory);
91     }
92 /*      g_print("added factory '%s'\n",_elements[i].name); */
93
94     i++;
95   }
96
97 /*  INFO (GST_INFO_PLUGIN_LOAD,"gstelements: loaded %d standard elements", i);*/
98
99   return TRUE;
100 }
101
102 GstPluginDesc plugin_desc = {
103   GST_VERSION_MAJOR,
104   GST_VERSION_MINOR,
105   "gstelements",
106   plugin_init
107 };
108