gstelements.c 3.18 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"
Erik Walthinsen's avatar
Erik Walthinsen committed
37

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

Erik Walthinsen's avatar
Erik Walthinsen committed
42 43 44 45 46

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

Wim Taymans's avatar
Wim Taymans committed
50
static struct _elements_entry _elements[] = {
51 52 53
  { "fakesrc", 	    gst_fakesrc_get_type, 	&gst_fakesrc_details,		NULL },
  { "fakesink",     gst_fakesink_get_type, 	&gst_fakesink_details,		NULL },
  { "disksrc", 	    gst_disksrc_get_type, 	&gst_disksrc_details,		NULL },
54
  { "disksink",	    gst_disksink_get_type,      &gst_disksink_details, 		NULL },
55 56 57
  { "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 },
58
  { "multidisksrc", gst_multidisksrc_get_type,	&gst_multidisksrc_details,	NULL },
59 60 61
  { "pipefilter",   gst_pipefilter_get_type, 	&gst_pipefilter_details,	NULL },
  { "sinesrc", 	    gst_sinesrc_get_type, 	&gst_sinesrc_details,		NULL },
  { "tee",     	    gst_tee_get_type, 		&gst_tee_details,		gst_tee_factory_init },
62 63

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

Erik Walthinsen's avatar
Erik Walthinsen committed
67 68 69
  { NULL, 0 },
};

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

  plugin = gst_plugin_new("gstelements");
  g_return_val_if_fail(plugin != NULL,NULL);

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

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

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

  return plugin;
}