configure.ac: comment about refining the xml deps
[platform/upstream/gstreamer.git] / gst / gstelementfactory.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *               2000,2004 Wim Taymans <wim@fluendo.com>
4  *
5  * gstelement.h: Header for GstElement
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 #ifndef __GST_ELEMENT_FACTORY_H__
25 #define __GST_ELEMENT_FACTORY_H__
26
27 typedef struct _GstElementFactory GstElementFactory;
28 typedef struct _GstElementFactoryClass GstElementFactoryClass;
29
30 #include <gst/gstconfig.h>
31 #include <gst/gstelement.h>
32 #include <gst/gstobject.h>
33 #include <gst/gstplugin.h>
34 #include <gst/gstpluginfeature.h>
35 #include <gst/gstiterator.h>
36
37 G_BEGIN_DECLS
38
39 typedef struct _GstElementDetails GstElementDetails;
40
41 /**
42  * GstElementDetails:
43  * @longname: long, english name
44  * @klass: type of element, as an unordered list separated with slashes ('/')
45  * @description: what the element is about
46  * @author: who wrote this thing?
47  *
48  * This struct defines the public information about a #GstElement. It contains
49  * meta-data about the element that is mostly for the benefit of editors.
50  *
51  * The @klass member can be used by applications to filter elements based 
52  * on functionality.
53  */
54 /* FIXME: need translatable stuff in here (how handle in registry)?
55  * can't we use _N("long name") in element implementations and use _(longname)
56  * in gst_element_factory_get_longname()
57  */
58 struct _GstElementDetails
59 {
60   /*< public > */
61   gchar *longname;
62   gchar *klass;
63   gchar *description;
64   gchar *author;
65
66   /*< private > */
67   gpointer _gst_reserved[GST_PADDING];
68 };
69
70 /**
71  * GST_ELEMENT_DETAILS:
72  * @longname: long, english name
73  * @klass: type of element, as hierarchy with '/' as a delimiter
74  * @description: what the element is about
75  * @author: who wrote this element
76  *
77  * Macro to initialize #GstElementDetails.
78  */
79 #define GST_ELEMENT_DETAILS(longname,klass,description,author)          \
80   { longname, klass, description, author, {0} }
81
82 /**
83  * GST_IS_ELEMENT_DETAILS:
84  * @details: the #GstElementDetails to check
85  *
86  * Tests if element details are initialized.
87  */
88 /* FIXME: what about adding '&& (*__gst_reserved==NULL)' */
89 #define GST_IS_ELEMENT_DETAILS(details) (                                       \
90   (details) && ((details)->longname != NULL) && ((details)->klass != NULL)      \
91   && ((details)->description != NULL) && ((details)->author != NULL))
92
93 #define GST_TYPE_ELEMENT_FACTORY                (gst_element_factory_get_type())
94 #define GST_ELEMENT_FACTORY(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
95                                                  GstElementFactory))
96 #define GST_ELEMENT_FACTORY_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT_FACTORY,\
97                                                  GstElementFactoryClass))
98 #define GST_IS_ELEMENT_FACTORY(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
99 #define GST_IS_ELEMENT_FACTORY_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
100 #define GST_ELEMENT_FACTORY_CAST(obj)           ((GstElementFactory *)(obj))
101
102 /**
103  * GstElementFactory:
104  *
105  * The opaque #GstElementFactory data structure.
106  */
107 struct _GstElementFactory {
108   GstPluginFeature      parent;
109
110   GType                 type;                   /* unique GType of element or 0 if not loaded */
111
112   GstElementDetails     details;
113
114   GList *               staticpadtemplates;
115   guint                 numpadtemplates;
116
117   /* URI interface stuff */
118   guint                 uri_type;
119   gchar **              uri_protocols;
120
121   GList *               interfaces;             /* interfaces this element implements */
122
123   gpointer _gst_reserved[GST_PADDING];
124 };
125
126 struct _GstElementFactoryClass {
127   GstPluginFeatureClass parent_class;
128
129   gpointer _gst_reserved[GST_PADDING];
130 };
131
132 GType                   gst_element_factory_get_type            (void);
133
134 GstElementFactory *     gst_element_factory_find                (const gchar *name);
135
136 GType                   gst_element_factory_get_element_type    (GstElementFactory *factory);
137 G_CONST_RETURN gchar *  gst_element_factory_get_longname        (GstElementFactory *factory);
138 G_CONST_RETURN gchar *  gst_element_factory_get_klass           (GstElementFactory *factory);
139 G_CONST_RETURN gchar *  gst_element_factory_get_description     (GstElementFactory *factory);
140 G_CONST_RETURN gchar *  gst_element_factory_get_author          (GstElementFactory *factory);
141 guint                   gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
142 G_CONST_RETURN GList *  gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
143 gint                    gst_element_factory_get_uri_type        (GstElementFactory *factory);
144 gchar **                gst_element_factory_get_uri_protocols   (GstElementFactory *factory);
145
146 GstElement*             gst_element_factory_create              (GstElementFactory *factory,
147                                                                  const gchar *name);
148 GstElement*             gst_element_factory_make                (const gchar *factoryname, const gchar *name);
149
150 void                    __gst_element_factory_add_static_pad_template (GstElementFactory *elementfactory,
151                                                                  GstStaticPadTemplate *templ);
152 void                    __gst_element_factory_add_interface     (GstElementFactory *elementfactory,
153                                                                  const gchar *interfacename);
154 gboolean                gst_element_register                    (GstPlugin *plugin, const gchar *name,
155                                                                  guint rank, GType type);
156
157
158
159 G_END_DECLS
160
161 #endif /* __GST_ELEMENT_FACTORY_H__ */