Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 4398

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- phonon.qdoc -->
  <title>Qt 4.8: Phonon multimedia framework</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li>Phonon multimedia framework</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#introduction">Introduction</a></li>
<li class="level1"><a href="#architecture">Architecture</a></li>
<li class="level2"><a href="#media-objects">Media Objects</a></li>
<li class="level2"><a href="#sinks">Sinks</a></li>
<li class="level2"><a href="#processors">Processors</a></li>
<li class="level1"><a href="#playback">Playback</a></li>
<li class="level1"><a href="#building-graphs">Building Graphs</a></li>
<li class="level2"><a href="#audio">Audio</a></li>
<li class="level3"><a href="#audio-effects">Audio Effects</a></li>
<li class="level2"><a href="#video">Video</a></li>
<li class="level1"><a href="#backends">Backends</a></li>
<li class="level2"><a href="#querying-backends-for-support">Querying Backends for Support</a></li>
<li class="level1"><a href="#installing-phonon">Installing Phonon</a></li>
<li class="level2"><a href="#windows">Windows</a></li>
<li class="level3"><a href="#windows-xp-and-later-windows-versions">Windows XP and later Windows versions</a></li>
<li class="level3"><a href="#earlier-windows-versions-than-windows-xp">Earlier Windows versions than Windows XP</a></li>
<li class="level3"><a href="#setting-up-the-environment">Setting up the environment</a></li>
<li class="level2"><a href="#linux">Linux</a></li>
<li class="level2"><a href="#mac-os-x">Mac OS X</a></li>
<li class="level1"><a href="#deploying-phonon-applications-on-windows-and-mac-os-x">Deploying Phonon Applications on Windows and Mac OS X</a></li>
</ul>
</div>
<h1 class="title">Phonon multimedia framework</h1>
<span class="subtitle"></span>
<!-- $$$phonon-overview.html-description -->
<div class="descr"> <a name="details"></a>
<a name="phonon-overview"></a><a name="introduction"></a>
<h2>Introduction</h2>
<p>Qt uses the Phonon multimedia framework to provide functionality for playback of the most common multimedia formats. The media can be read from files or streamed over a network, using a QURL to a file.</p>
<p>In this overview, we take a look at the main concepts of Phonon. We also explain the architecture, examine the core API classes, and show examples on how to use the classes provided.</p>
<a name="architecture"></a>
<h2>Architecture</h2>
<p>Phonon has three basic concepts: media objects, sinks, and paths. A media object manages a media source, for instance, a music file; it provides simple playback control, such as starting, stopping, and pausing the playback. A sink outputs the media from Phonon, e.g&#x2e;, by rendering video on a widget, or by sending audio to a sound card. Paths are used to connect Phonon objects, i.e&#x2e;, a media object and a sink, in a graph - called a media graph in Phonon.</p>
<p>As an example, we show a media graph for an audio stream:</p>
<p class="centerAlign"><img src="images/conceptaudio.png" alt="" /></p><p>The playback is started and managed by the media object, which send the media stream to any sinks connected to it by a path. The sink then plays the stream back, usually though a sound card.</p>
<a name="media-objects"></a>
<h3>Media Objects</h3>
<p>The media object, an instance of the <a href="phonon-mediaobject.html">MediaObject</a> class, lets you start, pause, and stop the playback of a media stream, i.e&#x2e;, it provided basic control over the playback. You may think of the object as a simple media player.</p>
<p>The media data is provided by a media source, which is kept by the media object. The media source is a separate object - an instance of <a href="phonon-mediasource.html">MediaSource</a> - in Phonon, and not part of the graph itself. The source will supply the media object with raw data. The data can be read from files and streamed over a network. The contents of the source will be interpreted by the media object.</p>
<p>A media object is always instantiated with the default constructor and then supplied with a media source. Concrete code examples are given later in this overview.</p>
<p>As a complement to the media object, Phonon also provides <a href="phonon-mediacontroller.html">MediaController</a>, which provides control over features that are optional for a given media. For instance, for chapters, menus, and titles of a VOB (DVD) file will be features managed by a <a href="phonon-mediacontroller.html">MediaController</a>.</p>
<a name="sinks"></a>
<h3>Sinks</h3>
<p>A sink is a node that can output media from the graph, i.e&#x2e;, it does not send its output to other nodes. A sink is usually a rendering device.</p>
<p>The input of sinks in a Phonon media graph comes from a <a href="phonon-mediaobject.html">MediaObject</a>, though it might have been processed through other nodes on the way.</p>
<p>While the <a href="phonon-mediaobject.html">MediaObject</a> controls the playback, the sink has basic controls for manipulation of the media. With an audio sink, for instance, you can control the volume and mute the sound, i.e&#x2e;, it represents a virtual audio device. Another example is the <a href="phonon-videowidget.html">VideoWidget</a>, which can render video on a <a href="qwidget.html">QWidget</a> and alter the brightness, hue, and scaling of the video.</p>
<p>As an example we give an image of a graph used for playing back a video file with sound.</p>
<p class="centerAlign"><img src="images/conceptvideo.png" alt="" /></p><a name="processors"></a>
<h3>Processors</h3>
<p>Phonon does not allow manipulation of media streams directly, i.e&#x2e;, one cannot alter a media stream's bytes programmatically after they have been given to a media object. We have other nodes to help with this: processors, which are placed in the graph on the path somewhere between the media object and its sinks. In Phonon, processors are of the <a href="phonon-effect.html">Effect</a> class.</p>
<p>When inserted into the rendering process, the processor will alter the media stream, and will be active as long as it is part of the graph. To stop, it needs to be removed.</p>
<p>The <tt>Effect</tt>s may also have controls that affect how the media stream is manipulated. A processor applying a depth effect to audio, for instance, can have a value controlling the amount of depth. An <tt>Effect</tt> can be configured at any point in time.</p>
<a name="playback"></a>
<h2>Playback</h2>
<p>In some common cases, it is not necessary to build a graph yourself.</p>
<p>Phonon has convenience functions for building common graphs. For playing an audio file, you can use the <a href="phonon.html#createPlayer">createPlayer()</a> function. This will set up the necessary graph and return the media object node; the sound can then be started by calling its <a href="phonon-mediaobject.html#play">play()</a> function.</p>
<pre class="cpp">     Phonon<span class="operator">::</span>MediaObject <span class="operator">*</span>music <span class="operator">=</span>
         Phonon<span class="operator">::</span>createPlayer(Phonon<span class="operator">::</span>MusicCategory<span class="operator">,</span>
                              Phonon<span class="operator">::</span>MediaSource(<span class="string">&quot;/path/mysong.wav&quot;</span>));
     music<span class="operator">-</span><span class="operator">&gt;</span>play();</pre>
