Add separate def for extra size time
[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., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22
23
24 #ifndef __GST_ELEMENT_FACTORY_H__
25 #define __GST_ELEMENT_FACTORY_H__
26
27 /**
28  * GstElementFactory:
29  *
30  * The opaque #GstElementFactory data structure.
31  */
32 typedef struct _GstElementFactory GstElementFactory;
33 typedef struct _GstElementFactoryClass GstElementFactoryClass;
34
35 #include <gst/gstconfig.h>
36 #include <gst/gstelement.h>
37 #include <gst/gstpad.h>
38 #include <gst/gstplugin.h>
39 #include <gst/gstpluginfeature.h>
40 #include <gst/gsturi.h>
41
42 G_BEGIN_DECLS
43
44 #define GST_TYPE_ELEMENT_FACTORY                (gst_element_factory_get_type())
45 #define GST_ELEMENT_FACTORY(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
46                                                  GstElementFactory))
47 #define GST_ELEMENT_FACTORY_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT_FACTORY,\
48                                                  GstElementFactoryClass))
49 #define GST_IS_ELEMENT_FACTORY(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
50 #define GST_IS_ELEMENT_FACTORY_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
51 #define GST_ELEMENT_FACTORY_CAST(obj)           ((GstElementFactory *)(obj))
52
53 GType                   gst_element_factory_get_type            (void);
54
55 GstElementFactory *     gst_element_factory_find                (const gchar *name);
56
57 GType                   gst_element_factory_get_element_type    (GstElementFactory *factory);
58
59 const gchar *           gst_element_factory_get_metadata        (GstElementFactory *factory, const gchar *key);
60 gchar **                gst_element_factory_get_metadata_keys   (GstElementFactory *factory);
61
62 guint                   gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
63 const GList *           gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
64
65 GstURIType              gst_element_factory_get_uri_type        (GstElementFactory *factory);
66 const gchar * const *   gst_element_factory_get_uri_protocols   (GstElementFactory *factory);
67
68 gboolean                gst_element_factory_has_interface       (GstElementFactory *factory,
69                                                                  const gchar *interfacename);
70
71 GstElement*             gst_element_factory_create              (GstElementFactory *factory,
72                                                                  const gchar *name) G_GNUC_MALLOC;
73 GstElement*             gst_element_factory_make                (const gchar *factoryname, const gchar *name) G_GNUC_MALLOC;
74
75 gboolean                gst_element_register                    (GstPlugin *plugin, const gchar *name,
76                                                                  guint rank, GType type);
77 #ifdef TIZEN_PROFILE_TV
78 GstElement              *gst_element_factory_get                (GstElementFactory * factory, const gchar * name);
79 #endif
80
81 /* Factory list functions */
82
83 /**
84  * GstFactoryListType:
85  * @GST_ELEMENT_FACTORY_TYPE_DECODER: Decoder elements
86  * @GST_ELEMENT_FACTORY_TYPE_ENCODER: Encoder elements
87  * @GST_ELEMENT_FACTORY_TYPE_SINK: Sink elements
88  * @GST_ELEMENT_FACTORY_TYPE_SRC: Source elements
89  * @GST_ELEMENT_FACTORY_TYPE_MUXER: Muxer elements
90  * @GST_ELEMENT_FACTORY_TYPE_DEMUXER: Demuxer elements
91  * @GST_ELEMENT_FACTORY_TYPE_PARSER: Parser elements
92  * @GST_ELEMENT_FACTORY_TYPE_PAYLOADER: Payloader elements
93  * @GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER: Depayloader elements
94  * @GST_ELEMENT_FACTORY_TYPE_DECRYPTOR: Elements handling decryption (Since 1.6)
95  * @GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR: Elements handling encryption (Since 1.6)
96  * @GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS: Private, do not use
97  * @GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO: Elements handling video media types
98  * @GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO: Elements handling audio media types
99  * @GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE: Elements handling image media types
100  * @GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE: Elements handling subtitle media types
101  * @GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA: Elements handling metadata media types
102  *
103  * The type of #GstElementFactory to filter.
104  *
105  * All @GstFactoryListType up to @GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS are exclusive.
106  *
107  * If one or more of the MEDIA types are specified, then only elements
108  * matching the specified media types will be selected.
109  */
110
111 typedef guint64 GstElementFactoryListType;
112
113 #define  GST_ELEMENT_FACTORY_TYPE_DECODER        (G_GUINT64_CONSTANT (1) << 0)
114 #define  GST_ELEMENT_FACTORY_TYPE_ENCODER        (G_GUINT64_CONSTANT (1) << 1)
115 #define  GST_ELEMENT_FACTORY_TYPE_SINK           (G_GUINT64_CONSTANT (1) << 2)
116 #define  GST_ELEMENT_FACTORY_TYPE_SRC            (G_GUINT64_CONSTANT (1) << 3)
117 #define  GST_ELEMENT_FACTORY_TYPE_MUXER          (G_GUINT64_CONSTANT (1) << 4)
118 #define  GST_ELEMENT_FACTORY_TYPE_DEMUXER        (G_GUINT64_CONSTANT (1) << 5)
119 #define  GST_ELEMENT_FACTORY_TYPE_PARSER         (G_GUINT64_CONSTANT (1) << 6)
120 #define  GST_ELEMENT_FACTORY_TYPE_PAYLOADER      (G_GUINT64_CONSTANT (1) << 7)
121 #define  GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER    (G_GUINT64_CONSTANT (1) << 8)
122 #define  GST_ELEMENT_FACTORY_TYPE_FORMATTER      (G_GUINT64_CONSTANT (1) << 9)
123 #define  GST_ELEMENT_FACTORY_TYPE_DECRYPTOR      (G_GUINT64_CONSTANT (1) << 10)
124 #define  GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR      (G_GUINT64_CONSTANT (1) << 11)
125
126 #define  GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS   (G_GUINT64_CONSTANT (1) << 48)
127
128 #define  GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO    (G_GUINT64_CONSTANT (1) << 49)
129 #define  GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO    (G_GUINT64_CONSTANT (1) << 50)
130 #define  GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE    (G_GUINT64_CONSTANT (1) << 51)
131 #define  GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE (G_GUINT64_CONSTANT (1) << 52)
132 #define  GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA (G_GUINT64_CONSTANT (1) << 53)
133
134 /**
135  * GST_ELEMENT_FACTORY_TYPE_ANY: (value 562949953421311) (type GstElementFactoryListType)
136  *
137  * Elements of any of the defined GST_ELEMENT_FACTORY_LIST types
138  */
139 #define  GST_ELEMENT_FACTORY_TYPE_ANY ((G_GUINT64_CONSTANT (1) << 49) - 1)
140
141 /**
142  * GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY: (value 18446462598732840960) (type GstElementFactoryListType)
143  *
144  * Elements matching any of the defined GST_ELEMENT_FACTORY_TYPE_MEDIA types
145  *
146  * Note: Do not use this if you wish to not filter against any of the defined
147  * media types. If you wish to do this, simply don't specify any
148  * GST_ELEMENT_FACTORY_TYPE_MEDIA flag.
149  */
150 #define GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY (~G_GUINT64_CONSTANT (0) << 48)
151
152 /**
153  * GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER: (value 2814749767106562) (type GstElementFactoryListType)
154  *
155  * All encoders handling video or image media types
156  */
157 #define GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER (GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)
158
159 /**
160  * GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER: (value 1125899906842626) (type GstElementFactoryListType)
161  *
162  * All encoders handling audio media types
163  */
164 #define GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER (GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO)
165
166 /**
167  * GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS: (value 3940649673949188) (type GstElementFactoryListType)
168  *
169  * All sinks handling audio, video or image media types
170  */
171 #define GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS (GST_ELEMENT_FACTORY_TYPE_SINK | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)
172
173 /**
174  * GST_ELEMENT_FACTORY_TYPE_DECODABLE: (value 353) (type GstElementFactoryListType)
175  *
176  * All elements used to 'decode' streams (decoders, demuxers, parsers, depayloaders)
177  */
178 #define GST_ELEMENT_FACTORY_TYPE_DECODABLE \
179   (GST_ELEMENT_FACTORY_TYPE_DECODER | GST_ELEMENT_FACTORY_TYPE_DEMUXER | GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER | GST_ELEMENT_FACTORY_TYPE_PARSER | GST_ELEMENT_FACTORY_TYPE_DECRYPTOR)
180
181 /* Element klass defines */
182 #define GST_ELEMENT_FACTORY_KLASS_DECODER               "Decoder"
183 #define GST_ELEMENT_FACTORY_KLASS_ENCODER               "Encoder"
184 #define GST_ELEMENT_FACTORY_KLASS_SINK                  "Sink"
185 #define GST_ELEMENT_FACTORY_KLASS_SRC                   "Source"
186 #define GST_ELEMENT_FACTORY_KLASS_MUXER                 "Muxer"
187 #define GST_ELEMENT_FACTORY_KLASS_DEMUXER               "Demuxer"
188 #define GST_ELEMENT_FACTORY_KLASS_PARSER                "Parser"
189 #define GST_ELEMENT_FACTORY_KLASS_PAYLOADER             "Payloader"
190 #define GST_ELEMENT_FACTORY_KLASS_DEPAYLOADER           "Depayloader"
191 #define GST_ELEMENT_FACTORY_KLASS_FORMATTER             "Formatter"
192 #define GST_ELEMENT_FACTORY_KLASS_DECRYPTOR             "Decryptor"
193 #define GST_ELEMENT_FACTORY_KLASS_ENCRYPTOR             "Encryptor"
194
195 #define GST_ELEMENT_FACTORY_KLASS_MEDIA_VIDEO           "Video"
196 #define GST_ELEMENT_FACTORY_KLASS_MEDIA_AUDIO           "Audio"
197 #define GST_ELEMENT_FACTORY_KLASS_MEDIA_IMAGE           "Image"
198 #define GST_ELEMENT_FACTORY_KLASS_MEDIA_SUBTITLE        "Subtitle"
199 #define GST_ELEMENT_FACTORY_KLASS_MEDIA_METADATA        "Metadata"
200
201 gboolean      gst_element_factory_list_is_type      (GstElementFactory *factory,
202                                                      GstElementFactoryListType type);
203
204 GList *       gst_element_factory_list_get_elements (GstElementFactoryListType type,
205                                                      GstRank minrank) G_GNUC_MALLOC;
206
207
208 GList *       gst_element_factory_list_filter       (GList *list, const GstCaps *caps,
209                                                      GstPadDirection direction,
210                                                      gboolean subsetonly) G_GNUC_MALLOC;
211 G_END_DECLS
212
213 #endif /* __GST_ELEMENT_FACTORY_H__ */