alternative to assert
[gtkD.git] / gtkD / srcgstreamer / gstreamer / gstreamer.d
blob3a2671d117edcf6ecf3a4d691a2b4bd3527d8901
1 /*
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 = gstreamer-Gst.html
26 * outPack = gstreamer
27 * outFile = gstreamer
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = GStreamer
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gst_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * - gst_init
44 * imports:
45 * - glib.Str
46 * structWrap:
47 * module aliases:
48 * local aliases:
51 module gstreamer.gstreamer;
53 private import gstreamerc.gstreamertypes;
55 private import gstreamerc.gstreamer;
57 private import glib.Str;
61 /**
62 * Description
63 * GStreamer is a framework for constructing graphs of various filters
64 * (termed elements here) that will handle streaming media. Any discreet
65 * (packetizable) media type is supported, with provisions for automatically
66 * determining source type. Formatting/framing information is provided with
67 * a powerful negotiation framework. Plugins are heavily used to provide for
68 * all elements, allowing one to construct plugins outside of the GST
69 * library, even released binary-only if license require (please don't).
70 * GStreamer borrows heavily from both the OGI media pipeline and
71 * Microsoft's DirectShow, hopefully taking the best of both and leaving the
72 * cruft behind. Its interface is slowly getting stable.
73 * The GStreamer library should be initialized with
74 * gst_init() before it can be used. You should pass pointers to the main argc
75 * and argv variables so that GStreamer can process its own command line
76 * options, as shown in the following example.
77 * Example1.Initializing the gstreamer library
78 * int
79 * main (int argc, char *argv[])
80 * {
81 * // initialize the GStreamer library
82 * gst_init (argc, argv);
83 * ...
84 * }
85 * It's allowed to pass two NULL pointers to gst_init() in case you don't want
86 * to pass the command line args to GStreamer.
87 * You can also use GOption to initialize your own parameters as shown in
88 * the next code fragment:
89 * Example2.Initializing own parameters when initializing gstreamer
90 * static gboolean stats = FALSE;
91 * ...
92 * int
93 * main (int argc, char *argv[])
94 * {
95 * GOptionEntry options[] = {
96 * {"tags", 't', 0, G_OPTION_ARG_NONE, tags,
97 * N_("Output tags (also known as metadata)"), NULL},
98 * {NULL}
99 * };
100 * // must initialise the threading system before using any other GLib funtion
101 * if (!g_thread_supported())
102 * g_thread_init (NULL);
103 * ctx = g_option_context_new ("[ADDITIONAL ARGUMENTS]");
104 * g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
105 * g_option_context_add_group (ctx, gst_init_get_option_group());
106 * if (!g_option_context_parse (ctx, argc, argv, err)) {
107 * g_print ("Error initializing: %s\n", GST_STR_NULL (err->message));
108 * exit (1);
110 * g_option_context_free (ctx);
111 * ...
113 * Use gst_version() to query the library version at runtime or use the
114 * GST_VERSION_* macros to find the version at compile time. Optionally
115 * gst_version_string() returns a printable string.
116 * The gst_deinit() call is used to clean up all internal resources used
117 * by GStreamer. It is mostly used in unit tests
118 * to check for leaks.
119 * Last reviewed on 2006-08-11 (0.10.10)
121 public class GStreamer
125 * Call this function before using any other GStreamer functions in your applications.
127 public static void init(char[][] args) //public static void init(int* argc, char**[] argv)
129 char** argv = cast(char**) new char*[args.length];
130 int argc = 0;
131 foreach (char[] p; args)
133 argv[argc++] = cast(char*)p;
136 gst_init(&argc, null);//cast(char**[])&argv);
144 * Initializes the GStreamer library, setting up internal path lists,
145 * registering built-in elements, and loading standard plugins.
146 * This function will return FALSE if GStreamer could not be initialized
147 * for some reason. If you want your program to fail fatally,
148 * use gst_init() instead.
149 * This function should be called before calling any other GLib functions. If
150 * this is not an option, your program must initialise the GLib thread system
151 * using g_thread_init() before any other GLib functions are called.
152 * argc:
153 * pointer to application's argc
154 * argv:
155 * pointer to application's argv
156 * err:
157 * pointer to a GError to which a message will be posted on error
158 * Returns:
159 * TRUE if GStreamer could be initialized.
161 public static int initCheck(int* argc, char**[] argv, GError** err)
163 // gboolean gst_init_check (int *argc, char **argv[], GError **err);
164 return gst_init_check(argc, argv, err);
168 * Returns a GOptionGroup with GStreamer's argument specifications. The
169 * group is set up to use standard GOption callbacks, so when using this
170 * group in combination with GOption parsing methods, all argument parsing
171 * and initialization is automated.
172 * This function is useful if you want to integrate GStreamer with other
173 * libraries that use GOption (see g_option_context_add_group() ).
174 * If you use this function, you should make sure you initialise the GLib
175 * threading system as one of the very first things in your program
176 * (see the example at the beginning of this section).
177 * Returns:
178 * a pointer to GStreamer's option group.
180 public static GOptionGroup* initGetOptionGroup()
182 // GOptionGroup* gst_init_get_option_group (void);
183 return gst_init_get_option_group();
187 * Clean up any resources created by GStreamer in gst_init().
188 * It is normally not needed to call this function in a normal application
189 * as the resources will automatically be freed when the program terminates.
190 * This function is therefore mostly used by testsuites and other memory
191 * profiling tools.
192 * After this call GStreamer (including this method) should not be used anymore.
194 public static void deinit()
196 // void gst_deinit (void);
197 gst_deinit();
201 * Gets the version number of the GStreamer library.
202 * major:
203 * pointer to a guint to store the major version number
204 * minor:
205 * pointer to a guint to store the minor version number
206 * micro:
207 * pointer to a guint to store the micro version number
208 * nano:
209 * pointer to a guint to store the nano version number
211 public static void versio(uint* major, uint* minor, uint* micro, uint* nano)
213 // void gst_version (guint *major, guint *minor, guint *micro, guint *nano);
214 gst_version(major, minor, micro, nano);
218 * This function returns a string that is useful for describing this version
219 * of GStreamer to the outside world: user agent strings, logging, ...
220 * Returns:
221 * a newly allocated string describing this version of GStreamer.
223 public static char[] versionString()
225 // gchar* gst_version_string (void);
226 return Str.toString(gst_version_string() );
230 * Some functions in the GStreamer core might install a custom SIGSEGV handler
231 * to better catch and report errors to the application. Currently this feature
232 * is enabled by default when loading plugins.
233 * Applications might want to disable this behaviour with the
234 * gst_segtrap_set_enabled() function. This is typically done if the application
235 * wants to install its own handler without GStreamer interfering.
236 * Returns:
237 * TRUE if GStreamer is allowed to install a custom SIGSEGV handler.
238 * Since 0.10.10
240 public static int segtrapIsEnabled()
242 // gboolean gst_segtrap_is_enabled (void);
243 return gst_segtrap_is_enabled();
247 * Applications might want to disable/enable the SIGSEGV handling of
248 * the GStreamer core. See gst_segtrap_is_enabled() for more information.
249 * enabled:
250 * whether a custom SIGSEGV handler should be installed.
251 * Since 0.10.10
253 public static void segtrapSetEnabled(int enabled)
255 // void gst_segtrap_set_enabled (gboolean enabled);
256 gst_segtrap_set_enabled(enabled);
260 * By default GStreamer will perform a fork() when scanning and rebuilding the
261 * registry file.
262 * Applications might want to disable this behaviour with the
263 * gst_registry_fork_set_enabled() function.
264 * Returns:
265 * TRUE if GStreamer will use fork() when rebuilding the registry. On
266 * platforms without fork(), this function will always return FALSE.
267 * Since 0.10.10
269 public static int registryForkIsEnabled()
271 // gboolean gst_registry_fork_is_enabled (void);
272 return gst_registry_fork_is_enabled();
276 * Applications might want to disable/enable the usage of fork() when rebuilding
277 * the registry. See gst_registry_fork_is_enabled() for more information.
278 * On platforms without fork(), this function will have no effect on the return
279 * value of gst_registry_fork_is_enabled().
280 * enabled:
281 * whether rebuilding the registry may fork
282 * Since 0.10.10
284 public static void registryForkSetEnabled(int enabled)
286 // void gst_registry_fork_set_enabled (gboolean enabled);
287 gst_registry_fork_set_enabled(enabled);
291 * Forces GStreamer to re-scan its plugin paths and update the default
292 * plugin registry.
293 * Applications will almost never need to call this function, it is only
294 * useful if the application knows new plugins have been installed (or old
295 * ones removed) since the start of the application (or, to be precise, the
296 * first call to gst_init()) and the application wants to make use of any
297 * newly-installed plugins without restarting the application.
298 * Applications should assume that the registry update is neither atomic nor
299 * thread-safe and should therefore not have any dynamic pipelines running
300 * (including the playbin and decodebin elements) and should also not create
301 * any elements or access the GStreamer registry while the update is in
302 * progress.
303 * Note that this function may block for a significant amount of time.
304 * Returns:
305 * TRUE if the registry has been updated successfully (does not
306 * imply that there were changes), otherwise FALSE.
307 * Since 0.10.12
308 * See Also
309 * Check out both OGI's
310 * pipeline and Microsoft's DirectShow for some background.
312 public static int updateRegistry()
314 // gboolean gst_update_registry (void);
315 return gst_update_registry();