Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > d620e9f76c810e9fbdaebc304909c8fc > files > 113

lib64gstreamer0.10-devel-0.10.36-7.mga4.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Developing applications with GStreamer</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79;charset=UTF-8"><LINK
REL="HOME"
TITLE="GStreamer FAQ (0.10.36)"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Building GStreamer from git"
HREF="chapter-git.html"><LINK
REL="NEXT"
TITLE="GStreamer Legal Issues"
HREF="chapter-legal.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>GStreamer FAQ (0.10.36)</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="chapter-git.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="chapter-legal.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="chapter-developing"
>8. Developing applications with GStreamer</A
></H1
><DIV
CLASS="qandaset"
><DL
><DT
>Q: <A
HREF="chapter-developing.html#developing-compile-programs"
>How do I compile programs that use GStreamer ?</A
></DT
><DT
>Q: <A
HREF="chapter-developing.html#developing-uninstalled-gstreamer"
>How do I develop against an uninstalled GStreamer copy ?</A
></DT
><DT
>Q: <A
HREF="chapter-developing.html#developing-gconf"
>How can I use GConf to get the system-wide defaults ?</A
></DT
><DT
>Q: <A
HREF="chapter-developing.html#developing-libtool-scripts"
>&#13;How do I debug these funny shell scripts that libtool makes ?
        </A
></DT
><DT
>Q: <A
HREF="chapter-developing.html#developing-mail-gstreamer-devel"
>Why is mail traffic so low on gstreamer-devel ?</A
></DT
><DT
>Q: <A
HREF="chapter-developing.html#developing-versioning"
>What kind of versioning scheme does GStreamer use ?</A
></DT
><DT
>Q: <A
HREF="chapter-developing.html#developing-coding-style"
>What is the coding style for GStreamer code?</A
></DT
><DT
>Q: <A
HREF="chapter-developing.html#developing-translations"
>I have translated one of the module .po files into a new language. How do I get it included?</A
></DT
></DL
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="developing-compile-programs"
></A
><B
>Q: </B
>How do I compile programs that use GStreamer ?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>
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.
        </P
><P
>&#13;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:
<PRE
CLASS="programlisting"
>&#13;$ libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-0.10` -o myprog myprog.c
</PRE
>
would be sufficient for a gstreamer-only program. 
If (for example) your app also used GTK+ 2.0, you could use
<PRE
CLASS="programlisting"
>&#13;$ libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-0.10 gtk+-2.0` -o myprog myprog.c
</PRE
>
Those are back-ticks (on the same key with the tilde on US keyboards), 
not single quotes.
        </P
><P
>&#13;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).
        </P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="developing-uninstalled-gstreamer"
></A
><B
>Q: </B
>How do I develop against an uninstalled GStreamer copy ?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>
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:
<A
HREF="http://cgit.freedesktop.org/gstreamer/gstreamer/tree/scripts/gst-uninstalled"
TARGET="_top"
>latest version of gst-uninstalled</A
>.

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).
        </P
><P
>&#13;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.
        </P
><P
>&#13;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.
        </P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="developing-gconf"
></A
><B
>Q: </B
>How can I use GConf to get the system-wide defaults ?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>
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.
        </P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="developing-libtool-scripts"
></A
><B
>Q: </B
>
How do I debug these funny shell scripts that libtool makes ?
        </P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>
When you link a program against uninstalled GStreamer using libtool, 
funny shell scripts are made to modify your shared object search path 
and then run your program. For instance, to debug gst-launch, try 
<PRE
CLASS="programlisting"
>&#13;libtool --mode=execute gdb /path/to/gst-launch
</PRE
>. 
If this does not work, you're probably using a broken version of libtool. 
        </P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="developing-mail-gstreamer-devel"
