summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-06-30 14:22:58 +0200
committerLars Knoll <lars.knoll@qt.io>2021-07-08 15:16:25 +0200
commit1b479a78945070932acc11f5ded533586563943a (patch)
treef544029b8e179a05f05a9c14d07dbdfd0698f8bf
parentb4e6892b64cce803d52f0e898e746bd9810501cc (diff)
Rename QMediaCaptureSession::encoder to recorder
As the class is called QMediaRecorder this is required for API consistency. Also cleaned up the front end code and examples where they used encoder instead of recorder. Cleanup of the backend will have to come in a separate change. Change-Id: I6e63e607473e68f628b1f89ffa3edcbc5bf5c2c8 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--examples/multimedia/audiorecorder/audiorecorder.cpp46
-rw-r--r--examples/multimedia/audiorecorder/audiorecorder.h2
-rw-r--r--examples/multimedia/declarative-camera/VideoCaptureControls.qml10
-rw-r--r--examples/multimedia/declarative-camera/declarative-camera.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml4
-rw-r--r--examples/multimedia/video/recorder/main.qml2
-rw-r--r--examples/multimediawidgets/camera/camera.cpp30
-rw-r--r--examples/multimediawidgets/camera/camera.h2
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/media.cpp18
-rw-r--r--src/multimedia/doc/src/changes.qdoc10
-rw-r--r--src/multimedia/qmediaformat.cpp2
-rw-r--r--src/multimedia/recording/qmediacapturesession.cpp30
-rw-r--r--src/multimedia/recording/qmediacapturesession.h8
-rw-r--r--src/multimedia/recording/qmediarecorder.cpp34
-rw-r--r--tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp4
-rw-r--r--tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp4
-rw-r--r--tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp14
17 files changed, 112 insertions, 114 deletions
diff --git a/examples/multimedia/audiorecorder/audiorecorder.cpp b/examples/multimedia/audiorecorder/audiorecorder.cpp
index 813ec1212..3be305465 100644
--- a/examples/multimedia/audiorecorder/audiorecorder.cpp
+++ b/examples/multimedia/audiorecorder/audiorecorder.cpp
@@ -72,8 +72,8 @@ AudioRecorder::AudioRecorder()
{
ui->setupUi(this);
- m_audioEncoder = new QMediaRecorder(this);
- m_captureSession.setEncoder(m_audioEncoder);
+ m_audioRecorder = new QMediaRecorder(this);
+ m_captureSession.setRecorder(m_audioRecorder);
m_captureSession.setAudioInput(new QAudioInput(this));
// ### replace with a monitoring output once we have it.
// m_probe = new QAudioProbe(this);
@@ -124,14 +124,14 @@ AudioRecorder::AudioRecorder()
ui->bitrateBox->addItem(QStringLiteral("96000"), QVariant(96000));
ui->bitrateBox->addItem(QStringLiteral("128000"), QVariant(128000));
- connect(m_audioEncoder, &QMediaRecorder::durationChanged, this, &AudioRecorder::updateProgress);
- connect(m_audioEncoder, &QMediaRecorder::recorderStateChanged, this, &AudioRecorder::onStateChanged);
- connect(m_audioEncoder, &QMediaRecorder::errorChanged, this, &AudioRecorder::displayErrorMessage);
+ connect(m_audioRecorder, &QMediaRecorder::durationChanged, this, &AudioRecorder::updateProgress);
+ connect(m_audioRecorder, &QMediaRecorder::recorderStateChanged, this, &AudioRecorder::onStateChanged);
+ connect(m_audioRecorder, &QMediaRecorder::errorChanged, this, &AudioRecorder::displayErrorMessage);
}
void AudioRecorder::updateProgress(qint64 duration)
{
- if (m_audioEncoder->error() != QMediaRecorder::NoError || duration < 2000)
+ if (m_audioRecorder->error() != QMediaRecorder::NoError || duration < 2000)
return;
ui->statusbar->showMessage(tr("Recorded %1 sec").arg(duration / 1000));
@@ -143,7 +143,7 @@ void AudioRecorder::onStateChanged(QMediaRecorder::RecorderState state)
switch (state) {
case QMediaRecorder::RecordingState:
- statusMessage = tr("Recording to %1").arg(m_audioEncoder->actualLocation().toString());
+ statusMessage = tr("Recording to %1").arg(m_audioRecorder->actualLocation().toString());
ui->recordButton->setText(tr("Stop"));
ui->pauseButton->setText(tr("Pause"));
break;
@@ -161,8 +161,8 @@ void AudioRecorder::onStateChanged(QMediaRecorder::RecorderState state)
break;
}
- ui->pauseButton->setEnabled(m_audioEncoder->recorderState() != QMediaRecorder::StoppedState);
- if (m_audioEncoder->error() == QMediaRecorder::NoError)
+ ui->pauseButton->setEnabled(m_audioRecorder->recorderState() != QMediaRecorder::StoppedState);
+ if (m_audioRecorder->error() == QMediaRecorder::NoError)
ui->statusbar->showMessage(statusMessage);
}
@@ -177,34 +177,34 @@ static QVariant boxValue(const QComboBox *box)
void AudioRecorder::toggleRecord()
{
- if (m_audioEncoder->recorderState() == QMediaRecorder::StoppedState) {
+ if (m_audioRecorder->recorderState() == QMediaRecorder::StoppedState) {
m_captureSession.audioInput()->setDevice(boxValue(ui->audioDeviceBox).value<QAudioDevice>());
QMediaFormat format;
format.setFileFormat(boxValue(ui->containerBox).value<QMediaFormat::FileFormat>());
format.setAudioCodec(boxValue(ui->audioCodecBox).value<QMediaFormat::AudioCodec>());
- m_audioEncoder->setMediaFormat(format);
- m_audioEncoder->setAudioSampleRate(ui->sampleRateBox->value());
- m_audioEncoder->setAudioBitRate(boxValue(ui->bitrateBox).toInt());
- m_audioEncoder->setAudioChannelCount(boxValue(ui->channelsBox).toInt());
- m_audioEncoder->setQuality(QMediaRecorder::Quality(ui->qualitySlider->value()));
- m_audioEncoder->setEncodingMode(ui->constantQualityRadioButton->isChecked() ?
+ m_audioRecorder->setMediaFormat(format);
+ m_audioRecorder->setAudioSampleRate(ui->sampleRateBox->value());
+ m_audioRecorder->setAudioBitRate(boxValue(ui->bitrateBox).toInt());
+ m_audioRecorder->setAudioChannelCount(boxValue(ui->channelsBox).toInt());
+ m_audioRecorder->setQuality(QMediaRecorder::Quality(ui->qualitySlider->value()));
+ m_audioRecorder->setEncodingMode(ui->constantQualityRadioButton->isChecked() ?
QMediaRecorder::ConstantQualityEncoding :
QMediaRecorder::ConstantBitRateEncoding);
- m_audioEncoder->record();
+ m_audioRecorder->record();
}
else {
- m_audioEncoder->stop();
+ m_audioRecorder->stop();
}
}
void AudioRecorder::togglePause()
{
- if (m_audioEncoder->recorderState() != QMediaRecorder::PausedState)
- m_audioEncoder->pause();
+ if (m_audioRecorder->recorderState() != QMediaRecorder::PausedState)
+ m_audioRecorder->pause();
else
- m_audioEncoder->record();
+ m_audioRecorder->record();
}
void AudioRecorder::setOutputLocation()
@@ -220,13 +220,13 @@ void AudioRecorder::setOutputLocation()
#else
QString fileName = QFileDialog::getSaveFileName();
#endif
- m_audioEncoder->setOutputLocation(QUrl::fromLocalFile(fileName));
+ m_audioRecorder->setOutputLocation(QUrl::fromLocalFile(fileName));
m_outputLocationSet = true;
}
void AudioRecorder::displayErrorMessage()
{
- ui->statusbar->showMessage(m_audioEncoder->errorString());
+ ui->statusbar->showMessage(m_audioRecorder->errorString());
}
void AudioRecorder::clearAudioLevels()
diff --git a/examples/multimedia/audiorecorder/audiorecorder.h b/examples/multimedia/audiorecorder/audiorecorder.h
index fae682c6f..97bd49688 100644
--- a/examples/multimedia/audiorecorder/audiorecorder.h
+++ b/examples/multimedia/audiorecorder/audiorecorder.h
@@ -88,7 +88,7 @@ private:
Ui::AudioRecorder *ui = nullptr;
QMediaCaptureSession m_captureSession;
- QMediaRecorder *m_audioEncoder = nullptr;
+ QMediaRecorder *m_audioRecorder = nullptr;
QList<AudioLevel*> m_audioLevels;
bool m_outputLocationSet = false;
diff --git a/examples/multimedia/declarative-camera/VideoCaptureControls.qml b/examples/multimedia/declarative-camera/VideoCaptureControls.qml
index 3fc787d30..fa1819f6e 100644
--- a/examples/multimedia/declarative-camera/VideoCaptureControls.qml
+++ b/examples/multimedia/declarative-camera/VideoCaptureControls.qml
@@ -81,22 +81,22 @@ FocusScope {
CameraButton {
text: "Record"
- visible: captureSession.encoder.status !== MediaEncoder.RecordingStatus
- onClicked: captureSession.encoder.record()
+ visible: captureSession.recorder.status !== MediaRecorder.RecordingStatus
+ onClicked: captureSession.recorder.record()
}
CameraButton {
id: stopButton
text: "Stop"
- visible: captureSession.encoder.status === MediaEncoder.RecordingStatus
- onClicked: captureSession.encoder.stop()
+ visible: captureSession.recorder.status === MediaRecorder.RecordingStatus
+ onClicked: captureSession.recorder.stop()
}
CameraButton {
text: "View"
onClicked: captureControls.previewSelected()
//don't show View button during recording
- visible: captureSession.encoder.actualLocation && !stopButton.visible
+ visible: captureSession.recorder.actualLocation && !stopButton.visible
}
}
diff --git a/examples/multimedia/declarative-camera/declarative-camera.qml b/examples/multimedia/declarative-camera/declarative-camera.qml
index 2b4ae20ad..51efb2b5b 100644
--- a/examples/multimedia/declarative-camera/declarative-camera.qml
+++ b/examples/multimedia/declarative-camera/declarative-camera.qml
@@ -99,8 +99,8 @@ Rectangle {
id: imageCapture
}
- encoder: MediaEncoder {
- id: encoder
+ recorder: MediaRecorder {
+ id: recorder
// resolution: "640x480"
// frameRate: 30
}
@@ -124,7 +124,7 @@ Rectangle {
focus: visible
//don't load recorded video if preview is invisible
- source: visible ? encoder.actualLocation : ""
+ source: visible ? recorder.actualLocation : ""
}
VideoOutput {
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml
index 3ee257ffa..26ffcc352 100644
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml
+++ b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml
@@ -75,8 +75,8 @@ Item {
id: imageCapture
}
- encoder: MediaEncoder {
- id: encoder
+ recorder: MediaRecorder {
+ id: recorder
// resolution: "640x480"
// frameRate: 30
}
diff --git a/examples/multimedia/video/recorder/main.qml b/examples/multimedia/video/recorder/main.qml
index c9c58eaa2..13ef0cd84 100644
--- a/examples/multimedia/video/recorder/main.qml
+++ b/examples/multimedia/video/recorder/main.qml
@@ -73,7 +73,7 @@ Window {
CaptureSession {
id: captureSession
- encoder: recorder
+ recorder: recorder
audioInput: controls.audioInput
camera: controls.camera
videoOutput: playback.active ? null : videoOutput
diff --git a/examples/multimediawidgets/camera/camera.cpp b/examples/multimediawidgets/camera/camera.cpp
index 89667ab43..a18b77b8a 100644
--- a/examples/multimediawidgets/camera/camera.cpp
+++ b/examples/multimediawidgets/camera/camera.cpp
@@ -101,22 +101,22 @@ void Camera::setCamera(const QCameraDevice &cameraDevice)
connect(m_camera.data(), &QCamera::activeChanged, this, &Camera::updateCameraActive);
connect(m_camera.data(), &QCamera::errorOccurred, this, &Camera::displayCameraError);
- m_mediaEncoder.reset(new QMediaRecorder);
- m_captureSession.setEncoder(m_mediaEncoder.data());
- connect(m_mediaEncoder.data(), &QMediaRecorder::recorderStateChanged, this, &Camera::updateRecorderState);
+ m_mediaRecorder.reset(new QMediaRecorder);
+ m_captureSession.setRecorder(m_mediaRecorder.data());
+ connect(m_mediaRecorder.data(), &QMediaRecorder::recorderStateChanged, this, &Camera::updateRecorderState);
m_imageCapture = new QImageCapture;
m_captureSession.setImageCapture(m_imageCapture);
- connect(m_mediaEncoder.data(), &QMediaRecorder::durationChanged, this, &Camera::updateRecordTime);
- connect(m_mediaEncoder.data(), &QMediaRecorder::errorChanged, this, &Camera::displayRecorderError);
+ connect(m_mediaRecorder.data(), &QMediaRecorder::durationChanged, this, &Camera::updateRecordTime);
+ connect(m_mediaRecorder.data(), &QMediaRecorder::errorChanged, this, &Camera::displayRecorderError);
connect(ui->exposureCompensation, &QAbstractSlider::valueChanged, this, &Camera::setExposureCompensation);
m_captureSession.setVideoOutput(ui->viewfinder);
updateCameraActive(m_camera->isActive());
- updateRecorderState(m_mediaEncoder->recorderState());
+ updateRecorderState(m_mediaRecorder->recorderState());
connect(m_imageCapture, &QImageCapture::readyForCaptureChanged, this, &Camera::readyForCapture);
connect(m_imageCapture, &QImageCapture::imageCaptured, this, &Camera::processCapturedImage);
@@ -142,7 +142,7 @@ void Camera::keyPressEvent(QKeyEvent * event)
if (m_doImageCapture) {
takeImage();
} else {
- if (m_mediaEncoder->recorderState() == QMediaRecorder::RecordingState)
+ if (m_mediaRecorder->recorderState() == QMediaRecorder::RecordingState)
stop();
else
record();
@@ -161,7 +161,7 @@ void Camera::keyReleaseEvent(QKeyEvent *event)
void Camera::updateRecordTime()
{
- QString str = QString("Recorded %1 sec").arg(m_mediaEncoder->duration()/1000);
+ QString str = QString("Recorded %1 sec").arg(m_mediaRecorder->duration()/1000);
ui->statusbar->showMessage(str);
}
@@ -189,7 +189,7 @@ void Camera::configureCaptureSettings()
void Camera::configureVideoSettings()
{
- VideoSettings settingsDialog(m_mediaEncoder.data());
+ VideoSettings settingsDialog(m_mediaRecorder.data());
settingsDialog.setWindowFlags(settingsDialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
if (settingsDialog.exec())
@@ -208,18 +208,18 @@ void Camera::configureImageSettings()
void Camera::record()
{
- m_mediaEncoder->record();
+ m_mediaRecorder->record();
updateRecordTime();
}
void Camera::pause()
{
- m_mediaEncoder->pause();
+ m_mediaRecorder->pause();
}
void Camera::stop()
{
- m_mediaEncoder->stop();
+ m_mediaRecorder->stop();
}
void Camera::setMuted(bool muted)
@@ -303,8 +303,8 @@ void Camera::setExposureCompensation(int index)
void Camera::displayRecorderError()
{
- if (m_mediaEncoder->error() != QMediaRecorder::NoError)
- QMessageBox::warning(this, tr("Capture Error"), m_mediaEncoder->errorString());
+ if (m_mediaRecorder->error() != QMediaRecorder::NoError)
+ QMessageBox::warning(this, tr("Capture Error"), m_mediaRecorder->errorString());
}
void Camera::displayCameraError()
@@ -402,6 +402,6 @@ void Camera::saveMetaData()
}
}
}
- m_mediaEncoder->setMetaData(data);
+ m_mediaRecorder->setMetaData(data);
}
diff --git a/examples/multimediawidgets/camera/camera.h b/examples/multimediawidgets/camera/camera.h
index d5920a0f3..786a6f722 100644
--- a/examples/multimediawidgets/camera/camera.h
+++ b/examples/multimediawidgets/camera/camera.h
@@ -136,7 +136,7 @@ private:
QScopedPointer<QCamera> m_camera;
QScopedPointer<QAudioInput> m_audioInput;
QImageCapture *m_imageCapture;
- QScopedPointer<QMediaRecorder> m_mediaEncoder;
+ QScopedPointer<QMediaRecorder> m_mediaRecorder;
bool m_isCapturingImage = false;
bool m_applicationExiting = false;
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
index 1e905484e..770bdec44 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
@@ -59,7 +59,7 @@ class MediaExample : public QObject {
void MediaControl();
void MediaPlayer();
- void AudioRecorder();
+ void MediaRecorder();
void recorderSettings();
void imageSettings();
@@ -88,21 +88,21 @@ void MediaExample::MediaControl()
void MediaExample::recorderSettings()
{
- //! [Media encoder settings]
+ //! [Media recorder settings]
QMediaFormat format(QMediaFormat::MPEG4);
format.setVideoCodec(QMediaRecorder::VideoCodec::H264);
format.setAudioCodec(QMediaRecorder::AudioCodec::MP3);
recorder->setMediaFormat(settings);
- //! [Media encoder settings]
+ //! [Media recorder settings]
}
void MediaExample::imageSettings()
{
- //! [Image encoder settings]
+ //! [Image recorder settings]
imageCapture->setFileFormat(QImageCapture::JPEG);
imageCapture->setResolution(1600, 1200);
- //! [Image encoder settings]
+ //! [Image recorder settings]
}
void MediaExample::MediaPlayer()
@@ -124,17 +124,17 @@ void MediaExample::MediaPlayer()
//! [Local playback]
}
-void MediaExample::AudioRecorder()
+void MediaExample::MediaRecorder()
{
- //! [Audio recorder]
+ //! [Media recorder]
QMediaCaptureSession session;
QAudioInput audioInput;
session.setAudioInput(&input);
QMediaRecorder recorder;
- session.setMediaEncoder(&recorder);
+ session.setMediaRecorder(&recorder);
recorder.setQuality(QMediaRecorder::HighQuality);
recorder.setOutputLocation(QUrl::fromLocalFile("test.mp3"));
recorder.record();
- //! [Audio recorder]
+ //! [Media recorder]
}
diff --git a/src/multimedia/doc/src/changes.qdoc b/src/multimedia/doc/src/changes.qdoc
index 764e77738..feb077ae6 100644
--- a/src/multimedia/doc/src/changes.qdoc
+++ b/src/multimedia/doc/src/changes.qdoc
@@ -55,10 +55,10 @@ There are a number of new features in Qt Multimedia:
\li QMediaCaptureSession class is the central object for media capture.
\li Changed QMediaRecorder class to be a high level class for audio/video
recording.
- \li new QMediaEncoder class to handle encoding of data produced in a capture
+ \li new QMediaRecorder class to handle encoding of data produced in a capture
session.
\li Setting up the desired encoding when recording has changed significantly.
- see QMediaEncoderSettings for details.
+ see QMediaFormat and QMediaRecorder for details.
\li Support for selection of audio, video and subtitle tracks when playing
back media files has been added.
\li QAudioDecoder is now supported on all platforms.
@@ -146,10 +146,10 @@ highlights these changes.
\row
\li QMediaFormat
\li Handling of formats for encoded media and the settings for the media
- encoder have changed significantly. Qt 5 provides a string based
+ recorder have changed significantly. Qt 5 provides a string based
API, a separated file format, and audio and video codecs into 3 classes.
- However, Qt 6 unifies the formats in the QMediaFormat class, and encoder
- settings in QMediaEncoderSettings. Setting up file formats and codecs
+ However, Qt 6 unifies the formats in the QMediaFormat class. Additional
+ settings are directly specified in QMediaRecorder. Setting up file formats and codecs
is now enum based and no longer uses strings. This puts some
limitations on the set of codecs that can be used, but helps provide a
consistent cross-platform API.
diff --git a/src/multimedia/qmediaformat.cpp b/src/multimedia/qmediaformat.cpp
index 18bc4621d..fd049679d 100644
--- a/src/multimedia/qmediaformat.cpp
+++ b/src/multimedia/qmediaformat.cpp
@@ -432,7 +432,7 @@ bool QMediaFormat::operator==(const QMediaFormat &other) const
Resolves the format to a format that is supported by QMediaRecorder.
This method tries to find the best possible match for unspecified settings.
- Settings that are not supported by the encoder will be modified to the closest
+ Settings that are not supported by the recorder will be modified to the closest
match that is supported.
*/
void QMediaFormat::resolveForEncoding(ResolveFlags flags)
diff --git a/src/multimedia/recording/qmediacapturesession.cpp b/src/multimedia/recording/qmediacapturesession.cpp
index 90cd27066..d9afcadba 100644
--- a/src/multimedia/recording/qmediacapturesession.cpp
+++ b/src/multimedia/recording/qmediacapturesession.cpp
@@ -62,7 +62,7 @@ public:
QAudioOutput *audioOutput = nullptr;
QCamera *camera = nullptr;
QImageCapture *imageCapture = nullptr;
- QMediaRecorder *encoder = nullptr;
+ QMediaRecorder *recorder = nullptr;
QVideoSink *videoSink = nullptr;
QPointer<QObject> videoOutput;
@@ -122,8 +122,8 @@ QMediaCaptureSession::~QMediaCaptureSession()
{
if (d_ptr->camera)
d_ptr->camera->setCaptureSession(nullptr);
- if (d_ptr->encoder)
- d_ptr->encoder->setCaptureSession(nullptr);
+ if (d_ptr->recorder)
+ d_ptr->recorder->setCaptureSession(nullptr);
if (d_ptr->imageCapture)
d_ptr->imageCapture->setCaptureSession(nullptr);
d_ptr->setVideoSink(nullptr);
@@ -209,30 +209,30 @@ void QMediaCaptureSession::setImageCapture(QImageCapture *imageCapture)
}
/*!
- \property QMediaCaptureSession::encoder
+ \property QMediaCaptureSession::recorder
- \brief the encoder object used to capture audio/video.
+ \brief the recorder object used to capture audio/video.
Add a QMediaRecorder object to the capture session to enable
recording of audio and/or video from the capture session.
*/
-QMediaRecorder *QMediaCaptureSession::encoder()
+QMediaRecorder *QMediaCaptureSession::recorder()
{
- return d_ptr->encoder;
+ return d_ptr->recorder;
}
-void QMediaCaptureSession::setEncoder(QMediaRecorder *encoder)
+void QMediaCaptureSession::setRecorder(QMediaRecorder *recorder)
{
- if (d_ptr->encoder == encoder)
+ if (d_ptr->recorder == recorder)
return;
- if (d_ptr->encoder)
- d_ptr->encoder->setCaptureSession(nullptr);
+ if (d_ptr->recorder)
+ d_ptr->recorder->setCaptureSession(nullptr);
- d_ptr->encoder = encoder;
- if (d_ptr->encoder)
- d_ptr->encoder->setCaptureSession(this);
- emit encoderChanged();
+ d_ptr->recorder = recorder;
+ if (d_ptr->recorder)
+ d_ptr->recorder->setCaptureSession(this);
+ emit recorderChanged();
}
QObject *QMediaCaptureSession::videoOutput() const
diff --git a/src/multimedia/recording/qmediacapturesession.h b/src/multimedia/recording/qmediacapturesession.h
index 50ece6aff..d0c6f28a9 100644
--- a/src/multimedia/recording/qmediacapturesession.h
+++ b/src/multimedia/recording/qmediacapturesession.h
@@ -61,7 +61,7 @@ class Q_MULTIMEDIA_EXPORT QMediaCaptureSession : public QObject
Q_PROPERTY(QAudioInput *audioInput READ audioInput WRITE setAudioInput NOTIFY audioInputChanged)
Q_PROPERTY(QCamera *camera READ camera WRITE setCamera NOTIFY cameraChanged)
Q_PROPERTY(QImageCapture *imageCapture READ imageCapture WRITE setImageCapture NOTIFY imageCaptureChanged)
- Q_PROPERTY(QMediaRecorder *encoder READ encoder WRITE setEncoder NOTIFY encoderChanged)
+ Q_PROPERTY(QMediaRecorder *recorder READ recorder WRITE setRecorder NOTIFY recorderChanged)
Q_PROPERTY(QObject *videoOutput READ videoOutput WRITE setVideoOutput NOTIFY videoOutputChanged)
public:
explicit QMediaCaptureSession(QObject *parent = nullptr);
@@ -76,8 +76,8 @@ public:
QImageCapture *imageCapture();
void setImageCapture(QImageCapture *imageCapture);
- QMediaRecorder *encoder();
- void setEncoder(QMediaRecorder *recorder);
+ QMediaRecorder *recorder();
+ void setRecorder(QMediaRecorder *recorder);
void setVideoOutput(QObject *output);
QObject *videoOutput() const;
@@ -94,7 +94,7 @@ Q_SIGNALS:
void audioInputChanged();
void cameraChanged();
void imageCaptureChanged();
- void encoderChanged();
+ void recorderChanged();
void videoOutputChanged();
void audioOutputChanged();
diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp
index d9dff04b8..194440792 100644
--- a/src/multimedia/recording/qmediarecorder.cpp
+++ b/src/multimedia/recording/qmediarecorder.cpp
@@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
The QMediaRecorder class is a class for encoding and recording media generated in a
QMediaCaptureSession.
- \snippet multimedia-snippets/media.cpp Media encoder
+ \snippet multimedia-snippets/media.cpp Media recorder
*/
QMediaRecorderPrivate::QMediaRecorderPrivate()
@@ -100,7 +100,7 @@ QString QMediaRecorderPrivate::msgFailedStartRecording()
}
/*!
- Constructs a media encoder which records the media produced by a microphone and camera.
+ Constructs a media recorder which records the media produced by a microphone and camera.
*/
QMediaRecorder::QMediaRecorder(QObject *parent)
@@ -113,7 +113,7 @@ QMediaRecorder::QMediaRecorder(QObject *parent)
}
/*!
- Destroys a media encoder object.
+ Destroys a media recorder object.
*/
QMediaRecorder::~QMediaRecorder()
@@ -121,7 +121,7 @@ QMediaRecorder::~QMediaRecorder()
if (d_ptr->captureSession) {
if (d_ptr->captureSession->platformSession())
d_ptr->captureSession->platformSession()->setMediaEncoder(nullptr);
- d_ptr->captureSession->setEncoder(nullptr);
+ d_ptr->captureSession->setRecorder(nullptr);
}
delete d_ptr->control;
delete d_ptr;
@@ -160,7 +160,7 @@ void QMediaRecorder::setCaptureSession(QMediaCaptureSession *session)
always fail. If the operation fails an errorOccured signal is emitted.
The \a location can be relative or empty;
- in the latter case the encoder uses the system specific place and file naming scheme.
+ in the latter case the recorder uses the system specific place and file naming scheme.
*/
/*!
@@ -172,7 +172,7 @@ void QMediaRecorder::setCaptureSession(QMediaCaptureSession *session)
*/
/*!
- Returns true if media encoder service ready to use.
+ Returns true if media recorder service ready to use.
\sa availabilityChanged()
*/
@@ -206,7 +206,7 @@ QUrl QMediaRecorder::actualLocation() const
}
/*!
- Returns the current media encoder state.
+ Returns the current media recorder state.
\sa QMediaRecorder::RecorderState
*/
@@ -256,11 +256,11 @@ qint64 QMediaRecorder::duration() const
/*!
Start recording.
- While the encoder state is changed immediately to QMediaRecorder::RecordingState,
+ While the recorder state is changed immediately to QMediaRecorder::RecordingState,
recording may start asynchronously.
If recording fails error() signal is emitted
- with encoder state being reset back to QMediaRecorder::StoppedState.
+ with recorder state being reset back to QMediaRecorder::StoppedState.
*/
void QMediaRecorder::record()
@@ -283,10 +283,10 @@ void QMediaRecorder::record()
/*!
Pause recording.
- The encoder state is changed to QMediaRecorder::PausedState.
+ The recorder state is changed to QMediaRecorder::PausedState.
Depending on platform recording pause may be not supported,
- in this case the encoder state stays unchanged.
+ in this case the recorder state stays unchanged.
*/
void QMediaRecorder::pause()
@@ -299,7 +299,7 @@ void QMediaRecorder::pause()
/*!
Stop recording.
- The encoder state is changed to QMediaRecorder::StoppedState.
+ The recorder state is changed to QMediaRecorder::StoppedState.
*/
void QMediaRecorder::stop()
@@ -526,7 +526,7 @@ QSize QMediaRecorder::videoResolution() const
/*!
Sets the \a resolution of the encoded video.
- An empty QSize indicates the encoder should make an optimal choice based on
+ An empty QSize indicates the recorder should make an optimal choice based on
what is available from the video source and the limitations of the codec.
*/
void QMediaRecorder::setVideoResolution(const QSize &size)
@@ -556,11 +556,9 @@ qreal QMediaRecorder::videoFrameRate() const
}
/*!
- \fn QVideoEncoderSettings::setFrameRate(qreal rate)
-
Sets the video frame \a rate.
- A value of 0 indicates the encoder should make an optimal choice based on what is available
+ A value of 0 indicates the recorder should make an optimal choice based on what is available
from the video source and the limitations of the codec.
*/
void QMediaRecorder::setVideoFrameRate(qreal frameRate)
@@ -629,7 +627,7 @@ int QMediaRecorder::audioChannelCount() const
/*!
Sets the number of audio \a channels.
- A value of -1 indicates the encoder should make an optimal choice based on
+ A value of -1 indicates the recorder should make an optimal choice based on
what is available from the audio source and the limitations of the codec.
*/
void QMediaRecorder::setAudioChannelCount(int channels)
@@ -654,7 +652,7 @@ int QMediaRecorder::audioSampleRate() const
/*!
Sets the audio sample \a rate in Hz.
- A value of -1 indicates the encoder should make an optimal choice based on what is avaialbe
+ A value of -1 indicates the recorder should make an optimal choice based on what is avaialbe
from the audio source and the limitations of the codec.
*/
void QMediaRecorder::setAudioSampleRate(int sampleRate)
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
index 42ac45349..17cde0802 100644
--- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
+++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
@@ -455,7 +455,7 @@ void tst_QCameraBackend::testVideoRecording()
session.setCamera(camera.data());
QMediaRecorder recorder;
- session.setEncoder(&recorder);
+ session.setRecorder(&recorder);
QSignalSpy errorSignal(camera.data(), SIGNAL(errorOccurred(QCamera::Error, const QString &)));
QSignalSpy recorderErrorSignal(&recorder, SIGNAL(errorOccurred(Error, const QString &)));
@@ -512,7 +512,7 @@ void tst_QCameraBackend::testNativeMetadata()
session.setCamera(&camera);
QMediaRecorder recorder;
- session.setEncoder(&recorder);
+ session.setRecorder(&recorder);
QSignalSpy errorSignal(&camera, SIGNAL(errorOccurred(QCamera::Error, const QString &)));
QSignalSpy recorderErrorSignal(&recorder, SIGNAL(errorOccurred(Error, const QString &)));
diff --git a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
index 7fe79c36c..f65b6768c 100644
--- a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
+++ b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
@@ -80,7 +80,7 @@ void tst_QAudioRecorder::testAudioSource()
{
QMediaCaptureSession session;
encoder = new QMediaRecorder;
- session.setEncoder(encoder);
+ session.setRecorder(encoder);
QCOMPARE(session.camera(), nullptr);
}
@@ -106,7 +106,7 @@ void tst_QAudioRecorder::testAvailability()
{
QMediaCaptureSession session;
QMediaRecorder source;
- session.setEncoder(&source);
+ session.setRecorder(&source);
QVERIFY(source.isAvailable());
}
diff --git a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp
index 9a3661886..36fd0a16d 100644
--- a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp
+++ b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp
@@ -86,7 +86,7 @@ void tst_QMediaRecorder::initTestCase()
object = new QCamera;
encoder = new QMediaRecorder;
captureSession->setCamera(object);
- captureSession->setEncoder(encoder);
+ captureSession->setRecorder(encoder);
service = mockIntegration->lastCaptureService();
mock = service->mockControl;
}
@@ -105,7 +105,7 @@ void tst_QMediaRecorder::testBasicSession()
QCamera camera;
QMediaRecorder recorder;
session.setCamera(&camera);
- session.setEncoder(&recorder);
+ session.setRecorder(&recorder);
QCOMPARE(recorder.outputLocation(), QUrl());
QCOMPARE(recorder.recorderState(), QMediaRecorder::StoppedState);
@@ -124,7 +124,7 @@ void tst_QMediaRecorder::testNullControls()
QCamera camera;
QMediaRecorder recorder;
session.setCamera(&camera);
- // session.setEncoder(&recorder);
+ // session.setRecorder(&recorder);
QCOMPARE(recorder.outputLocation(), QUrl());
QCOMPARE(recorder.recorderState(), QMediaRecorder::StoppedState);
@@ -171,7 +171,7 @@ void tst_QMediaRecorder::testDeleteMediaSource()
QCamera *camera = new QCamera;
QMediaRecorder *recorder = new QMediaRecorder;
session.setCamera(camera);
- session.setEncoder(recorder);
+ session.setRecorder(recorder);
QVERIFY(session.camera() == camera);
QVERIFY(recorder->isAvailable());
@@ -358,7 +358,7 @@ void tst_QMediaRecorder::testSettingsApplied()
{
QMediaCaptureSession session;
QMediaRecorder encoder;
- session.setEncoder(&encoder);
+ session.setRecorder(&encoder);
auto *mock = mockIntegration->lastCaptureService()->mockControl;
//if the media recorder is not configured after construction
@@ -387,7 +387,7 @@ void tst_QMediaRecorder::metaData()
QCamera camera;
QMediaRecorder recorder;
session.setCamera(&camera);
- session.setEncoder(&recorder);
+ session.setRecorder(&recorder);
QVERIFY(recorder.metaData().isEmpty());
@@ -405,7 +405,7 @@ void tst_QMediaRecorder::testIsAvailable()
QCamera camera;
QMediaRecorder recorder;
session.setCamera(&camera);
- session.setEncoder(&recorder);
+ session.setRecorder(&recorder);
QCOMPARE(recorder.isAvailable(), true);
}
{