gstelements.c 3.59 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>

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
26
#include "gstfilesink.h"
27 28 29 30 31
#include "gstidentity.h"
#include "gstfakesink.h"
#include "gstfakesrc.h"
#include "gstfdsink.h"
#include "gstfdsrc.h"
32
#include "gstmultidisksrc.h"
33 34
#include "gstpipefilter.h"
#include "gsttee.h"
Wim Taymans's avatar
Wim Taymans committed
35
#include "gstaggregator.h"
36
#include "gstshaper.h"
David I. Lehn's avatar
David I. Lehn committed
37
#include "gststatistics.h"
Benjamin Otte's avatar
Benjamin Otte committed
38
#include "gstmd5sink.h"
Erik Walthinsen's avatar
Erik Walthinsen committed
39 40 41 42


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

48

49
extern GType gst_filesrc_get_type(void);
Wim Taymans's avatar
Wim Taymans committed
50
extern GstElementDetails gst_filesrc_details;
51

Wim Taymans's avatar
Wim Taymans committed
52
static struct _elements_entry _elements[] = {
53
  { "fakesrc", 	    gst_fakesrc_get_type, 	&gst_fakesrc_details,		gst_fakesrc_factory_init },
Wim Taymans's avatar
Wim Taymans committed
54
  { "fakesink",     gst_fakesink_get_type, 	&gst_fakesink_details,		gst_fakesink_factory_init },
55
  { "filesrc", 	    gst_filesrc_get_type, 	&gst_filesrc_details,		NULL },
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
56
  { "filesink",	    gst_filesink_get_type,      &gst_filesink_details, 		NULL },
57 58 59
  { "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 },
60
  { "multidisksrc", gst_multidisksrc_get_type,	&gst_multidisksrc_details,	NULL },
61 62
  { "pipefilter",   gst_pipefilter_get_type, 	&gst_pipefilter_details,	NULL },
  { "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
  { "shaper",       gst_shaper_get_type, 	&gst_shaper_details,		gst_shaper_factory_init },
David I. Lehn's avatar
David I. Lehn committed
65
  { "statistics",   gst_statistics_get_type, 	&gst_statistics_details,	NULL },
Benjamin Otte's avatar
Benjamin Otte committed
66
  { "md5sink",      gst_md5sink_get_type, 	&gst_md5sink_details,		gst_md5sink_factory_init },
Erik Walthinsen's avatar
Erik Walthinsen committed
67 68 69
  { NULL, 0 },
};

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

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

  while (_elements[i].name) {
79
    factory = gst_element_factory_new (_elements[i].name,
Wim Taymans's avatar
Wim Taymans committed
80 81
                                      (_elements[i].type) (),
                                      _elements[i].details);
Joshua N. Pritikin's avatar
Joshua N. Pritikin committed
82 83 84

    if (!factory)
      {
85
	g_warning ("gst_element_factory_new failed for `%s'",
Joshua N. Pritikin's avatar
Joshua N. Pritikin committed
86 87
		   _elements[i].name);
	continue;
88
      }
Joshua N. Pritikin's avatar
Joshua N. Pritikin committed
89 90 91 92

    gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
    if (_elements[i].factoryinit) {
      _elements[i].factoryinit (factory);
Erik Walthinsen's avatar
Erik Walthinsen committed
93
    }
94
/*      g_print("added factory '%s'\n",_elements[i].name); */
Joshua N. Pritikin's avatar
Joshua N. Pritikin committed
95

Erik Walthinsen's avatar
Erik Walthinsen committed
96 97 98
    i++;
  }

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

101
  return TRUE;
Erik Walthinsen's avatar
Erik Walthinsen committed
102
}
103 104 105 106 107 108 109 110

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