<p>We have a similar solution for playing video files, the <a href="phonon-videoplayer.html">VideoPlayer</a>.</p>
<pre class="cpp">     Phonon<span class="operator">::</span>VideoPlayer <span class="operator">*</span>player <span class="operator">=</span>
         <span class="keyword">new</span> Phonon<span class="operator">::</span>VideoPlayer(Phonon<span class="operator">::</span>VideoCategory<span class="operator">,</span> parentWidget);
     player<span class="operator">-</span><span class="operator">&gt;</span>play(url);</pre>
<p>The VideoPlayer is a widget onto which the video will be drawn.</p>
<p>The <tt>.pro</tt> file for a project needs the following line to be added:</p>
<pre class="cpp"> QT += phonon</pre>
<p>Phonon comes with several widgets that provide functionality commonly associated with multimedia players - notably SeekSlider for controlling the position of the stream, VolumeSlider for controlling sound volume, and EffectWidget for controlling the parameters of an effect. You can learn about them in the API documentation.</p>
<a name="building-graphs"></a>
<h2>Building Graphs</h2>
<p>If you need more freedom than the convenience functions described in the previous section offers you, you can build the graphs yourself. We will now take a look at how some common graphs are built. Starting a graph up is a matter of calling the <a href="phonon-mediaobject.html#play">play()</a> function of the media object.</p>
<p>If the media source contains several types of media, for instance, a stream with both video and audio, the graph will contain two output nodes: one for the video and one for the audio.</p>
<p>We will now look at the code required to build the graphs discussed previously in the <a href="#architecture">Architecture</a> section.</p>
<a name="audio"></a>
<h3>Audio</h3>
<p>When playing back audio, you create the media object and connect it to an audio output node - a node that inherits from AbstractAudioOutput. Currently, AudioOutput, which outputs audio to the sound card, is provided.</p>
<p>The code to create the graph is straight forward:</p>
<pre class="cpp">     Phonon<span class="operator">::</span>MediaObject <span class="operator">*</span>mediaObject <span class="operator">=</span> <span class="keyword">new</span> Phonon<span class="operator">::</span>MediaObject(<span class="keyword">this</span>);
     mediaObject<span class="operator">-</span><span class="operator">&gt;</span>setCurrentSource(Phonon<span class="operator">::</span>MediaSource(<span class="string">&quot;/mymusic/barbiegirl.wav&quot;</span>));
     Phonon<span class="operator">::</span>AudioOutput <span class="operator">*</span>audioOutput <span class="operator">=</span>
         <span class="keyword">new</span> Phonon<span class="operator">::</span>AudioOutput(Phonon<span class="operator">::</span>MusicCategory<span class="operator">,</span> <span class="keyword">this</span>);
     Phonon<span class="operator">::</span>Path path <span class="operator">=</span> Phonon<span class="operator">::</span>createPath(mediaObject<span class="operator">,</span> audioOutput);</pre>