></A
><B
>Q: </B
>Why is mail traffic so low on gstreamer-devel ?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>
Our main arena for coordination and discussion is IRC, not email. 
Join us in <A
HREF="irc://irc.freenode.net/#gstreamer"
TARGET="_top"
>#gstreamer on irc.freenode.net</A
>
For larger picture questions or getting more input from more persons,
a mail to gstreamer-devel is never a bad idea.
        </P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="developing-versioning"
></A
><B
>Q: </B
>What kind of versioning scheme does GStreamer use ?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>
For public releases, GStreamer uses a standard MAJOR.MINOR.MICRO version 
scheme.  If the release consists of mostly bug fixes or incremental changes, 
the MICRO version is incremented.
If the release contains big changes, the MINOR version is incremented.
If we're particularly giddy, we might even increase the MAJOR number.  
Don't hold your breath for that though.
        </P
><P
>&#13;During the development cycle, GStreamer also uses a fourth or NANO number.
If this number is 1, then it's a git development version.  
Any tarball or package that has a nano number of 1 is made from git and thus 
not supported.  Additionally, if you didn't get this package or tarball from
the GStreamer team, don't have high hopes on it doing whatever you want it
to do.
        </P
><P
>&#13;If the number is 2 or higher, it's an official pre-release in preparation 
of an actual complete release.  Your help in testing these tarballs and
packages is very much appreciated.
        </P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="developing-coding-style"
></A
><B
>Q: </B
>What is the coding style for GStreamer code?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>
The core and almost all plugin modules are basically coded in K&#38;R with
2-space indenting. Just follow what's already there and you'll be fine.
        </P
><P
>&#13;Individual plugins in gst-plugins-* or plugins that you want considered for
addition to one of the gst-plugins-* modules should be coded in the same style.
It's easier if everything is consistent. Consistency is, of course, the goal. 
        </P
><P
>&#13;Simply run your code (only the *.c files, not the header files) through
<PRE
CLASS="programlisting"
>&#13;indent \
  --braces-on-if-line \
  --case-brace-indentation0 \
  --case-indentation2 \
  --braces-after-struct-decl-line \
  --line-length80 \
  --no-tabs \
  --cuddle-else \
  --dont-line-up-parentheses \
  --continuation-indentation4 \
  --honour-newlines \
  --tab-size8 \
  --indent-level2
</PRE
>
before submitting a patch. (This is using GNU indent.) There is also a
gst-indent script in the GStreamer core source tree in the tools directory
which wraps this and contains the latest option. The easiest way to get the
indenting right is probably to develop against a git checkout. The local
git commit hook will ensure correct indentation. We only require code files to
be indented, header files may be indented manually for better readability
(however, please use spaces for indenting, not tabs, even in header files).
        </P
><P
>&#13;As for the code itself, the 
<A
HREF="http://developer.gnome.org/doc/guides/programming-guidelines/book1.html"
TARGET="_top"
>GNOME coding guidelines</A
> is a good read.
Where possible, we try to adhere to the spirit of GObject and use similar
coding idioms.
        </P
><P
>&#13;Patches should be made against git master or the latest release and should be
in 'unified context' format (use diff -u -p). They should be attached to
a bug report (or feature request) in
<A
HREF="http://bugzilla.gnome.org"
TARGET="_top"
>bugzilla</A
> rather than
sent to the mailing list. Also see
<A
HREF="http://gstreamer.freedesktop.org/wiki/SubmittingPatches"
TARGET="_top"
>SubmittingPatches</A
>
in the GStreamer wiki.
        </P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="developing-translations"
></A
><B
>Q: </B
>I have translated one of the module .po files into a new language. How do I get it included?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>GStreamer translations are uniformly managed through the Translation Project (http://translationproject.org). There are some instructions on how to join the Translation Project team and submit new translations at http://translationproject.org/html/translators.html.</P
><P
>New translations submitted via the Translation Project are merged periodically into git by the maintainers by running 'make download-po' in the various modules.</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="chapter-git.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="chapter-legal.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Building GStreamer from git</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>GStreamer Legal Issues</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>