summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-06-11 11:04:09 +0200
committerLars Knoll <lars.knoll@qt.io>2021-06-16 08:56:43 +0200
commit52c8d7efdd4f783097dcec6e66f3e076cdbc88ca (patch)
treee0575987b814769a4c33bae4fd2133b907db1657
parentd58d93b8e45b2bf62221b104914df771849c007c (diff)
Kill the current QMediaRecorder class
The class provides only minimal convenience over using QMediaCaptureSession directly. Change-Id: I706bb6821fbf8a7cc79a86819001ee1fd669733e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--examples/multimedia/audiorecorder/doc/src/audiorecorder.qdoc12
-rw-r--r--examples/multimediawidgets/camera/doc/src/camera.qdoc6
-rw-r--r--src/multimedia/CMakeLists.txt1
-rw-r--r--src/multimedia/audio/qaudio.cpp2
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/media.cpp10
-rw-r--r--src/multimedia/doc/src/audiooverview.qdoc2
-rw-r--r--src/multimedia/doc/src/cameraoverview.qdoc2
-rw-r--r--src/multimedia/doc/src/changes.qdoc4
-rw-r--r--src/multimedia/doc/src/multimedia.qdoc2
-rw-r--r--src/multimedia/doc/src/qtmultimedia-index.qdoc2
-rw-r--r--src/multimedia/doc/src/videooverview.qdoc2
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamermediaencoder.cpp2
-rw-r--r--src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol.cpp18
-rw-r--r--src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol_p.h6
-rw-r--r--src/multimedia/platform/qnx/camera/bbcamerasession.cpp48
-rw-r--r--src/multimedia/platform/qnx/camera/bbcamerasession_p.h16
-rw-r--r--src/multimedia/platform/qplatformmediaencoder.cpp12
-rw-r--r--src/multimedia/platform/qplatformmediaintegration_p.h2
-rw-r--r--src/multimedia/recording/qmediacapturesession.cpp4
-rw-r--r--src/multimedia/recording/qmediaencoder.cpp6
-rw-r--r--src/multimedia/recording/qmediaencoder.h2
-rw-r--r--src/multimedia/recording/qmediaencodersettings.cpp10
-rw-r--r--src/multimedia/recording/qmediarecorder.cpp502
-rw-r--r--src/multimedia/recording/qmediarecorder.h145
-rw-r--r--src/multimedia/recording/qmediarecorder_p.h73
-rw-r--r--tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp6
-rw-r--r--tests/auto/unit/multimedia/qmediaencoder/CMakeLists.txt4
27 files changed, 90 insertions, 811 deletions
diff --git a/examples/multimedia/audiorecorder/doc/src/audiorecorder.qdoc b/examples/multimedia/audiorecorder/doc/src/audiorecorder.qdoc
index 4d5bdfa0e..4b6357184 100644
--- a/examples/multimedia/audiorecorder/doc/src/audiorecorder.qdoc
+++ b/examples/multimedia/audiorecorder/doc/src/audiorecorder.qdoc
@@ -64,11 +64,11 @@
\endcode
And setup the lists as described above. The text on the record and pause
- buttons are toggled depending on the \l{QMediaRecorder::State}{state} of
+ buttons are toggled depending on the \l{QMediaEncoder::State}{state} of
the \c audioRecorder object. This means that if the state is
- \l{QMediaRecorder::StoppedState} then the button text will be "Record" and
- "Pause". In \l{QMediaRecorder::RecordingState} the record button will have
- the text "Stop", and in \l{QMediaRecorder::PausedState} the pause button
+ \l{QMediaEncoder::StoppedState} then the button text will be "Record" and
+ "Pause". In \l{QMediaEncoder::RecordingState} the record button will have
+ the text "Stop", and in \l{QMediaEncoder::PausedState} the pause button
will have the text "Resume".
Pressing the buttons will also result in a toggle based on the state. If
@@ -76,7 +76,7 @@
\l{QAudioEncoderSettings} based on the values of the selection lists,
will set the encoding settings and container on the \c audioRecorder
object, and start recording using the
- \l{QMediaRecorder::record()}{record()} method.
+ \l{QMediaEncoder::record()}{record()} method.
\code
QAudioEncoderSettings settings;
@@ -95,7 +95,7 @@
\endcode
While recording, the status bar of the application is updated with duration information
- from the \l{QMediaRecorder::durationChanged()}{durationChanged} signal from the
+ from the \l{QMediaEncoder::durationChanged()}{durationChanged} signal from the
\c audioRecorder object.
\code
diff --git a/examples/multimediawidgets/camera/doc/src/camera.qdoc b/examples/multimediawidgets/camera/doc/src/camera.qdoc
index 68e19aac3..8792674b8 100644
--- a/examples/multimediawidgets/camera/doc/src/camera.qdoc
+++ b/examples/multimediawidgets/camera/doc/src/camera.qdoc
@@ -49,7 +49,7 @@ settings.
The Camera class contains an instance of \l {QCamera}, the API class interface to
the hardware. It also has an instance of \l {QCameraImageCapture} to take still images
-and an instance of \l {QMediaRecorder} to record video. It also contains the user
+and an instance of \l {QMediaEncoder} to record video. It also contains the user
interface object.
The Camera constructor does some basic initialization. The camera object is
@@ -59,7 +59,7 @@ the \e{setCamera()} function is called, passing in a \l {QByteArray}.
\e{setCamera()} sets up various connections between the user interface and the functionality
of the Camera class using signals and slots. It also instantiates and initializes the \l {QCamera},
-\l {QCameraImageCapture} and \l {QMediaRecorder} objects mentioned above. The still
+\l {QCameraImageCapture} and \l {QMediaEncoder} objects mentioned above. The still
and video recording visual tabs are enabled and finally the
\l {QCamera::start()}{start()} function of the \l{QCamera} object is called.
@@ -72,7 +72,7 @@ is QCamera::CaptureStillImage, or if the capture mode is for video then one
of two actions will occur. If the recording state shows that we are currently
recording then the \e{stop()} function is called resulting in a call to
\l {QCamera::stop()}, whereas if we are not recording then a video recording
-is started with a call to \l {QMediaRecorder::record()}.
+is started with a call to \l {QMediaEncoder::record()}.
\image camera-example.png
diff --git a/src/multimedia/CMakeLists.txt b/src/multimedia/CMakeLists.txt
index 9021223f9..a23342355 100644
--- a/src/multimedia/CMakeLists.txt
+++ b/src/multimedia/CMakeLists.txt
@@ -57,7 +57,6 @@ qt_internal_add_module(Multimedia
recording/qmediacapturesession.cpp recording/qmediacapturesession.h
recording/qmediaencoder.cpp recording/qmediaencoder.h recording/qmediaencoder_p.h
recording/qmediaencodersettings.cpp recording/qmediaencodersettings.h
- recording/qmediarecorder.cpp recording/qmediarecorder.h recording/qmediarecorder_p.h
video/qabstractvideobuffer.cpp video/qabstractvideobuffer_p.h
video/qmemoryvideobuffer.cpp video/qmemoryvideobuffer_p.h
video/qvideoframe.cpp video/qvideoframe.h
diff --git a/src/multimedia/audio/qaudio.cpp b/src/multimedia/audio/qaudio.cpp
index e45a67868..6fe722514 100644
--- a/src/multimedia/audio/qaudio.cpp
+++ b/src/multimedia/audio/qaudio.cpp
@@ -151,7 +151,7 @@ namespace QAudio
\since 5.8
\sa VolumeScale, QMediaPlayer::setVolume(), QAudioSink::setVolume(),
- QAudioSource::setVolume(), QSoundEffect::setVolume(), QMediaRecorder::setVolume()
+ QAudioSource::setVolume(), QSoundEffect::setVolume(), QMediaEncoder::setVolume()
*/
qreal convertVolume(qreal volume, VolumeScale from, VolumeScale to)
{
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
index f2ed71cf7..82f6ba6a6 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
@@ -43,7 +43,7 @@
#include <QBuffer>
#include "qmediaplaylist.h"
-#include "qmediarecorder.h"
+#include "qmediaencoder.h"
#include "qplatformmediaplayer_p.h"
#include "qmediaplayer.h"
#include "qvideowidget.h"
@@ -71,7 +71,7 @@ private:
QMediaPlayer *player;
QMediaPlaylist *playlist;
QMediaContent video;
- QMediaRecorder *recorder;
+ QMediaEncoder *recorder;
QCamera *camera;
QCameraViewfinder *viewfinder;
QCameraImageCapture *imageCapture;
@@ -132,7 +132,7 @@ void MediaExample::MediaPlayer()
void MediaExample::MediaRecorder()
{
//! [Media recorder]
- recorder = new QMediaRecorder(camera);
+ recorder = new QMediaEncoder(camera);
QMediaEncoderSettings audioSettings(QMediaFormat::MP3);
audioSettings.setQuality(QMediaEncoderSettings::HighQuality);
@@ -147,8 +147,8 @@ void MediaExample::MediaRecorder()
void MediaExample::AudioRecorder()
{
//! [Audio recorder]
- QMediaRecorder recorder;
- recorder.setCaptureMode(QMediaRecorder::AudioOnly);
+ QMediaEncoder recorder;
+ recorder.setCaptureMode(QMediaEncoder::AudioOnly);
QMediaEncoderSettings audioSettings(QMediaFormat::MP3);
audioSettings.setQuality(QMediaEncoderSettings::HighQuality);
diff --git a/src/multimedia/doc/src/audiooverview.qdoc b/src/multimedia/doc/src/audiooverview.qdoc
index ce49e1e98..8adbf8beb 100644
--- a/src/multimedia/doc/src/audiooverview.qdoc
+++ b/src/multimedia/doc/src/audiooverview.qdoc
@@ -53,7 +53,7 @@ You can also put files (even remote URLs) into a playlist:
\snippet multimedia-snippets/media.cpp Audio playlist
\section2 Recording Audio to a File
-For recording audio to a file, the \l {QMediaRecorder} class allows you
+For recording audio to a file, the \l {QMediaEncoder} class allows you
to compress audio data from an input device and record it.
\snippet multimedia-snippets/media.cpp Audio recorder
diff --git a/src/multimedia/doc/src/cameraoverview.qdoc b/src/multimedia/doc/src/cameraoverview.qdoc
index 1ade899b0..bd378bcea 100644
--- a/src/multimedia/doc/src/cameraoverview.qdoc
+++ b/src/multimedia/doc/src/cameraoverview.qdoc
@@ -219,7 +219,7 @@ mediaEncoder being called, this causes the signal \l
recording process can be changed with the \l {QMediaEncoder::record()}{record()},
\l {QMediaEncoder::stop()}{stop()} slots in \l QMediaEncoder.
-On top of the above, QMediaRecorder provides a simple to use, but more limited all-in-one class
+On top of the above, QMediaEncoder provides a simple to use, but more limited all-in-one class
for recording audio and video content.
\section2 Controlling the Imaging Pipeline
diff --git a/src/multimedia/doc/src/changes.qdoc b/src/multimedia/doc/src/changes.qdoc
index 871dc92b5..62e4c72b4 100644
--- a/src/multimedia/doc/src/changes.qdoc
+++ b/src/multimedia/doc/src/changes.qdoc
@@ -41,7 +41,7 @@ Existing code that uses Qt Multimedia from Qt 5 can be ported with limited effor
There are a number of new features in Qt Multimedia:
\list
\li QMediaCaptureSession class as the central object for media capture
-\li Changed QMediaRecorder class to be a high level class for audio/video recording
+\li Changed QMediaEncoder class to be a high level class for audio/video recording
\li new QMediaEncoder class to handle encoding of data produced in a capture session
\li Setting up the desired encodings when recording has changed significantly, see
QMediaEncoderSettings for details
@@ -67,7 +67,7 @@ QMediaEncoderSettings for details
and video outputs may be added in a future release.
\row
\li QAudioRecorder and the Audio QML type
- \li QMediaRecorder and the MediaRecorder QML type provide the same functionality
+ \li QMediaEncoder and the MediaRecorder QML type provide the same functionality
\row
\li QMediaObject and QMediaBindableInterface
\li These classes have been removed in favor of a more direct API for setting up connections
diff --git a/src/multimedia/doc/src/multimedia.qdoc b/src/multimedia/doc/src/multimedia.qdoc
index c554d5898..4dbf2f2d8 100644
--- a/src/multimedia/doc/src/multimedia.qdoc
+++ b/src/multimedia/doc/src/multimedia.qdoc
@@ -138,7 +138,7 @@ For some quick recipes, look at the overviews above and consult this table:
\li \l {Camera Example}{camera},
\l {QML Camera Example}{declarative-camera}
\li \l Camera
- \li QCamera, QMediaRecorder
+ \li QCamera, QMediaEncoder
\row
\li 3D sound sources
\li
diff --git a/src/multimedia/doc/src/qtmultimedia-index.qdoc b/src/multimedia/doc/src/qtmultimedia-index.qdoc
index 5e2f4d98f..86c1dc8c3 100644
--- a/src/multimedia/doc/src/qtmultimedia-index.qdoc
+++ b/src/multimedia/doc/src/qtmultimedia-index.qdoc
@@ -120,7 +120,7 @@
\li QCameraImageCapture
\li Capture still images with a camera.
\row
- \li QMediaRecorder
+ \li QMediaEncoder
\li Record media content from a camera source.
\row
\li QMediaPlayer
diff --git a/src/multimedia/doc/src/videooverview.qdoc b/src/multimedia/doc/src/videooverview.qdoc
index e3fe0175e..ced829a1e 100644
--- a/src/multimedia/doc/src/videooverview.qdoc
+++ b/src/multimedia/doc/src/videooverview.qdoc
@@ -75,7 +75,7 @@ allows you to receive these frames from \l QMediaPlayer and
\l QCamera.
\section2 Recording Video
-You can use the \l QMediaRecorder class as a simple way to record video to disk.
+You can use the \l QMediaEncoder class as a simple way to record video to disk.
For more advances use cases \l QMediaCaptureSession provides a more flexible API.
\section1 Examples
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamermediaencoder.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamermediaencoder.cpp
index 9a9fdfd9e..d9aee8fed 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamermediaencoder.cpp
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamermediaencoder.cpp
@@ -350,7 +350,7 @@ void QGstreamerMediaEncoder::pause()
gstPipeline.dumpGraph("before-pause");
gstEncoder.setState(GST_STATE_PAUSED);
- stateChanged(QMediaRecorder::PausedState);
+ stateChanged(QMediaEncoder::PausedState);
updateStatus();
}
diff --git a/src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol.cpp b/src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol.cpp
index 809e30827..c5df78ece 100644
--- a/src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol.cpp
+++ b/src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol.cpp
@@ -65,8 +65,8 @@ BbCameraMediaRecorderControl::BbCameraMediaRecorderControl(BbCameraSession *sess
: QPlatformMediaEncoder(parent)
, m_session(session)
{
- connect(m_session, SIGNAL(videoStateChanged(QMediaRecorder::State)), this, SIGNAL(stateChanged(QMediaRecorder::State)));
- connect(m_session, SIGNAL(videoStatusChanged(QMediaRecorder::Status)), this, SIGNAL(statusChanged(QMediaRecorder::Status)));
+ connect(m_session, SIGNAL(videoStateChanged(QMediaEncoder::State)), this, SIGNAL(stateChanged(QMediaEncoder::State)));
+ connect(m_session, SIGNAL(videoStatusChanged(QMediaEncoder::Status)), this, SIGNAL(statusChanged(QMediaEncoder::Status)));
connect(m_session, SIGNAL(durationChanged(qint64)), this, SIGNAL(durationChanged(qint64)));
connect(m_session, SIGNAL(actualLocationChanged(QUrl)), this, SIGNAL(actualLocationChanged(QUrl)));
connect(m_session, SIGNAL(videoError(int,QString)), this, SIGNAL(error(int,QString)));
@@ -82,12 +82,12 @@ bool BbCameraMediaRecorderControl::setOutputLocation(const QUrl &location)
return m_session->setOutputLocation(location);
}
-QMediaRecorder::State BbCameraMediaRecorderControl::state() const
+QMediaEncoder::State BbCameraMediaRecorderControl::state() const
{
return m_session->videoState();
}
-QMediaRecorder::Status BbCameraMediaRecorderControl::status() const
+QMediaEncoder::Status BbCameraMediaRecorderControl::status() const
{
return m_session->videoStatus();
}
@@ -103,7 +103,7 @@ bool BbCameraMediaRecorderControl::isMuted() const
const int result = audio_manager_get_input_mute(currentAudioInputDevice(), &muted);
if (result != EOK) {
- emit const_cast<BbCameraMediaRecorderControl*>(this)->error(QMediaRecorder::ResourceError, tr("Unable to retrieve mute status"));
+ emit const_cast<BbCameraMediaRecorderControl*>(this)->error(QMediaEncoder::ResourceError, tr("Unable to retrieve mute status"));
return false;
}
@@ -116,7 +116,7 @@ qreal BbCameraMediaRecorderControl::volume() const
const int result = audio_manager_get_input_level(currentAudioInputDevice(), &level);
if (result != EOK) {
- emit const_cast<BbCameraMediaRecorderControl*>(this)->error(QMediaRecorder::ResourceError, tr("Unable to retrieve audio input volume"));
+ emit const_cast<BbCameraMediaRecorderControl*>(this)->error(QMediaEncoder::ResourceError, tr("Unable to retrieve audio input volume"));
return 0.0;
}
@@ -128,7 +128,7 @@ void BbCameraMediaRecorderControl::applySettings()
m_session->applyVideoSettings();
}
-void BbCameraMediaRecorderControl::setState(QMediaRecorder::State state)
+void BbCameraMediaRecorderControl::setState(QMediaEncoder::State state)
{
m_session->setVideoState(state);
}
@@ -137,7 +137,7 @@ void BbCameraMediaRecorderControl::setMuted(bool muted)
{
const int result = audio_manager_set_input_mute(currentAudioInputDevice(), muted);
if (result != EOK) {
- emit error(QMediaRecorder::ResourceError, tr("Unable to set mute status"));
+ emit error(QMediaEncoder::ResourceError, tr("Unable to set mute status"));
} else {
emit mutedChanged(muted);
}
@@ -147,7 +147,7 @@ void BbCameraMediaRecorderControl::setVolume(qreal volume)
{
const int result = audio_manager_set_input_level(currentAudioInputDevice(), (volume * 100));
if (result != EOK) {
- emit error(QMediaRecorder::ResourceError, tr("Unable to set audio input volume"));
+ emit error(QMediaEncoder::ResourceError, tr("Unable to set audio input volume"));
} else {
emit volumeChanged(volume);
}
diff --git a/src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol_p.h b/src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol_p.h
index 40de8e474..e8d550c81 100644
--- a/src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol_p.h
+++ b/src/multimedia/platform/qnx/camera/bbcameramediarecordercontrol_p.h
@@ -64,15 +64,15 @@ public:
QUrl outputLocation() const override;
bool setOutputLocation(const QUrl &location) override;
- QMediaRecorder::State state() const override;
- QMediaRecorder::Status status() const override;
+ QMediaEncoder::State state() const override;
+ QMediaEncoder::Status status() const override;
qint64 duration() const override;
bool isMuted() const override;
qreal volume() const override;
void applySettings() override;
public Q_SLOTS:
- void setState(QMediaRecorder::State state) override;
+ void setState(QMediaEncoder::State state) override;
void setMuted(bool muted) override;
void setVolume(qreal volume) override;
diff --git a/src/multimedia/platform/qnx/camera/bbcamerasession.cpp b/src/multimedia/platform/qnx/camera/bbcamerasession.cpp
index 623dce93b..ad6e43a49 100644
--- a/src/multimedia/platform/qnx/camera/bbcamerasession.cpp
+++ b/src/multimedia/platform/qnx/camera/bbcamerasession.cpp
@@ -123,8 +123,8 @@ BbCameraSession::BbCameraSession(QObject *parent)
, m_previewIsVideo(true)
, m_surface(0)
, m_lastImageCaptureId(0)
- , m_videoState(QMediaRecorder::StoppedState)
- , m_videoStatus(QMediaRecorder::StoppedStatus)
+ , m_videoState(QMediaEncoder::StoppedState)
+ , m_videoStatus(QMediaEncoder::StoppedStatus)
, m_handle(CAMERA_HANDLE_INVALID)
, m_windowGrabber(new WindowGrabber(this))
{
@@ -418,38 +418,38 @@ bool BbCameraSession::setOutputLocation(const QUrl &location)
return true;
}
-QMediaRecorder::State BbCameraSession::videoState() const
+QMediaEncoder::State BbCameraSession::videoState() const
{
return m_videoState;
}
-void BbCameraSession::setVideoState(QMediaRecorder::State state)
+void BbCameraSession::setVideoState(QMediaEncoder::State state)
{
if (m_videoState == state)
return;
- const QMediaRecorder::State previousState = m_videoState;
+ const QMediaEncoder::State previousState = m_videoState;
- if (previousState == QMediaRecorder::StoppedState) {
- if (state == QMediaRecorder::RecordingState) {
+ if (previousState == QMediaEncoder::StoppedState) {
+ if (state == QMediaEncoder::RecordingState) {
if (startVideoRecording()) {
m_videoState = state;
}
- } else if (state == QMediaRecorder::PausedState) {
+ } else if (state == QMediaEncoder::PausedState) {
// do nothing
}
- } else if (previousState == QMediaRecorder::RecordingState) {
- if (state == QMediaRecorder::StoppedState) {
+ } else if (previousState == QMediaEncoder::RecordingState) {
+ if (state == QMediaEncoder::StoppedState) {
stopVideoRecording();
m_videoState = state;
- } else if (state == QMediaRecorder::PausedState) {
+ } else if (state == QMediaEncoder::PausedState) {
//TODO: (pause) not supported by BB10 API yet
}
- } else if (previousState == QMediaRecorder::PausedState) {
- if (state == QMediaRecorder::StoppedState) {
+ } else if (previousState == QMediaEncoder::PausedState) {
+ if (state == QMediaEncoder::StoppedState) {
stopVideoRecording();
m_videoState = state;
- } else if (state == QMediaRecorder::RecordingState) {
+ } else if (state == QMediaEncoder::RecordingState) {
//TODO: (resume) not supported by BB10 API yet
}
}
@@ -457,7 +457,7 @@ void BbCameraSession::setVideoState(QMediaRecorder::State state)
emit videoStateChanged(m_videoState);
}
-QMediaRecorder::Status BbCameraSession::videoStatus() const
+QMediaEncoder::Status BbCameraSession::videoStatus() const
{
return m_videoStatus;
}
@@ -563,7 +563,7 @@ void BbCameraSession::applyVideoSettings()
if (result != CAMERA_EOK) {
qWarning() << "Unable to apply video settings:" << result;
- emit videoError(QMediaRecorder::ResourceError, tr("Unable to apply video settings"));
+ emit videoError(QMediaEncoder::ResourceError, tr("Unable to apply video settings"));
}
}
@@ -693,8 +693,8 @@ void BbCameraSession::handleVideoRecordingPaused()
void BbCameraSession::handleVideoRecordingResumed()
{
- if (m_videoStatus == QMediaRecorder::StartingStatus) {
- m_videoStatus = QMediaRecorder::RecordingStatus;
+ if (m_videoStatus == QMediaEncoder::StartingStatus) {
+ m_videoStatus = QMediaEncoder::RecordingStatus;
emit videoStatusChanged(m_videoStatus);
m_videoRecordingDuration.restart();
@@ -990,7 +990,7 @@ bool BbCameraSession::startVideoRecording()
{
m_videoRecordingDuration.invalidate();
- m_videoStatus = QMediaRecorder::StartingStatus;
+ m_videoStatus = QMediaEncoder::StartingStatus;
emit videoStatusChanged(m_videoStatus);
if (m_videoOutputLocation.isEmpty())
@@ -1000,10 +1000,10 @@ bool BbCameraSession::startVideoRecording()
const camera_error_t result = camera_start_video(m_handle, QFile::encodeName(m_videoOutputLocation), 0, videoRecordingStatusCallback, this);
if (result != CAMERA_EOK) {
- m_videoStatus = QMediaRecorder::StoppedStatus;
+ m_videoStatus = QMediaEncoder::StoppedStatus;
emit videoStatusChanged(m_videoStatus);
- emit videoError(QMediaRecorder::ResourceError, tr("Unable to start video recording"));
+ emit videoError(QMediaEncoder::ResourceError, tr("Unable to start video recording"));
return false;
}
@@ -1012,15 +1012,15 @@ bool BbCameraSession::startVideoRecording()
void BbCameraSession::stopVideoRecording()
{
- m_videoStatus = QMediaRecorder::FinalizingStatus;
+ m_videoStatus = QMediaEncoder::FinalizingStatus;
emit videoStatusChanged(m_videoStatus);
const camera_error_t result = camera_stop_video(m_handle);
if (result != CAMERA_EOK) {
- emit videoError(QMediaRecorder::ResourceError, tr("Unable to stop video recording"));
+ emit videoError(QMediaEncoder::ResourceError, tr("Unable to stop video recording"));
}
- m_videoStatus = QMediaRecorder::StoppedStatus;
+ m_videoStatus = QMediaEncoder::StoppedStatus;
emit videoStatusChanged(m_videoStatus);
m_videoRecordingDuration.invalidate();
diff --git a/src/multimedia/platform/qnx/camera/bbcamerasession_p.h b/src/multimedia/platform/qnx/camera/bbcamerasession_p.h
index c3db06e3a..1b5b09c91 100644
--- a/src/multimedia/platform/qnx/camera/bbcamerasession_p.h
+++ b/src/multimedia/platform/qnx/camera/bbcamerasession_p.h
@@ -55,7 +55,7 @@
#include <QCamera>
#include <QCameraImageCapture>
#include <QElapsedTimer>
-#include <QMediaRecorder>
+#include <QMediaEncoder>
#include <QMutex>
#include <QObject>
#include <QPointer>
@@ -109,9 +109,9 @@ public:
// media recorder control
QUrl outputLocation() const;
bool setOutputLocation(const QUrl &location);
- QMediaRecorder::State videoState() const;
- void setVideoState(QMediaRecorder::State state);
- QMediaRecorder::Status videoStatus() const;
+ QMediaEncoder::State videoState() const;
+ void setVideoState(QMediaEncoder::State state);
+ QMediaEncoder::Status videoStatus() const;
qint64 duration() const;
void applyVideoSettings();
@@ -142,8 +142,8 @@ Q_SIGNALS:
void imageCaptureError(int id, int error, const QString &errorString);
// media recorder control
- void videoStateChanged(QMediaRecorder::State state);
- void videoStatusChanged(QMediaRecorder::Status status);
+ void videoStateChanged(QMediaEncoder::State state);
+ void videoStatusChanged(QMediaEncoder::Status status);
void durationChanged(qint64 duration);
void actualLocationChanged(const QUrl &location);
void videoError(int error, const QString &errorString);
@@ -192,8 +192,8 @@ private:
QImageEncoderSettings m_imageEncoderSettings;
QString m_videoOutputLocation;
- QMediaRecorder::State m_videoState;
- QMediaRecorder::Status m_videoStatus;
+ QMediaEncoder::State m_videoState;
+ QMediaEncoder::Status m_videoStatus;
QElapsedTimer m_videoRecordingDuration;
QVideoEncoderSettings m_videoEncoderSettings;
diff --git a/src/multimedia/platform/qplatformmediaencoder.cpp b/src/multimedia/platform/qplatformmediaencoder.cpp
index 944c1d944..3995ebf7d 100644
--- a/src/multimedia/platform/qplatformmediaencoder.cpp
+++ b/src/multimedia/platform/qplatformmediaencoder.cpp
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
and record, pause and stop recording via the \l setState() method. It also
provides feedback on the \l {duration()}{duration} of the recording.
- \sa QMediaRecorder
+ \sa QMediaEncoder
*/
@@ -90,13 +90,13 @@ QPlatformMediaEncoder::QPlatformMediaEncoder(QMediaEncoder *parent)
*/
/*!
- \fn QMediaRecorder::State QPlatformMediaEncoder::state() const
+ \fn QMediaEncoder::State QPlatformMediaEncoder::state() const
Return the current recording state.
*/
/*!
- \fn QMediaRecorder::Status QPlatformMediaEncoder::status() const
+ \fn QMediaEncoder::Status QPlatformMediaEncoder::status() const
Return the current recording status.
*/
@@ -108,7 +108,7 @@ QPlatformMediaEncoder::QPlatformMediaEncoder(QMediaEncoder *parent)
*/
/*!
- \fn void QPlatformMediaEncoder::setState(QMediaRecorder::State state)
+ \fn void QPlatformMediaEncoder::setState(QMediaEncoder::State state)
Set the media recorder \a state.
*/
@@ -127,7 +127,7 @@ QPlatformMediaEncoder::QPlatformMediaEncoder(QMediaEncoder *parent)
*/
/*!
- \fn void QPlatformMediaEncoder::stateChanged(QMediaRecorder::State state)
+ \fn void QPlatformMediaEncoder::stateChanged(QMediaEncoder::State state)
Signals that the \a state of a media recorder has changed.
*/
@@ -140,7 +140,7 @@ void QPlatformMediaEncoder::stateChanged(QMediaEncoder::State state)
}
/*!
- \fn void QPlatformMediaEncoder::statusChanged(QMediaRecorder::Status status)
+ \fn void QPlatformMediaEncoder::statusChanged(QMediaEncoder::Status status)
Signals that the \a status of a media recorder has changed.
*/
diff --git a/src/multimedia/platform/qplatformmediaintegration_p.h b/src/multimedia/platform/qplatformmediaintegration_p.h
index 28c447a82..2a4fc740a 100644
--- a/src/multimedia/platform/qplatformmediaintegration_p.h
+++ b/src/multimedia/platform/qplatformmediaintegration_p.h
@@ -51,7 +51,7 @@
//
#include <private/qtmultimediaglobal_p.h>
-#include <qmediarecorder.h>
+#include <qmediaencoder.h>
QT_BEGIN_NAMESPACE
diff --git a/src/multimedia/recording/qmediacapturesession.cpp b/src/multimedia/recording/qmediacapturesession.cpp
index d07db84d2..4c7838440 100644
--- a/src/multimedia/recording/qmediacapturesession.cpp
+++ b/src/multimedia/recording/qmediacapturesession.cpp
@@ -97,10 +97,10 @@ public:
You can capture still images from a camera by setting a QCameraImageCapture object on the capture session,
and record audio/video using a QMediaEncoder.
- If you need a simple class that records media from the default camera and microphone, you can use QMediaRecorder.
+ If you need a simple class that records media from the default camera and microphone, you can use QMediaEncoder.
That class uses a QMediaCaptureSession behind the scene to support audio and video capture.
- \sa QCamera, QAudioDevice, QMediaEncoder, QCameraImageCapture, QMediaRecorder
+ \sa QCamera, QAudioDevice, QMediaEncoder, QCameraImageCapture, QMediaEncoder
*/
/*!
diff --git a/src/multimedia/recording/qmediaencoder.cpp b/src/multimedia/recording/qmediaencoder.cpp
index 57777f8fc..1fcbec29f 100644
--- a/src/multimedia/recording/qmediaencoder.cpp
+++ b/src/multimedia/recording/qmediaencoder.cpp
@@ -306,7 +306,7 @@ void QMediaEncoder::record()
d->control->clearError();
if (d->control && d->captureSession)
- d->control->setState(QMediaRecorder::RecordingState);
+ d->control->setState(QMediaEncoder::RecordingState);
}
/*!
@@ -322,7 +322,7 @@ void QMediaEncoder::pause()
{
Q_D(QMediaEncoder);
if (d->control && d->captureSession)
- d->control->setState(QMediaRecorder::PausedState);
+ d->control->setState(QMediaEncoder::PausedState);
}
/*!
@@ -335,7 +335,7 @@ void QMediaEncoder::stop()
{
Q_D(QMediaEncoder);
if (d->control && d->captureSession)
- d->control->setState(QMediaRecorder::StoppedState);
+ d->control->setState(QMediaEncoder::StoppedState);
}
/*!
diff --git a/src/multimedia/recording/qmediaencoder.h b/src/multimedia/recording/qmediaencoder.h
index 81d8d0a93..0c0e41ed2 100644
--- a/src/multimedia/recording/qmediaencoder.h
+++ b/src/multimedia/recording/qmediaencoder.h
@@ -55,7 +55,7 @@ class QSize;
class QAudioFormat;
class QCamera;
class QCameraDevice;
-class QMediaRecorderService;
+class QMediaEncoderService;
class QAudioEncoderSettings;
class QVideoEncoderSettings;
class QAudioDevice;
diff --git a/src/multimedia/recording/qmediaencodersettings.cpp b/src/multimedia/recording/qmediaencodersettings.cpp
index 833155089..1c24d4241 100644
--- a/src/multimedia/recording/qmediaencodersettings.cpp
+++ b/src/multimedia/recording/qmediaencodersettings.cpp
@@ -55,14 +55,14 @@ QT_BEGIN_NAMESPACE
\ingroup multimedia_recording
A media encoder settings object is used to specify the encoder
- settings used by QMediaRecorder. Settings are selected by
+ settings used by QMediaEncoder. Settings are selected by
constructing a QMediaEncoderSettings object specifying an output file format,
- setting the desired properties and then passing it to a QMediaRecorder instance
- using the QMediaRecorder::setEncoderSettings() function.
+ setting the desired properties and then passing it to a QMediaEncoder instance
+ using the QMediaEncoder::setEncoderSettings() function.
\snippet multimedia-snippets/media.cpp Audio encoder settings
- \sa QMediaRecorder
+ \sa QMediaEncoder
*/
class QMediaEncoderSettingsPrivate : public QSharedData
@@ -201,7 +201,7 @@ void QMediaEncoderSettings::setQuality(Quality quality)
}
/*!
- Resolves the format to a format that is supported by QMediaRecorder.
+ Resolves the format to a format that is supported by QMediaEncoder.
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
diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp
deleted file mode 100644
index a08b4d19e..000000000
--- a/src/multimedia/recording/qmediarecorder.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmediarecorder.h"
-
-#include <qaudiodevice.h>
-#include <qcamera.h>
-#include <qmediadevices.h>
-#include <qmediacapturesession.h>
-#include <qmediaencoder.h>
-#include <qcamera.h>
-#include <qaudioinput.h>
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qurl.h>
-#include <QtCore/qstringlist.h>
-
-QT_BEGIN_NAMESPACE
-
-class QMediaRecorderPrivate
-{
- Q_DECLARE_PUBLIC(QMediaRecorder)
-public:
- QMediaRecorder::CaptureMode mode = QMediaRecorder::AudioOnly;
- QMediaCaptureSession *captureSession = nullptr;
- QCamera *camera = nullptr;
- QMediaEncoder *encoder = nullptr;
- QAudioInput *audioInput = nullptr;
-
- QMediaRecorder *q_ptr = nullptr;
-};
-
-/*!
- \class QMediaRecorder
- \inmodule QtMultimedia
- \ingroup multimedia
- \ingroup multimedia_recording
-
- \brief The QMediaRecorder class is used for the recording of media content.
-
- The QMediaRecorder class is a high level media recording class. It's
- intended to be used as a simple standalone class to record from the default
- camera and microphone.
-
- \snippet multimedia-snippets/media.cpp Media recorder
-
- If you need a more flexible setup, use QMediaCaptureSession.
-
- \sa QMediaCaptureSession
-*/
-
-/*!
- Constructs a media recorder with \a parent and \a mode.
-
- QMediaRecorder will always use the default microphone and camera of the system.
- The CaptureMode \a mode parameter can be used to determine whether the recorder
- should only record audio or also use the camera.
-*/
-
-QMediaRecorder::QMediaRecorder(QObject *parent, CaptureMode mode)
- : QMediaEncoderBase(parent),
- d_ptr(new QMediaRecorderPrivate)
-{
- Q_D(QMediaRecorder);
- d->q_ptr = this;
-
- d->captureSession = new QMediaCaptureSession(this);
- d->audioInput = new QAudioInput(this);
- d->captureSession->setAudioInput(d->audioInput);
- d->encoder = new QMediaEncoder(this);
- d->captureSession->setEncoder(d->encoder);
- setCaptureMode(mode);
-
- connect(d->encoder, &QMediaEncoder::stateChanged, this, &QMediaRecorder::stateChanged);
- connect(d->encoder, &QMediaEncoder::statusChanged, this, &QMediaRecorder::statusChanged);
- connect(d->encoder, &QMediaEncoder::actualLocationChanged, this, &QMediaRecorder::actualLocationChanged);
- connect(d->audioInput, &QAudioInput::mutedChanged, this, &QMediaRecorder::mutedChanged);
- connect(d->audioInput, &QAudioInput::volumeChanged, this, &QMediaRecorder::volumeChanged);
- connect(d->captureSession, &QMediaCaptureSession::videoOutputChanged, this, &QMediaRecorder::videoOutputChanged);
-}
-
-/*!
- Destroys a media recorder object.
-*/
-
-QMediaRecorder::~QMediaRecorder()
-{
- delete d_ptr;
-}
-
-/*!
- \property QMediaRecorder::outputLocation
- \brief the destination location of media content.
-
- Setting the location can fail, for example when the service supports only
- local file system locations but a network URL was passed. If the service
- does not support media recording this setting the output location will
- always fail. If the operation fails an errorOccured signal is emitted.
-
- The \a location can be relative or empty;
- in the latter case the recorder uses the system specific place and file naming scheme.
-*/
-
-/*!
- \property QMediaRecorder::actualLocation
- \brief the actual location of the last media content.
-
- The actual location is usually available after recording starts,
- and reset when new location is set or new recording starts.
-*/
-
-/*!
- Returns true if media recorder service ready to use.
-
- \sa availabilityChanged()
-*/
-bool QMediaRecorder::isAvailable() const
-{
- return d_ptr->encoder->isAvailable();
-}
-
-/*!
- \property QMediaRecorder::captureMode
- \brief The current mode the recorder operates in.
-
- The capture mode defines whether QMediaRecorder will record audio and
- video or audio only.
-
- The capture mode can only be changed while nothing is being recorded.
-*/
-
-QMediaRecorder::CaptureMode QMediaRecorder::captureMode() const
-{
- return d_ptr->mode;
-}
-
-void QMediaRecorder::setCaptureMode(QMediaRecorder::CaptureMode mode)
-{
- if (d_ptr->mode == mode)
- return;
- if (mode == AudioAndVideo) {
- Q_ASSERT(!d_ptr->camera);
- d_ptr->camera = new QCamera(this);
- d_ptr->captureSession->setCamera(d_ptr->camera);
- } else { // AudioOnly
- Q_ASSERT(d_ptr->camera);
- d_ptr->captureSession->setCamera(nullptr);
- delete d_ptr->camera;
- d_ptr->camera = nullptr;
- }
-}
-
-/*!
- Returns the camera object associated with this recording session.
- If the current \l captureMode is \l AudioOnly, a nullptr will be
- returned.
- */
-QCamera *QMediaRecorder::camera() const
-{
- return d_ptr->camera;
-}
-
-QUrl QMediaRecorder::actualLocation() const
-{
- return d_ptr->encoder->actualLocation();
-}
-
-QUrl QMediaRecorder::outputLocation() const
-{
- return d_ptr->encoder->outputLocation();
-}
-
-bool QMediaRecorder::setOutputLocation(const QUrl &location)
-{
- Q_D(QMediaRecorder);
- return d->encoder->setOutputLocation(location);
-}
-
-/*!
- Returns the current media recorder state.
-
- \sa QMediaRecorder::State
-*/
-
-QMediaEncoderBase::State QMediaRecorder::state() const
-{
- return d_ptr->encoder->state();
-}
-
-/*!
- Returns the current media recorder status.
-
- \sa QMediaRecorder::Status
-*/
-
-QMediaEncoderBase::Status QMediaRecorder::status() const
-{
- return d_ptr->encoder->status();
-}
-
-/*!
- Returns the current error state.
-
- \sa errorString()
-*/
-
-QMediaEncoderBase::Error QMediaRecorder::error() const
-{
- return d_ptr->encoder->error();
-}
-
-/*!
- Returns a string describing the current error state.
-
- \sa error()
-*/
-
-QString QMediaRecorder::errorString() const
-{
- return d_ptr->encoder->errorString();
-}
-
-/*!
- \property QMediaRecorder::duration
-
- \brief the recorded media duration in milliseconds.
-*/
-
-qint64 QMediaRecorder::duration() const
-{
- return d_ptr->encoder->duration();
-}
-
-/*!
- \property QMediaRecorder::muted
-
- \brief whether a recording audio stream is muted.
-*/
-
-bool QMediaRecorder::isMuted() const
-{
- return d_ptr->audioInput->isMuted();
-}
-
-void QMediaRecorder::setMuted(bool muted)
-{
- d_ptr->audioInput->setMuted(muted);
-}
-
-/*!
- \property QMediaRecorder::volume
-
- \brief the current recording audio volume.
-
- The volume is scaled linearly from \c 0.0 (silence) to \c 1.0 (full volume). Values outside this
- range will be clamped.
-
- The default volume is \c 1.0.
-
- UI volume controls should usually be scaled nonlinearly. For example, using a logarithmic scale
- will produce linear changes in perceived loudness, which is what a user would normally expect
- from a volume control. See QAudio::convertVolume() for more details.
-*/
-
-qreal QMediaRecorder::volume() const
-{
- return d_ptr->audioInput->volume();
-}
-
-void QMediaRecorder::setVolume(qreal volume)
-{
- d_ptr->audioInput->setVolume(volume);
-}
-
-/*!
- Sets the encoder settings to \a settings.
-
- \sa QMediaEncoderSettings
-*/
-void QMediaRecorder::setEncoderSettings(const QMediaEncoderSettings &settings)
-{
- d_ptr->encoder->setEncoderSettings(settings);
-}
-
-/*!
- Returns the current encoder settings.
-
- \sa QMediaEncoderSettings
-*/
-QMediaEncoderSettings QMediaRecorder::encoderSettings() const
-{
- return d_ptr->encoder->encoderSettings();
-}
-
-/*!
- Start recording.
-
- While the recorder state is changed immediately to QMediaRecorder::RecordingState,
- recording may start asynchronously, with statusChanged(QMediaRecorder::RecordingStatus)
- signal emitted when recording starts.
-
- If recording fails error() signal is emitted
- with recorder state being reset back to QMediaRecorder::StoppedState.
-*/
-
-void QMediaRecorder::record()
-{
- d_ptr->encoder->record();
-}
-
-/*!
- Pause recording.
-
- The recorder state is changed to QMediaRecorder::PausedState.
-
- Depending on platform recording pause may be not supported,
- in this case the recorder state stays unchanged.
-*/
-
-void QMediaRecorder::pause()
-{
- d_ptr->encoder->pause();
-}
-
-/*!
- Stop recording.
-
- The recorder state is changed to QMediaRecorder::StoppedState.
-*/
-
-void QMediaRecorder::stop()
-{
- d_ptr->encoder->stop();
-}
-
-
-/*!
- \property QMediaRecorder::state
- \brief The current state of the media recorder.
-
- The state property represents the user request and is changed synchronously
- during record(), pause() or stop() calls.
- Recorder state may also change asynchronously when recording fails.
-*/
-
-/*!
- \property QMediaRecorder::status
- \brief The current status of the media recorder.
-
- The status is changed asynchronously and represents the actual status
- of media recorder.
-*/
-
-/*!
- \fn QMediaRecorder::stateChanged(State state)
-
- Signals that a media recorder's \a state has changed.
-*/
-
-/*!
- \fn QMediaRecorder::durationChanged(qint64 duration)
-
- Signals that the \a duration of the recorded media has changed.
-*/
-
-/*!
- \fn QMediaRecorder::actualLocationChanged(const QUrl &location)
-
- Signals that the actual \a location of the recorded media has changed.
- This signal is usually emitted when recording starts.
-*/
-
-/*!
- \fn QMediaRecorder::error(QMediaRecorder::Error error)
-
- Signals that an \a error has occurred.
-*/
-
-/*!
- \fn QMediaRecorder::availabilityChanged(bool available)
-
- Signals that the media recorder is now available (if \a available is true), or not.
-*/
-
-/*!
- \fn QMediaRecorder::mutedChanged(bool muted)
-
- Signals that the \a muted state has changed. If true the recording is being muted.
-*/
-
-/*!
- Returns the metaData associated with the recording.
-*/
-QMediaMetaData QMediaRecorder::metaData() const
-{
- return d_ptr->encoder->metaData();
-}
-
-/*!
- Sets the meta data tp \a metaData.
-
- \note To ensure that meta data is set corretly, it should be set before starting the recording.
- Once the recording is stopped, any meta data set will be attached to the next recording.
-*/
-void QMediaRecorder::setMetaData(const QMediaMetaData &metaData)
-{
- d_ptr->encoder->setMetaData(metaData);
-}
-
-void QMediaRecorder::addMetaData(const QMediaMetaData &metaData)
-{
- d_ptr->encoder->addMetaData(metaData);
-}
-
-/*!
- \fn QMediaRecorder::metaDataChanged()
-
- Signals that a media object's meta-data has changed.
-
- If multiple meta-data elements are changed,
- metaDataChanged(const QString &key, const QVariant &value) signal is emitted
- for each of them with metaDataChanged() changed emitted once.
-*/
-
-/*!
- \property QMediaRecorder::audioInput
- \brief the active audio input name.
-
-*/
-
-QMediaCaptureSession *QMediaRecorder::captureSession() const
-{
- Q_D(const QMediaRecorder);
- return d->captureSession;
-}
-
-QObject *QMediaRecorder::videoOutput() const
-{
- return d_ptr->captureSession->videoOutput();
-}
-
-void QMediaRecorder::setVideoOutput(QObject *output)
-{
- d_ptr->captureSession->setVideoOutput(output);
-}
-
-void QMediaRecorder::setVideoSink(QVideoSink *output)
-{
- d_ptr->captureSession->setVideoSink(output);
-}
-
-QVideoSink *QMediaRecorder::videoSink() const
-{
- return d_ptr->captureSession->videoSink();
-}
-
-
-/*!
- \fn QMediaRecorder::videoOutputChanged()
-
- This signal is emitted when the active video output changed.
-*/
-
-QT_END_NAMESPACE
-
-#include "moc_qmediarecorder.cpp"
diff --git a/src/multimedia/recording/qmediarecorder.h b/src/multimedia/recording/qmediarecorder.h
deleted file mode 100644
index cf1827423..000000000
--- a/src/multimedia/recording/qmediarecorder.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMEDIARECORDER_H
-#define QMEDIARECORDER_H
-
-#include <QtMultimedia/qmediaencoder.h>
-
-QT_BEGIN_NAMESPACE
-
-class QVideoSink;
-
-class QMediaRecorderPrivate;
-class Q_MULTIMEDIA_EXPORT QMediaRecorder : public QMediaEncoderBase
-{
- Q_OBJECT
- Q_PROPERTY(QMediaEncoderBase::State state READ state NOTIFY stateChanged)
- Q_PROPERTY(QMediaEncoderBase::Status status READ status NOTIFY statusChanged)
- Q_PROPERTY(qint64 duration READ duration NOTIFY durationChanged)
- Q_PROPERTY(QUrl outputLocation READ outputLocation WRITE setOutputLocation)
- Q_PROPERTY(QUrl actualLocation READ actualLocation NOTIFY actualLocationChanged)
- Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
- Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged)
- Q_PROPERTY(QMediaMetaData metaData READ metaData WRITE setMetaData NOTIFY metaDataChanged)
- Q_PROPERTY(CaptureMode captureMode READ captureMode WRITE setCaptureMode NOTIFY captureModeChanged)
- Q_PROPERTY(QObject *videoOutput READ videoOutput WRITE setVideoOutput NOTIFY videoOutputChanged)
- Q_PROPERTY(QCamera camera READ camera)
-public:
-
- enum CaptureMode {
- AudioOnly,
- AudioAndVideo
- };
-
- QMediaRecorder(QObject *parent = nullptr, CaptureMode mode = AudioOnly);
- ~QMediaRecorder();
-
- bool isAvailable() const;
-
- CaptureMode captureMode() const;
- void setCaptureMode(CaptureMode mode);
-
- // ### Should we expose this, or restrict it to cameraFormat?
- QCamera *camera() const;
-
- QUrl actualLocation() const;
- QUrl outputLocation() const;
- bool setOutputLocation(const QUrl &location);
-
- QMediaEncoderBase::State state() const;
- QMediaEncoderBase::Status status() const;
-
- QMediaEncoderBase::Error error() const;
- QString errorString() const;
-
- qint64 duration() const;
-
- bool isMuted() const;
- qreal volume() const;
-
- void setEncoderSettings(const QMediaEncoderSettings &);
- QMediaEncoderSettings encoderSettings() const;
-
- QMediaMetaData metaData() const;
- void setMetaData(const QMediaMetaData &metaData);
- void addMetaData(const QMediaMetaData &metaData);
-
- QMediaCaptureSession *captureSession() const;
-
- void setVideoOutput(QObject *output);
- QObject *videoOutput() const;
-
- void setVideoSink(QVideoSink *output);
- QVideoSink *videoSink() const;
-
-public Q_SLOTS:
- void record();
- void pause();
- void stop();
- void setMuted(bool muted);
- void setVolume(qreal volume);
-
-Q_SIGNALS:
- void stateChanged(QMediaRecorder::State state);
- void statusChanged(QMediaRecorder::Status status);
- void durationChanged(qint64 duration);
- void mutedChanged(bool muted);
- void volumeChanged(qreal volume);
- void captureModeChanged();
- void videoOutputChanged();
- void actualLocationChanged();
-
- void error(QMediaRecorder::Error error);
-
- void metaDataChanged();
-
-private:
- // This is here to flag an incompatibilities with Qt 5
- QMediaRecorder(QCamera *) = delete;
-
- QMediaRecorderPrivate *d_ptr;
- friend class QMediaCaptureSession;
- Q_DISABLE_COPY(QMediaRecorder)
- Q_DECLARE_PRIVATE(QMediaRecorder)
-};
-
-QT_END_NAMESPACE
-
-#endif // QMEDIARECORDER_H
diff --git a/src/multimedia/recording/qmediarecorder_p.h b/src/multimedia/recording/qmediarecorder_p.h
deleted file mode 100644
index 878658346..000000000
--- a/src/multimedia/recording/qmediarecorder_p.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMEDIARECORDER_P_H
-#define QMEDIARECORDER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qmediarecorder.h"
-#include "qcamera.h"
-#include <QtCore/qurl.h>
-#include <QtCore/qpointer.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPlatformMediaEncoder;
-class QMediaContainerControl;
-class QAudioEncoderSettingsControl;
-class QVideoEncoderSettingsControl;
-class QTimer;
-
-
-#undef Q_DECLARE_NON_CONST_PUBLIC
-
-QT_END_NAMESPACE
-
-#endif
-
diff --git a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
index c9b49b2ab..ac2136eb0 100644
--- a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
+++ b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
@@ -79,7 +79,7 @@ void tst_QAudioRecorder::cleanup()
void tst_QAudioRecorder::testNullControl()
{
- QMediaRecorder source;
+ QMediaEncoder source;
auto *service = mockIntegration->lastCaptureService();
service->hasControls = false;
@@ -97,7 +97,7 @@ void tst_QAudioRecorder::testAudioSource()
void tst_QAudioRecorder::testDevices()
{
-// audiosource = new QMediaRecorder;
+// audiosource = new QMediaEncoder;
// QList<QAudioDevice> devices = mockIntegration->audioInputs();
// QVERIFY(devices.size() > 0);
// QVERIFY(devices.at(0).id() == "device1");
@@ -114,7 +114,7 @@ void tst_QAudioRecorder::testDevices()
void tst_QAudioRecorder::testAvailability()
{
- QMediaRecorder source;
+ QMediaEncoder source;
QVERIFY(source.isAvailable());
}
diff --git a/tests/auto/unit/multimedia/qmediaencoder/CMakeLists.txt b/tests/auto/unit/multimedia/qmediaencoder/CMakeLists.txt
index 566b55a95..71afe08d9 100644
--- a/tests/auto/unit/multimedia/qmediaencoder/CMakeLists.txt
+++ b/tests/auto/unit/multimedia/qmediaencoder/CMakeLists.txt
@@ -1,7 +1,7 @@
-# Generated from qmediarecorder.pro.
+# Generated from QMediaEncoder.pro.
#####################################################################
-## tst_qmediarecorder Test:
+## tst_QMediaEncoder Test:
#####################################################################
qt_internal_add_test(tst_qmediaencoder