<p>Notice that the type of media an input source has is resolved by Phonon, so you need not be concerned with this. If a source contains multiple media formats, this is also handled automatically.</p>
<p>The media object is always created using the default constructor since it handles all multimedia formats.</p>
<p>The setting of a Category, <a href="phonon.html#Category-enum">Phonon::MusicCategory</a> in this case, does not affect the actual playback; the category can be used by KDE to control the playback through, for instance, the control panel.</p>
<p>The AudioOutput class outputs the audio media to a sound card, that is, one of the audio devices of the operating system. An audio device can be a sound card or a intermediate technology, such as <tt>DirectShow</tt> on windows. A default device will be chosen if one is not set with <a href="phonon-audiooutput.html#outputDevice-prop">setOutputDevice()</a>.</p>
<p>The AudioOutput node will work with all audio formats supported by the back end, so you don't need to know what format a specific media source has.</p>
<p>For a an extensive example of audio playback, see the <a href="phonon-qmusicplayer.html">Phonon Music Player</a>.</p>
<a name="audio-effects"></a>
<h4>Audio Effects</h4>
<p>Since a media stream cannot be manipulated directly, the backend can produce nodes that can process the media streams. These nodes are inserted into the graph between a media object and an output node.</p>
<p>Nodes that process media streams inherit from the Effect class. The effects available depends on the underlying system. Most of these effects will be supported by Phonon. See the <a href="#querying-backends-for-support">Querying Backends for Support</a> section for information on how to resolve the available effects on a particular system.</p>
<p>We will now continue the example from above using the Path variable <tt>path</tt> to add an effect. The code is again trivial:</p>
<pre class="cpp">     Phonon<span class="operator">::</span>Effect <span class="operator">*</span>effect <span class="operator">=</span>
         <span class="keyword">new</span> Phonon<span class="operator">::</span>Effect(
             Phonon<span class="operator">::</span>BackendCapabilities<span class="operator">::</span>availableAudioEffects()<span class="operator">[</span><span class="number">0</span><span class="operator">]</span><span class="operator">,</span> <span class="keyword">this</span>);
     path<span class="operator">.</span>insertEffect(effect);</pre>
<p>Here we simply take the first available effect on the system.</p>
<p>The effect will start immediately after being inserted into the graph if the media object is playing. To stop it, you have to detach it again using <a href="phonon-path.html#removeEffect">removeEffect()</a> of the Path.</p>
<a name="video"></a>
<h3>Video</h3>
<p>For playing video, VideoWidget is provided. This class functions both as a node in the graph and as a widget upon which it draws the video stream. The widget will automatically choose an available device for playing the video, which is usually a technology between the Qt application and the graphics card, such as <tt>DirectShow</tt> on Windows.</p>
<p>The video widget does not play the audio (if any) in the media stream. If you want to play the audio as well, you will need an AudioOutput node. You create and connect it to the graph as shown in the previous section.</p>
<p>The code for creating this graph is given below, after which one can play the video with <a href="phonon-mediaobject.html#play">play()</a>.</p>
<pre class="cpp">     Phonon<span class="operator">::</span>MediaObject <span class="operator">*</span>mediaObject <span class="operator">=</span> <span class="keyword">new</span> Phonon<span class="operator">::</span>MediaObject(<span class="keyword">this</span>);

     Phonon<span class="operator">::</span>VideoWidget <span class="operator">*</span>videoWidget <span class="operator">=</span> <span class="keyword">new</span> Phonon<span class="operator">::</span>VideoWidget(<span class="keyword">this</span>);
     Phonon<span class="operator">::</span>createPath(mediaObject<span class="operator">,</span> videoWidget);

     Phonon<span class="operator">::</span>AudioOutput <span class="operator">*</span>audioOutput <span class="operator">=</span>
         <span class="keyword">new</span> Phonon<span class="operator">::</span>AudioOutput(Phonon<span class="operator">::</span>VideoCategory<span class="operator">,</span> <span class="keyword">this</span>);
     Phonon<span class="operator">::</span>createPath(mediaObject<span class="operator">,</span> audioOutput);</pre>
