gstreamer: Fix memory leaks when context parse fails
[platform/upstream/gstreamer.git] / docs / manual / appendix-integration.xml
index 3e764e5..b288a6b 100644 (file)
@@ -8,6 +8,10 @@
     operating system or desktop environment of choice.
   </para>
  
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+
   <sect1 id="section-integration-nix">
     <title>Linux and UNIX-like operating systems</title>
     <para>
         <para>
           For audio input and output, &GStreamer; provides input and
           output elements for several audio subsystems. Amongst others,
-          &GStreamer; includes elements for ALSA (alsasrc, alsamixer,
-          alsasink), OSS (osssrc, ossmixer, osssink) and Sun audio
-          (sunaudiosrc, sunaudiomixer, sunaudiosink).
+          &GStreamer; includes elements for ALSA (alsasrc,
+          alsasink), OSS (osssrc, osssink) Pulesaudio (pulsesrc, pulsesink)
+          and Sun audio (sunaudiosrc, sunaudiomixer, sunaudiosink).
         </para>
       </listitem>
       <listitem>
         <para>
           For video input, &GStreamer; contains source elements for
-          Video4linux (v4lsrc, v4lmjpegsrc, v4lelement and v4lmjpegisnk)
-          and Video4linux2 (v4l2src, v4l2element).
+          Video4linux2 (v4l2src, v4l2element, v4l2sink).
         </para>
       </listitem>
       <listitem>
     </itemizedlist>
   </sect1>
 
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+
   <sect1 id="section-integration-gnome">
     <title>GNOME desktop</title>
     <para>
@@ -50,9 +57,9 @@
       onwards. Nowadays, a whole bunch of GNOME applications make use of
       &GStreamer; for media-processing, including (but not limited to)
       <ulink type="http" url="http://www.rhythmbox.org/">Rhythmbox</ulink>,
-      <ulink type="http" url="http://www.hadess.net/totem.php3">Totem</ulink>
+      <ulink type="http" url="https://wiki.gnome.org/Apps/Videos">Videos</ulink>
       and <ulink type="http"
-      url="http://www.burtonini.com/blog/computers/sound-juicer">Sound
+      url="https://wiki.gnome.org/Apps/SoundJuicer">Sound
       Juicer</ulink>.
     </para>
     <para>
     <itemizedlist>
       <listitem>
         <para>
-          GNOME applications call <function>gnome_program_init ()</function>
-          to parse command-line options and initialize the necessary gnome
-          modules. &GStreamer; applications would normally call
-          <function>gst_init ()</function> to do the same for GStreamer.
+          GNOME applications usually call <function>gtk_init ()</function>
+          to parse command-line options and initialize GTK. &GStreamer;
+          applications would normally call <function>gst_init ()</function>
+          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
           GLib <classname>GOptionGroup</classname> which can be passed to
           <function>gnome_program_init ()</function>. The following
-          example requires Gnome-2.14 or newer (previous libgnome versions
-          do not support command line parsing via GOption yet but use the
-          now deprecated popt)
+          example requires GTK 2.6 or newer (previous GTK versions
+          do not support command line parsing via GOption yet)
         </para>
         <programlisting><!-- example-begin gnome.c a -->
-#include &lt;gnome.h&gt;
+#include &lt;gtk/gtk.h&gt;
 #include &lt;gst/gst.h&gt;
 
 static gchar **cmd_filenames = NULL;
