oops, another gtkism, changed GtkType to GType for filesrc
[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 "gstdisksrc.h"
27 #include "gstdisksink.h"
28 #include "gstidentity.h"
29 #include "gstfakesink.h"
30 #include "gstfakesrc.h"
31 #include "gstfdsink.h"
32 #include "gstfdsrc.h"
33 #include "gstmultidisksrc.h"
34 #include "gstpipefilter.h"
35 #include "gstsinesrc.h"
36 #include "gsttee.h"
37 #include "gstaggregator.h"
38
39 #if HAVE_LIBGHTTP
40 #include <gsthttpsrc.h>
41 #endif /* HAVE_LIBGHTTP */
42
43
44 struct _elements_entry {
45   gchar *name;
46   GType (*type) (void);
47   GstElementDetails *details;
48   gboolean (*factoryinit) (GstElementFactory *factory);
49 };
50
51
52 extern GType gst_filesrc_get_type(void);
53
54 extern GstElementDetails *gst_filesrc_details;
55
56 static struct _elements_entry _elements[] = {
57   { "fakesrc",      gst_fakesrc_get_type,       &gst_fakesrc_details,           gst_fakesrc_factory_init },
58   { "fakesink",     gst_fakesink_get_type,      &gst_fakesink_details,          gst_fakesink_factory_init },
59   { "disksrc",      gst_disksrc_get_type,       &gst_disksrc_details,           NULL },
60   { "filesrc",      gst_filesrc_get_type,       &gst_filesrc_details,           NULL },
61   { "disksink",     gst_disksink_get_type,      &gst_disksink_details,          NULL },
62   { "identity",     gst_identity_get_type,      &gst_identity_details,          NULL },
63   { "fdsink",       gst_fdsink_get_type,        &gst_fdsink_details,            NULL },
64   { "fdsrc",        gst_fdsrc_get_type,         &gst_fdsrc_details,             NULL },
65   { "multidisksrc", gst_multidisksrc_get_type,  &gst_multidisksrc_details,      NULL },
66   { "pipefilter",   gst_pipefilter_get_type,    &gst_pipefilter_details,        NULL },
67   { "sinesrc",      gst_sinesrc_get_type,       &gst_sinesrc_details,           gst_sinesrc_factory_init },
68   { "tee",          gst_tee_get_type,           &gst_tee_details,               gst_tee_factory_init },
69   { "aggregator",   gst_aggregator_get_type,    &gst_aggregator_details,        gst_aggregator_factory_init },
70
71 #if HAVE_LIBGHTTP
72   { "httpsrc",      gst_httpsrc_get_type,       &gst_httpsrc_details,      NULL },
73 #endif /* HAVE_LIBGHTTP */
74
75   { NULL, 0 },
76 };
77
78 static gboolean
79 plugin_init (GModule *module, GstPlugin *plugin)
80 {
81   GstElementFactory *factory;
82   gint i = 0;
83
84   gst_plugin_set_longname (plugin, "Standard GST Elements");
85
86   while (_elements[i].name) {
87     factory = gst_elementfactory_new (_elements[i].name,
88                                       (_elements[i].type) (),
89                                       _elements[i].details);
90     if (factory != NULL) {
91       gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
92       if (_elements[i].factoryinit) {
93         _elements[i].factoryinit (factory);
94       }
95 //      g_print("added factory '%s'\n",_elements[i].name);
96     }
97     i++;
98   }
99
100 //  INFO (GST_INFO_PLUGIN_LOAD,"gstelements: loaded %d standard elements", i);
101
102   return TRUE;
103 }
104
105 GstPluginDesc plugin_desc = {
106   GST_VERSION_MAJOR,
107   GST_VERSION_MINOR,
108   "gstelements",
109   plugin_init
110 };
111