Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 50facae208d4a6f280e44a513b104320 > files > 511

qt-mobility-doc-1.2.0-13.mga5.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" />
<!-- multimediabackend.qdoc -->
  <title>Qt Mobility 1.2: </title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>QtMobility Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li></li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#multimedia-backend-development">Multimedia Backend Development</a></li>
<li class="level1"><a href="#extending-the-api">Extending the API</a></li>
<li class="level2"><a href="#adding-a-media-service-provider">Adding a Media Service Provider</a></li>
<li class="level2"><a href="#classes-for-service-implementers">Classes for service implementers.</a></li>
</ul>
</div>
<span class="subtitle"></span>
<!-- $$$multimediabackend.html-description -->
<div class="descr"> <a name="details"></a>
<a name="multimedia-backend-development"></a>
<h2>Multimedia Backend Development</h2>
<p>In some cases the available cross-platform Multimedia APIs or implementations are not sufficient, or not immediately available on a certain platform. In some cases the multimedia implementation on a platform might expose certain extra properties or functionality that other platforms do not, or a finer degree of control might be possible. For these cases, it is possible to use extended controls directly.</p>
<p>In addition, if you plan to port the Qt Multimedia APIs to a new platform, you do this by implementing certain control and service classes, as detailed below.</p>
<a name="extending-the-api"></a>
<h2>Extending the API</h2>
<p>For the developer who wishes to extend the functionality of the Multimedia classes there are several classes of particular importance. The default classes are <a href="qmediaservice.html">QMediaService</a>, <a href="qmediaserviceprovider.html">QMediaServiceProvider</a> and <a href="qmediacontrol.html">QMediaControl</a>.</p>
<p>Basically, the idea is that to use the Multimedia API you would use these three classes or classes derived from them as follows</p>
<ul>
<li><a href="qmediaserviceprovider.html">QMediaServiceProvider</a> is used by the top level client class to request a service. The top level class knowing what kind of service it needs.</li>
<li><a href="qmediaservice.html">QMediaService</a> provides a service and when asked by the top level object, say a component, will return a <a href="qmediacontrol.html">QMediaControl</a> object.</li>
<li><a href="qmediacontrol.html">QMediaControl</a> allows the control of the service using a known interface.</li>
</ul>
<p>Consider a developer creating, for example, a media player class called MyPlayer. It may have special requirements beyond ordinary media players and so may need a custom service and a custom control. We can subclass <a href="qmediaserviceprovider.html">QMediaServiceProvider</a> to create our MyServiceProvider class. Also we will create a MyMediaService, and the MyMediaControl to manipulate the media service.</p>
<p>The MyPlayer object calls MyServiceProvider::requestService() to get an instance of MyMediaService. Then the MyPlayer object calls this service object it has just received and calling <a href="qmediaservice.html#requestControl">requestControl()</a> it will receive the control object derived from <a href="qmediacontrol.html">QMediaControl</a>. Now we have all the parts necessary for our media application. We have the service provider, the service it provides and the control used to manipulate the service. Since our MyPlayer object has instances of the service and its control then it would be possible for these to be used by associated classes that could do additional actions, perhaps with their own control since the parameter to requestControl() is a c-type string, <i>const char *</i>, for the interface.</p>
<a name="adding-a-media-service-provider"></a>
<h3>Adding a Media Service Provider</h3>
<p>The base class for creating new service providers is <a href="qmediaserviceprovider.html">QMediaServiceProvider</a>. The user must implement the <a href="qmediaserviceprovider.html#requestService">requestService()</a> function</p>
<pre class="cpp"> <span class="type"><a href="qmediaservice.html">QMediaService</a></span><span class="operator">*</span> requestService(<span class="keyword">const</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> <span class="operator">&amp;</span>type<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qmediaserviceproviderhint.html">QMediaServiceProviderHint</a></span> <span class="operator">&amp;</span>hint);</pre>
<p>The details of implementation will depend on the provider. Looking at the class <a href="qmediaserviceprovider.html">QMediaServiceProvider</a> for the default implementation. Notice that <a href="qmediaserviceprovider.html#requestService">requestService()</a> uses the <a href="qmediaserviceproviderhint.html">QMediaServiceProviderHint</a> to look for the appropriate plugin and then to insert it into the plugin map. However, for a specific service provider there is probably no need for this approach, it will simply depend on what the developer wants to implement.</p>
<p>Other methods that may be overloaded</p>
<pre class="cpp"> <span class="type">void</span> releaseService(<span class="type"><a href="qmediaservice.html">QMediaService</a></span> <span class="operator">*</span>service);

 <span class="type">QtMediaServices</span><span class="operator">::</span>SupportEstimate hasSupport(<span class="keyword">const</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> <span class="operator">&amp;</span>serviceType<span class="operator">,</span>
                                     <span class="keyword">const</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qstring.html">QString</a></span> <span class="operator">&amp;</span>mimeType<span class="operator">,</span>
                                     <span class="keyword">const</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qstringlist.html">QStringList</a></span><span class="operator">&amp;</span> codecs<span class="operator">,</span>
                                     <span class="type">int</span> flags) <span class="keyword">const</span>;

 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qstringlist.html">QStringList</a></span> supportedMimeTypes(<span class="keyword">const</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> <span class="operator">&amp;</span>serviceType<span class="operator">,</span> <span class="type">int</span> flags) <span class="keyword">const</span>;

 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qlist.html">QList</a></span><span class="operator">&lt;</span><span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span><span class="operator">&gt;</span> devices(<span class="keyword">const</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> <span class="operator">&amp;</span>serviceType) <span class="keyword">const</span>;

 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qstring.html">QString</a></span> deviceDescription(<span class="keyword">const</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> <span class="operator">&amp;</span>serviceType<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> <span class="operator">&amp;</span>device);</pre>
<p>The choice of what needs to be done depends on what the developer wishes to do with the service.</p>
<a name="classes-for-service-implementers"></a>
<h3>Classes for service implementers.</h3>
<table class="annotated">
<tr class="odd topAlign"><td class="tblName"><p><a href="qaudioencodercontrol.html">QAudioEncoderControl</a></p></td><td class="tblDescr"><p>Access to the settings of a media service that performs audio encoding</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qcameracapturebufferformatcontrol.html">QCameraCaptureBufferFormatControl</a></p></td><td class="tblDescr"><p>Control for setting the capture buffer format</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qcameracapturedestinationcontrol.html">QCameraCaptureDestinationControl</a></p></td><td class="tblDescr"><p>Control for setting capture destination</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qcameracontrol.html">QCameraControl</a></p></td><td class="tblDescr"><p>Abstract base class for classes that control still cameras or video cameras</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qcameraexposurecontrol.html">QCameraExposureControl</a></p></td><td class="tblDescr"><p>Supplies control for exposure related camera parameters</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qcameraflashcontrol.html">QCameraFlashControl</a></p></td><td class="tblDescr"><p>Supplies a camera flash control</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qcamerafocuscontrol.html">QCameraFocusControl</a></p></td><td class="tblDescr"><p>Supplies control for focusing related camera parameters</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qcameraimagecapturecontrol.html">QCameraImageCaptureControl</a></p></td><td class="tblDescr"><p>Control interface for image capture services</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qcameraimageprocessingcontrol.html">QCameraImageProcessingControl</a></p></td><td class="tblDescr"><p>Abstract class for controlling image processing parameters, like white balance, contrast, saturation, sharpening and denoising</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qcameralockscontrol.html">QCameraLocksControl</a></p></td><td class="tblDescr"><p>Abstract base class for classes that control still cameras or video cameras</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qimageencodercontrol.html">QImageEncoderControl</a></p></td><td class="tblDescr"><p>Access to the settings of a media service that performs image encoding</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmediacontainercontrol.html">QMediaContainerControl</a></p></td><td class="tblDescr"><p>Access to the output container format of a QMediaService</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmediacontrol.html">QMediaControl</a></p></td><td class="tblDescr"><p>Base interface for media service controls</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmedianetworkaccesscontrol.html">QMediaNetworkAccessControl</a></p></td><td class="tblDescr"><p>Allows the setting of the Network Access Point for media related activities</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmediaplayercontrol.html">QMediaPlayerControl</a></p></td><td class="tblDescr"><p>Access to the media playing functionality of a QMediaService</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmediaplaylistcontrol.html">QMediaPlaylistControl</a></p></td><td class="tblDescr"><p>Access to the playlist functionality of a QMediaService</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmediaplaylistsourcecontrol.html">QMediaPlaylistSourceControl</a></p></td><td class="tblDescr"><p>Access to the playlist playback functionality of a QMediaService</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmediarecordercontrol.html">QMediaRecorderControl</a></p></td><td class="tblDescr"><p>Access to the recording functionality of a QMediaService</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmediaservice.html">QMediaService</a></p></td><td class="tblDescr"><p>Common base class for media service implementations</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmediaserviceprovider.html">QMediaServiceProvider</a></p></td><td class="tblDescr"><p>Abstract allocator for media services</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmediaserviceproviderhint.html">QMediaServiceProviderHint</a></p></td><td class="tblDescr"><p>Describes what is required of a QMediaService</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmediastreamscontrol.html">QMediaStreamsControl</a></p></td><td class="tblDescr"><p>Media stream selection control</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmetadatareadercontrol.html">QMetaDataReaderControl</a></p></td><td class="tblDescr"><p>Read access to the meta-data of a QMediaService's media</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmetadatawritercontrol.html">QMetaDataWriterControl</a></p></td><td class="tblDescr"><p>Write access to the meta-data of a QMediaService's media</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qradiotunercontrol.html">QRadioTunerControl</a></p></td><td class="tblDescr"><p>Access to the radio tuning functionality of a QMediaService</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qvideodevicecontrol.html">QVideoDeviceControl</a></p></td><td class="tblDescr"><p>Video device selector media control</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qvideoencodercontrol.html">QVideoEncoderControl</a></p></td><td class="tblDescr"><p>Access to the settings of a media service that performs video encoding</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qvideorenderercontrol.html">QVideoRendererControl</a></p></td><td class="tblDescr"><p>Control for rendering to a video surface</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qvideowidgetcontrol.html">QVideoWidgetControl</a></p></td><td class="tblDescr"><p>Media control which implements a video widget</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qvideowindowcontrol.html">QVideoWindowControl</a></p></td><td class="tblDescr"><p>Media control for rendering video to a window</p></td></tr>
</table>
</div>
<!-- @@@multimediabackend.html -->
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
  <p>
     <acronym title="Copyright">&copy;</acronym> 2008-2011 Nokia Corporation and/or its
     subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
     in Finland and/or other countries worldwide.</p>
  <p>
     All other trademarks are property of their respective owners. <a title="Privacy Policy"
     href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
  <br />
  <p>
    Licensees holding valid Qt Commercial licenses may use this document in accordance with the    Qt Commercial License Agreement provided with the Software or, alternatively, in accordance    with the terms contained in a written agreement between you and Nokia.</p>
  <p>
    Alternatively, this document may be used 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>
</div>
</body>
</html>