summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-02-14 12:07:00 +0100
committerLars Knoll <lars.knoll@qt.io>2021-03-02 14:49:49 +0000
commit3c59d3c008665c7075ad6fb3e7f89a295518036d (patch)
tree9b150ac0548dbc4729c6587934bc7287038ae9b0
parent2e84ea2c3b13d51bb03c0d386daaea23e9e40226 (diff)
Modernize code base
Use clang-modernize to modernize the code base * Use = default where applicable * Use nullptr Change-Id: I88b307e76b7f7dde090354ff4b292cea76f5c60c Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--examples/multimedia/audiodevices/audiodevices.cpp6
-rw-r--r--examples/multimedia/spectrum/app/engine.cpp5
-rw-r--r--examples/multimedia/spectrum/app/levelmeter.cpp5
-rw-r--r--examples/multimedia/spectrum/app/mainwidget.cpp5
-rw-r--r--examples/multimedia/spectrum/app/progressbar.cpp5
-rw-r--r--examples/multimedia/spectrum/app/settingsdialog.cpp5
-rw-r--r--examples/multimedia/spectrum/app/spectrograph.cpp4
-rw-r--r--examples/multimedia/spectrum/app/spectrumanalyser.cpp5
-rw-r--r--examples/multimedia/spectrum/app/tonegeneratordialog.cpp5
-rw-r--r--examples/multimedia/video/snippets/frequencymonitor/frequencymonitor.cpp5
-rw-r--r--examples/multimediawidgets/customvideosurface/customvideoitem/videoitem.cpp4
-rw-r--r--examples/multimediawidgets/player/playlistmodel.cpp4
-rw-r--r--src/imports/multimedia/qdeclarativecameracapture.cpp4
-rw-r--r--src/imports/multimedia/qdeclarativecameraexposure.cpp4
-rw-r--r--src/imports/multimedia/qdeclarativecameraflash.cpp4
-rw-r--r--src/imports/multimedia/qdeclarativecamerafocus.cpp4
-rw-r--r--src/imports/multimedia/qdeclarativecameraimageprocessing.cpp4
-rw-r--r--src/imports/multimedia/qdeclarativetorch.cpp3
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo.cpp19
-rw-r--r--src/multimedia/audio/qsoundeffect.cpp2
-rw-r--r--src/multimedia/audio/qwavedecoder.cpp4
-rw-r--r--src/multimedia/camera/qcamerafocus.cpp21
-rw-r--r--src/multimedia/camera/qcameraimageprocessing.cpp4
-rw-r--r--src/multimedia/camera/qcamerainfo.cpp30
-rw-r--r--src/multimedia/platform/gstreamer/audio/qaudioinput_gstreamer.cpp6
-rw-r--r--src/multimedia/platform/gstreamer/audio/qgstreameraudiodecodercontrol.cpp36
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstappsrc.cpp8
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstreamerbufferprobe.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstreamerbushelper.cpp10
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstreamermediaplayer.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstreamermessage.cpp6
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstreamerplayersession.cpp34
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstreamervideooverlay.cpp10
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstreamervideorendererinterface.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstreamervideowindow.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstutils.cpp6
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstvideorendererplugin.cpp6
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp34
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamercameracontrol.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamercapturesession.cpp48
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp6
-rw-r--r--src/multimedia/platform/gstreamer/qgstreamerformatinfo.cpp4
-rw-r--r--src/multimedia/platform/gstreamer/qgstreamerintegration.cpp5
-rw-r--r--src/multimedia/platform/qplatformmediacapture.cpp5
-rw-r--r--src/multimedia/platform/qplatformmediadevicemanager.cpp8
-rw-r--r--src/multimedia/platform/qplatformmediaintegration.cpp4
-rw-r--r--src/multimedia/playback/qplaylistfileparser.cpp7
-rw-r--r--src/multimedia/qmediadevicemanager.cpp10
-rw-r--r--src/multimedia/qmediastoragelocation.cpp4
-rw-r--r--src/multimedia/qmediatimerange.cpp17
-rw-r--r--src/multimedia/recording/qmediaencodersettings.cpp32
-rw-r--r--src/multimedia/recording/qmediarecorder.cpp2
-rw-r--r--src/multimedia/video/qabstractvideofilter.cpp4
-rw-r--r--src/multimedia/video/qabstractvideosurface.cpp4
-rw-r--r--src/multimedia/video/qimagevideobuffer.cpp4
-rw-r--r--src/multimedia/video/qmemoryvideobuffer.cpp4
-rw-r--r--src/multimedia/video/qvideosurfaceformat.cpp16
-rw-r--r--src/multimedia/video/qvideosurfaces.cpp4
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp4
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_p.cpp4
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_rgb.cpp4
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_texture.cpp8
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_yuv.cpp4
-rw-r--r--src/qtmultimediaquicktools/qsgvideotexture.cpp4
-rw-r--r--tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp5
-rw-r--r--tests/auto/unit/mockbackend/qmockdevicemanager.cpp4
70 files changed, 187 insertions, 391 deletions
diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp
index c624fcb3a..f49f1cb22 100644
--- a/examples/multimedia/audiodevices/audiodevices.cpp
+++ b/examples/multimedia/audiodevices/audiodevices.cpp
@@ -76,7 +76,7 @@ AudioDevicesBase::AudioDevicesBase(QWidget *parent)
setupUi(this);
}
-AudioDevicesBase::~AudioDevicesBase() {}
+AudioDevicesBase::~AudioDevicesBase() = default;
AudioTest::AudioTest(QWidget *parent)
@@ -167,8 +167,8 @@ void AudioTest::deviceChanged(int idx)
sampleFormatBox->clear();
const QList<QAudioFormat::SampleFormat> sampleFormats = m_deviceInfo.supportedSampleFormats();
- for (int i = 0; i < sampleFormats.size(); ++i)
- sampleFormatBox->addItem(toString(sampleFormats.at(i)));
+ for (auto sampleFormat : sampleFormats)
+ sampleFormatBox->addItem(toString(sampleFormat));
if (sampleFormats.size())
m_settings.setSampleFormat(sampleFormats.at(0));
diff --git a/examples/multimedia/spectrum/app/engine.cpp b/examples/multimedia/spectrum/app/engine.cpp
index a90501d3d..6451e940c 100644
--- a/examples/multimedia/spectrum/app/engine.cpp
+++ b/examples/multimedia/spectrum/app/engine.cpp
@@ -135,10 +135,7 @@ Engine::Engine(QObject *parent)
#endif
}
-Engine::~Engine()
-{
-
-}
+Engine::~Engine() = default;
//-----------------------------------------------------------------------------
// Public functions
diff --git a/examples/multimedia/spectrum/app/levelmeter.cpp b/examples/multimedia/spectrum/app/levelmeter.cpp
index f0c66eeb3..f3bd619cd 100644
--- a/examples/multimedia/spectrum/app/levelmeter.cpp
+++ b/examples/multimedia/spectrum/app/levelmeter.cpp
@@ -82,10 +82,7 @@ LevelMeter::LevelMeter(QWidget *parent)
m_redrawTimer->start(RedrawInterval);
}
-LevelMeter::~LevelMeter()
-{
-
-}
+LevelMeter::~LevelMeter() = default;
void LevelMeter::reset()
{
diff --git a/examples/multimedia/spectrum/app/mainwidget.cpp b/examples/multimedia/spectrum/app/mainwidget.cpp
index 7dea3313d..20ce13a3d 100644
--- a/examples/multimedia/spectrum/app/mainwidget.cpp
+++ b/examples/multimedia/spectrum/app/mainwidget.cpp
@@ -103,10 +103,7 @@ MainWidget::MainWidget(QWidget *parent)
connectUi();
}
-MainWidget::~MainWidget()
-{
-
-}
+MainWidget::~MainWidget() = default;
//-----------------------------------------------------------------------------
diff --git a/examples/multimedia/spectrum/app/progressbar.cpp b/examples/multimedia/spectrum/app/progressbar.cpp
index b42816e1c..4ac34b866 100644
--- a/examples/multimedia/spectrum/app/progressbar.cpp
+++ b/examples/multimedia/spectrum/app/progressbar.cpp
@@ -67,10 +67,7 @@ ProgressBar::ProgressBar(QWidget *parent)
#endif
}
-ProgressBar::~ProgressBar()
-{
-
-}
+ProgressBar::~ProgressBar() = default;
void ProgressBar::reset()
{
diff --git a/examples/multimedia/spectrum/app/settingsdialog.cpp b/examples/multimedia/spectrum/app/settingsdialog.cpp
index 541bf1590..455e1dd5a 100644
--- a/examples/multimedia/spectrum/app/settingsdialog.cpp
+++ b/examples/multimedia/spectrum/app/settingsdialog.cpp
@@ -131,10 +131,7 @@ SettingsDialog::SettingsDialog(
setLayout(dialogLayout);
}
-SettingsDialog::~SettingsDialog()
-{
-
-}
+SettingsDialog::~SettingsDialog() = default;
void SettingsDialog::windowFunctionChanged(int index)
{
diff --git a/examples/multimedia/spectrum/app/spectrograph.cpp b/examples/multimedia/spectrum/app/spectrograph.cpp
index 6eaa097fc..2ab1127d7 100644
--- a/examples/multimedia/spectrum/app/spectrograph.cpp
+++ b/examples/multimedia/spectrum/app/spectrograph.cpp
@@ -69,9 +69,7 @@ Spectrograph::Spectrograph(QWidget *parent)
}
Spectrograph::~Spectrograph()
-{
-
-}
+= default;
void Spectrograph::setParams(int numBars, qreal lowFreq, qreal highFreq)
{
diff --git a/examples/multimedia/spectrum/app/spectrumanalyser.cpp b/examples/multimedia/spectrum/app/spectrumanalyser.cpp
index 848aac9d6..4a7b06809 100644
--- a/examples/multimedia/spectrum/app/spectrumanalyser.cpp
+++ b/examples/multimedia/spectrum/app/spectrumanalyser.cpp
@@ -176,10 +176,7 @@ SpectrumAnalyser::SpectrumAnalyser(QObject *parent)
this, &SpectrumAnalyser::calculationComplete);
}
-SpectrumAnalyser::~SpectrumAnalyser()
-{
-
-}
+SpectrumAnalyser::~SpectrumAnalyser() = default;
#ifdef DUMP_SPECTRUMANALYSER
void SpectrumAnalyser::setOutputPath(const QString &outputDir)
diff --git a/examples/multimedia/spectrum/app/tonegeneratordialog.cpp b/examples/multimedia/spectrum/app/tonegeneratordialog.cpp
index 76fe5d2e3..086eba758 100644
--- a/examples/multimedia/spectrum/app/tonegeneratordialog.cpp
+++ b/examples/multimedia/spectrum/app/tonegeneratordialog.cpp
@@ -127,10 +127,7 @@ ToneGeneratorDialog::ToneGeneratorDialog(QWidget *parent)
setLayout(dialogLayout);
}
-ToneGeneratorDialog::~ToneGeneratorDialog()
-{
-
-}
+ToneGeneratorDialog::~ToneGeneratorDialog() = default;
bool ToneGeneratorDialog::isFrequencySweepEnabled() const
{
diff --git a/examples/multimedia/video/snippets/frequencymonitor/frequencymonitor.cpp b/examples/multimedia/video/snippets/frequencymonitor/frequencymonitor.cpp
index d611497fe..5f48cd35e 100644
--- a/examples/multimedia/video/snippets/frequencymonitor/frequencymonitor.cpp
+++ b/examples/multimedia/video/snippets/frequencymonitor/frequencymonitor.cpp
@@ -154,10 +154,7 @@ FrequencyMonitor::FrequencyMonitor(QObject *parent)
d_ptr = new FrequencyMonitorPrivate(this);
}
-FrequencyMonitor::~FrequencyMonitor()
-{
-
-}
+FrequencyMonitor::~FrequencyMonitor() = default;
QString FrequencyMonitor::label() const
{
diff --git a/examples/multimediawidgets/customvideosurface/customvideoitem/videoitem.cpp b/examples/multimediawidgets/customvideosurface/customvideoitem/videoitem.cpp
index 7a0991e4f..b2dc6331d 100644
--- a/examples/multimediawidgets/customvideosurface/customvideoitem/videoitem.cpp
+++ b/examples/multimediawidgets/customvideosurface/customvideoitem/videoitem.cpp
@@ -61,9 +61,7 @@ VideoItem::VideoItem(QGraphicsItem *parent)
{
}
-VideoItem::~VideoItem()
-{
-}
+VideoItem::~VideoItem() = default;
QRectF VideoItem::boundingRect() const
{
diff --git a/examples/multimediawidgets/player/playlistmodel.cpp b/examples/multimediawidgets/player/playlistmodel.cpp
index ed55cecbb..676781b60 100644
--- a/examples/multimediawidgets/player/playlistmodel.cpp
+++ b/examples/multimediawidgets/player/playlistmodel.cpp
@@ -65,9 +65,7 @@ PlaylistModel::PlaylistModel(QObject *parent)
connect(m_playlist.data(), &QMediaPlaylist::mediaChanged, this, &PlaylistModel::changeItems);
}
-PlaylistModel::~PlaylistModel()
-{
-}
+PlaylistModel::~PlaylistModel() = default;
int PlaylistModel::rowCount(const QModelIndex &parent) const
{
diff --git a/src/imports/multimedia/qdeclarativecameracapture.cpp b/src/imports/multimedia/qdeclarativecameracapture.cpp
index c6fe3b970..91cdd9e1d 100644
--- a/src/imports/multimedia/qdeclarativecameracapture.cpp
+++ b/src/imports/multimedia/qdeclarativecameracapture.cpp
@@ -114,9 +114,7 @@ QDeclarativeCameraCapture::QDeclarativeCameraCapture(QCamera *camera)
this, SLOT(_q_cameraStatusChanged(QCamera::Status)));
}
-QDeclarativeCameraCapture::~QDeclarativeCameraCapture()
-{
-}
+QDeclarativeCameraCapture::~QDeclarativeCameraCapture() = default;
/*!
\property QDeclarativeCameraCapture::ready
diff --git a/src/imports/multimedia/qdeclarativecameraexposure.cpp b/src/imports/multimedia/qdeclarativecameraexposure.cpp
index 641b49774..c9a2df57e 100644
--- a/src/imports/multimedia/qdeclarativecameraexposure.cpp
+++ b/src/imports/multimedia/qdeclarativecameraexposure.cpp
@@ -117,9 +117,7 @@ QDeclarativeCameraExposure::QDeclarativeCameraExposure(QCamera *camera, QObject
});
}
-QDeclarativeCameraExposure::~QDeclarativeCameraExposure()
-{
-}
+QDeclarativeCameraExposure::~QDeclarativeCameraExposure() = default;
/*!
\property QDeclarativeCameraExposure::exposureCompensation
diff --git a/src/imports/multimedia/qdeclarativecameraflash.cpp b/src/imports/multimedia/qdeclarativecameraflash.cpp
index 5ce4a5d06..df2f3336b 100644
--- a/src/imports/multimedia/qdeclarativecameraflash.cpp
+++ b/src/imports/multimedia/qdeclarativecameraflash.cpp
@@ -82,9 +82,7 @@ QDeclarativeCameraFlash::QDeclarativeCameraFlash(QCamera *camera, QObject *paren
this, SLOT(_q_cameraStatusChanged(QCamera::Status)));
}
-QDeclarativeCameraFlash::~QDeclarativeCameraFlash()
-{
-}
+QDeclarativeCameraFlash::~QDeclarativeCameraFlash() = default;
/*!
\qmlproperty bool QtMultimedia::CameraFlash::ready
diff --git a/src/imports/multimedia/qdeclarativecamerafocus.cpp b/src/imports/multimedia/qdeclarativecamerafocus.cpp
index d8fb62d9a..5e1d5ee6e 100644
--- a/src/imports/multimedia/qdeclarativecamerafocus.cpp
+++ b/src/imports/multimedia/qdeclarativecamerafocus.cpp
@@ -112,9 +112,7 @@ QDeclarativeCameraFocus::QDeclarativeCameraFocus(QCamera *camera, QObject *paren
});
}
-QDeclarativeCameraFocus::~QDeclarativeCameraFocus()
-{
-}
+QDeclarativeCameraFocus::~QDeclarativeCameraFocus() = default;
/*!
\property QDeclarativeCameraFocus::focusMode
diff --git a/src/imports/multimedia/qdeclarativecameraimageprocessing.cpp b/src/imports/multimedia/qdeclarativecameraimageprocessing.cpp
index a27ff3e0c..33c57f4f4 100644
--- a/src/imports/multimedia/qdeclarativecameraimageprocessing.cpp
+++ b/src/imports/multimedia/qdeclarativecameraimageprocessing.cpp
@@ -96,9 +96,7 @@ QDeclarativeCameraImageProcessing::QDeclarativeCameraImageProcessing(QCamera *ca
});
}
-QDeclarativeCameraImageProcessing::~QDeclarativeCameraImageProcessing()
-{
-}
+QDeclarativeCameraImageProcessing::~QDeclarativeCameraImageProcessing() = default;
/*!
\qmlproperty enumeration QtMultimedia::CameraImageProcessing::whiteBalanceMode
diff --git a/src/imports/multimedia/qdeclarativetorch.cpp b/src/imports/multimedia/qdeclarativetorch.cpp
index efd213e20..a14847642 100644
--- a/src/imports/multimedia/qdeclarativetorch.cpp
+++ b/src/imports/multimedia/qdeclarativetorch.cpp
@@ -83,8 +83,7 @@ QDeclarativeTorch::QDeclarativeTorch(QCamera *camera)
}
QDeclarativeTorch::~QDeclarativeTorch()
-{
-}
+= default;
/*!
\qmlproperty bool QtMultimedia::Torch::enabled
diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp
index c852cdeb4..e9dd05326 100644
--- a/src/multimedia/audio/qaudiodeviceinfo.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo.cpp
@@ -46,9 +46,7 @@
QT_BEGIN_NAMESPACE
-QAudioDeviceInfoPrivate::~QAudioDeviceInfoPrivate()
-{
-}
+QAudioDeviceInfoPrivate::~QAudioDeviceInfoPrivate() = default;
/*!
\class QAudioDeviceInfo
@@ -112,26 +110,17 @@ QAudioDeviceInfo::QAudioDeviceInfo():
/*!
Constructs a copy of \a other.
*/
-QAudioDeviceInfo::QAudioDeviceInfo(const QAudioDeviceInfo& other):
- d(other.d)
-{
-}
+QAudioDeviceInfo::QAudioDeviceInfo(const QAudioDeviceInfo& other) = default;
/*!
Destroy this audio device info.
*/
-QAudioDeviceInfo::~QAudioDeviceInfo()
-{
-}
+QAudioDeviceInfo::~QAudioDeviceInfo() = default;
/*!
Sets the QAudioDeviceInfo object to be equal to \a other.
*/
-QAudioDeviceInfo& QAudioDeviceInfo::operator=(const QAudioDeviceInfo &other)
-{
- d = other.d;
- return *this;
-}
+QAudioDeviceInfo& QAudioDeviceInfo::operator=(const QAudioDeviceInfo &other) = default;
/*!
Returns true if this QAudioDeviceInfo class represents the
diff --git a/src/multimedia/audio/qsoundeffect.cpp b/src/multimedia/audio/qsoundeffect.cpp
index 6e24a2288..974df3139 100644
--- a/src/multimedia/audio/qsoundeffect.cpp
+++ b/src/multimedia/audio/qsoundeffect.cpp
@@ -52,7 +52,7 @@ class QSoundEffectPrivate : public QIODevice
{
public:
QSoundEffectPrivate(QSoundEffect *q, const QAudioDeviceInfo &audioDevice = QAudioDeviceInfo());
- ~QSoundEffectPrivate() {}
+ ~QSoundEffectPrivate() override = default;
qint64 readData(char *data, qint64 len) override;
qint64 writeData(const char *data, qint64 len) override;
diff --git a/src/multimedia/audio/qwavedecoder.cpp b/src/multimedia/audio/qwavedecoder.cpp
index 1507087df..ed5fc900e 100644
--- a/src/multimedia/audio/qwavedecoder.cpp
+++ b/src/multimedia/audio/qwavedecoder.cpp
@@ -91,9 +91,7 @@ QWaveDecoder::QWaveDecoder(QIODevice *device, const QAudioFormat &format, QObjec
{
}
-QWaveDecoder::~QWaveDecoder()
-{
-}
+QWaveDecoder::~QWaveDecoder() = default;
bool QWaveDecoder::open(QIODevice::OpenMode mode)
{
diff --git a/src/multimedia/camera/qcamerafocus.cpp b/src/multimedia/camera/qcamerafocus.cpp
index 6fbec82e9..74d2f4454 100644
--- a/src/multimedia/camera/qcamerafocus.cpp
+++ b/src/multimedia/camera/qcamerafocus.cpp
@@ -121,28 +121,17 @@ QCameraFocusZone::QCameraFocusZone(const QRectF &area, QCameraFocusZone::FocusZo
/*!
* Creates a new QCameraFocusZone as a copy of \a other.
*/
-QCameraFocusZone::QCameraFocusZone(const QCameraFocusZone &other)
- :d(other.d)
-{
-
-}
+QCameraFocusZone::QCameraFocusZone(const QCameraFocusZone &other) = default;
/*!
* Destroys this QCameraFocusZone.
*/
-QCameraFocusZone::~QCameraFocusZone()
-{
-
-}
+QCameraFocusZone::~QCameraFocusZone() = default;
/*!
* Assigns \a other to this QCameraFocusZone.
*/
-QCameraFocusZone& QCameraFocusZone::operator=(const QCameraFocusZone &other)
-{
- d = other.d;
- return *this;
-}
+QCameraFocusZone& QCameraFocusZone::operator=(const QCameraFocusZone &other) = default;
/*!
* Returns true if this focus zone is the same as \a other.
@@ -300,9 +289,7 @@ QCameraFocus::QCameraFocus(QCamera *camera, QCameraControl *cameraControl)
Destroys the camera focus object.
*/
-QCameraFocus::~QCameraFocus()
-{
-}
+QCameraFocus::~QCameraFocus() = default;
/*!
Returns true if focus related settings are supported by this camera.
diff --git a/src/multimedia/camera/qcameraimageprocessing.cpp b/src/multimedia/camera/qcameraimageprocessing.cpp
index 49e77b023..cf5b3d07d 100644
--- a/src/multimedia/camera/qcameraimageprocessing.cpp
+++ b/src/multimedia/camera/qcameraimageprocessing.cpp
@@ -113,9 +113,7 @@ QCameraImageProcessing::QCameraImageProcessing(QCamera *camera, QCameraControl *
Destroys the camera focus object.
*/
-QCameraImageProcessing::~QCameraImageProcessing()
-{
-}
+QCameraImageProcessing::~QCameraImageProcessing() = default;
/*!
diff --git a/src/multimedia/camera/qcamerainfo.cpp b/src/multimedia/camera/qcamerainfo.cpp
index 571b749b0..9c0de17ee 100644
--- a/src/multimedia/camera/qcamerainfo.cpp
+++ b/src/multimedia/camera/qcamerainfo.cpp
@@ -43,20 +43,11 @@
QT_BEGIN_NAMESPACE
-QCameraFormat::QCameraFormat(const QCameraFormat &other)
- : d(other.d)
-{
-}
+QCameraFormat::QCameraFormat(const QCameraFormat &other) = default;
-QCameraFormat &QCameraFormat::operator=(const QCameraFormat &other)
-{
- d = other.d;
- return *this;
-}
+QCameraFormat &QCameraFormat::operator=(const QCameraFormat &other) = default;
-QCameraFormat::~QCameraFormat()
-{
-}
+QCameraFormat::~QCameraFormat() = default;
QVideoFrame::PixelFormat QCameraFormat::pixelFormat() const
{
@@ -118,17 +109,12 @@ QCameraInfo::QCameraInfo() = default;
/*!
Constructs a copy of \a other.
*/
-QCameraInfo::QCameraInfo(const QCameraInfo &other)
- : d(other.d)
-{
-}
+QCameraInfo::QCameraInfo(const QCameraInfo &other) = default;
/*!
Destroys the QCameraInfo.
*/
-QCameraInfo::~QCameraInfo()
-{
-}
+QCameraInfo::~QCameraInfo() = default;
/*!
Returns true if this QCameraInfo is equal to \a other.
@@ -205,11 +191,7 @@ QCameraInfo::QCameraInfo(QCameraInfoPrivate *p)
/*!
Sets the QCameraInfo object to be equal to \a other.
*/
-QCameraInfo& QCameraInfo::operator=(const QCameraInfo& other)
-{
- d = other.d;
- return *this;
-}
+QCameraInfo& QCameraInfo::operator=(const QCameraInfo& other) = default;
/*!
\fn QCameraInfo::operator!=(const QCameraInfo &other) const
diff --git a/src/multimedia/platform/gstreamer/audio/qaudioinput_gstreamer.cpp b/src/multimedia/platform/gstreamer/audio/qaudioinput_gstreamer.cpp
index 60b2a6b83..4689634b4 100644
--- a/src/multimedia/platform/gstreamer/audio/qaudioinput_gstreamer.cpp
+++ b/src/multimedia/platform/gstreamer/audio/qaudioinput_gstreamer.cpp
@@ -159,7 +159,7 @@ bool QGStreamerAudioInput::open()
return false;
}
- gstInput = gst_device_create_element(deviceInfo.gstDevice, NULL);
+ gstInput = gst_device_create_element(deviceInfo.gstDevice, nullptr);
if (!gstInput) {
setError(QAudio::OpenError);
setState(QAudio::StoppedState);
@@ -350,14 +350,14 @@ void QGStreamerAudioInput::reset()
GstElement *QGStreamerAudioInput::createAppSink()
{
- GstElement *sink = gst_element_factory_make("appsink", NULL);
+ GstElement *sink = gst_element_factory_make("appsink", nullptr);
GstAppSink *appSink = reinterpret_cast<GstAppSink *>(sink);
GstAppSinkCallbacks callbacks;
memset(&callbacks, 0, sizeof(callbacks));
callbacks.eos = &eos;
callbacks.new_sample = &new_sample;
- gst_app_sink_set_callbacks(appSink, &callbacks, this, NULL);
+ gst_app_sink_set_callbacks(appSink, &callbacks, this, nullptr);
// gst_app_sink_set_max_buffers(appSink, MAX_BUFFERS_IN_QUEUE);
gst_base_sink_set_sync(GST_BASE_SINK(appSink), FALSE);
diff --git a/src/multimedia/platform/gstreamer/audio/qgstreameraudiodecodercontrol.cpp b/src/multimedia/platform/gstreamer/audio/qgstreameraudiodecodercontrol.cpp
index 123b1bf1e..7c0d5cb87 100644
--- a/src/multimedia/platform/gstreamer/audio/qgstreameraudiodecodercontrol.cpp
+++ b/src/multimedia/platform/gstreamer/audio/qgstreameraudiodecodercontrol.cpp
@@ -75,25 +75,25 @@ QGstreamerAudioDecoderControl::QGstreamerAudioDecoderControl(QObject *parent)
: QAudioDecoderControl(parent),
m_state(QAudioDecoder::StoppedState),
m_pendingState(QAudioDecoder::StoppedState),
- m_busHelper(0),
- m_bus(0),
- m_playbin(0),
- m_outputBin(0),
- m_audioConvert(0),
- m_appSink(0),
+ m_busHelper(nullptr),
+ m_bus(nullptr),
+ m_playbin(nullptr),
+ m_outputBin(nullptr),
+ m_audioConvert(nullptr),
+ m_appSink(nullptr),
#if QT_CONFIG(gstreamer_app)
- m_appSrc(0),
+ m_appSrc(nullptr),
#endif
- mDevice(0),
+ mDevice(nullptr),
m_buffersAvailable(0),
m_position(-1),
m_duration(-1),
m_durationQueries(0)
{
// Create pipeline here
- m_playbin = gst_element_factory_make("playbin", NULL);
+ m_playbin = gst_element_factory_make("playbin", nullptr);
- if (m_playbin != 0) {
+ if (m_playbin != nullptr) {
// Sort out messages
m_bus = gst_element_get_bus(m_playbin);
m_busHelper = new QGstreamerBusHelper(m_bus, this);
@@ -102,7 +102,7 @@ QGstreamerAudioDecoderControl::QGstreamerAudioDecoderControl(QObject *parent)
// Set the rest of the pipeline up
setAudioFlags(true);
- m_audioConvert = gst_element_factory_make("audioconvert", NULL);
+ m_audioConvert = gst_element_factory_make("audioconvert", nullptr);
m_outputBin = gst_bin_new("audio-output-bin");
gst_bin_add(GST_BIN(m_outputBin), m_audioConvert);
@@ -306,11 +306,11 @@ QString QGstreamerAudioDecoderControl::sourceFilename() const
void QGstreamerAudioDecoderControl::setSourceFilename(const QString &fileName)
{
stop();
- mDevice = 0;
+ mDevice = nullptr;
#if QT_CONFIG(gstreamer_app)
if (m_appSrc)
m_appSrc->deleteLater();
- m_appSrc = 0;
+ m_appSrc = nullptr;
#endif
bool isSignalRequired = (mSource != fileName);
@@ -373,7 +373,7 @@ void QGstreamerAudioDecoderControl::start()
} else {
// We want whatever the native audio format is
setAudioFlags(true);
- gst_app_sink_set_caps(m_appSink, NULL);
+ gst_app_sink_set_caps(m_appSink, nullptr);
}
}
@@ -448,7 +448,7 @@ QAudioBuffer QGstreamerAudioDecoderControl::read()
if (buffersAvailable == 1)
emit bufferAvailableChanged(false);
- const char* bufferData = 0;
+ const char* bufferData = nullptr;
int bufferSize = 0;
GstSample *sample = gst_app_sink_pull_sample(m_appSink);
@@ -538,12 +538,12 @@ void QGstreamerAudioDecoderControl::addAppSink()
if (m_appSink)
return;
- m_appSink = (GstAppSink*)gst_element_factory_make("appsink", NULL);
+ m_appSink = (GstAppSink*)gst_element_factory_make("appsink", nullptr);
GstAppSinkCallbacks callbacks;
memset(&callbacks, 0, sizeof(callbacks));
callbacks.new_sample = &new_sample;
- gst_app_sink_set_callbacks(m_appSink, &callbacks, this, NULL);
+ gst_app_sink_set_callbacks(m_appSink, &callbacks, this, nullptr);
gst_app_sink_set_max_buffers(m_appSink, MAX_BUFFERS_IN_QUEUE);
gst_base_sink_set_sync(GST_BASE_SINK(m_appSink), FALSE);
@@ -559,7 +559,7 @@ void QGstreamerAudioDecoderControl::removeAppSink()
gst_element_unlink(m_audioConvert, GST_ELEMENT(m_appSink));
gst_bin_remove(GST_BIN(m_outputBin), GST_ELEMENT(m_appSink));
- m_appSink = 0;
+ m_appSink = nullptr;
}
void QGstreamerAudioDecoderControl::updateDuration()
diff --git a/src/multimedia/platform/gstreamer/common/qgstappsrc.cpp b/src/multimedia/platform/gstreamer/common/qgstappsrc.cpp
index 3c2df339c..9ba6fc09b 100644
--- a/src/multimedia/platform/gstreamer/common/qgstappsrc.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstappsrc.cpp
@@ -60,7 +60,7 @@ bool QGstAppSrc::setup(GstElement* appsrc)
{
if (m_appSrc) {
gst_object_unref(G_OBJECT(m_appSrc));
- m_appSrc = 0;
+ m_appSrc = nullptr;
}
if (!appsrc || (!m_stream && !m_buffer))
@@ -96,12 +96,12 @@ void QGstAppSrc::setStream(QIODevice *stream)
if (m_stream) {
disconnect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady()));
disconnect(m_stream, SIGNAL(destroyed()), this, SLOT(streamDestroyed()));
- m_stream = 0;
+ m_stream = nullptr;
}
if (m_appSrc) {
gst_object_unref(G_OBJECT(m_appSrc));
- m_appSrc = 0;
+ m_appSrc = nullptr;
}
m_dataRequestSize = ~0;
@@ -140,7 +140,7 @@ void QGstAppSrc::onDataReady()
void QGstAppSrc::streamDestroyed()
{
if (sender() == m_stream) {
- m_stream = 0;
+ m_stream = nullptr;
sendEOS();
}
}
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamerbufferprobe.cpp b/src/multimedia/platform/gstreamer/common/qgstreamerbufferprobe.cpp
index 80f656d9f..3af8000bb 100644
--- a/src/multimedia/platform/gstreamer/common/qgstreamerbufferprobe.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstreamerbufferprobe.cpp
@@ -47,9 +47,7 @@ QGstreamerBufferProbe::QGstreamerBufferProbe(Flags flags)
{
}
-QGstreamerBufferProbe::~QGstreamerBufferProbe()
-{
-}
+QGstreamerBufferProbe::~QGstreamerBufferProbe() = default;
void QGstreamerBufferProbe::addProbeToPad(GstPad *pad, bool downstream)
{
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamerbushelper.cpp b/src/multimedia/platform/gstreamer/common/qgstreamerbushelper.cpp
index 059183fb6..699175f64 100644
--- a/src/multimedia/platform/gstreamer/common/qgstreamerbushelper.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstreamerbushelper.cpp
@@ -73,9 +73,9 @@ public:
}
}
- ~QGstreamerBusHelperPrivate()
+ ~QGstreamerBusHelperPrivate() override
{
- m_helper = 0;
+ m_helper = nullptr;
delete m_intervalTimer;
if (m_tag)
@@ -88,7 +88,7 @@ private slots:
void interval()
{
GstMessage* message;
- while ((message = gst_bus_poll(m_bus, GST_MESSAGE_ANY, 0)) != 0) {
+ while ((message = gst_bus_poll(m_bus, GST_MESSAGE_ANY, 0)) != nullptr) {
processMessage(message);
gst_message_unref(message);
}
@@ -162,13 +162,13 @@ QGstreamerBusHelper::QGstreamerBusHelper(GstBus* bus, QObject* parent):
QObject(parent)
{
d = new QGstreamerBusHelperPrivate(this, bus);
- gst_bus_set_sync_handler(bus, (GstBusSyncHandler)syncGstBusFilter, d, 0);
+ gst_bus_set_sync_handler(bus, (GstBusSyncHandler)syncGstBusFilter, d, nullptr);
gst_object_ref(GST_OBJECT(bus));
}
QGstreamerBusHelper::~QGstreamerBusHelper()
{
- gst_bus_set_sync_handler(d->bus(), 0, 0, 0);
+ gst_bus_set_sync_handler(d->bus(), nullptr, nullptr, nullptr);
gst_object_unref(GST_OBJECT(d->bus()));
}
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamermediaplayer.cpp b/src/multimedia/platform/gstreamer/common/qgstreamermediaplayer.cpp
index 2f46023e8..2a4fb269f 100644
--- a/src/multimedia/platform/gstreamer/common/qgstreamermediaplayer.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstreamermediaplayer.cpp
@@ -75,9 +75,7 @@ QGstreamerMediaPlayer::QGstreamerMediaPlayer(QObject *parent)
connect(m_session, &QGstreamerPlayerSession::metaDataChanged, this, &QGstreamerMediaPlayer::metaDataChanged);
}
-QGstreamerMediaPlayer::~QGstreamerMediaPlayer()
-{
-}
+QGstreamerMediaPlayer::~QGstreamerMediaPlayer() = default;
qint64 QGstreamerMediaPlayer::position() const
{
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamermessage.cpp b/src/multimedia/platform/gstreamer/common/qgstreamermessage.cpp
index 82c9542e9..950cc46cb 100644
--- a/src/multimedia/platform/gstreamer/common/qgstreamermessage.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstreamermessage.cpp
@@ -63,7 +63,7 @@ QGstreamerMessage::QGstreamerMessage(QGstreamerMessage const& m):
QGstreamerMessage::~QGstreamerMessage()
{
- if (m_message != 0)
+ if (m_message != nullptr)
gst_message_unref(m_message);
}
@@ -75,10 +75,10 @@ GstMessage* QGstreamerMessage::rawMessage() const
QGstreamerMessage& QGstreamerMessage::operator=(QGstreamerMessage const& rhs)
{
if (rhs.m_message != m_message) {
- if (rhs.m_message != 0)
+ if (rhs.m_message != nullptr)
gst_message_ref(rhs.m_message);
- if (m_message != 0)
+ if (m_message != nullptr)
gst_message_unref(m_message);
m_message = rhs.m_message;
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamerplayersession.cpp b/src/multimedia/platform/gstreamer/common/qgstreamerplayersession.cpp
index d304e5252..15c7da302 100644
--- a/src/multimedia/platform/gstreamer/common/qgstreamerplayersession.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstreamerplayersession.cpp
@@ -151,7 +151,7 @@ void QGstreamerPlayerSession::initPlaybin()
gst_element_add_pad(GST_ELEMENT(m_videoOutputBin), gst_ghost_pad_new("sink", pad));
gst_object_unref(GST_OBJECT(pad));
- if (m_playbin != 0) {
+ if (m_playbin != nullptr) {
// Sort out messages
setBus(gst_element_get_bus(m_playbin));
@@ -275,7 +275,7 @@ void QGstreamerPlayerSession::loadFromUri(const QNetworkRequest &request)
#if QT_CONFIG(gstreamer_app)
if (m_appSrc) {
m_appSrc->deleteLater();
- m_appSrc = 0;
+ m_appSrc = nullptr;
}
#endif
@@ -555,7 +555,7 @@ void QGstreamerPlayerSession::updateVideoRenderer()
if (!m_playbin || !m_videoOutput)
return;
- GstElement *videoSink = 0;
+ GstElement *videoSink = nullptr;
if (m_renderer && m_renderer->isReady())
videoSink = m_renderer->videoSink();
@@ -570,7 +570,7 @@ void QGstreamerPlayerSession::updateVideoRenderer()
#endif
if (m_pendingVideoSink == videoSink ||
- (m_pendingVideoSink == 0 && m_videoSink == videoSink)) {
+ (m_pendingVideoSink == nullptr && m_videoSink == videoSink)) {
#ifdef DEBUG_PLAYBIN
qDebug() << "Video sink has not changed, skip video output reconfiguration";
#endif
@@ -586,7 +586,7 @@ void QGstreamerPlayerSession::updateVideoRenderer()
qDebug() << "The pipeline has not started yet, pending state:" << m_pendingState;
#endif
//the pipeline has not started yet
- m_pendingVideoSink = 0;
+ m_pendingVideoSink = nullptr;
gst_element_set_state(m_videoSink, GST_STATE_NULL);
gst_element_set_state(m_playbin, GST_STATE_NULL);
@@ -600,7 +600,7 @@ void QGstreamerPlayerSession::updateVideoRenderer()
if (!linked)
qWarning() << "Linking video output element failed";
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "show-preroll-frame") != 0) {
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "show-preroll-frame") != nullptr) {
gboolean value = m_displayPrerolledFrame;
g_object_set(G_OBJECT(m_videoSink), "show-preroll-frame", value, nullptr);
}
@@ -698,7 +698,7 @@ void QGstreamerPlayerSession::finishVideoOutputChange()
if (gst_pad_is_blocked(srcPad))
gst_pad_remove_probe(srcPad, this->pad_probe_id);
- m_pendingVideoSink = 0;
+ m_pendingVideoSink = nullptr;
gst_object_unref(GST_OBJECT(srcPad));
return;
}
@@ -709,7 +709,7 @@ void QGstreamerPlayerSession::finishVideoOutputChange()
gst_bin_remove(GST_BIN(m_videoOutputBin), m_videoSink);
m_videoSink = m_pendingVideoSink;
- m_pendingVideoSink = 0;
+ m_pendingVideoSink = nullptr;
gst_bin_add(GST_BIN(m_videoOutputBin), m_videoSink);
@@ -791,7 +791,7 @@ bool QGstreamerPlayerSession::pause()
#endif
if (m_pipeline) {
m_pendingState = QMediaPlayer::PausedState;
- if (m_pendingVideoSink != 0)
+ if (m_pendingVideoSink != nullptr)
return true;
if (gst_element_set_state(m_pipeline, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE) {
@@ -1232,7 +1232,7 @@ void QGstreamerPlayerSession::getStreamsInfo()
int streamIndex = i - m_playbin2StreamOffset[streamType];
- GstTagList *tags = 0;
+ GstTagList *tags = nullptr;
switch (streamType) {
case QMediaStreamsControl::AudioStream:
g_signal_emit_by_name(G_OBJECT(m_playbin), "get-audio-tags", streamIndex, &tags);
@@ -1247,7 +1247,7 @@ void QGstreamerPlayerSession::getStreamsInfo()
break;
}
if (tags && GST_IS_TAG_LIST(tags)) {
- gchar *languageCode = 0;
+ gchar *languageCode = nullptr;
if (gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &languageCode))
streamProperties[QMediaMetaData::Language] = QString::fromUtf8(languageCode);
@@ -1337,7 +1337,7 @@ void QGstreamerPlayerSession::updateDuration()
m_durationQueries = 0;
GstQuery *query = gst_query_new_seeking(GST_FORMAT_TIME);
if (gst_element_query(m_pipeline, query))
- gst_query_parse_seeking(query, 0, &seekable, 0, 0);
+ gst_query_parse_seeking(query, nullptr, &seekable, nullptr, nullptr);
gst_query_unref(query);
}
setSeekable(seekable);
@@ -1357,9 +1357,9 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo
{
Q_UNUSED(p);
- GstElement *source = 0;
+ GstElement *source = nullptr;
g_object_get(o, "source", &source, nullptr);
- if (source == 0)
+ if (source == nullptr)
return;
#ifdef DEBUG_PLAYBIN
@@ -1373,13 +1373,13 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo
// User-Agent - special case, souphhtpsrc will always set something, even if
// defined in extra-headers
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "user-agent") != 0) {
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "user-agent") != nullptr) {
g_object_set(G_OBJECT(source), "user-agent",
self->m_request.rawHeader(userAgentString).constData(), nullptr);
}
// The rest
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "extra-headers") != 0) {
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "extra-headers") != nullptr) {
GstStructure *extras = gst_structure_new_empty("extras");
const auto rawHeaderList = self->m_request.rawHeaderList();
@@ -1535,7 +1535,7 @@ void QGstreamerPlayerSession::showPrerollFrames(bool enabled)
qDebug() << Q_FUNC_INFO << enabled;
#endif
if (enabled != m_displayPrerolledFrame && m_videoSink &&
- g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "show-preroll-frame") != 0) {
+ g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "show-preroll-frame") != nullptr) {
gboolean value = enabled;
g_object_set(G_OBJECT(m_videoSink), "show-preroll-frame", value, nullptr);
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamervideooverlay.cpp b/src/multimedia/platform/gstreamer/common/qgstreamervideooverlay.cpp
index 92bf1324f..0b606974b 100644
--- a/src/multimedia/platform/gstreamer/common/qgstreamervideooverlay.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstreamervideooverlay.cpp
@@ -68,9 +68,7 @@ static constexpr ElementMap elementMap[] =
class QGstreamerSinkProperties
{
public:
- virtual ~QGstreamerSinkProperties()
- {
- }
+ virtual ~QGstreamerSinkProperties() = default;
virtual bool hasShowPrerollFrame() const = 0;
virtual void reset() = 0;
@@ -331,13 +329,13 @@ static bool qt_gst_element_is_functioning(GstElement *element)
static GstElement *findBestVideoSink()
{
- GstElement *choice = 0;
+ GstElement *choice = nullptr;
QString platform = QGuiApplication::platformName();
// We need a native window ID to use the GstVideoOverlay interface.
// Bail out if the Qt platform plugin in use cannot provide a sensible WId.
if (platform != QLatin1String("xcb"))
- return 0;
+ return nullptr;
// First, try some known video sinks, depending on the Qt platform plugin in use.
for (auto i : elementMap) {
@@ -352,7 +350,7 @@ static GstElement *findBestVideoSink()
return choice;
gst_object_unref(choice);
- choice = 0;
+ choice = nullptr;
}
}
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamervideorendererinterface.cpp b/src/multimedia/platform/gstreamer/common/qgstreamervideorendererinterface.cpp
index ae7de06f1..3cf08d79c 100644
--- a/src/multimedia/platform/gstreamer/common/qgstreamervideorendererinterface.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstreamervideorendererinterface.cpp
@@ -39,6 +39,4 @@
#include "qgstreamervideorendererinterface_p.h"
-QGstreamerVideoRendererInterface::~QGstreamerVideoRendererInterface()
-{
-}
+QGstreamerVideoRendererInterface::~QGstreamerVideoRendererInterface() = default;
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamervideowindow.cpp b/src/multimedia/platform/gstreamer/common/qgstreamervideowindow.cpp
index e7e3c5044..a5069fd0f 100644
--- a/src/multimedia/platform/gstreamer/common/qgstreamervideowindow.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstreamervideowindow.cpp
@@ -58,9 +58,7 @@ QGstreamerVideoWindow::QGstreamerVideoWindow(QObject *parent, const QByteArray &
this, &QGstreamerVideoWindow::saturationChanged);
}
-QGstreamerVideoWindow::~QGstreamerVideoWindow()
-{
-}
+QGstreamerVideoWindow::~QGstreamerVideoWindow() = default;
GstElement *QGstreamerVideoWindow::videoSink()
{
diff --git a/src/multimedia/platform/gstreamer/common/qgstutils.cpp b/src/multimedia/platform/gstreamer/common/qgstutils.cpp
index 9baae11b7..ba61be3d2 100644
--- a/src/multimedia/platform/gstreamer/common/qgstutils.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstutils.cpp
@@ -176,7 +176,7 @@ QAudioFormat QGstUtils::audioFormatForSample(GstSample *sample)
GstCaps *QGstUtils::capsForAudioFormat(const QAudioFormat &format)
{
if (!format.isValid())
- return 0;
+ return nullptr;
auto sampleFormat = format.sampleFormat();
return gst_caps_new_simple(
@@ -623,8 +623,8 @@ bool QGstUtils::useOpenGL()
const gchar *qt_gst_element_get_factory_name(GstElement *element)
{
- const gchar *name = 0;
- const GstElementFactory *factory = 0;
+ const gchar *name = nullptr;
+ const GstElementFactory *factory = nullptr;
if (element && (factory = gst_element_get_factory(element)))
name = gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(factory));
diff --git a/src/multimedia/platform/gstreamer/common/qgstvideorendererplugin.cpp b/src/multimedia/platform/gstreamer/common/qgstvideorendererplugin.cpp
index 1b63cbfa8..5828cbd22 100644
--- a/src/multimedia/platform/gstreamer/common/qgstvideorendererplugin.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstvideorendererplugin.cpp
@@ -46,11 +46,11 @@ QGstVideoRendererPlugin::QGstVideoRendererPlugin(QObject *parent) :
{
}
-QGstVideoRenderer::~QGstVideoRenderer() {}
+QGstVideoRenderer::~QGstVideoRenderer() = default;
-QGstVideoRendererInterface::~QGstVideoRendererInterface() {}
+QGstVideoRendererInterface::~QGstVideoRendererInterface() = default;
-QGstVideoRendererPlugin::~QGstVideoRendererPlugin() {}
+QGstVideoRendererPlugin::~QGstVideoRendererPlugin() = default;
QT_END_NAMESPACE
diff --git a/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp b/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp
index 0f930cf02..9afd79a80 100644
--- a/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp
@@ -77,13 +77,9 @@
QT_BEGIN_NAMESPACE
-QGstDefaultVideoRenderer::QGstDefaultVideoRenderer()
-{
-}
+QGstDefaultVideoRenderer::QGstDefaultVideoRenderer() = default;
-QGstDefaultVideoRenderer::~QGstDefaultVideoRenderer()
-{
-}
+QGstDefaultVideoRenderer::~QGstDefaultVideoRenderer() = default;
GstCaps *QGstDefaultVideoRenderer::getCaps(QAbstractVideoSurface *surface)
{
@@ -245,10 +241,10 @@ bool QVideoSurfaceGstDelegate::start(GstCaps *caps)
if (!waitForAsyncEvent(&locker, &m_setupCondition, 1000) && m_startCaps) {
qWarning() << "Failed to start video surface due to main thread blocked.";
gst_caps_unref(m_startCaps);
- m_startCaps = 0;
+ m_startCaps = nullptr;
}
- return m_activeRenderer != 0;
+ return m_activeRenderer != nullptr;
}
void QVideoSurfaceGstDelegate::stop()
@@ -263,7 +259,7 @@ void QVideoSurfaceGstDelegate::stop()
if (m_startCaps) {
gst_caps_unref(m_startCaps);
- m_startCaps = 0;
+ m_startCaps = nullptr;
}
waitForAsyncEvent(&locker, &m_setupCondition, 500);
@@ -295,7 +291,7 @@ void QVideoSurfaceGstDelegate::flush()
QMutexLocker locker(&m_mutex);
m_flush = true;
- m_renderBuffer = 0;
+ m_renderBuffer = nullptr;
m_renderCondition.wakeAll();
notify();
@@ -310,7 +306,7 @@ GstFlowReturn QVideoSurfaceGstDelegate::render(GstBuffer *buffer)
waitForAsyncEvent(&locker, &m_renderCondition, 300);
- m_renderBuffer = 0;
+ m_renderBuffer = nullptr;
return m_renderReturn;
}
@@ -449,7 +445,7 @@ bool QVideoSurfaceGstDelegate::handleEvent(QMutexLocker<QMutex> *locker)
m_stop = false;
if (QGstVideoRenderer * const activePool = m_activeRenderer) {
- m_activeRenderer = 0;
+ m_activeRenderer = nullptr;
locker->unlock();
activePool->stop(m_surface);
@@ -460,7 +456,7 @@ bool QVideoSurfaceGstDelegate::handleEvent(QMutexLocker<QMutex> *locker)
Q_ASSERT(!m_activeRenderer);
GstCaps * const startCaps = m_startCaps;
- m_startCaps = 0;
+ m_startCaps = nullptr;
if (m_renderer && m_surface) {
locker->unlock();
@@ -471,9 +467,9 @@ bool QVideoSurfaceGstDelegate::handleEvent(QMutexLocker<QMutex> *locker)
m_activeRenderer = started
? m_renderer
- : 0;
+ : nullptr;
} else if (QGstVideoRenderer * const activePool = m_activeRenderer) {
- m_activeRenderer = 0;
+ m_activeRenderer = nullptr;
locker->unlock();
activePool->stop(m_surface);
@@ -484,7 +480,7 @@ bool QVideoSurfaceGstDelegate::handleEvent(QMutexLocker<QMutex> *locker)
gst_caps_unref(startCaps);
} else if (m_renderBuffer) {
GstBuffer *buffer = m_renderBuffer;
- m_renderBuffer = 0;
+ m_renderBuffer = nullptr;
m_renderReturn = GST_FLOW_ERROR;
if (m_activeRenderer && m_surface) {
@@ -538,7 +534,7 @@ void QVideoSurfaceGstDelegate::updateSupportedFormats()
{
if (m_surfaceCaps) {
gst_caps_unref(m_surfaceCaps);
- m_surfaceCaps = 0;
+ m_surfaceCaps = nullptr;
}
for (QGstVideoRenderer *pool : qAsConst(m_renderers)) {
@@ -567,7 +563,7 @@ QGstVideoRendererSink *QGstVideoRendererSink::createSink(QAbstractVideoSurface *
{
setSurface(surface);
QGstVideoRendererSink *sink = reinterpret_cast<QGstVideoRendererSink *>(
- g_object_new(QGstVideoRendererSink::get_type(), 0));
+ g_object_new(QGstVideoRendererSink::get_type(), nullptr));
g_signal_connect(G_OBJECT(sink), "notify::show-preroll-frame", G_CALLBACK(handleShowPrerollChange), sink);
@@ -596,7 +592,7 @@ GType QGstVideoRendererSink::get_type()
sizeof(QGstVideoRendererSink), // instance_size
0, // n_preallocs
instance_init, // instance_init
- 0 // value_table
+ nullptr // value_table
};
type = g_type_register_static(
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameracontrol.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameracontrol.cpp
index 3a84e8a5f..79afd2f83 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameracontrol.cpp
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameracontrol.cpp
@@ -67,9 +67,7 @@ QGstreamerCameraControl::QGstreamerCameraControl(QGstreamerCaptureSession *sessi
m_session->setCaptureMode(QGstreamerCaptureSession::AudioAndVideoAndImage);
}
-QGstreamerCameraControl::~QGstreamerCameraControl()
-{
-}
+QGstreamerCameraControl::~QGstreamerCameraControl() = default;
void QGstreamerCameraControl::setState(QCamera::State state)
{
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp
index deddd59c1..399eea0dc 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercaptureservice.cpp
@@ -60,9 +60,7 @@ QGstreamerCaptureService::QGstreamerCaptureService(QMediaRecorder::CaptureMode m
}
}
-QGstreamerCaptureService::~QGstreamerCaptureService()
-{
-}
+QGstreamerCaptureService::~QGstreamerCaptureService() = default;
QCameraControl *QGstreamerCaptureService::cameraControl()
{
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercapturesession.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercapturesession.cpp
index f7ef94165..664618618 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercapturesession.cpp
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercapturesession.cpp
@@ -71,20 +71,20 @@ QGstreamerCaptureSession::QGstreamerCaptureSession(QGstreamerCaptureSession::Cap
m_waitingForEos(false),
m_pipelineMode(EmptyPipeline),
m_captureMode(captureMode),
- m_viewfinderInterface(0),
- m_audioSrc(0),
- m_audioTee(0),
- m_audioPreviewQueue(0),
- m_audioPreview(0),
- m_audioVolume(0),
+ m_viewfinderInterface(nullptr),
+ m_audioSrc(nullptr),
+ m_audioTee(nullptr),
+ m_audioPreviewQueue(nullptr),
+ m_audioPreview(nullptr),
+ m_audioVolume(nullptr),
m_muted(false),
m_volume(1.0),
- m_videoSrc(0),
- m_videoTee(0),
- m_videoPreviewQueue(0),
- m_videoPreview(0),
- m_imageCaptureBin(0),
- m_encodeBin(0),
+ m_videoSrc(nullptr),
+ m_videoTee(nullptr),
+ m_videoPreviewQueue(nullptr),
+ m_videoPreview(nullptr),
+ m_imageCaptureBin(nullptr),
+ m_encodeBin(nullptr),
m_passImage(false),
m_passPrerollImage(false)
{
@@ -135,7 +135,7 @@ static GstEncodingContainerProfile *createContainerProfile(const QMediaEncoderSe
"container_profile",
(gchar *)"custom container profile",
const_cast<GstCaps *>(caps.get()),
- NULL); //preset
+ nullptr); //preset
return profile;
}
@@ -150,7 +150,7 @@ static GstEncodingProfile *createVideoProfile(const QMediaEncoderSettings &setti
GstEncodingVideoProfile *profile = gst_encoding_video_profile_new(
const_cast<GstCaps *>(caps.get()),
nullptr,
- NULL, //restriction
+ nullptr, //restriction
0); //presence
gst_encoding_video_profile_set_pass(profile, 0);
@@ -170,7 +170,7 @@ static GstEncodingProfile *createAudioProfile(const QMediaEncoderSettings &setti
GstEncodingProfile *profile = (GstEncodingProfile *)gst_encoding_audio_profile_new(
const_cast<GstCaps *>(caps.get()),
nullptr, //preset
- NULL, //restriction
+ nullptr, //restriction
0); //presence
return profile;
@@ -237,7 +237,7 @@ GstElement *QGstreamerCaptureSession::buildAudioSrc()
GstElement *QGstreamerCaptureSession::buildAudioPreview()
{
- GstElement *previewElement = 0;
+ GstElement *previewElement = nullptr;
#if 1
previewElement = gst_element_factory_make("fakesink", "audio-preview");
@@ -273,7 +273,7 @@ GstElement *QGstreamerCaptureSession::buildVideoSrc()
GstElement *QGstreamerCaptureSession::buildVideoPreview()
{
- GstElement *previewElement = 0;
+ GstElement *previewElement = nullptr;
if (m_viewfinderInterface) {
GstElement *bin = gst_bin_new("video-preview-bin");
@@ -473,7 +473,7 @@ bool QGstreamerCaptureSession::rebuildGraph(QGstreamerCaptureSession::PipelineMo
REMOVE_ELEMENT(m_encodeBin);
REMOVE_ELEMENT(m_imageCaptureBin);
REMOVE_ELEMENT(m_fileSink);
- m_audioVolume = 0;
+ m_audioVolume = nullptr;
bool ok = true;
@@ -534,7 +534,7 @@ bool QGstreamerCaptureSession::rebuildGraph(QGstreamerCaptureSession::PipelineMo
if (m_captureMode & Audio) {
m_audioSrc = buildAudioSrc();
- ok &= m_audioSrc != 0;
+ ok &= m_audioSrc != nullptr;
gst_bin_add(GST_BIN(m_pipeline), m_audioSrc);
ok &= gst_element_link(m_audioSrc, m_encodeBin);
@@ -542,7 +542,7 @@ bool QGstreamerCaptureSession::rebuildGraph(QGstreamerCaptureSession::PipelineMo
if (m_captureMode & Video) {
m_videoSrc = buildVideoSrc();
- ok &= m_videoSrc != 0;
+ ok &= m_videoSrc != nullptr;
gst_bin_add(GST_BIN(m_pipeline), m_videoSrc);
ok &= gst_element_link(m_videoSrc, m_encodeBin);
@@ -564,11 +564,11 @@ bool QGstreamerCaptureSession::rebuildGraph(QGstreamerCaptureSession::PipelineMo
qWarning() << "Could not link encoder to filesink";
}
- ok &= m_encodeBin != 0;
+ ok &= m_encodeBin != nullptr;
if (ok && (m_captureMode & Video || m_captureMode & Image)) {
m_videoSrc = buildVideoSrc();
- m_videoTee = gst_element_factory_make("tee", NULL);
+ m_videoTee = gst_element_factory_make("tee", nullptr);
ok &= m_videoSrc && m_videoTee;
// ### This causes the whole pipeline to hang for some reason
@@ -601,8 +601,8 @@ bool QGstreamerCaptureSession::rebuildGraph(QGstreamerCaptureSession::PipelineMo
if (ok && m_captureMode & Audio) {
m_audioSrc = buildAudioSrc();
m_audioPreview = buildAudioPreview();
- m_audioTee = gst_element_factory_make("tee", NULL);
- m_audioPreviewQueue = gst_element_factory_make("queue", NULL);
+ m_audioTee = gst_element_factory_make("tee", nullptr);
+ m_audioPreviewQueue = gst_element_factory_make("queue", nullptr);
ok &= m_audioSrc && m_audioPreview && m_audioTee && m_audioPreviewQueue;
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
index a5117b451..cdf882b57 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
@@ -50,9 +50,7 @@ QGstreamerImageCaptureControl::QGstreamerImageCaptureControl(QGstreamerCaptureSe
connect(m_session, SIGNAL(imageSaved(int,QString)), this, SIGNAL(imageSaved(int,QString)));
}
-QGstreamerImageCaptureControl::~QGstreamerImageCaptureControl()
-{
-}
+QGstreamerImageCaptureControl::~QGstreamerImageCaptureControl() = default;
bool QGstreamerImageCaptureControl::isReadyForCapture() const
{
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
index 5c13fccb4..fd231e126 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
@@ -58,9 +58,7 @@ QGstreamerRecorderControl::QGstreamerRecorderControl(QGstreamerCaptureSession *s
m_hasPreviewState = m_session->captureMode() != QGstreamerCaptureSession::Audio;
}
-QGstreamerRecorderControl::~QGstreamerRecorderControl()
-{
-}
+QGstreamerRecorderControl::~QGstreamerRecorderControl() = default;
QUrl QGstreamerRecorderControl::outputLocation() const
{
diff --git a/src/multimedia/platform/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp b/src/multimedia/platform/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp
index 4dc36fca4..9fa541f0d 100644
--- a/src/multimedia/platform/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp
+++ b/src/multimedia/platform/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp
@@ -46,9 +46,7 @@ QGstreamerStreamsControl::QGstreamerStreamsControl(QGstreamerPlayerSession *sess
connect(m_session, SIGNAL(streamsChanged()), SIGNAL(streamsChanged()));
}
-QGstreamerStreamsControl::~QGstreamerStreamsControl()
-{
-}
+QGstreamerStreamsControl::~QGstreamerStreamsControl() = default;
int QGstreamerStreamsControl::streamCount()
{
diff --git a/src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp b/src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp
index f424a9842..3691da6c5 100644
--- a/src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp
+++ b/src/multimedia/platform/gstreamer/qgstreamerdevicemanager.cpp
@@ -81,9 +81,9 @@ QGstreamerDeviceManager::QGstreamerDeviceManager()
monitor = gst_device_monitor_new();
- gst_device_monitor_add_filter (monitor, "Video/Source", NULL);
- gst_device_monitor_add_filter (monitor, "Audio/Source", NULL);
- gst_device_monitor_add_filter (monitor, "Audio/Sink", NULL);
+ gst_device_monitor_add_filter (monitor, "Video/Source", nullptr);
+ gst_device_monitor_add_filter (monitor, "Audio/Source", nullptr);
+ gst_device_monitor_add_filter (monitor, "Audio/Sink", nullptr);
bus = gst_device_monitor_get_bus(monitor);
gst_bus_add_watch(bus, deviceMonitor, this);
diff --git a/src/multimedia/platform/gstreamer/qgstreamerformatinfo.cpp b/src/multimedia/platform/gstreamer/qgstreamerformatinfo.cpp
index 6a5cd9824..8606c0aea 100644
--- a/src/multimedia/platform/gstreamer/qgstreamerformatinfo.cpp
+++ b/src/multimedia/platform/gstreamer/qgstreamerformatinfo.cpp
@@ -329,9 +329,7 @@ QGstreamerFormatInfo::QGstreamerFormatInfo()
imageFormats = getImageFormatList();
}
-QGstreamerFormatInfo::~QGstreamerFormatInfo()
-{
-}
+QGstreamerFormatInfo::~QGstreamerFormatInfo() = default;
QGstMutableCaps QGstreamerFormatInfo::formatCaps(const QMediaFormat &f) const
{
diff --git a/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp b/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp
index ba40ebffb..4a9c54e75 100644
--- a/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp
+++ b/src/multimedia/platform/gstreamer/qgstreamerintegration.cpp
@@ -47,10 +47,7 @@
QT_BEGIN_NAMESPACE
-QGstreamerIntegration::QGstreamerIntegration()
-{
-
-}
+QGstreamerIntegration::QGstreamerIntegration() = default;
QGstreamerIntegration::~QGstreamerIntegration()
{
diff --git a/src/multimedia/platform/qplatformmediacapture.cpp b/src/multimedia/platform/qplatformmediacapture.cpp
index 5f84cbdaa..f6f6270e3 100644
--- a/src/multimedia/platform/qplatformmediacapture.cpp
+++ b/src/multimedia/platform/qplatformmediacapture.cpp
@@ -42,9 +42,6 @@
QT_BEGIN_NAMESPACE
-QPlatformMediaCapture::~QPlatformMediaCapture()
-{
-
-}
+QPlatformMediaCapture::~QPlatformMediaCapture() = default;
QT_END_NAMESPACE
diff --git a/src/multimedia/platform/qplatformmediadevicemanager.cpp b/src/multimedia/platform/qplatformmediadevicemanager.cpp
index e5a61a7b8..53ae652f6 100644
--- a/src/multimedia/platform/qplatformmediadevicemanager.cpp
+++ b/src/multimedia/platform/qplatformmediadevicemanager.cpp
@@ -44,13 +44,9 @@
QT_BEGIN_NAMESPACE
-QPlatformMediaDeviceManager::QPlatformMediaDeviceManager()
-{
-}
+QPlatformMediaDeviceManager::QPlatformMediaDeviceManager() = default;
-QPlatformMediaDeviceManager::~QPlatformMediaDeviceManager()
-{
-}
+QPlatformMediaDeviceManager::~QPlatformMediaDeviceManager() = default;
QAudioDeviceInfo QPlatformMediaDeviceManager::audioInput(const QByteArray &id) const
{
diff --git a/src/multimedia/platform/qplatformmediaintegration.cpp b/src/multimedia/platform/qplatformmediaintegration.cpp
index 06a07ebba..4dca72a17 100644
--- a/src/multimedia/platform/qplatformmediaintegration.cpp
+++ b/src/multimedia/platform/qplatformmediaintegration.cpp
@@ -91,8 +91,6 @@ void QPlatformMediaIntegration::setIntegration(QPlatformMediaIntegration *integr
}
QPlatformMediaIntegration::~QPlatformMediaIntegration()
-{
-
-}
+= default;
QT_END_NAMESPACE
diff --git a/src/multimedia/playback/qplaylistfileparser.cpp b/src/multimedia/playback/qplaylistfileparser.cpp
index 42e8a7601..d684a9853 100644
--- a/src/multimedia/playback/qplaylistfileparser.cpp
+++ b/src/multimedia/playback/qplaylistfileparser.cpp
@@ -71,7 +71,7 @@ public:
}
virtual void abort() { m_aborted = true; }
- virtual ~ParserBase() { }
+ virtual ~ParserBase() = default;
protected:
virtual bool parseLineImpl(int lineIndex, const QString& line, const QUrl& root) = 0;
@@ -430,10 +430,7 @@ QPlaylistFileParser::QPlaylistFileParser(QObject *parent)
}
-QPlaylistFileParser::~QPlaylistFileParser()
-{
-
-}
+QPlaylistFileParser::~QPlaylistFileParser() = default;
QPlaylistFileParser::FileType QPlaylistFileParser::findByMimeType(const QString &mime)
{
diff --git a/src/multimedia/qmediadevicemanager.cpp b/src/multimedia/qmediadevicemanager.cpp
index 840860e5b..d5441df83 100644
--- a/src/multimedia/qmediadevicemanager.cpp
+++ b/src/multimedia/qmediadevicemanager.cpp
@@ -158,18 +158,12 @@ QCameraInfo QMediaDeviceManager::defaultVideoInput()
/*!
\internal
*/
-QMediaDeviceManager::QMediaDeviceManager()
-{
-
-}
+QMediaDeviceManager::QMediaDeviceManager() = default;
/*!
\internal
*/
-QMediaDeviceManager::~QMediaDeviceManager()
-{
-
-}
+QMediaDeviceManager::~QMediaDeviceManager() = default;
QT_END_NAMESPACE
diff --git a/src/multimedia/qmediastoragelocation.cpp b/src/multimedia/qmediastoragelocation.cpp
index c77ad5dba..dd80ae483 100644
--- a/src/multimedia/qmediastoragelocation.cpp
+++ b/src/multimedia/qmediastoragelocation.cpp
@@ -43,9 +43,7 @@
QT_BEGIN_NAMESPACE
-QMediaStorageLocation::QMediaStorageLocation()
-{
-}
+QMediaStorageLocation::QMediaStorageLocation() = default;
void QMediaStorageLocation::addStorageLocation(MediaType type, const QString &location)
{
diff --git a/src/multimedia/qmediatimerange.cpp b/src/multimedia/qmediatimerange.cpp
index 8522e77b2..20e937dbb 100644
--- a/src/multimedia/qmediatimerange.cpp
+++ b/src/multimedia/qmediatimerange.cpp
@@ -349,30 +349,19 @@ QMediaTimeRange::QMediaTimeRange(const QMediaTimeInterval &interval)
Constructs a time range by copying another time \a range.
*/
-QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange &range)
- : d(range.d)
-{
-
-}
+QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange &range) = default;
/*!
\fn QMediaTimeRange::~QMediaTimeRange()
Destructor.
*/
-QMediaTimeRange::~QMediaTimeRange()
-{
-
-}
+QMediaTimeRange::~QMediaTimeRange() = default;
/*!
Takes a copy of the \a other time range and returns itself.
*/
-QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeRange &other)
-{
- d = other.d;
- return *this;
-}
+QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeRange &other) = default;
/*!
Sets the time range to a single continuous interval, \a interval.
diff --git a/src/multimedia/recording/qmediaencodersettings.cpp b/src/multimedia/recording/qmediaencodersettings.cpp
index 37d73d6a3..cc05eecc7 100644
--- a/src/multimedia/recording/qmediaencodersettings.cpp
+++ b/src/multimedia/recording/qmediaencodersettings.cpp
@@ -158,22 +158,11 @@ QMediaEncoderSettings::QMediaEncoderSettings(FileFormat format)
/*!
Creates a copy of the encoder settings object \a other.
*/
-QMediaEncoderSettings::QMediaEncoderSettings(const QMediaEncoderSettings &other)
- : QMediaFormat(other),
- d(other.d)
-{
-}
+QMediaEncoderSettings::QMediaEncoderSettings(const QMediaEncoderSettings &other) = default;
-QMediaEncoderSettings &QMediaEncoderSettings::operator=(const QMediaEncoderSettings &other)
-{
- QMediaFormat::operator=(other);
- d = other.d;
- return *this;
-}
+QMediaEncoderSettings &QMediaEncoderSettings::operator=(const QMediaEncoderSettings &other) = default;
-QMediaEncoderSettings::~QMediaEncoderSettings()
-{
-}
+QMediaEncoderSettings::~QMediaEncoderSettings() = default;
/*!
Returns the encoding mode.
@@ -481,27 +470,18 @@ QImageEncoderSettings::QImageEncoderSettings()
Constructs a copy of the image encoder settings object \a other.
*/
-QImageEncoderSettings::QImageEncoderSettings(const QImageEncoderSettings& other)
- :d(other.d)
-{
-}
+QImageEncoderSettings::QImageEncoderSettings(const QImageEncoderSettings& other) = default;
/*!
Destroys a image encoder settings object.
*/
-QImageEncoderSettings::~QImageEncoderSettings()
-{
-}
+QImageEncoderSettings::~QImageEncoderSettings() = default;
/*!
Assigns the value of \a other to a image encoder settings object.
*/
-QImageEncoderSettings &QImageEncoderSettings::operator=(const QImageEncoderSettings &other)
-{
- d = other.d;
- return *this;
-}
+QImageEncoderSettings &QImageEncoderSettings::operator=(const QImageEncoderSettings &other) = default;
/*!
Determines if \a other is of equal value to a image encoder settings
diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp
index eca237744..dac7b7188 100644
--- a/src/multimedia/recording/qmediarecorder.cpp
+++ b/src/multimedia/recording/qmediarecorder.cpp
@@ -423,7 +423,7 @@ qint64 QMediaRecorder::duration() const
bool QMediaRecorder::isMuted() const
{
- return d_func()->control ? d_func()->control->isMuted() : 0;
+ return d_func()->control ? d_func()->control->isMuted() : false;
}
void QMediaRecorder::setMuted(bool muted)
diff --git a/src/multimedia/video/qabstractvideofilter.cpp b/src/multimedia/video/qabstractvideofilter.cpp
index de6cbad41..7bdee2177 100644
--- a/src/multimedia/video/qabstractvideofilter.cpp
+++ b/src/multimedia/video/qabstractvideofilter.cpp
@@ -256,9 +256,7 @@ public:
/*!
\internal
*/
-QVideoFilterRunnable::~QVideoFilterRunnable()
-{
-}
+QVideoFilterRunnable::~QVideoFilterRunnable() = default;
/*!
Constructs a new QAbstractVideoFilter instance with parent object \a parent.
diff --git a/src/multimedia/video/qabstractvideosurface.cpp b/src/multimedia/video/qabstractvideosurface.cpp
index 8e7d0620d..aa8dcbd0d 100644
--- a/src/multimedia/video/qabstractvideosurface.cpp
+++ b/src/multimedia/video/qabstractvideosurface.cpp
@@ -127,9 +127,7 @@ QAbstractVideoSurface::QAbstractVideoSurface(QObject *parent)
/*!
Destroys a video surface.
*/
-QAbstractVideoSurface::~QAbstractVideoSurface()
-{
-}
+QAbstractVideoSurface::~QAbstractVideoSurface() = default;
/*!
\fn QAbstractVideoSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType type) const
diff --git a/src/multimedia/video/qimagevideobuffer.cpp b/src/multimedia/video/qimagevideobuffer.cpp
index 2602d7d9e..272c31ff6 100644
--- a/src/multimedia/video/qimagevideobuffer.cpp
+++ b/src/multimedia/video/qimagevideobuffer.cpp
@@ -67,9 +67,7 @@ QImageVideoBuffer::QImageVideoBuffer(const QImage &image)
d->image = image;
}
-QImageVideoBuffer::~QImageVideoBuffer()
-{
-}
+QImageVideoBuffer::~QImageVideoBuffer() = default;
QAbstractVideoBuffer::MapMode QImageVideoBuffer::mapMode() const
{
diff --git a/src/multimedia/video/qmemoryvideobuffer.cpp b/src/multimedia/video/qmemoryvideobuffer.cpp
index 164aa6ebc..5b04ff51c 100644
--- a/src/multimedia/video/qmemoryvideobuffer.cpp
+++ b/src/multimedia/video/qmemoryvideobuffer.cpp
@@ -76,9 +76,7 @@ QMemoryVideoBuffer::QMemoryVideoBuffer(const QByteArray &array, int bytesPerLine
/*!
Destroys a system memory allocated video buffer.
*/
-QMemoryVideoBuffer::~QMemoryVideoBuffer()
-{
-}
+QMemoryVideoBuffer::~QMemoryVideoBuffer() = default;
/*!
\reimp
diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp
index e5f69a03d..2fba59744 100644
--- a/src/multimedia/video/qvideosurfaceformat.cpp
+++ b/src/multimedia/video/qvideosurfaceformat.cpp
@@ -194,27 +194,17 @@ QVideoSurfaceFormat::QVideoSurfaceFormat(
/*!
Constructs a copy of \a other.
*/
-QVideoSurfaceFormat::QVideoSurfaceFormat(const QVideoSurfaceFormat &other)
- : d(other.d)
-{
-}
+QVideoSurfaceFormat::QVideoSurfaceFormat(const QVideoSurfaceFormat &other) = default;
/*!
Assigns the values of \a other to this object.
*/
-QVideoSurfaceFormat &QVideoSurfaceFormat::operator =(const QVideoSurfaceFormat &other)
-{
- d = other.d;
-
- return *this;
-}
+QVideoSurfaceFormat &QVideoSurfaceFormat::operator =(const QVideoSurfaceFormat &other) = default;
/*!
Destroys a video stream description.
*/
-QVideoSurfaceFormat::~QVideoSurfaceFormat()
-{
-}
+QVideoSurfaceFormat::~QVideoSurfaceFormat() = default;
/*!
Identifies if a video surface format has a valid pixel format and frame size.
diff --git a/src/multimedia/video/qvideosurfaces.cpp b/src/multimedia/video/qvideosurfaces.cpp
index 7ce1bd932..0583133be 100644
--- a/src/multimedia/video/qvideosurfaces.cpp
+++ b/src/multimedia/video/qvideosurfaces.cpp
@@ -55,9 +55,7 @@ QVideoSurfaces::QVideoSurfaces(const QList<QAbstractVideoSurface *> &s, QObject
}
}
-QVideoSurfaces::~QVideoSurfaces()
-{
-}
+QVideoSurfaces::~QVideoSurfaces() = default;
QList<QVideoFrame::PixelFormat> QVideoSurfaces::supportedPixelFormats(QAbstractVideoBuffer::HandleType type) const
{
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
index 321abd3ec..5ef318a22 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
@@ -394,9 +394,7 @@ QSGVideoItemSurface::QSGVideoItemSurface(QDeclarativeVideoBackend *backend, QObj
{
}
-QSGVideoItemSurface::~QSGVideoItemSurface()
-{
-}
+QSGVideoItemSurface::~QSGVideoItemSurface() = default;
QList<QVideoFrame::PixelFormat> QSGVideoItemSurface::supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType) const
diff --git a/src/qtmultimediaquicktools/qsgvideonode_p.cpp b/src/qtmultimediaquicktools/qsgvideonode_p.cpp
index 8914415dc..9cb81902e 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_p.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_p.cpp
@@ -124,8 +124,6 @@ void QSGVideoNode::setTexturedRectGeometry(const QRectF &rect, const QRectF &tex
markDirty(DirtyGeometry);
}
-QSGVideoNodeFactoryInterface::~QSGVideoNodeFactoryInterface()
-{
-}
+QSGVideoNodeFactoryInterface::~QSGVideoNodeFactoryInterface() = default;
QT_END_NAMESPACE
diff --git a/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp b/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp
index dd6241634..72404c427 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp
@@ -192,9 +192,7 @@ QSGVideoNode_RGB::QSGVideoNode_RGB(const QVideoSurfaceFormat &format) :
setMaterial(m_material);
}
-QSGVideoNode_RGB::~QSGVideoNode_RGB()
-{
-}
+QSGVideoNode_RGB::~QSGVideoNode_RGB() = default;
void QSGVideoNode_RGB::setCurrentFrame(const QVideoFrame &frame, FrameFlags)
{
diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
index 1b09eed98..45469125b 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
@@ -119,9 +119,7 @@ public:
m_texture.reset(new QSGVideoTexture);
}
- ~QSGVideoMaterial_Texture() override
- {
- }
+ ~QSGVideoMaterial_Texture() override = default;
[[nodiscard]] QSGMaterialType *type() const override {
static QSGMaterialType normalType, swizzleType;
@@ -216,9 +214,7 @@ QSGVideoNode_Texture::QSGVideoNode_Texture(const QVideoSurfaceFormat &format) :
setMaterial(m_material);
}
-QSGVideoNode_Texture::~QSGVideoNode_Texture()
-{
-}
+QSGVideoNode_Texture::~QSGVideoNode_Texture() = default;
void QSGVideoNode_Texture::setCurrentFrame(const QVideoFrame &frame, FrameFlags)
{
diff --git a/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp b/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp
index 0df76a5db..5979c4c1c 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_yuv.cpp
@@ -394,9 +394,7 @@ QSGVideoNode_YUV::QSGVideoNode_YUV(const QVideoSurfaceFormat &format) :
setMaterial(m_material);
}
-QSGVideoNode_YUV::~QSGVideoNode_YUV()
-{
-}
+QSGVideoNode_YUV::~QSGVideoNode_YUV() = default;
void QSGVideoNode_YUV::setCurrentFrame(const QVideoFrame &frame, FrameFlags)
{
diff --git a/src/qtmultimediaquicktools/qsgvideotexture.cpp b/src/qtmultimediaquicktools/qsgvideotexture.cpp
index 92b9245cb..1c3ff30f3 100644
--- a/src/qtmultimediaquicktools/qsgvideotexture.cpp
+++ b/src/qtmultimediaquicktools/qsgvideotexture.cpp
@@ -65,9 +65,7 @@ QSGVideoTexture::QSGVideoTexture()
d_ptr->q_ptr = this;
}
-QSGVideoTexture::~QSGVideoTexture()
-{
-}
+QSGVideoTexture::~QSGVideoTexture() = default;
qint64 QSGVideoTexture::comparisonKey() const
{
diff --git a/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp b/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
index b6b998b33..dc7f17487 100644
--- a/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
+++ b/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
@@ -98,7 +98,7 @@ private:
Qt::AspectRatioMode m_aspectRatioMode = Qt::KeepAspectRatio;
QRect m_displayRect;
QSize m_nativeSize;
- bool m_fullScreen = 0;
+ bool m_fullScreen = false;
};
class QtTestVideoObject : public QObject
@@ -122,8 +122,7 @@ public:
}
~tst_QDeclarativeVideoOutputWindow() override
- {
- }
+ = default;
public slots:
void initTestCase();
diff --git a/tests/auto/unit/mockbackend/qmockdevicemanager.cpp b/tests/auto/unit/mockbackend/qmockdevicemanager.cpp
index d41987a34..bac9ea277 100644
--- a/tests/auto/unit/mockbackend/qmockdevicemanager.cpp
+++ b/tests/auto/unit/mockbackend/qmockdevicemanager.cpp
@@ -47,9 +47,7 @@ QMockDeviceManager::QMockDeviceManager()
{
}
-QMockDeviceManager::~QMockDeviceManager()
-{
-}
+QMockDeviceManager::~QMockDeviceManager() = default;
QList<QAudioDeviceInfo> QMockDeviceManager::audioInputs() const
{