![]() |
Home · All Classes · All Functions · | ![]() |
The 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.
enum | Error { NoError, ResourceError, FormatError } |
enum | State { StoppedState, RecordingState, PausedState } |
QMediaRecorder ( QMediaObject * mediaObject, QObject * parent = 0 ) | |
~QMediaRecorder () | |
QString | audioCodecDescription ( const QString & codec ) const |
QAudioEncoderSettings | audioSettings () const |
QString | containerDescription ( const QString & mimeType ) const |
QString | containerMimeType () const |
qint64 | duration () const |
Error | error () const |
QString | errorString () const |
QUrl | outputLocation () const |
void | setEncodingSettings ( const QAudioEncoderSettings & audio, const QVideoEncoderSettings & video = QVideoEncoderSettings(), const QString & container = QString() ) |
bool | setOutputLocation ( const QUrl & location ) |
State | state () const |
QStringList | supportedAudioCodecs () const |
QList<int> | supportedAudioSampleRates ( const QAudioEncoderSettings & settings = QAudioEncoderSettings(), bool * continuous = 0 ) const |
QStringList | supportedContainers () const |
QList<qreal> | supportedFrameRates ( const QVideoEncoderSettings & settings = QVideoEncoderSettings(), bool * continuous = 0 ) const |
QList<QSize> | supportedResolutions ( const QVideoEncoderSettings & settings = QVideoEncoderSettings(), bool * continuous = 0 ) const |
QStringList | supportedVideoCodecs () const |
QString | videoCodecDescription ( const QString & codec ) const |
QVideoEncoderSettings | videoSettings () const |
virtual QtMedia::AvailabilityError | availabilityError () const |
virtual bool | isAvailable () const |
void | pause () |
void | record () |
void | stop () |
void | durationChanged ( qint64 duration ) |
void | error ( QMediaRecorder::Error error ) |
void | stateChanged ( QMediaRecorder::State state ) |
The 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();
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().
Reimplemented from QMediaObject::availabilityError().
Returns the availability error code.
Returns a description of a container format mimeType.
Returns the MIME type of the selected container format.
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().
Reimplemented from QMediaObject::isAvailable().
Returns true if media recorder service ready to use.
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 containerMimeType().
Returns 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().
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Mobility Project 1.0.0 |