Modified a lot of plugins to use the caps system.
[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 "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 "gstsinesrc.h"
35 #include "gsttee.h"
36
37 #if HAVE_LIBGHTTP
38 #include <gsthttpsrc.h>
39 #endif /* HAVE_LIBGHTTP */
40
41
42 struct _elements_entry {
43   gchar *name;
44   GtkType (*type) (void);
45   GstElementDetails *details;
46   gboolean (*factoryinit) (GstElementFactory *factory);
47 };
48
49 static struct _elements_entry _elements[] = {
50   { "fakesrc",      gst_fakesrc_get_type,       &gst_fakesrc_details,           NULL },
51   { "fakesink",     gst_fakesink_get_type,      &gst_fakesink_details,          NULL },
52   { "disksrc",      gst_disksrc_get_type,       &gst_disksrc_details,           NULL },
53   { "identity",     gst_identity_get_type,      &gst_identity_details,          NULL },
54   { "fdsink",       gst_fdsink_get_type,        &gst_fdsink_details,            NULL },
55   { "fdsrc",        gst_fdsrc_get_type,         &gst_fdsrc_details,             NULL },
56   { "multidisksrc", gst_multidisksrc_get_type,  &gst_multidisksrc_details,      NULL },
57   { "pipefilter",   gst_pipefilter_get_type,    &gst_pipefilter_details,        NULL },
58   { "sinesrc",      gst_sinesrc_get_type,       &gst_sinesrc_details,           NULL },
59   { "tee",          gst_tee_get_type,           &gst_tee_details,               gst_tee_factory_init },
60
61 #if HAVE_LIBGHTTP
62   { "httpsrc",      gst_httpsrc_get_type,       &gst_httpsrc_details,      NULL },
63 #endif /* HAVE_LIBGHTTP */
64
65   { NULL, 0 },
66 };
67
68 GstPlugin *plugin_init (GModule *module)
69 {
70   GstPlugin *plugin;
71   GstElementFactory *factory;
72   gint i = 0;
73
74   plugin = gst_plugin_new("gstelements");
75   g_return_val_if_fail(plugin != NULL,NULL);
76
77   gst_plugin_set_longname (plugin, "Standard GST Elements");
78
79   while (_elements[i].name) {
80     factory = gst_elementfactory_new (_elements[i].name,
81                                       (_elements[i].type) (),
82                                       _elements[i].details);
83     if (factory != NULL) {
84       gst_plugin_add_factory (plugin, factory);
85       if (_elements[i].factoryinit) {
86         _elements[i].factoryinit (factory);
87       }
88 //      g_print("added factory '%s'\n",_elements[i].name);
89     }
90     i++;
91   }
92
93 //  INFO (GST_INFO_PLUGIN_LOAD,"gstelements: loaded %d standard elements", i);
94
95   return plugin;
96 }