gstelements.c 3.41 KB
Newer Older
Erik Walthinsen's avatar
Erik Walthinsen committed
1 2 3 4
/* GStreamer
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
 *                    2000 Wim Taymans <wtay@chello.be>
 *
Wim Taymans's avatar
Wim Taymans committed
5
 * gstelements.c:
Erik Walthinsen's avatar
Erik Walthinsen committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */


#include <gst/gst.h>

26
#include "gstdisksrc.h"
27
#include "gstdisksink.h"
28 29 30 31 32
#include "gstidentity.h"
#include "gstfakesink.h"
#include "gstfakesrc.h"
#include "gstfdsink.h"
#include "gstfdsrc.h"
33
#include "gstmultidisksrc.h"
34 35 36
#include "gstpipefilter.h"
#include "gstsinesrc.h"
#include "gsttee.h"
Wim Taymans's avatar
Wim Taymans committed
37
#include "gstaggregator.h"
Erik Walthinsen's avatar
Erik Walthinsen committed
38

39 40 41 42
#if HAVE_LIBGHTTP
#include <gsthttpsrc.h>
#endif /* HAVE_LIBGHTTP */

Erik Walthinsen's avatar
Erik Walthinsen committed
43 44 45

struct _elements_entry {
  gchar *name;
46
  GType (*type) (void);
Erik Walthinsen's avatar
Erik Walthinsen committed
47
  GstElementDetails *details;
48
  gboolean (*factoryinit) (GstElementFactory *factory);
Erik Walthinsen's avatar
Erik Walthinsen committed
49 50
};

Wim Taymans's avatar
Wim Taymans committed
51
static struct _elements_entry _elements[] = {
52
  { "fakesrc", 	    gst_fakesrc_get_type, 	&gst_fakesrc_details,		gst_fakesrc_factory_init },
Wim Taymans's avatar
Wim Taymans committed
53
  { "fakesink",     gst_fakesink_get_type, 	&gst_fakesink_details,		gst_fakesink_factory_init },
54
  { "disksrc", 	    gst_disksrc_get_type, 	&gst_disksrc_details,		NULL },
55
  { "disksink",	    gst_disksink_get_type,      &gst_disksink_details, 		NULL },
56 57 58
  { "identity",     gst_identity_get_type,  	&gst_identity_details,		NULL },
  { "fdsink",       gst_fdsink_get_type, 	&gst_fdsink_details,		NULL },
  { "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
  { "sinesrc", 	    gst_sinesrc_get_type, 	&gst_sinesrc_details,		gst_sinesrc_factory_init },
62
  { "tee",     	    gst_tee_get_type, 		&gst_tee_details,		gst_tee_factory_init },
Wim Taymans's avatar
Wim Taymans committed
63
  { "aggregator",   gst_aggregator_get_type, 	&gst_aggregator_details,	gst_aggregator_factory_init },
64 65

#if HAVE_LIBGHTTP
Wim Taymans's avatar
Wim Taymans committed
66
  { "httpsrc",	    gst_httpsrc_get_type,	&gst_httpsrc_details,      NULL },
67
#endif /* HAVE_LIBGHTTP */
Wim Taymans's avatar
Wim Taymans committed
68

Erik Walthinsen's avatar
Erik Walthinsen committed
69 70 71
  { NULL, 0 },
};

72 73
static gboolean
plugin_init (GModule *module, GstPlugin *plugin)
Wim Taymans's avatar
Wim Taymans committed
74
{
Erik Walthinsen's avatar
Erik Walthinsen committed
75
  GstElementFactory *factory;
Wim Taymans's avatar
Wim Taymans committed
76
  gint i = 0;
Erik Walthinsen's avatar
Erik Walthinsen committed
77

Wim Taymans's avatar
Wim Taymans committed
78
  gst_plugin_set_longname (plugin, "Standard GST Elements");
Erik Walthinsen's avatar
Erik Walthinsen committed
79 80

  while (_elements[i].name) {
Wim Taymans's avatar
Wim Taymans committed
81 82 83
    factory = gst_elementfactory_new (_elements[i].name,
                                      (_elements[i].type) (),
                                      _elements[i].details);
Erik Walthinsen's avatar
Erik Walthinsen committed
84
    if (factory != NULL) {
85
      gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
86
      if (_elements[i].factoryinit) {
Wim Taymans's avatar
Wim Taymans committed
87
        _elements[i].factoryinit (factory);
88 89
      }
//      g_print("added factory '%s'\n",_elements[i].name);
Erik Walthinsen's avatar
Erik Walthinsen committed
90 91 92 93
    }
    i++;
  }

94
//  INFO (GST_INFO_PLUGIN_LOAD,"gstelements: loaded %d standard elements", i);
Erik Walthinsen's avatar
Erik Walthinsen committed
95

96
  return TRUE;
Erik Walthinsen's avatar
Erik Walthinsen committed
97
}
98 99 100 101 102 103 104 105

GstPluginDesc plugin_desc = {
  GST_VERSION_MAJOR,
  GST_VERSION_MINOR,
  "gstelements",
  plugin_init
};