summaryrefslogtreecommitdiffstats
path: root/src/multimedia/doc
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 /src/multimedia/doc
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>
Diffstat (limited to 'src/multimedia/doc')
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/media.cpp18
-rw-r--r--src/multimedia/doc/src/changes.qdoc10
2 files changed, 14 insertions, 14 deletions
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.