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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Multimedia

Introduction

The Qt Extended Multimedia Framework provides a generic API to manage audio/video playback, handling priority requests, suspending and resuming as needed automatically.

Multimedia Block Diagram

Features

Features provided by the Qt Extended Multimedia Framework include:

  • Automatic suspend and resume of playback sessions based on priority.
  • Access control to audio sub-system (oss, alsa) QAudioInterface.
  • Generic audio mixer control class (oss, alsa) QAudioMixer.
  • QSound class emulation.

Media Engines

On startup the Qt Extended Media Server loads plugin media engines installed, these engines are implementations of 3rd party multimedia engines like helix and gstreamer using QMediaEngine. The video rendering is done using a QWSEmbedWidget in the player see QMediaVideoWidget ::createVideoWidget() for details on this. On the server side a QVideoFrame allows the media server to render the video to the screen. For details on implementation of the engine API refer to the Simple Media Engine example used in the tutorial.

Cruxus Engine

Cruxus is a light weight media engine that supports audio only playback allowing the developer to add support for audio codecs without having to write there own media engine, instead just implementing QMediaDecoder. Currently cruxus has plugins for wav, ogg (tremor), mp3 (libmad) and midi (libtimidity). See (src/plugins/codecs/wavplay, src/3rdparty/plugins/codecs/libmad,tremor,libtimidity for implementations.

Note: libmad is not enabled by default due to licensing issues. When fast response times on playback are required it is recommended that cruxus engine is used for wav support.

Media Player

For details on implementation of the player side API refer to the Simple Media Player example used in the tutorial.

Audio Management

As of 4.4.1 release QAudioInterface provides an easy way for the application developer to allow Qt Extended to control the audio of there applications.

  • Control is implemented in the mediaserver (src/tools/mediaserver/qaudiointerfaceserver.cpp)
  • Each QAudioInterface connects to this server instance running as part of the mediaserver

For Example:

    QAudioInput      *audio;
    QAudioInterface  *audiomgr;

First we create out audio input class.

    audio = new QAudioInput(this);

Then we create out control class using the default Media as the domain.

    audiomgr = new QAudioInterface("Media", this);

Then we tell the control class what audio it has to control, if you are not using a QAudioInput or QAudioOutput class then you will need to connect to the QAudioInterface::audioStarted() and QAudioInterface::audioStopped() signals to implement the open and close functionality.

    audiomgr->setInput(audio);

User requests to start recording.

    audiomgr->audioStart();

When all the handshaking is done, conflicting instances are stopped or paused and audio state is changed to support audio request QAudioInterface::audioStarted() signal is emitted to begin reading the input.

Rules on Access for Audio System

On play request:

  • If OSS, pause all Active instances before playing.

On record request:

  • Recording is exclusive access, stop all Active instances before recording.

Tutorials

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 qtextended4.4
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