<p>The VideoWidget does not need to be set to a Category, it is automatically classified to <a href="phonon.html#Category-enum">VideoCategory</a>, we only need to assure that the audio is also classified in the same category.</p>
<p>The media object will split files with different media content into separate streams before sending them off to other nodes in the graph. It is the media object that determines the type of content appropriate for nodes that connect to it.</p>
<a name="backends"></a>
<h2>Backends</h2>
<p>The multimedia functionality is not implemented by Phonon itself, but by a back end - often also referred to as an engine. This includes connecting to, managing, and driving the underlying hardware or intermediate technology. For the programmer, this implies that the media nodes, e.g&#x2e;, media objects, processors, and sinks, are produced by the back end. Also, it is responsible for building the graph, i.e&#x2e;, connecting the nodes.</p>
<p>The backends of Qt use the media systems DirectShow (which requires DirectX) on Windows, QuickTime on Mac, and GStreamer on Linux. The functionality provided on the different platforms are dependent on these underlying systems and may vary somewhat, e.g&#x2e;, in the media formats supported.</p>
<p>Backends expose information about the underlying system. It can tell which media formats are supported, e.g&#x2e;, <tt>AVI</tt>, <tt>mp3</tt>, or <tt>OGG</tt>.</p>
<p>A user can often add support for new formats and filters to the underlying system, by, for instance, installing the DivX codex. We can therefore not give an exact overview of which formats are available with the Qt backends.</p>
<a name="querying-backends-for-support"></a>
<h3>Querying Backends for Support</h3>
<p>As mentioned, Phonon depends on the backend to provide its functionality. Depending on the individual backend, full support of the API may not be in place. Applications therefore need to check with the backend if functionality they require is implemented. In this section, we take look at how this is done.</p>
<p>The backend provides the <a href="phonon-backendcapabilities.html#availableMimeTypes">availableMimeTypes()</a> and <a href="phonon-backendcapabilities.html#isMimeTypeAvailable">isMimeTypeAvailable()</a> functions to query which MIME types the backend can produce nodes for. The types are listed as strings, which for any type is equal for any backend or platform.</p>
<p>The backend will emit a signal - <a href="phonon-backendcapabilities-notifier.html#capabilitiesChanged">Notifier::capabilitiesChanged()</a> - if its abilities have changed. If the available audio devices have changed, the <a href="phonon-backendcapabilities-notifier.html#availableAudioOutputDevicesChanged">Notifier::availableAudioOutputDevicesChanged()</a> signal is emitted instead.</p>
<p>To query the actual audio devices possible, we have the <a href="phonon-backendcapabilities.html#availableAudioOutputDevices">availableAudioOutputDevices()</a> as mentioned in the <a href="#sinks">Sinks</a> section. To query information about the individual devices, you can examine its <tt>name()</tt>; this string is dependent on the operating system, and the Qt backends does not analyze the devices further.</p>
<p>The sink for playback of video does not have a selection of devices. For convenience, the <a href="phonon-videowidget.html">VideoWidget</a> is both a node in the graph and a widget on which the video output is rendered. To query the various video formats available, use <a href="phonon-backendcapabilities.html#isMimeTypeAvailable">isMimeTypeAvailable()</a>. To add it to a path, you can use the <a href="phonon-path.html#createPath">Phonon::createPath</a>() as usual. After creating a media object, it is also possible to call its <a href="phonon-mediaobject.html#hasVideo">hasVideo()</a> function.</p>
<p>See also the <a href="phonon-capabilities.html">Capabilities Example</a>.</p>
<a name="installing-phonon"></a>
<h2>Installing Phonon</h2>
<p>When running the Qt configure script, you will be notified whether Phonon support is available on your system. As mentioned previously, to use develop and run Phonon applications, you also need to link to a backend, which provides the multimedia functionality.</p>
<p>Note that Phonon applications will compile and run without a working backend, but will, of course, not work as expected.</p>
<p>The following sections explains requirements for each backend.</p>
<a name="windows"></a>
<h3>Windows</h3>
<p>On Windows, building Phonon requires DirectX and DirectShow version 9 or higher. You'll need additional SDKs you can download from Microsoft.</p>
<a name="windows-xp-and-later-windows-versions"></a>
<h4>Windows XP and later Windows versions</h4>
<p>If you develop for Windows XP and up, you should download the Windows SDK <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&amp;DisplayLang=en">here</a>. Before building Qt, just call the script: <tt>C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\setenv.cmd</tt></p>
<p><b>Note:</b> Visual C++ 2008 already contains the Windows SDK and doesn't need that package and has already the environment set up for a smooth compilation of phonon.</p>
<a name="earlier-windows-versions-than-windows-xp"></a>
<h4>Earlier Windows versions than Windows XP</h4>
<p>If you want to support previous Windows versions, you should download and install the Platform SDK. You find it <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&amp;displaylang=en">here</a>.</p>
<p><b>Note:</b> The platform SDK provided with Visual C++ is not complete and you'll need this one to have DirectShow 9.0 support. You can download the DirectX SDK <a href="http://www.microsoft.com/downloads/details.aspx?familyid=09F7578C-24AA-4E0A-BF91-5FEC24C8C7BF&amp;displaylang=en">here</a>.</p>
<a name="setting-up-the-environment"></a>
<h4>Setting up the environment</h4>
<p>Once the SDKs are installed, please make sure to set your environment variables LIB and INCLUDE correctly. The paths to the include and lib directory of the SDKs should appear first. Typically, to setup your environment, you would execute the following script:</p>
<pre class="cpp"> Set DXSDK_DIR<span class="operator">=</span>C:\Program Files\Microsoft DirectX SDK (February <span class="number">2007</span>)
 <span class="operator">%</span>DXSDK_DIR<span class="operator">%</span>\utilities\bin\dx_setenv<span class="operator">.</span>cmd
 C:\program files\Microsoft Platform SDK\setenv<span class="operator">.</span>cmd</pre>
