<commit_before><sect1 id="chapter-developing">
  <title id="title-developing">Developing applications with GStreamer</title>
  <qandaset defaultlabel="qanda">

    <qandaentry>
      <question id="developing-compile-programs">
        <para>How do I compile programs that use GStreamer ?</para>
      </question>

      <answer>
        <para>
GStreamer uses pkg-config to assist applications with compilation and 
linking flags. 
pkg-config is already used by GTK+, GNOME, SDL, and others; so if you are 
familiar with using it for any of those, you're set.
        </para>
        <para>
If you're not familiar with pkg-config to compile and link a small 
one-file program, pass the --cflags and --libs arguments to pkg-config.
For example:
<programlisting>
$ libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-&GST_API_VERSION;` -o myprog myprog.c
</programlisting>
would be sufficient for a gstreamer-only program. 
If (for example) your app also used GTK+ 2.0, you could use
<programlisting>
$ libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-&GST_API_VERSION; gtk+-2.0` -o myprog myprog.c
</programlisting>
Those are back-ticks (on the same key with the tilde on US keyboards), 
not single quotes.
        </para>
        <para>
For bigger projects, you should integrate pkg-config use in your Makefile,
or integrate with autoconf using the pkg.m4 macro (providing PKG_CONFIG_CHECK).
        </para>
      </answer>
    </qandaentry>

    <qandaentry>
      <question id="developing-uninstalled-gstreamer">
        <para>How do I develop against an uninstalled GStreamer copy ?</para>
      </question>

      <answer>
        <para>
It is possible to develop and compile against an uninstalled copy of
gstreamer and gst-plugins-* (for example, against gits checkouts).
The easiest way to do this is to use a bash script like  this:
<ulink url="http://cgit.freedesktop.org/gstreamer/gstreamer/tree/scripts/gst-uninstalled">latest version of gst-uninstalled</ulink>.

If you put this script in your path, and symlink it to gst-git (if you want
to develop against git master) or to gst-released (if you want to develop
against the lastest release of each module), it will automatically use the
uninstalled version from that directory (ie. gst-git will look for a directory
called 'git', and gst-released will expect the uninstalled modules to be in
the 'released' directory; you are free to use any name or identifier you like
here).
        </para>
        <para>
This requires you to have put your checkouts of gstreamer and gst-plugins
under ~/gst/git (for the master version).  The program is easily modifiable
if this isn't the case.
        </para>
        <para>
After running this script, you'll be in an environment where the uninstalled
tools and plugins will be used by default.  Also, pkg-config will detect the
uninstalled copies before (and prefer them to) any installed copies.
        </para>
      </answer>
    </qandaentry>

    <qandaentry>
      <question id="developing-gconf">
        <para>How can I use GConf to get the system-wide defaults ?</para>
      </question>

      <answer>
        <para>
For GNOME applications it's a good idea to use GConf to find the default ways
of outputting audio and video.  You can do this by using the 'gconfaudiosink'
and 'gconfvideosink' elements for audio and video output. They will take
care of everything GConf-related for you and automatically use the outputs
that the user configured. If you are using gconfaudiosink, your application
should set the 'profile' property.
        </para>
      </answer>
    </qandaentry>

    <qandaentry>
      <question id="developing-libtool-scripts"><commit_msg>docs: FAQ update to mention create-uninstalled-setup.sh<commit_after><sect1 id="chapter-developing">
  <title id="title-developing">Developing applications with GStreamer</title>
  <qandaset defaultlabel="qanda">

    <qandaentry>
      <question id="developing-compile-programs">
        <para>How do I compile programs that use GStreamer ?</para>
      </question>

      <answer>
        <para>
GStreamer uses pkg-config to assist applications with compilation and 
linking flags. 
pkg-config is already used by GTK+, GNOME, SDL, and others; so if you are 
familiar with using it for any of those, you're set.
        </para>
        <para>
If you're not familiar with pkg-config to compile and link a small 
one-file program, pass the --cflags and --libs arguments to pkg-config.
For example:
<programlisting>
$ libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-&GST_API_VERSION;` -o myprog myprog.c
</programlisting>
would be sufficient for a gstreamer-only program. 
If (for example) your app also used GTK+ 2.0, you could use
<programlisting>
$ libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-&GST_API_VERSION; gtk+-2.0` -o myprog myprog.c
</programlisting>
Those are back-ticks (on the same key with the tilde on US keyboards), 
not single quotes.
        </para>
        <para>
For bigger projects, you should integrate pkg-config use in your Makefile,
or integrate with autoconf using the pkg.m4 macro (providing PKG_CONFIG_CHECK).
        </para>
      </answer>
    </qandaentry>

    <qandaentry>
      <question id="developing-uninstalled-gstreamer">
        <para>How do I develop against an uninstalled GStreamer copy ?</para>
      </question>

      <answer>
        <para>
It is possible to develop and compile against an uninstalled copy of
gstreamer and gst-plugins-* (for example, against gits checkouts).

The easiest way too create such a setup is the
<ulink url="http://cgit.freedesktop.org/gstreamer/gstreamer/tree/scripts/create-uninstalled-setup.sh">latest version of create-uninstalled-setup.sh</ulink>
	</para>
	<para>
This setup makes use of the
<ulink url="http://cgit.freedesktop.org/gstreamer/gstreamer/tree/scripts/gst-uninstalled">latest version of gst-uninstalled</ulink>.
Running this script, you'll be in an environment where the uninstalled
tools and plugins will be used by default.  Also, pkg-config will detect the
uninstalled copies before (and prefer them to) any installed copies.
        </para>
	<para>
Multiple uninstalled setups can be used in parallel. Have a look at
<ulink url="http://cgit.freedesktop.org/gstreamer/gstreamer/tree/scripts/gst-uninstalled">gst-uninstalled</ulink> to see how it determines which environment is used.
	</para>
      </answer>
    </qandaentry>

    <qandaentry>
      <question id="developing-gconf">
        <para>How can I use GConf to get the system-wide defaults ?</para>
      </question>

      <answer>
        <para>
For GNOME applications it's a good idea to use GConf to find the default ways
of outputting audio and video.  You can do this by using the 'gconfaudiosink'
and 'gconfvideosink' elements for audio and video output. They will take
care of everything GConf-related for you and automatically use the outputs
that the user configured. If you are using gconfaudiosink, your application
should set the 'profile' property.
        </para>
      </answer>
    </qandaentry>

    <qandaentry>
      <question id="developing-libtool-scripts">
{'fraction_non_alphanumeric': 0.08937299259879905, 'fraction_numerical': 0.0016757436112274822, 'mean_word_length': 3.4846587351283658, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 107, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2847105', 'n_tokens_mistral': 2197, 'n_tokens_neox': 2078, 'n_words': 855}