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
51 module gstreamer
.gstreamer
;
53 private import gstreamerc
.gstreamertypes
;
55 private import gstreamerc
.gstreamer
;
57 private import glib
.Str
;
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
79 * main (int argc, char *argv[])
81 * // initialize the GStreamer library
82 * gst_init (argc, argv);
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;
93 * main (int argc, char *argv[])
95 * GOptionEntry options[] = {
96 * {"tags", 't', 0, G_OPTION_ARG_NONE, tags,
97 * N_("Output tags (also known as metadata)"), NULL},
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));
110 * g_option_context_free (ctx);
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
];
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.
153 * pointer to application's argc
155 * pointer to application's argv
157 * pointer to a GError to which a message will be posted on error
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).
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
192 * After this call GStreamer (including this method) should not be used anymore.
194 public static void deinit()
196 // void gst_deinit (void);
201 * Gets the version number of the GStreamer library.
203 * pointer to a guint to store the major version number
205 * pointer to a guint to store the minor version number
207 * pointer to a guint to store the micro version number
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, ...
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.
237 * TRUE if GStreamer is allowed to install a custom SIGSEGV handler.
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.
250 * whether a custom SIGSEGV handler should be installed.
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
262 * Applications might want to disable this behaviour with the
263 * gst_registry_fork_set_enabled() function.
265 * TRUE if GStreamer will use fork() when rebuilding the registry. On
266 * platforms without fork(), this function will always return FALSE.
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().
281 * whether rebuilding the registry may fork
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
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
303 * Note that this function may block for a significant amount of time.
305 * TRUE if the registry has been updated successfully (does not
306 * imply that there were changes), otherwise FALSE.
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();