<p>If your environment is setup correctly, executing configure.exe on your Qt installation should automatically activate Phonon.</p>
<p><b>Warning:</b> The MinGW version of Qt does not support building the Qt backend.</p>
<a name="linux"></a>
<h3>Linux</h3>
<p>The Qt backend on Linux uses GStreamer (minimum version is 0.10), which must be installed on the system. At a minimum, you need the GStreamer library and base plugins, which provides support for <tt>.ogg</tt> files. The package names may vary between Linux distributions; on Mandriva, they have the following names:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Package</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td >libgstreamer0.10_0.10</td><td >The GStreamer base library.</td></tr>
<tr valign="top" class="even"><td >libgstreamer0.10_0.10-devel</td><td >Contains files for developing applications with GStreamer.</td></tr>
<tr valign="top" class="odd"><td >libgstreamer-plugins-base0.10</td><td >Contains the basic plugins for audio and video playback, and will enable support for <tt>ogg</tt> files.</td></tr>
<tr valign="top" class="even"><td >libgstreamer-plugins-base0.10-devel</td><td >Makes it possible to develop applications using the base plugins.</td></tr>
</table>
<a name="mac-os-x"></a>
<h3>Mac OS X</h3>
<p>On Mac OS X, Qt uses QuickTime for its backend. The minimum supported version is 7.0&#x2e;</p>
<a name="deploying-phonon-applications-on-windows-and-mac-os-x"></a>
<h2>Deploying Phonon Applications on Windows and Mac OS X</h2>
<p>On Windows and Mac OS X, the Qt backend makes use of the <a href="qtopengl.html">QtOpenGL</a> module. You therefore need to deploy the <a href="qtopengl.html">QtOpenGL</a> shared library. If this is not what you want, it is possible to configure Qt without OpenGL support. In that case, you need to run <tt>configure</tt> with the <tt>-no-opengl</tt> option.</p>
</div>
<!-- @@@phonon-overview.html -->
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>