GStreamer has been the media backend of the GNOME desktop since GNOME-2.2 onwards. Nowadays, a whole bunch of GNOME applications make use of GStreamer for media-processing, including (but not limited to) Rhythmbox, Totem and Sound Juicer.
Most of these GNOME applications make use of some specific techniques to integrate as closely as possible with the GNOME desktop:
GNOME applications call gnome_program_init ()
to parse command-line options and initialize the necessary gnome
modules. GStreamer applications would normally call
gst_init ()
to do the same for GStreamer.
This would mean that only one of the two can parse command-line
options. To work around this issue, GStreamer can provide a
poptOption
array which can be passed to
gnome_program_init ()
.
#include <gnome.h> #include <gst/gst.h> gint main (gint argc, gchar *argv[]) { struct poptOption options[] = { {NULL, '\0', POPT_ARG_INCLUDE_TABLE, NULL, 0, "GStreamer", NULL}, POPT_TABLEEND }; /* init GStreamer and GNOME using the GStreamer popt tables */ options[0].arg = (void *) gst_init_get_popt_table (); gnome_program_init ("my-application", "0.0.1", LIBGNOMEUI_MODULE, argc, argv, GNOME_PARAM_POPT_TABLE, options, NULL); [..] }
GNOME stores the default video and audio sources and sinks in GConf.
GStreamer provides a small utility library that can be used to
get the elements from the registry using functions such as
gst_gconf_get_default_video_sink ()
. See the
header file (gst/gconf/gconf.h) for details.
All GNOME applications are recommended to use those variables.
GStreamer provides data input/output elements for use with the GNOME-VFS system. These elements are called "gnomevfssrc" and "gnomevfssink".