QMediaRecorder Class ReferenceThe QMediaRecorder class is used for the recording of media content. More... #include <QMediaRecorder> This class is under development and is subject to change. Inherits QMediaObject. Public Types
Properties
Public Functions
Public Slots
Signals
Additional Inherited Members
Detailed DescriptionThe QMediaRecorder class is used for the recording of media content. The QMediaRecorder class is a high level media recording class. It's not intended to be used alone but for accessing the media recording functions of other media objects, like QRadioTuner, or QAudioCaptureSource. If the radio is used as a source, recording is only possible when the source is in appropriate state // Audio only recording
audioSource = new QAudioCaptureSource;
recorder = new QMediaRecorder(audioSource);
QAudioEncoderSettings audioSettings;
audioSettings.setCodec("audio/vorbis");
audioSettings.setQuality(QtMedia::HighQuality);
recorder->setEncodingSettings(audioSettings);
recorder->setOutputLocation(QUrl::fromLocalFile(fileName));
recorder->record();
Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QMediaRecorder::NoError | 0 | No Errors. |
QMediaRecorder::ResourceError | 1 | Device is not ready or not available. |
QMediaRecorder::FormatError | 2 | Current format is not supported. |
Constant | Value | Description |
---|---|---|
QMediaRecorder::StoppedState | 0 | The recorder is not active. |
QMediaRecorder::RecordingState | 1 | The recorder is currently active and producing data. |
QMediaRecorder::PausedState | 2 | The recorder is paused. |
This property holds the recorded media duration in milliseconds.
Access functions:
qint64 | duration () const |
Notifier signal:
void | durationChanged ( qint64 duration ) |
This property holds the destination location of media content.
Setting the location can fail for example when the service supports only local file system locations while the network url was passed, or the service doesn't support media recording.
Access functions:
QUrl | outputLocation () const |
bool | setOutputLocation ( const QUrl & location ) |
Constructs a media recorder which records the media produced by mediaObject.
The parent is passed to QMediaObject.
Destroys a media recorder object.
Returns a description of an audio codec.
Returns the audio encoder settings being used.
See also setEncodingSettings().
Signals that the duration of the recorded media has changed.
Returns the current error state.
See also errorString().
Signals that an error has occurred.
Returns a string describing the current error state.
See also error().
Returns the MIME type of the selected container format.
Returns a description of a container format mimeType.
Pause recording.
Start recording.
This is an asynchronous call, with signal stateCahnged(QMediaRecorder::RecordingState) being emited when recording started, otherwise error() signal is emited.
Sets the audio and video encoder settings and container format MIME type.
It's only possible to change setttings when the encoder is in the QMediaEncoder::StoppedState state.
If some parameters are not specified, or null settings are passed, the encoder choose the default encoding parameters, depending on media source properties. But while setEncodingSettings is optional, the backend can preload encoding pipeline to improve recording startup time.
See also audioSettings(), videoSettings(), and format().
Return the current media recorder state.
See also QMediaRecorder::State.
Signals that a media recorder's state has changed.
Stop recording.
Returns a list of supported audio codecs.
Returns a list of supported audio sample rates.
If non null audio settings parameter is passed, the returned list is reduced to sample rates supported with partial settings applied.
It can be used for example to query the list of sample rates, supported by specific audio codec.
If the encoder supports arbitrary sample rates within the supported rates range, *continuous is set to true, otherwise *continuous is set to false.
Returns a list of MIME types of supported container formats.
Returns a list of frame rates video can be encoded at.
If non null video settings parameter is passed, the returned list is reduced to frame rates supported with partial settings like video codec or resolution applied.
If the encoder supports arbitrary frame rates within the supported range, *continuous is set to true, otherwise *continuous is set to false.
See also QVideoEncoderSettings::frameRate().
Returns a list of resolutions video can be encoded at.
If non null video settings parameter is passed, the returned list is reduced to resolution supported with partial settings like video codec or framerate applied.
If the encoder supports arbitrary resolutions within the supported range, *continuous is set to true, otherwise *continuous is set to false.
See also QVideoEncoderSettings::resolution().
Returns a list of supported video codecs.
Returns a description of a video codec.
See also setEncodingSettings().
Returns the video encoder settings being used.
See also setEncodingSettings().
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 qtmobility-1.0-tp | |
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 ! |
Copyright © 2000-2012 - www.developpez.com