@@ -102,29 +108,30 @@ gint
 main (gint argc, gchar **argv)
 {
   GOptionContext *context;
-  GOptionGroup *gstreamer_group;
-  GnomeProgram *program;
+  GOptionGroup *gstreamer_group, *gtk_group;
+  GError *err = NULL;
 
-  /* we must initialise the threading system before using any
-   * other GLib funtion, such as g_option_context_new() */
-  if (!g_thread_supported ())
-    g_thread_init (NULL);
-
-  context = g_option_context_new ("gnome-demo-app");
+  context = g_option_context_new ("gtk-demo-app");
 
   /* get command line options from GStreamer and add them to the group */
   gstreamer_group = gst_init_get_option_group ();
   g_option_context_add_group (context, gstreamer_group);
+  gtk_group = gtk_get_option_group (TRUE);
+  g_option_context_add_group (context, gtk_group);
 
   /* add our own options. If you are using gettext for translation of your
    * strings, use GETTEXT_PACKAGE here instead of NULL */
   g_option_context_add_main_entries (context, cmd_options, NULL);
 
-  program = gnome_program_init ("gnome-demo-app", VERSION
-                                LIBGNOMEUI_MODULE, argc, argv,
-                                GNOME_PARAM_HUMAN_READABLE_NAME, "Gnome Demo",
-                                GNOME_PARAM_GOPTION_CONTEXT, context,
-                                NULL);
+  /* now parse the commandline options, note that this already
+   * calls gtk_init() and gst_init() */
+  if (!g_option_context_parse (ctx, &amp;argc, &amp;argv, &amp;err)) {
+    g_print ("Error initializing: %s\n", err->message);
+    g_clear_error (&amp;err);
+    g_option_context_free (ctx);
+    exit (1);
+  }
+  g_option_context_free (ctx);
 
   /* any filenames we got passed on the command line? parse them! */
   if (cmd_filenames != NULL) {
@@ -149,26 +156,28 @@ main (gint argc, gchar **argv)
       </listitem>
       <listitem>
         <para>
-          GNOME stores the default video and audio sources and sinks in GConf.
-          &GStreamer; provides a number of elements that create audio and
-          video sources and sinks directly based on those GConf settings. 
-          Those elements are: gconfaudiosink, gconfvideosink, gconfaudiosrc
-          and gconfvideosrc. You can create them with
-          <function>gst_element_factory_make ()</function> and use them
-          directly just like you would use any other source or sink element.
-          All GNOME applications are recommended to use those elements.
+          GNOME uses Pulseaudio for audio, use the pulsesrc and
+          pulsesink elements to have access to all the features.
         </para>
       </listitem>
       <listitem>
         <para>
           &GStreamer; provides data input/output elements for use with the
-          GNOME-VFS system. These elements are called <quote>gnomevfssrc</quote>
-          and <quote>gnomevfssink</quote>.
+          GIO VFS system. These elements are called <quote>giosrc</quote>
+          and <quote>giosink</quote>.
+          The deprecated GNOME-VFS system is supported too but shouldn't be
+          used for any new applications.
         </para>
       </listitem>
     </itemizedlist>
   </sect1>
 
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+
+
+
   <sect1 id="section-integration-kde">
     <title>KDE desktop</title>
     <para>
@@ -197,6 +206,10 @@ main (gint argc, gchar **argv)
     </itemizedlist>
   </sect1>
 
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+
   <sect1 id="section-integration-osx">
     <title>OS X</title>
     <para>
@@ -205,10 +218,115 @@ main (gint argc, gchar **argv)
     </para>
   </sect1>
 
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+<!-- ####################################################################### -->
+
   <sect1 id="section-integration-win32">
     <title>Windows</title>
+
+    <warning>
+<para>
+Note: this section is out of date. GStreamer-1.0 has much better
+support for win32 than previous versions though and should usually compile
+and work out-of-the-box both using MSYS/MinGW or Microsoft compilers. The
+<ulink url="http://gstreamer.freedesktop.org">GStreamer web site</ulink> and the
+<ulink url="http://news.gmane.org/gmane.comp.video.gstreamer.devel">mailing list
+archives</ulink> are a good place to check the latest win32-related news.
+</para>
+    </warning>
+
+
     <para>
       &GStreamer; builds using Microsoft Visual C .NET 2003 and using Cygwin.
     </para>
+
+  <sect2 id="section-win32-build">
+  <title>Building <application>GStreamer</application> under Win32</title>
+
+<para>There are different makefiles that can be used to build GStreamer with the usual Microsoft 
+compiling tools.</para>
+
+<para>The Makefile is meant to be used with the GNU make program and the free 
+version of the Microsoft compiler (<ulink url="http://msdn.microsoft.com/visualc/vctoolkit2003/">http://msdn.microsoft.com/visualc/vctoolkit2003/</ulink>). You also 
+have to modify your system environment variables to use it from the command-line. You will also 
+need a working Platform SDK for Windows that is available for free from Microsoft.</para>
+
+<para>The projects/makefiles will generate automatically some source files needed to compile 
+GStreamer. That requires that you have installed on your system some GNU tools and that they are 
+available in your system PATH.</para>
+
+<para>The GStreamer project depends on other libraries, namely :</para>
+<itemizedlist>
+<listitem><para>GLib</para></listitem>
+<listitem><para>libxml2</para></listitem>
+<listitem><para>libintl</para></listitem>
+<listitem><para>libiconv</para></listitem>
+</itemizedlist>
+
+<para>Work is being done to provide pre-compiled GStreamer-1.0 libraries as
+a packages for win32. Check the <ulink url="http://gstreamer.freedesktop.org">
+GStreamer web site</ulink> and check our
+<ulink url="http://news.gmane.org/gmane.comp.video.gstreamer.devel">mailing list
+</ulink> for the latest developments in this respect.</para>
+
+<note>
+<title>Notes</title>
+
+<para>GNU tools needed that you can find on <ulink url="http://gnuwin32.sourceforge.net/">http://gnuwin32.sourceforge.net/</ulink></para>
+<itemizedlist>
+<listitem><para>GNU flex      (tested with 2.5.4)</para></listitem>
+<listitem><para>GNU bison     (tested with 1.35)</para></listitem>
+</itemizedlist>
+
+<para>and <ulink url="http://www.mingw.org/">http://www.mingw.org/</ulink></para>
+<itemizedlist>
+<listitem><para>GNU make      (tested with 3.80)</para></listitem>
+</itemizedlist>
+
+<para>the generated files from the -auto makefiles will be available soon separately on the net 
+for convenience (people who don't want to install GNU tools).</para>
+</note>
+</sect2>
+
+  <sect2 id="section-win32-install">
+<title>Installation on the system</title>
+
+<para>FIXME: This section needs be updated for GStreamer-1.0.</para>
+
+<!--
+<para>By default, GStreamer needs a registry. You have to generate it using "gst-register.exe". It will create
+the file in c:\gstreamer\registry.xml that will hold all the plugins you can use.</para>
+
+<para>You should install the GStreamer core in c:\gstreamer\bin and the plugins in c:\gstreamer\plugins.  Both
+directories should be added to your system PATH. The library dependencies should be installed in c:\usr</para>
+
+<para>For example, my current setup is :</para>
+
+<itemizedlist>
+<listitem><para><filename>c:\gstreamer\registry.xml</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\bin\gst-inspect.exe</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\bin\gst-launch.exe</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\bin\gst-register.exe</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\bin\gstbytestream.dll</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\bin\gstelements.dll</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\bin\gstoptimalscheduler.dll</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\bin\gstspider.dll</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\bin\libgtreamer-0.8.dll</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\plugins\gst-libs.dll</filename></para></listitem>
+<listitem><para><filename>c:\gstreamer\plugins\gstmatroska.dll</filename></para></listitem>
+<listitem><para><filename>c:\usr\bin\iconv.dll</filename></para></listitem>
+<listitem><para><filename>c:\usr\bin\intl.dll</filename></para></listitem>
+<listitem><para><filename>c:\usr\bin\libglib-2.0-0.dll</filename></para></listitem>
+<listitem><para><filename>c:\usr\bin\libgmodule-2.0-0.dll</filename></para></listitem>
+<listitem><para><filename>c:\usr\bin\libgobject-2.0-0.dll</filename></para></listitem>
+<listitem><para><filename>c:\usr\bin\libgthread-2.0-0.dll</filename></para></listitem>
+<listitem><para><filename>c:\usr\bin\libxml2.dll</filename></para></listitem>
+</itemizedlist>
+-->
+
+  </sect2>
+
   </sect1>
+
 </chapter>