![]() |
Home · All Classes · All Functions · | ![]() |
Warning: The camera support classes are in a technology preview state. They are in development and subject to change.
Multimedia provides a set of APIs that allow the developer to play, record and manage a collection of media content. It is dependent on the QtMultimedia API. This API is planned to replace Phonon at a later stage.
This library will require Qt 4.6.
This API delivers an easy to use interface to multimedia functions whether the developer wants to show an image, a video, record sound or play a multimedia stream.
There are several benefits from that this API brings to Qt. Firstly, the developer can now implement fundamental multimedia functions with minimal code, mostly because they are already implemented. Also there is a great deal of flexibility with the source or generated multimedia. The source file does not need to be local to the device, it could be streamed from a remote location and identified by a URL. Many different codecs are supported 'out of the box'.
The supplied examples give a good idea at the ease of use of the API. When the supporting user interface code is ignored we can see that functionality is immediately available with minimal code.
Looking at the Audio Recorder example we see that by creating a QMediaRecorder object that is initialized with a newly created QAudioCaptureSource object we can now perform all the core actions necessary to record a sound source.
To initialize the objects we create a QAudioCaptureSource object. This will have a list of available devices to choose from so that we can identify the origin of the audio data. We then use the capture source object to initialize a QMediaRecorder object
audiosource = new QAudioCaptureSource; capture = new QMediaRecorder(audiosource);
The API now allows us to discover available devices and codecs as shown in the example. To actually do the recording we merely have to call the record() function, and to stop call the stop() function. Saving to a file is done simply by calling QMediaRecorder::setOutputLocation() before starting to record.
With a handful of functions and two classes we can implement a sound recording application, excluding the supporting user interface code.
Support for the camera is not included in this release but will be part of a future update.
For playing and manipulating video sources the API enables us to easily implement a player application. If we examine the Player example we see that the implementation of a simple media player requires a QMediaPlayer object, which is used to initialize a QMediaPlaylist object.
player = new QMediaPlayer; playlist = new QMediaPlaylist(player);
To display the playing video file we need a QVideoWidget object. However, instead of using a QVideoWidget object directly the Player example has a VideoWidget class that inherits from QVideoWidget so that functions can be added to go to full screen display, either on a double click or on a particular keypress.
QRadioTunerControl is a pure virtual base class that will be the basis for any platform specific radio device control. When the functions are implemented the developer will be able to quickly produce an application that supports the typical uses of an FM radio including tuning, volume, start, stop and various other controls.
AudioRecorder is a demonstration of the discovery of the supported devices and codecs and the use of recording functions in the QMediaRecorder class.
The Player example is a simple multimedia player. Select a video file to play, stop, pause, show in fullscreen or manipulate various image attributes using the Color Options button.
The Slide Show shows the use of the QMediaImageViewer and QVideoWidget classes.
QAudioCaptureSource | Interface to query and select an audio input endpoint |
---|---|
QAudioEncoderSettings | Set of audio encoder settings |
QGraphicsVideoItem | Graphics item which display video produced by a QMediaObject |
QMediaContent | Access to the resources relating to a media content |
QMediaImageViewer | Means of viewing image media |
QMediaObject | Common base for multimedia objects |
QMediaPlayer | Allows the playing of a media source |
QMediaPlaylist | List of media content to play |
QMediaRecorder | Used for the recording of media content |
QMediaResource | Description of a media resource |
QMediaStreamsControl | Media stream selection control |
QMediaTimeInterval | Represents a time interval with integer precision |
QMediaTimeRange | Represents a set of zero or more disjoint time intervals |
QRadioTuner | Interface to the systems analog radio device |
QStillImageCapture | Used for the recording of media content |
QVideoWidget | Widget which presents video produced by a media object |
QtMedia | Contains miscellaneous identifiers used throughout the Qt Media library |
QAudioEncoderControl | Access to the settings of a media service that performs audio encoding |
---|---|
QAudioEndpointSelector | Audio endpoint selector media control |
QImageEncoderControl | Access to the settings of a media service that performs image encoding |
QImageProcessingControl | Abstract class for controling image processing parameters, like white balance, contrast, saturation, sharpening and denoising |
QMediaContainerControl | Access to the output container format of a QMediaService |
QMediaControl | Base interface for media service controls |
QMediaPlayerControl | Access to the media playing functionality of a QMediaService |
QMediaPlaylistControl | Access to the playlist functionality of a QMediaService |
QMediaRecorderControl | Access to the recording functionality of a QMediaService |
QMediaService | Common base class for media service implementations |
QMediaServiceProviderHint | Describes what is required of a QMediaService |
QMediaStreamsControl | Media stream selection control |
QMetaDataControl | Access to the meta-data of a QMediaService's media |
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 |
QVideoOutputControl | Means of selecting the active video output control |
QVideoRendererControl | Control for rendering to a video surface |
QVideoWidgetControl | Media control which implements a video widget |
QVideoWindowControl | Media control for rendering video to a window |
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Mobility Project 1.0.0 |