Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Multimedia Backend Development

Overview

A multimedia backend provides the glue between platform specific libraries, and Qt Multimedia. In some cases the available cross-platform Multimedia APIs or implementations are not sufficient, or not immediately available on a certain platform. Alternatively, 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.

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.

Extending the API

For the developer who wishes to extend the functionality of the Qt Multimedia classes there are several classes of particular importance. The classes providing default functionality are QMediaService, QMediaServiceProvider and QMediaControl.

to extend the Multimedia API you would use the following three classes or classes derived from them.

  • QMediaServiceProvider is used by the top level client class to request a service. The top level class knowing what kind of service it needs.
  • QMediaService provides a service and when asked by the top level object, say a component, will return a QMediaControl object.
  • QMediaControl allows the control of the service using a known interface.

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 QMediaServiceProvider to create our MyServiceProvider class. Also we will create a MyMediaService, and the MyMediaControl to manipulate the media service.

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 requestControl() it will receive the control object derived from QMediaControl.

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 zero-terminated string, const char *, for the interface.

Adding a Media Service Provider

The base class for creating new service providers is QMediaServiceProvider. The user must implement the requestService() function

 QMediaService* requestService(const QByteArray &type, const QMediaServiceProviderHint &hint);

The details of implementation will depend on the provider. Looking at the class QMediaServiceProvider for the default implementation. Notice that requestService() uses the QMediaServiceProviderHint 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.

Other methods that may be overloaded

 void releaseService(QMediaService *service);

 QtMediaServices::SupportEstimate hasSupport(const QByteArray &serviceType,
                                     const QString &mimeType,
                                     const QStringList& codecs,
                                     int flags) const;

 QStringList supportedMimeTypes(const QByteArray &serviceType, int flags) const;

 QList<QByteArray> devices(const QByteArray &serviceType) const;

 QString deviceDescription(const QByteArray &serviceType, const QByteArray &device);

The choice of what needs to be done depends on what the developer wishes to do with the service.

Classes for service implementers.

QAudioDecoderControl

Access to the audio decoding functionality of a QMediaService

QAudioEncoderControl

Access to the settings of a media service that performs audio encoding

QAudioEndpointSelector

Audio endpoint selector media control

QCameraCaptureBufferFormatControl

Control for setting the capture buffer format

QCameraCaptureDestinationControl

Control for setting capture destination

QCameraControl

Abstract base class for classes that control still cameras or video cameras

QCameraExposureControl

Allows controlling camera exposure parameters

QCameraFeedbackControl

Allows controlling feedback (sounds etc) during camera operation

QCameraFlashControl

Allows controlling a camera's flash

QCameraFocusControl

Supplies control for focusing related camera parameters

QCameraImageCaptureControl

Control interface for image capture services

QCameraImageProcessingControl

Abstract class for controlling image processing parameters, like white balance, contrast, saturation, sharpening and denoising

QCameraLocksControl

Abstract base class for classes that control still cameras or video cameras

QCameraViewfinderSettingsControl

Abstract class for controlling camera viewfinder parameters

QCameraZoomControl

Supplies control for optical and digital camera zoom

QImageEncoderControl

Access to the settings of a media service that performs image encoding

QMediaAudioProbeControl

Allows control over probing audio data in media objects

QMediaAvailabilityControl

Supplies a control for reporting availability of a service

QMediaContainerControl

Access to the output container format of a QMediaService

QMediaControl

Base interface for media service controls

QMediaGaplessPlaybackControl

Access to the gapless playback related control of a QMediaService

QMediaNetworkAccessControl

Allows the setting of the Network Access Point for media related activities

QMediaPlayerControl

Access to the media playing functionality of a QMediaService

QMediaRecorderControl

Access to the recording functionality of a QMediaService

QMediaService

Common base class for media service implementations

QMediaStreamsControl

Media stream selection control

QMediaVideoProbeControl

Allows control over probing video frames in media objects

QMetaDataReaderControl

Read access to the meta-data of a QMediaService's media

QMetaDataWriterControl

Write access to the meta-data of a QMediaService's media

QRadioDataControl

Access to the RDS functionality of the radio in the QMediaService

QRadioTunerControl

Access to the radio tuning functionality of a QMediaService

QVideoDeviceControl

Video device selector media control

QVideoEncoderControl

Access to the settings of a media service that performs video encoding

QVideoRendererControl

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web