2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GstPlugin.html
51 * - GModule* -> Module
52 * - GstPlugin* -> Plugin
57 module gstreamer
.Plugin
;
59 private import gstreamerc
.gstreamertypes
;
61 private import gstreamerc
.gstreamer
;
63 private import glib
.Str
;
64 private import glib
.Module
;
65 private import glib
.ErrorG
;
66 private import glib
.ListG
;
72 * GStreamer is extensible, so GstElement instances can be loaded at runtime.
73 * A plugin system can provide one or more of the basic
74 * GStreamer GstPluginFeature subclasses.
75 * A plugin should export a symbol plugin_desc that is a
76 * struct of type GstPluginDesc.
77 * the plugin loader will check the version of the core library the plugin was
78 * linked against and will create a new GstPlugin. It will then call the
79 * GstPluginInitFunc function that was provided in the plugin_desc.
80 * Once you have a handle to a GstPlugin (e.g. from the GstRegistryPool), you
81 * can add any object that subclasses GstPluginFeature.
82 * Use gst_plugin_find_feature() and gst_plugin_get_feature_list() to find
83 * features in a plugin.
84 * Usually plugins are always automaticlly loaded so you don't need to call
85 * gst_plugin_load() explicitly to bring it into memory. There are options to
86 * statically link plugins to an app or even use GStreamer without a plugin
87 * repository in which case gst_plugin_load() can be needed to bring the plugin
90 private import gstreamer
.ObjectGst
;
91 public class Plugin
: ObjectGst
94 /** the main Gtk struct */
95 protected GstPlugin
* gstPlugin
;
98 public GstPlugin
* getPluginStruct()
104 /** the main Gtk struct as a void* */
105 protected void* getStruct()
107 return cast(void*)gstPlugin
;
111 * Sets our main struct and passes it to the parent class
113 public this (GstPlugin
* gstPlugin
)
115 super(cast(GstObject
*)gstPlugin
);
116 this.gstPlugin
= gstPlugin
;
123 * Get the error quark.
125 * The error quark used in GError messages
127 public static GQuark
errorQuark()
129 // GQuark gst_plugin_error_quark (void);
130 return gst_plugin_error_quark();
143 * Get the short name of the plugin
145 * plugin to get the name of
147 * the name of the plugin
149 public char[] getName()
151 // const gchar* gst_plugin_get_name (GstPlugin *plugin);
152 return Str
.toString(gst_plugin_get_name(gstPlugin
) );
156 * Get the long descriptive name of the plugin
158 * plugin to get long name of
160 * the long name of the plugin
162 public char[] getDescription()
164 // const gchar* gst_plugin_get_description (GstPlugin *plugin);
165 return Str
.toString(gst_plugin_get_description(gstPlugin
) );
169 * get the filename of the plugin
171 * plugin to get the filename of
173 * the filename of the plugin
175 public char[] getFilename()
177 // const gchar* gst_plugin_get_filename (GstPlugin *plugin);
178 return Str
.toString(gst_plugin_get_filename(gstPlugin
) );
182 * get the license of the plugin
184 * plugin to get the license of
186 * the license of the plugin
188 public char[] getLicense()
190 // const gchar* gst_plugin_get_license (GstPlugin *plugin);
191 return Str
.toString(gst_plugin_get_license(gstPlugin
) );
195 * get the package the plugin belongs to.
197 * plugin to get the package of
199 * the package of the plugin
201 public char[] getPackage()
203 // const gchar* gst_plugin_get_package (GstPlugin *plugin);
204 return Str
.toString(gst_plugin_get_package(gstPlugin
) );
208 * get the URL where the plugin comes from
210 * plugin to get the origin of
212 * the origin of the plugin
214 public char[] getOrigin()
216 // const gchar* gst_plugin_get_origin (GstPlugin *plugin);
217 return Str
.toString(gst_plugin_get_origin(gstPlugin
) );
221 * get the source module the plugin belongs to.
223 * plugin to get the source of
225 * the source of the plugin
227 public char[] getSource()
229 // const gchar* gst_plugin_get_source (GstPlugin *plugin);
230 return Str
.toString(gst_plugin_get_source(gstPlugin
) );
234 * get the version of the plugin
236 * plugin to get the version of
238 * the version of the plugin
240 public char[] getVersion()
242 // const gchar* gst_plugin_get_version (GstPlugin *plugin);
243 return Str
.toString(gst_plugin_get_version(gstPlugin
) );
247 * Gets the GModule of the plugin. If the plugin isn't loaded yet, NULL is
252 * module belonging to the plugin or NULL if the plugin isn't
255 public Module
getModule()
257 // GModule* gst_plugin_get_module (GstPlugin *plugin);
258 return new Module( gst_plugin_get_module(gstPlugin
) );
262 * queries if the plugin is loaded into memory
266 * TRUE is loaded, FALSE otherwise
268 public int isLoaded()
270 // gboolean gst_plugin_is_loaded (GstPlugin *plugin);
271 return gst_plugin_is_loaded(gstPlugin
);
275 * A standard filter that returns TRUE when the plugin is of the
278 * the plugin to check
280 * the name of the plugin
282 * TRUE if the plugin is of the given name.
284 public int nameFilter(char[] name
)
286 // gboolean gst_plugin_name_filter (GstPlugin *plugin, const gchar *name);
287 return gst_plugin_name_filter(gstPlugin
, Str
.toStringz(name
));
291 * Loads the given plugin and refs it. Caller needs to unref after use.
293 * the plugin filename to load
295 * pointer to a NULL-valued GError
297 * a reference to the existing loaded GstPlugin, a reference to the
298 * newly-loaded GstPlugin, or NULL if an error occurred.
300 public static Plugin
loadFile(char[] filename
, GError
** error
)
302 // GstPlugin* gst_plugin_load_file (const gchar *filename, GError **error);
303 return new Plugin( gst_plugin_load_file(Str
.toStringz(filename
), error
) );
307 * Loads plugin. Note that the *return value* is the loaded plugin; plugin is
308 * untouched. The normal use pattern of this function goes like this:
309 * GstPlugin *loaded_plugin;
310 * loaded_plugin = gst_plugin_load (plugin);
311 * // presumably, we're no longer interested in the potentially-unloaded plugin
312 * gst_object_unref (plugin);
313 * plugin = loaded_plugin;
317 * A reference to a loaded plugin, or NULL on error.
321 // GstPlugin* gst_plugin_load (GstPlugin *plugin);
322 return new Plugin( gst_plugin_load(gstPlugin
) );
326 * Load the named plugin. Refs the plugin.
328 * name of plugin to load
330 * A reference to a loaded plugin, or NULL on error.
332 public static Plugin
loadByName(char[] name
)
334 // GstPlugin* gst_plugin_load_by_name (const gchar *name);
335 return new Plugin( gst_plugin_load_by_name(Str
.toStringz(name
)) );
339 * Unrefs each member of list, then frees the list.
343 * GstPluginFeature, GstElementFactory
345 public static void listFree(ListG list
)
347 // void gst_plugin_list_free (GList *list);
348 gst_plugin_list_free((list
is null) ?
null : list
.getListGStruct());