Updated copyright notices.
[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 <gstasyncdisksrc.h>
27 #include <gstaudiosink.h>
28 #include <gstaudiosrc.h>
29 #include <gstdisksrc.h>
30 #include <gstidentity.h>
31 #include <gstfakesink.h>
32 #include <gstfakesrc.h>
33 #include <gstfdsink.h>
34 #include <gstfdsrc.h>
35 #include <gstpipefilter.h>
36 #include <gstqueue.h>
37 #include <gstsinesrc.h>
38 #include <gsttypefind.h>
39
40 #if HAVE_LIBGHTTP
41 #include <gsthttpsrc.h>
42 #endif /* HAVE_LIBGHTTP */
43
44
45 struct _elements_entry {
46   gchar *name;
47   GtkType (*type) (void);
48   GstElementDetails *details;
49   gboolean (*factoryinit) (GstElementFactory *factory);
50 };
51
52 static struct _elements_entry _elements[] = {
53   { "fakesrc",      gst_fakesrc_get_type,       &gst_fakesrc_details,      NULL },
54   { "fakesink",     gst_fakesink_get_type,      &gst_fakesink_details,     NULL },
55   { "asyncdisksrc", gst_asyncdisksrc_get_type,  &gst_asyncdisksrc_details, NULL },
56   { "audiosink",    gst_audiosink_get_type,     &gst_audiosink_details,    gst_audiosink_factory_init },
57   { "audiosrc",     gst_audiosrc_get_type,      &gst_audiosrc_details,     NULL },
58   { "disksrc",      gst_disksrc_get_type,       &gst_disksrc_details,      NULL },
59   { "identity",     gst_identity_get_type,      &gst_identity_details,     NULL },
60   { "fdsink",       gst_fdsink_get_type,        &gst_fdsink_details,       NULL },
61   { "fdsrc",        gst_fdsrc_get_type,         &gst_fdsrc_details,        NULL },
62   { "pipefilter",   gst_pipefilter_get_type,    &gst_pipefilter_details,   NULL },
63   { "queue",        gst_queue_get_type,         &gst_queue_details,        NULL },
64   { "sinesrc",      gst_sinesrc_get_type,       &gst_sinesrc_details,      NULL },
65   { "typefind",     gst_typefind_get_type,      &gst_typefind_details,     NULL },
66
67 #if HAVE_LIBGHTTP
68   { "httpsrc",      gst_httpsrc_get_type,       &gst_httpsrc_details,      NULL },
69 #endif /* HAVE_LIBGHTTP */
70   
71   { NULL, 0 },
72 };
73
74 GstPlugin *plugin_init (GModule *module) 
75 {
76   GstPlugin *plugin;
77   GstElementFactory *factory;
78   gint i = 0;
79
80   plugin = gst_plugin_new("gstelements");
81   g_return_val_if_fail(plugin != NULL,NULL);
82
83   gst_plugin_set_longname (plugin, "Standard GST Elements");
84
85   while (_elements[i].name) {
86     factory = gst_elementfactory_new (_elements[i].name,
87                                       (_elements[i].type) (),
88                                       _elements[i].details);
89     if (factory != NULL) {
90       gst_plugin_add_factory (plugin, factory);
91       if (_elements[i].factoryinit) {
92         _elements[i].factoryinit (factory);
93       }
94 //      g_print("added factory '%s'\n",_elements[i].name);
95     }
96     i++;
97   }
98
99   gst_info ("gstelements: loaded %d standard elements\n", i);
100
101   return plugin;
102 }