2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000,2004 Wim Taymans <wim@fluendo.com>
5 * gstelement.h: Header for GstElement
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.
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.
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.
24 #ifndef __GST_ELEMENT_FACTORY_H__
25 #define __GST_ELEMENT_FACTORY_H__
27 #include <gst/gstconfig.h>
28 #include <gst/gsttypes.h>
29 #include <gst/gstelement.h>
30 #include <gst/gstobject.h>
31 #include <gst/gstplugin.h>
32 #include <gst/gstpluginfeature.h>
33 #include <gst/gstiterator.h>
37 /* FIXME: need translatable stuff in here (how handle in registry)? */
38 struct _GstElementDetails
41 gchar *longname; /* long, english name */
42 gchar *klass; /* type of element, as hierarchy */
43 gchar *description; /* insights of one form or another */
44 gchar *author; /* who wrote this thing? */
47 gpointer _gst_reserved[GST_PADDING];
50 #define GST_ELEMENT_DETAILS(longname,klass,description,author) \
51 { longname, klass, description, author, GST_PADDING_INIT }
52 #define GST_IS_ELEMENT_DETAILS(details) ( \
53 (details) && ((details)->longname != NULL) && ((details)->klass != NULL) \
54 && ((details)->description != NULL) && ((details)->author != NULL))
56 #define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type())
57 #define GST_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
59 #define GST_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT_FACTORY,\
60 GstElementFactoryClass))
61 #define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
62 #define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
64 struct _GstElementFactory {
65 GstPluginFeature parent;
67 GType type; /* unique GType of element or 0 if not loaded */
69 GstElementDetails details;
71 GList * staticpadtemplates;
72 guint numpadtemplates;
74 /* URI interface stuff */
76 gchar ** uri_protocols;
78 GList * interfaces; /* interfaces this element implements */
80 gpointer _gst_reserved[GST_PADDING];
83 struct _GstElementFactoryClass {
84 GstPluginFeatureClass parent_class;
86 gpointer _gst_reserved[GST_PADDING];
89 GType gst_element_factory_get_type (void);
91 GstElementFactory * gst_element_factory_find (const gchar *name);
93 GType gst_element_factory_get_element_type (GstElementFactory *factory);
94 G_CONST_RETURN gchar * gst_element_factory_get_longname (GstElementFactory *factory);
95 G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factory);
96 G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory);
97 G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory);
98 guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
99 G_CONST_RETURN GList * gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
100 guint gst_element_factory_get_uri_type (GstElementFactory *factory);
101 gchar ** gst_element_factory_get_uri_protocols (GstElementFactory *factory);
103 GstElement* gst_element_factory_create (GstElementFactory *factory,
105 GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
107 void __gst_element_factory_add_static_pad_template (GstElementFactory *elementfactory,
108 GstStaticPadTemplate *templ);
109 void __gst_element_factory_add_interface (GstElementFactory *elementfactory,
110 const gchar *interfacename);
111 gboolean gst_element_register (GstPlugin *plugin, const gchar *name,
112 guint rank, GType type);
118 #endif /* __GST_ELEMENT_FACTORY_H__ */