summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJochen Seemann <seemann.jochen@gmail.com>2018-07-22 22:19:56 +0200
committerJochen Seemann <seemann.jochen@gmail.com>2019-01-04 22:21:01 +0000
commit2403f8dc6f1f72bab326025a78b98ec5f81a3d34 (patch)
treedcd127d3378716a7788be10865dafa5ca3121a1c /src
parent34d15785600f98faa4a51827b452d6c488e4c10c (diff)
avfoundation: modernize by using nullptr and override
Change-Id: Ifd483f925ed69f0ba35c46facfdb571dea87c1ac Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/avfoundation/camera/avfaudioencodersettingscontrol.h2
-rw-r--r--src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.h12
-rw-r--r--src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.mm2
-rw-r--r--src/plugins/avfoundation/camera/avfcameracontrol.h16
-rw-r--r--src/plugins/avfoundation/camera/avfcameradevicecontrol.h14
-rw-r--r--src/plugins/avfoundation/camera/avfcameradevicecontrol.mm2
-rw-r--r--src/plugins/avfoundation/camera/avfcameraflashcontrol.mm2
-rw-r--r--src/plugins/avfoundation/camera/avfcamerainfocontrol.h6
-rw-r--r--src/plugins/avfoundation/camera/avfcamerametadatacontrol.h12
-rw-r--r--src/plugins/avfoundation/camera/avfcamerarenderercontrol.h6
-rw-r--r--src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm22
-rw-r--r--src/plugins/avfoundation/camera/avfcameraservice.h2
-rw-r--r--src/plugins/avfoundation/camera/avfcameraservice.mm18
-rw-r--r--src/plugins/avfoundation/camera/avfcameraserviceplugin.h14
-rw-r--r--src/plugins/avfoundation/camera/avfcameraserviceplugin.mm2
-rw-r--r--src/plugins/avfoundation/camera/avfcamerasession.h2
-rw-r--r--src/plugins/avfoundation/camera/avfcamerasession.mm4
-rw-r--r--src/plugins/avfoundation/camera/avfcamerautility.h6
-rw-r--r--src/plugins/avfoundation/camera/avfcamerautility.mm6
-rw-r--r--src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm8
-rw-r--r--src/plugins/avfoundation/camera/avfimagecapturecontrol.h12
-rw-r--r--src/plugins/avfoundation/camera/avfmediarecordercontrol.h24
-rw-r--r--src/plugins/avfoundation/camera/avfmediarecordercontrol.mm2
-rw-r--r--src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h4
-rw-r--r--src/plugins/avfoundation/camera/avfmediavideoprobecontrol.h2
-rw-r--r--src/plugins/avfoundation/camera/avfvideoencodersettingscontrol.h4
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfdisplaylink.h4
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfdisplaylink.mm8
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayercontrol.h46
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.h8
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.mm4
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h6
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm10
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.h10
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.mm2
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h10
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm56
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.h2
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm12
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.h2
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.mm30
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.h8
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm26
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideowidget.h6
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideowidget.mm4
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.h30
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.mm4
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.h40
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm6
49 files changed, 270 insertions, 270 deletions
diff --git a/src/plugins/avfoundation/camera/avfaudioencodersettingscontrol.h b/src/plugins/avfoundation/camera/avfaudioencodersettingscontrol.h
index 4ba987e53..94aa6a8f0 100644
--- a/src/plugins/avfoundation/camera/avfaudioencodersettingscontrol.h
+++ b/src/plugins/avfoundation/camera/avfaudioencodersettingscontrol.h
@@ -56,7 +56,7 @@ public:
QStringList supportedAudioCodecs() const override;
QString codecDescription(const QString &codecName) const override;
- QList<int> supportedSampleRates(const QAudioEncoderSettings &settings, bool *continuous = 0) const override;
+ QList<int> supportedSampleRates(const QAudioEncoderSettings &settings, bool *continuous = nullptr) const override;
QAudioEncoderSettings audioSettings() const override;
void setAudioSettings(const QAudioEncoderSettings &settings) override;
diff --git a/src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.h b/src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.h
index 80669d242..a902a71f9 100644
--- a/src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.h
+++ b/src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.h
@@ -54,16 +54,16 @@ class AVFAudioInputSelectorControl : public QAudioInputSelectorControl
{
Q_OBJECT
public:
- AVFAudioInputSelectorControl(AVFCameraService *service, QObject *parent = 0);
+ AVFAudioInputSelectorControl(AVFCameraService *service, QObject *parent = nullptr);
~AVFAudioInputSelectorControl();
- QList<QString> availableInputs() const;
- QString inputDescription(const QString &name) const;
- QString defaultInput() const;
- QString activeInput() const;
+ QList<QString> availableInputs() const override;
+ QString inputDescription(const QString &name) const override;
+ QString defaultInput() const override;
+ QString activeInput() const override;
public Q_SLOTS:
- void setActiveInput(const QString &name);
+ void setActiveInput(const QString &name) override;
public:
//device changed since the last createCaptureDevice()
diff --git a/src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.mm b/src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.mm
index b6228290d..de29fd970 100644
--- a/src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.mm
+++ b/src/plugins/avfoundation/camera/avfaudioinputselectorcontrol.mm
@@ -102,7 +102,7 @@ void AVFAudioInputSelectorControl::setActiveInput(const QString &name)
AVCaptureDevice *AVFAudioInputSelectorControl::createCaptureDevice()
{
m_dirty = false;
- AVCaptureDevice *device = 0;
+ AVCaptureDevice *device = nullptr;
if (!m_activeInput.isEmpty()) {
device = [AVCaptureDevice deviceWithUniqueID:
diff --git a/src/plugins/avfoundation/camera/avfcameracontrol.h b/src/plugins/avfoundation/camera/avfcameracontrol.h
index 7489e6cb3..df371e864 100644
--- a/src/plugins/avfoundation/camera/avfcameracontrol.h
+++ b/src/plugins/avfoundation/camera/avfcameracontrol.h
@@ -53,19 +53,19 @@ class AVFCameraControl : public QCameraControl
{
Q_OBJECT
public:
- AVFCameraControl(AVFCameraService *service, QObject *parent = 0);
+ AVFCameraControl(AVFCameraService *service, QObject *parent = nullptr);
~AVFCameraControl();
- QCamera::State state() const;
- void setState(QCamera::State state);
+ QCamera::State state() const override;
+ void setState(QCamera::State state) override;
- QCamera::Status status() const;
+ QCamera::Status status() const override;
- QCamera::CaptureModes captureMode() const;
- void setCaptureMode(QCamera::CaptureModes);
- bool isCaptureModeSupported(QCamera::CaptureModes mode) const;
+ QCamera::CaptureModes captureMode() const override;
+ void setCaptureMode(QCamera::CaptureModes) override;
+ bool isCaptureModeSupported(QCamera::CaptureModes mode) const override;
- bool canChangeProperty(PropertyChangeType changeType, QCamera::Status status) const;
+ bool canChangeProperty(PropertyChangeType changeType, QCamera::Status status) const override;
private Q_SLOTS:
void updateStatus();
diff --git a/src/plugins/avfoundation/camera/avfcameradevicecontrol.h b/src/plugins/avfoundation/camera/avfcameradevicecontrol.h
index ac84b1983..0a16c0408 100644
--- a/src/plugins/avfoundation/camera/avfcameradevicecontrol.h
+++ b/src/plugins/avfoundation/camera/avfcameradevicecontrol.h
@@ -54,19 +54,19 @@ class AVFCameraDeviceControl : public QVideoDeviceSelectorControl
{
Q_OBJECT
public:
- AVFCameraDeviceControl(AVFCameraService *service, QObject *parent = 0);
+ AVFCameraDeviceControl(AVFCameraService *service, QObject *parent = nullptr);
~AVFCameraDeviceControl();
- int deviceCount() const;
+ int deviceCount() const override;
- QString deviceName(int index) const;
- QString deviceDescription(int index) const;
+ QString deviceName(int index) const override;
+ QString deviceDescription(int index) const override;
- int defaultDevice() const;
- int selectedDevice() const;
+ int defaultDevice() const override;
+ int selectedDevice() const override;
public Q_SLOTS:
- void setSelectedDevice(int index);
+ void setSelectedDevice(int index) override;
public:
//device changed since the last createCaptureDevice()
diff --git a/src/plugins/avfoundation/camera/avfcameradevicecontrol.mm b/src/plugins/avfoundation/camera/avfcameradevicecontrol.mm
index 87180859a..907373b61 100644
--- a/src/plugins/avfoundation/camera/avfcameradevicecontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcameradevicecontrol.mm
@@ -105,7 +105,7 @@ void AVFCameraDeviceControl::setSelectedDevice(int index)
AVCaptureDevice *AVFCameraDeviceControl::createCaptureDevice()
{
m_dirty = false;
- AVCaptureDevice *device = 0;
+ AVCaptureDevice *device = nullptr;
QString deviceId = deviceName(m_selectedDevice);
if (!deviceId.isEmpty()) {
diff --git a/src/plugins/avfoundation/camera/avfcameraflashcontrol.mm b/src/plugins/avfoundation/camera/avfcameraflashcontrol.mm
index 134c88e68..42303ce17 100644
--- a/src/plugins/avfoundation/camera/avfcameraflashcontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcameraflashcontrol.mm
@@ -50,7 +50,7 @@
AVFCameraFlashControl::AVFCameraFlashControl(AVFCameraService *service)
: m_service(service)
- , m_session(0)
+ , m_session(nullptr)
, m_supportedModes(QCameraExposure::FlashOff)
, m_flashMode(QCameraExposure::FlashOff)
{
diff --git a/src/plugins/avfoundation/camera/avfcamerainfocontrol.h b/src/plugins/avfoundation/camera/avfcamerainfocontrol.h
index 806a51cbd..c3aa11918 100644
--- a/src/plugins/avfoundation/camera/avfcamerainfocontrol.h
+++ b/src/plugins/avfoundation/camera/avfcamerainfocontrol.h
@@ -48,10 +48,10 @@ class AVFCameraInfoControl : public QCameraInfoControl
{
Q_OBJECT
public:
- explicit AVFCameraInfoControl(QObject *parent = 0);
+ explicit AVFCameraInfoControl(QObject *parent = nullptr);
- QCamera::Position cameraPosition(const QString &deviceName) const;
- int cameraOrientation(const QString &deviceName) const;
+ QCamera::Position cameraPosition(const QString &deviceName) const override;
+ int cameraOrientation(const QString &deviceName) const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/avfoundation/camera/avfcamerametadatacontrol.h b/src/plugins/avfoundation/camera/avfcamerametadatacontrol.h
index 1b00043d0..cba29c394 100644
--- a/src/plugins/avfoundation/camera/avfcamerametadatacontrol.h
+++ b/src/plugins/avfoundation/camera/avfcamerametadatacontrol.h
@@ -50,15 +50,15 @@ class AVFCameraMetaDataControl : public QMetaDataWriterControl
{
Q_OBJECT
public:
- AVFCameraMetaDataControl(AVFCameraService *service, QObject *parent=0);
+ AVFCameraMetaDataControl(AVFCameraService *service, QObject *parent = nullptr);
virtual ~AVFCameraMetaDataControl();
- bool isMetaDataAvailable() const;
- bool isWritable() const;
+ bool isMetaDataAvailable() const override;
+ bool isWritable() const override;
- QVariant metaData(const QString &key) const;
- void setMetaData(const QString &key, const QVariant &value);
- QStringList availableMetaData() const;
+ QVariant metaData(const QString &key) const override;
+ void setMetaData(const QString &key, const QVariant &value) override;
+ QStringList availableMetaData() const override;
private:
QMap<QString, QVariant> m_tags;
diff --git a/src/plugins/avfoundation/camera/avfcamerarenderercontrol.h b/src/plugins/avfoundation/camera/avfcamerarenderercontrol.h
index e0966a027..3ef3d07d4 100644
--- a/src/plugins/avfoundation/camera/avfcamerarenderercontrol.h
+++ b/src/plugins/avfoundation/camera/avfcamerarenderercontrol.h
@@ -58,11 +58,11 @@ class AVFCameraRendererControl : public QVideoRendererControl
{
Q_OBJECT
public:
- AVFCameraRendererControl(QObject *parent = 0);
+ AVFCameraRendererControl(QObject *parent = nullptr);
~AVFCameraRendererControl();
- QAbstractVideoSurface *surface() const;
- void setSurface(QAbstractVideoSurface *surface);
+ QAbstractVideoSurface *surface() const override;
+ void setSurface(QAbstractVideoSurface *surface) override;
void configureAVCaptureSession(AVFCameraSession *cameraSession);
void syncHandleViewfinderFrame(const QVideoFrame &frame);
diff --git a/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm b/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
index e4f234b7e..2ba5ab2b9 100644
--- a/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
@@ -65,7 +65,7 @@ public:
: QAbstractPlanarVideoBuffer(renderer->supportsTextures()
&& CVPixelBufferGetPixelFormatType(buffer) == kCVPixelFormatType_32BGRA
? GLTextureHandle : NoHandle)
- , m_texture(0)
+ , m_texture(nullptr)
, m_renderer(renderer)
#endif
, m_buffer(buffer)
@@ -117,8 +117,8 @@ public:
}
if (data) {
- data[0] = (uchar *)CVPixelBufferGetBaseAddressOfPlane(m_buffer, 0);
- data[1] = (uchar *)CVPixelBufferGetBaseAddressOfPlane(m_buffer, 1);
+ data[0] = static_cast<uchar*>(CVPixelBufferGetBaseAddressOfPlane(m_buffer, 0));
+ data[1] = static_cast<uchar*>(CVPixelBufferGetBaseAddressOfPlane(m_buffer, 1));
}
m_mode = mode;
@@ -140,9 +140,9 @@ public:
*bytesPerLine = CVPixelBufferGetBytesPerRow(m_buffer);
m_mode = mode;
- return (uchar*)CVPixelBufferGetBaseAddress(m_buffer);
+ return static_cast<uchar*>(CVPixelBufferGetBaseAddress(m_buffer));
} else {
- return 0;
+ return nullptr;
}
}
@@ -163,9 +163,9 @@ public:
if (!m_renderer->m_textureCache) {
CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault,
- NULL,
+ nullptr,
[EAGLContext currentContext],
- NULL,
+ nullptr,
&m_renderer->m_textureCache);
if (err != kCVReturnSuccess)
@@ -178,7 +178,7 @@ public:
CVReturn err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault,
m_renderer->m_textureCache,
m_buffer,
- NULL,
+ nullptr,
GL_TEXTURE_2D,
GL_RGBA,
CVPixelBufferGetWidth(m_buffer),
@@ -266,11 +266,11 @@ private:
AVFCameraRendererControl::AVFCameraRendererControl(QObject *parent)
: QVideoRendererControl(parent)
- , m_surface(0)
+ , m_surface(nullptr)
, m_supportsTextures(false)
, m_needsHorizontalMirroring(false)
#ifdef Q_OS_IOS
- , m_textureCache(0)
+ , m_textureCache(nullptr)
#endif
{
m_viewfinderFramesDelegate = [[AVFCaptureFramesDelegate alloc] initWithRenderer:this];
@@ -317,7 +317,7 @@ void AVFCameraRendererControl::configureAVCaptureSession(AVFCameraSession *camer
m_videoDataOutput = [[[AVCaptureVideoDataOutput alloc] init] autorelease];
// Configure video output
- m_delegateQueue = dispatch_queue_create("vf_queue", NULL);
+ m_delegateQueue = dispatch_queue_create("vf_queue", nullptr);
[m_videoDataOutput
setSampleBufferDelegate:m_viewfinderFramesDelegate
queue:m_delegateQueue];
diff --git a/src/plugins/avfoundation/camera/avfcameraservice.h b/src/plugins/avfoundation/camera/avfcameraservice.h
index 9ce637ee3..2969882b0 100644
--- a/src/plugins/avfoundation/camera/avfcameraservice.h
+++ b/src/plugins/avfoundation/camera/avfcameraservice.h
@@ -75,7 +75,7 @@ class AVFCameraService : public QMediaService
{
Q_OBJECT
public:
- AVFCameraService(QObject *parent = 0);
+ AVFCameraService(QObject *parent = nullptr);
~AVFCameraService();
QMediaControl* requestControl(const char *name);
diff --git a/src/plugins/avfoundation/camera/avfcameraservice.mm b/src/plugins/avfoundation/camera/avfcameraservice.mm
index 71ea31e5b..33b4b72aa 100644
--- a/src/plugins/avfoundation/camera/avfcameraservice.mm
+++ b/src/plugins/avfoundation/camera/avfcameraservice.mm
@@ -74,7 +74,7 @@ QT_USE_NAMESPACE
AVFCameraService::AVFCameraService(QObject *parent):
QMediaService(parent),
- m_videoOutput(0)
+ m_videoOutput(nullptr)
{
m_session = new AVFCameraSession(this);
m_cameraControl = new AVFCameraControl(this);
@@ -93,12 +93,12 @@ AVFCameraService::AVFCameraService(QObject *parent):
#endif
m_imageCaptureControl = new AVFImageCaptureControl(this);
m_cameraFocusControl = new AVFCameraFocusControl(this);
- m_cameraExposureControl = 0;
+ m_cameraExposureControl = nullptr;
#ifdef Q_OS_IOS
m_cameraExposureControl = new AVFCameraExposureControl(this);
#endif
- m_cameraZoomControl = 0;
+ m_cameraZoomControl = nullptr;
#ifdef Q_OS_IOS
m_cameraZoomControl = new AVFCameraZoomControl(this);
#endif
@@ -120,9 +120,9 @@ AVFCameraService::~AVFCameraService()
#endif
if (m_videoOutput) {
- m_session->setVideoOutput(0);
+ m_session->setVideoOutput(nullptr);
delete m_videoOutput;
- m_videoOutput = 0;
+ m_videoOutput = nullptr;
}
//delete controls before session,
@@ -199,7 +199,7 @@ QMediaControl *AVFCameraService::requestControl(const char *name)
return m_mediaContainerControl;
if (qstrcmp(name,QMediaVideoProbeControl_iid) == 0) {
- AVFMediaVideoProbeControl *videoProbe = 0;
+ AVFMediaVideoProbeControl *videoProbe = nullptr;
videoProbe = new AVFMediaVideoProbeControl(this);
m_session->addProbe(videoProbe);
return videoProbe;
@@ -220,7 +220,7 @@ QMediaControl *AVFCameraService::requestControl(const char *name)
}
}
- return 0;
+ return nullptr;
}
void AVFCameraService::releaseControl(QMediaControl *control)
@@ -230,9 +230,9 @@ void AVFCameraService::releaseControl(QMediaControl *control)
m_session->removeProbe(videoProbe);
delete videoProbe;
} else if (m_videoOutput == control) {
- m_session->setVideoOutput(0);
+ m_session->setVideoOutput(nullptr);
delete m_videoOutput;
- m_videoOutput = 0;
+ m_videoOutput = nullptr;
}
}
diff --git a/src/plugins/avfoundation/camera/avfcameraserviceplugin.h b/src/plugins/avfoundation/camera/avfcameraserviceplugin.h
index aec9767a7..bd5f83249 100644
--- a/src/plugins/avfoundation/camera/avfcameraserviceplugin.h
+++ b/src/plugins/avfoundation/camera/avfcameraserviceplugin.h
@@ -60,15 +60,15 @@ class AVFServicePlugin : public QMediaServiceProviderPlugin,
public:
AVFServicePlugin();
- QMediaService* create(QString const& key);
- void release(QMediaService *service);
+ QMediaService* create(QString const &key) override;
+ void release(QMediaService *service) override;
- QByteArray defaultDevice(const QByteArray &service) const;
- QList<QByteArray> devices(const QByteArray &service) const;
- QString deviceDescription(const QByteArray &service, const QByteArray &device);
+ QByteArray defaultDevice(const QByteArray &service) const override;
+ QList<QByteArray> devices(const QByteArray &service) const override;
+ QString deviceDescription(const QByteArray &service, const QByteArray &device) override;
- QCamera::Position cameraPosition(const QByteArray &device) const;
- int cameraOrientation(const QByteArray &device) const;
+ QCamera::Position cameraPosition(const QByteArray &device) const override;
+ int cameraOrientation(const QByteArray &device) const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/avfoundation/camera/avfcameraserviceplugin.mm b/src/plugins/avfoundation/camera/avfcameraserviceplugin.mm
index 434d28683..08bd8c9bd 100644
--- a/src/plugins/avfoundation/camera/avfcameraserviceplugin.mm
+++ b/src/plugins/avfoundation/camera/avfcameraserviceplugin.mm
@@ -59,7 +59,7 @@ QMediaService* AVFServicePlugin::create(QString const& key)
else
qWarning() << "unsupported key:" << key;
- return 0;
+ return nullptr;
}
void AVFServicePlugin::release(QMediaService *service)
diff --git a/src/plugins/avfoundation/camera/avfcamerasession.h b/src/plugins/avfoundation/camera/avfcamerasession.h
index 3f90f1f7f..103ec0e17 100644
--- a/src/plugins/avfoundation/camera/avfcamerasession.h
+++ b/src/plugins/avfoundation/camera/avfcamerasession.h
@@ -70,7 +70,7 @@ class AVFCameraSession : public QObject
{
Q_OBJECT
public:
- AVFCameraSession(AVFCameraService *service, QObject *parent = 0);
+ AVFCameraSession(AVFCameraService *service, QObject *parent = nullptr);
~AVFCameraSession();
static int defaultCameraIndex();
diff --git a/src/plugins/avfoundation/camera/avfcamerasession.mm b/src/plugins/avfoundation/camera/avfcamerasession.mm
index 8e3436d39..dd6859f73 100644
--- a/src/plugins/avfoundation/camera/avfcamerasession.mm
+++ b/src/plugins/avfoundation/camera/avfcamerasession.mm
@@ -262,7 +262,7 @@ AVCaptureDevice *AVFCameraSession::videoCaptureDevice() const
if (m_videoInput)
return m_videoInput.device;
- return 0;
+ return nullptr;
}
QCamera::State AVFCameraSession::state() const
@@ -362,7 +362,7 @@ void AVFCameraSession::attachVideoInputDevice()
if (m_videoInput) {
[m_captureSession removeInput:m_videoInput];
[m_videoInput release];
- m_videoInput = 0;
+ m_videoInput = nullptr;
m_activeCameraInfo = AVFCameraInfo();
}
diff --git a/src/plugins/avfoundation/camera/avfcamerautility.h b/src/plugins/avfoundation/camera/avfcamerautility.h
index ba1bd3861..370302b1c 100644
--- a/src/plugins/avfoundation/camera/avfcamerautility.h
+++ b/src/plugins/avfoundation/camera/avfcamerautility.h
@@ -118,7 +118,7 @@ template<>
class AVFScopedPointer<dispatch_queue_t>
{
public:
- AVFScopedPointer() : m_queue(0) {}
+ AVFScopedPointer() : m_queue(nullptr) {}
explicit AVFScopedPointer(dispatch_queue_t q) : m_queue(q) {}
~AVFScopedPointer()
@@ -138,7 +138,7 @@ public:
return m_queue;
}
- void reset(dispatch_queue_t q = 0)
+ void reset(dispatch_queue_t q = nullptr)
{
if (m_queue)
dispatch_release(m_queue);
@@ -148,7 +148,7 @@ public:
private:
dispatch_queue_t m_queue;
- Q_DISABLE_COPY(AVFScopedPointer);
+ Q_DISABLE_COPY(AVFScopedPointer)
};
typedef QPair<qreal, qreal> AVFPSRange;
diff --git a/src/plugins/avfoundation/camera/avfcamerautility.mm b/src/plugins/avfoundation/camera/avfcamerautility.mm
index 8a2254c2e..e68fc703b 100644
--- a/src/plugins/avfoundation/camera/avfcamerautility.mm
+++ b/src/plugins/avfoundation/camera/avfcamerautility.mm
@@ -240,7 +240,7 @@ AVCaptureDeviceFormat *qt_find_best_resolution_match(AVCaptureDevice *captureDev
Q_ASSERT(!request.isNull() && request.isValid());
if (!captureDevice.formats || !captureDevice.formats.count)
- return 0;
+ return nullptr;
QVector<AVCaptureDeviceFormat *> formats(qt_unique_device_formats(captureDevice, filter));
@@ -254,7 +254,7 @@ AVCaptureDeviceFormat *qt_find_best_resolution_match(AVCaptureDevice *captureDev
}
if (!qt_area_sane(request))
- return 0;
+ return nullptr;
typedef QPair<QSize, AVCaptureDeviceFormat *> FormatPair;
@@ -272,7 +272,7 @@ AVCaptureDeviceFormat *qt_find_best_resolution_match(AVCaptureDevice *captureDev
}
if (!pairs.size())
- return 0;
+ return nullptr;
AVCaptureDeviceFormat *best = pairs[0].second;
QSize next(pairs[0].first);
diff --git a/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm b/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
index 0054a8d01..a77d7de03 100644
--- a/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
@@ -167,7 +167,7 @@ QCameraViewfinderSettings AVFCameraViewfinderSettingsControl2::viewfinderSetting
settings.setMinimumFrameRate(fps.first);
settings.setMaximumFrameRate(fps.second);
- AVCaptureVideoDataOutput *videoOutput = m_service->videoOutput() ? m_service->videoOutput()->videoDataOutput() : 0;
+ AVCaptureVideoDataOutput *videoOutput = m_service->videoOutput() ? m_service->videoOutput()->videoDataOutput() : nullptr;
if (videoOutput) {
NSObject *obj = [videoOutput.videoSettings objectForKey:(id)kCVPixelBufferPixelFormatTypeKey];
if (obj && [obj isKindOfClass:[NSNumber class]]) {
@@ -291,7 +291,7 @@ QVector<QVideoFrame::PixelFormat> AVFCameraViewfinderSettingsControl2::viewfinde
{
QVector<QVideoFrame::PixelFormat> qtFormats;
- AVCaptureVideoDataOutput *videoOutput = m_service->videoOutput() ? m_service->videoOutput()->videoDataOutput() : 0;
+ AVCaptureVideoDataOutput *videoOutput = m_service->videoOutput() ? m_service->videoOutput()->videoDataOutput() : nullptr;
if (!videoOutput) {
qDebugCamera() << Q_FUNC_INFO << "no video output found";
return qtFormats;
@@ -318,7 +318,7 @@ QVector<QVideoFrame::PixelFormat> AVFCameraViewfinderSettingsControl2::viewfinde
bool AVFCameraViewfinderSettingsControl2::convertPixelFormatIfSupported(QVideoFrame::PixelFormat qtFormat,
unsigned &avfFormat)const
{
- AVCaptureVideoDataOutput *videoOutput = m_service->videoOutput() ? m_service->videoOutput()->videoDataOutput() : 0;
+ AVCaptureVideoDataOutput *videoOutput = m_service->videoOutput() ? m_service->videoOutput()->videoDataOutput() : nullptr;
if (!videoOutput)
return false;
@@ -372,7 +372,7 @@ bool AVFCameraViewfinderSettingsControl2::applySettings(const QCameraViewfinderS
// We still can update the pixel format at least.
}
- AVCaptureVideoDataOutput *videoOutput = m_service->videoOutput() ? m_service->videoOutput()->videoDataOutput() : 0;
+ AVCaptureVideoDataOutput *videoOutput = m_service->videoOutput() ? m_service->videoOutput()->videoDataOutput() : nullptr;
if (videoOutput) {
unsigned avfPixelFormat = 0;
if (!convertPixelFormatIfSupported(settings.pixelFormat(), avfPixelFormat)) {
diff --git a/src/plugins/avfoundation/camera/avfimagecapturecontrol.h b/src/plugins/avfoundation/camera/avfimagecapturecontrol.h
index 2cdf0e5f3..314e867e7 100644
--- a/src/plugins/avfoundation/camera/avfimagecapturecontrol.h
+++ b/src/plugins/avfoundation/camera/avfimagecapturecontrol.h
@@ -60,17 +60,17 @@ public:
QSharedPointer<QSemaphore> previewReady;
};
- AVFImageCaptureControl(AVFCameraService *service, QObject *parent = 0);
+ AVFImageCaptureControl(AVFCameraService *service, QObject *parent = nullptr);
~AVFImageCaptureControl();
- bool isReadyForCapture() const;
+ bool isReadyForCapture() const override;
- QCameraImageCapture::DriveMode driveMode() const { return QCameraImageCapture::SingleImageCapture; }
- void setDriveMode(QCameraImageCapture::DriveMode ) {}
+ QCameraImageCapture::DriveMode driveMode() const override { return QCameraImageCapture::SingleImageCapture; }
+ void setDriveMode(QCameraImageCapture::DriveMode ) override {}
AVCaptureStillImageOutput *stillImageOutput() const {return m_stillImageOutput;}
- int capture(const QString &fileName);
- void cancelCapture();
+ int capture(const QString &fileName) override;
+ void cancelCapture() override;
private Q_SLOTS:
void updateCaptureConnection();
diff --git a/src/plugins/avfoundation/camera/avfmediarecordercontrol.h b/src/plugins/avfoundation/camera/avfmediarecordercontrol.h
index a4894b3da..fbba5eca4 100644
--- a/src/plugins/avfoundation/camera/avfmediarecordercontrol.h
+++ b/src/plugins/avfoundation/camera/avfmediarecordercontrol.h
@@ -60,27 +60,27 @@ class AVFMediaRecorderControl : public QMediaRecorderControl
{
Q_OBJECT
public:
- AVFMediaRecorderControl(AVFCameraService *service, QObject *parent = 0);
+ AVFMediaRecorderControl(AVFCameraService *service, QObject *parent = nullptr);
~AVFMediaRecorderControl();
- QUrl outputLocation() const;
- bool setOutputLocation(const QUrl &location);
+ QUrl outputLocation() const override;
+ bool setOutputLocation(const QUrl &location) override;
- QMediaRecorder::State state() const;
- QMediaRecorder::Status status() const;
+ QMediaRecorder::State state() const override;
+ QMediaRecorder::Status status() const override;
- qint64 duration() const;
+ qint64 duration() const override;
- bool isMuted() const;
- qreal volume() const;
+ bool isMuted() const override;
+ qreal volume() const override;
- void applySettings();
+ void applySettings() override;
void unapplySettings();
public Q_SLOTS:
- void setState(QMediaRecorder::State state);
- void setMuted(bool muted);
- void setVolume(qreal volume);
+ void setState(QMediaRecorder::State state) override;
+ void setMuted(bool muted) override;
+ void setVolume(qreal volume) override;
void handleRecordingStarted();
void handleRecordingFinished();
diff --git a/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm b/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm
index 546eabf89..9a6057e6b 100644
--- a/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm
+++ b/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm
@@ -394,7 +394,7 @@ void AVFMediaRecorderControl::setupSessionForCapture()
qWarning() << "Failed to create audio device input";
} else if (![captureSession canAddInput:m_audioInput]) {
qWarning() << "Could not connect the audio input";
- m_audioInput = 0;
+ m_audioInput = nullptr;
} else {
[m_audioInput retain];
[captureSession addInput:m_audioInput];
diff --git a/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h b/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h
index 8e049a595..9afb1068d 100644
--- a/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h
+++ b/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h
@@ -62,8 +62,8 @@ class AVFMediaRecorderControlIOS : public QMediaRecorderControl
{
Q_OBJECT
public:
- AVFMediaRecorderControlIOS(AVFCameraService *service, QObject *parent = 0);
- ~AVFMediaRecorderControlIOS();
+ AVFMediaRecorderControlIOS(AVFCameraService *service, QObject *parent = nullptr);
+ ~AVFMediaRecorderControlIOS() override;
QUrl outputLocation() const override;
bool setOutputLocation(const QUrl &location) override;
diff --git a/src/plugins/avfoundation/camera/avfmediavideoprobecontrol.h b/src/plugins/avfoundation/camera/avfmediavideoprobecontrol.h
index ce9ef4dbe..69a452a97 100644
--- a/src/plugins/avfoundation/camera/avfmediavideoprobecontrol.h
+++ b/src/plugins/avfoundation/camera/avfmediavideoprobecontrol.h
@@ -48,7 +48,7 @@ class AVFMediaVideoProbeControl : public QMediaVideoProbeControl
{
Q_OBJECT
public:
- explicit AVFMediaVideoProbeControl(QObject *parent = 0);
+ explicit AVFMediaVideoProbeControl(QObject *parent = nullptr);
~AVFMediaVideoProbeControl();
void newFrameProbed(const QVideoFrame& frame);
diff --git a/src/plugins/avfoundation/camera/avfvideoencodersettingscontrol.h b/src/plugins/avfoundation/camera/avfvideoencodersettingscontrol.h
index 9bdf5a788..7c9574f3d 100644
--- a/src/plugins/avfoundation/camera/avfvideoencodersettingscontrol.h
+++ b/src/plugins/avfoundation/camera/avfvideoencodersettingscontrol.h
@@ -59,10 +59,10 @@ public:
explicit AVFVideoEncoderSettingsControl(AVFCameraService *service);
QList<QSize> supportedResolutions(const QVideoEncoderSettings &requestedVideoSettings,
- bool *continuous = 0) const override;
+ bool *continuous = nullptr) const override;
QList<qreal> supportedFrameRates(const QVideoEncoderSettings &requestedVideoSettings,
- bool *continuous = 0) const override;
+ bool *continuous = nullptr) const override;
QStringList supportedVideoCodecs() const override;
QString videoCodecDescription(const QString &codecName) const override;
diff --git a/src/plugins/avfoundation/mediaplayer/avfdisplaylink.h b/src/plugins/avfoundation/mediaplayer/avfdisplaylink.h
index 45db7aef7..ba0803807 100644
--- a/src/plugins/avfoundation/mediaplayer/avfdisplaylink.h
+++ b/src/plugins/avfoundation/mediaplayer/avfdisplaylink.h
@@ -55,7 +55,7 @@ class AVFDisplayLink : public QObject
{
Q_OBJECT
public:
- explicit AVFDisplayLink(QObject *parent = 0);
+ explicit AVFDisplayLink(QObject *parent = nullptr);
virtual ~AVFDisplayLink();
bool isValid() const;
bool isActive() const;
@@ -71,7 +71,7 @@ public:
void displayLinkEvent(const CVTimeStamp *);
protected:
- virtual bool event(QEvent *);
+ virtual bool event(QEvent *) override;
private:
#if defined(Q_OS_IOS) || defined(Q_OS_TVOS)
diff --git a/src/plugins/avfoundation/mediaplayer/avfdisplaylink.mm b/src/plugins/avfoundation/mediaplayer/avfdisplaylink.mm
index 63747e486..948db33ba 100644
--- a/src/plugins/avfoundation/mediaplayer/avfdisplaylink.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfdisplaylink.mm
@@ -84,7 +84,7 @@ QT_USE_NAMESPACE
{
if (m_displayLink) {
[m_displayLink release];
- m_displayLink = NULL;
+ m_displayLink = nullptr;
}
[super dealloc];
@@ -129,7 +129,7 @@ static CVReturn CVDisplayLinkCallback(CVDisplayLinkRef displayLink,
AVFDisplayLink::AVFDisplayLink(QObject *parent)
: QObject(parent)
- , m_displayLink(0)
+ , m_displayLink(nullptr)
, m_pendingDisplayLinkEvent(false)
, m_isActive(false)
{
@@ -161,13 +161,13 @@ AVFDisplayLink::~AVFDisplayLink()
#else
CVDisplayLinkRelease(m_displayLink);
#endif
- m_displayLink = NULL;
+ m_displayLink = nullptr;
}
}
bool AVFDisplayLink::isValid() const
{
- return m_displayLink != 0;
+ return m_displayLink != nullptr;
}
bool AVFDisplayLink::isActive() const
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayercontrol.h b/src/plugins/avfoundation/mediaplayer/avfmediaplayercontrol.h
index a65ee8529..ac0ba0ab2 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayercontrol.h
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayercontrol.h
@@ -51,44 +51,44 @@ class AVFMediaPlayerControl : public QMediaPlayerControl
{
Q_OBJECT
public:
- explicit AVFMediaPlayerControl(QObject *parent = 0);
+ explicit AVFMediaPlayerControl(QObject *parent = nullptr);
~AVFMediaPlayerControl();
void setSession(AVFMediaPlayerSession *session);
- QMediaPlayer::State state() const;
- QMediaPlayer::MediaStatus mediaStatus() const;
+ QMediaPlayer::State state() const override;
+ QMediaPlayer::MediaStatus mediaStatus() const override;
- QMediaContent media() const;
- const QIODevice *mediaStream() const;
- void setMedia(const QMediaContent &content, QIODevice *stream);
+ QMediaContent media() const override;
+ const QIODevice *mediaStream() const override;
+ void setMedia(const QMediaContent &content, QIODevice *stream) override;
- qint64 position() const;
- qint64 duration() const;
+ qint64 position() const override;
+ qint64 duration() const override;
- int bufferStatus() const;
+ int bufferStatus() const override;
- int volume() const;
- bool isMuted() const;
+ int volume() const override;
+ bool isMuted() const override;
- bool isAudioAvailable() const;
- bool isVideoAvailable() const;
+ bool isAudioAvailable() const override;
+ bool isVideoAvailable() const override;
- bool isSeekable() const;
- QMediaTimeRange availablePlaybackRanges() const;
+ bool isSeekable() const override;
+ QMediaTimeRange availablePlaybackRanges() const override;
- qreal playbackRate() const;
- void setPlaybackRate(qreal rate);
+ qreal playbackRate() const override;
+ void setPlaybackRate(qreal rate) override;
public Q_SLOTS:
- void setPosition(qint64 pos);
+ void setPosition(qint64 pos) override;
- void play();
- void pause();
- void stop();
+ void play() override;
+ void pause() override;
+ void stop() override;
- void setVolume(int volume);
- void setMuted(bool muted);
+ void setVolume(int volume) override;
+ void setMuted(bool muted) override;
private:
AVFMediaPlayerSession *m_session;
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.h b/src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.h
index 396550047..ae99c7eda 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.h
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.h
@@ -50,14 +50,14 @@ class AVFMediaPlayerMetaDataControl : public QMetaDataReaderControl
{
Q_OBJECT
public:
- explicit AVFMediaPlayerMetaDataControl(AVFMediaPlayerSession *session, QObject *parent = 0);
+ explicit AVFMediaPlayerMetaDataControl(AVFMediaPlayerSession *session, QObject *parent = nullptr);
virtual ~AVFMediaPlayerMetaDataControl();
- bool isMetaDataAvailable() const;
+ bool isMetaDataAvailable() const override;
bool isWritable() const;
- QVariant metaData(const QString &key) const;
- QStringList availableMetaData() const;
+ QVariant metaData(const QString &key) const override;
+ QStringList availableMetaData() const override;
private Q_SLOTS:
void updateTags();
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.mm
index 39783680b..b9ec38c0f 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayermetadatacontrol.mm
@@ -49,7 +49,7 @@ QT_USE_NAMESPACE
AVFMediaPlayerMetaDataControl::AVFMediaPlayerMetaDataControl(AVFMediaPlayerSession *session, QObject *parent)
: QMetaDataReaderControl(parent)
, m_session(session)
- , m_asset(0)
+ , m_asset(nullptr)
{
QObject::connect(m_session, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(updateTags()));
}
@@ -121,7 +121,7 @@ void AVFMediaPlayerMetaDataControl::updateTags()
#ifdef QT_DEBUG_AVF
qDebug() << Q_FUNC_INFO;
#endif
- AVAsset *currentAsset = (AVAsset*)m_session->currentAssetHandle();
+ AVAsset *currentAsset = static_cast<AVAsset*>(m_session->currentAssetHandle());
//Don't read the tags from the same asset more than once
if (currentAsset == m_asset)
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h
index 4460a4867..6a4b915cf 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h
@@ -52,11 +52,11 @@ class AVFVideoOutput;
class AVFMediaPlayerService : public QMediaService
{
public:
- explicit AVFMediaPlayerService(QObject *parent = 0);
+ explicit AVFMediaPlayerService(QObject *parent = nullptr);
~AVFMediaPlayerService();
- QMediaControl* requestControl(const char *name);
- void releaseControl(QMediaControl *control);
+ QMediaControl* requestControl(const char *name) override;
+ void releaseControl(QMediaControl *control) override;
private:
AVFMediaPlayerSession *m_session;
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
index 91def6b3b..bc59fa921 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
@@ -56,7 +56,7 @@ QT_USE_NAMESPACE
AVFMediaPlayerService::AVFMediaPlayerService(QObject *parent)
: QMediaService(parent)
- , m_videoOutput(0)
+ , m_videoOutput(nullptr)
{
m_session = new AVFMediaPlayerSession(this);
m_control = new AVFMediaPlayerControl(this);
@@ -111,7 +111,7 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name)
m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput));
return m_videoOutput;
}
- return 0;
+ return nullptr;
}
void AVFMediaPlayerService::releaseControl(QMediaControl *control)
@@ -124,10 +124,10 @@ void AVFMediaPlayerService::releaseControl(QMediaControl *control)
AVFVideoRendererControl *renderControl = qobject_cast<AVFVideoRendererControl*>(m_videoOutput);
if (renderControl)
- renderControl->setSurface(0);
+ renderControl->setSurface(nullptr);
#endif
- m_videoOutput = 0;
- m_session->setVideoOutput(0);
+ m_videoOutput = nullptr;
+ m_session->setVideoOutput(nullptr);
delete control;
}
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.h b/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.h
index eae9b9a05..e08f0f46e 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.h
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.h
@@ -59,12 +59,12 @@ class AVFMediaPlayerServicePlugin
public:
explicit AVFMediaPlayerServicePlugin();
- QMediaService* create(QString const& key);
- void release(QMediaService *service);
+ QMediaService* create(QString const& key) override;
+ void release(QMediaService *service) override;
- QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const;
- QMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const;
- QStringList supportedMimeTypes() const;
+ QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const override;
+ QMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const override;
+ QStringList supportedMimeTypes() const override;
private:
void buildSupportedTypes();
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.mm
index dcdd9efed..59b29a3d2 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.mm
@@ -60,7 +60,7 @@ QMediaService *AVFMediaPlayerServicePlugin::create(const QString &key)
return new AVFMediaPlayerService;
qWarning() << "unsupported key: " << key;
- return 0;
+ return nullptr;
}
void AVFMediaPlayerServicePlugin::release(QMediaService *service)
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h
index e20f4a1ec..f6e0ef3bf 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h
@@ -57,7 +57,7 @@ class AVFMediaPlayerSession : public QObject
{
Q_OBJECT
public:
- AVFMediaPlayerSession(AVFMediaPlayerService *service, QObject *parent = 0);
+ AVFMediaPlayerSession(AVFMediaPlayerService *service, QObject *parent = nullptr);
virtual ~AVFMediaPlayerSession();
void setVideoOutput(AVFVideoOutput *output);
@@ -127,7 +127,7 @@ Q_SIGNALS:
private:
class ResourceHandler {
public:
- ResourceHandler():resource(0) {}
+ ResourceHandler() : resource(nullptr) {}
~ResourceHandler() { clear(); }
void setResourceFile(const QString &file) {
if (resource) {
@@ -138,10 +138,10 @@ private:
}
resource = new QResource(file);
}
- bool isValid() const { return resource && resource->isValid() && resource->data() != 0; }
+ bool isValid() const { return resource && resource->isValid() && resource->data() != nullptr; }
const uchar *data() {
if (!isValid())
- return 0;
+ return nullptr;
if (resource->isCompressed()) {
if (rawData.size() == 0)
rawData = qUncompress(resource->data(), resource->size());
@@ -150,7 +150,7 @@ private:
return resource->data();
}
qint64 size() {
- if (data() == 0)
+ if (data() == nullptr)
return 0;
return resource->isCompressed() ? rawData.size() : resource->size();
}
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
index 06fb71ef8..bca4c85a5 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
@@ -339,7 +339,7 @@ static void *AVFMediaPlayerSessionObserverCurrentItemDurationObservationContext
case AVPlayerStatusFailed:
{
- AVPlayerItem *playerItem = (AVPlayerItem *)object;
+ AVPlayerItem *playerItem = static_cast<AVPlayerItem*>(object);
[self assetFailedToPrepareForPlayback:playerItem.error];
if (self.session)
@@ -411,10 +411,10 @@ static void *AVFMediaPlayerSessionObserverCurrentItemDurationObservationContext
AVFMediaPlayerSession::AVFMediaPlayerSession(AVFMediaPlayerService *service, QObject *parent)
: QObject(parent)
, m_service(service)
- , m_videoOutput(0)
+ , m_videoOutput(nullptr)
, m_state(QMediaPlayer::StoppedState)
, m_mediaStatus(QMediaPlayer::NoMedia)
- , m_mediaStream(0)
+ , m_mediaStream(nullptr)
, m_muted(false)
, m_tryingAsync(false)
, m_volume(100)
@@ -435,8 +435,8 @@ AVFMediaPlayerSession::~AVFMediaPlayerSession()
qDebug() << Q_FUNC_INFO;
#endif
//Detatch the session from the sessionObserver (which could still be alive trying to communicate with this session).
- [(AVFMediaPlayerSessionObserver*)m_observer detatchSession];
- [(AVFMediaPlayerSessionObserver*)m_observer release];
+ [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) detatchSession];
+ [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) release];
}
void AVFMediaPlayerSession::setVideoOutput(AVFVideoOutput *output)
@@ -450,13 +450,13 @@ void AVFMediaPlayerSession::setVideoOutput(AVFVideoOutput *output)
//Set the current output layer to null to stop rendering
if (m_videoOutput) {
- m_videoOutput->setLayer(0);
+ m_videoOutput->setLayer(nullptr);
}
m_videoOutput = output;
if (m_videoOutput && m_state != QMediaPlayer::StoppedState)
- m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
+ m_videoOutput->setLayer([static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerLayer]);
}
void *AVFMediaPlayerSession::currentAssetHandle()
@@ -464,7 +464,7 @@ void *AVFMediaPlayerSession::currentAssetHandle()
#ifdef QT_DEBUG_AVF
qDebug() << Q_FUNC_INFO;
#endif
- AVAsset *currentAsset = [[(AVFMediaPlayerSessionObserver*)m_observer playerItem] asset];
+ AVAsset *currentAsset = [[static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerItem] asset];
return currentAsset;
}
@@ -494,7 +494,7 @@ void AVFMediaPlayerSession::setMedia(const QMediaContent &content, QIODevice *st
qDebug() << Q_FUNC_INFO << content.canonicalUrl();
#endif
- [(AVFMediaPlayerSessionObserver*)m_observer unloadMedia];
+ [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) unloadMedia];
m_resources = content;
m_mediaStream = stream;
@@ -528,7 +528,7 @@ void AVFMediaPlayerSession::setMedia(const QMediaContent &content, QIODevice *st
//initialize asset using content's URL
NSString *urlString = [NSString stringWithUTF8String:content.canonicalUrl().toEncoded().constData()];
NSURL *url = [NSURL URLWithString:urlString];
- [(AVFMediaPlayerSessionObserver*)m_observer setURL:url];
+ [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) setURL:url];
m_state = QMediaPlayer::StoppedState;
if (m_state != oldState)
@@ -537,7 +537,7 @@ void AVFMediaPlayerSession::setMedia(const QMediaContent &content, QIODevice *st
qint64 AVFMediaPlayerSession::position() const
{
- AVPlayerItem *playerItem = [(AVFMediaPlayerSessionObserver*)m_observer playerItem];
+ AVPlayerItem *playerItem = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerItem];
if (!playerItem)
return m_requestedPosition != -1 ? m_requestedPosition : 0;
@@ -616,7 +616,7 @@ void AVFMediaPlayerSession::setSeekable(bool seekable)
QMediaTimeRange AVFMediaPlayerSession::availablePlaybackRanges() const
{
- AVPlayerItem *playerItem = [(AVFMediaPlayerSessionObserver*)m_observer playerItem];
+ AVPlayerItem *playerItem = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerItem];
if (playerItem) {
QMediaTimeRange timeRanges;
@@ -649,7 +649,7 @@ void AVFMediaPlayerSession::setPlaybackRate(qreal rate)
m_rate = rate;
- AVPlayer *player = [(AVFMediaPlayerSessionObserver*)m_observer player];
+ AVPlayer *player = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player];
if (player && m_state == QMediaPlayer::PlayingState)
[player setRate:m_rate];
@@ -665,7 +665,7 @@ void AVFMediaPlayerSession::setPosition(qint64 pos)
if (pos == position())
return;
- AVPlayerItem *playerItem = [(AVFMediaPlayerSessionObserver*)m_observer playerItem];
+ AVPlayerItem *playerItem = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerItem];
if (!playerItem) {
m_requestedPosition = pos;
Q_EMIT positionChanged(m_requestedPosition);
@@ -711,7 +711,7 @@ void AVFMediaPlayerSession::play()
return;
if (m_videoOutput) {
- m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
+ m_videoOutput->setLayer([static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerLayer]);
}
// Reset media status if the current status is EndOfMedia
@@ -720,7 +720,7 @@ void AVFMediaPlayerSession::play()
if (m_mediaStatus == QMediaPlayer::LoadedMedia || m_mediaStatus == QMediaPlayer::BufferedMedia) {
// Setting the rate starts playback
- [[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
+ [[static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player] setRate:m_rate];
}
m_state = QMediaPlayer::PlayingState;
@@ -744,10 +744,10 @@ void AVFMediaPlayerSession::pause()
m_state = QMediaPlayer::PausedState;
if (m_videoOutput) {
- m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
+ m_videoOutput->setLayer([static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerLayer]);
}
- [[(AVFMediaPlayerSessionObserver*)m_observer player] pause];
+ [[static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player] pause];
// Reset media status if the current status is EndOfMedia
if (m_mediaStatus == QMediaPlayer::EndOfMedia)
@@ -767,11 +767,11 @@ void AVFMediaPlayerSession::stop()
return;
// AVPlayer doesn't have stop(), only pause() and play().
- [[(AVFMediaPlayerSessionObserver*)m_observer player] pause];
+ [[static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player] pause];
setPosition(0);
if (m_videoOutput) {
- m_videoOutput->setLayer(0);
+ m_videoOutput->setLayer(nullptr);
}
if (m_mediaStatus == QMediaPlayer::BufferedMedia)
@@ -792,7 +792,7 @@ void AVFMediaPlayerSession::setVolume(int volume)
m_volume = volume;
- AVPlayer *player = [(AVFMediaPlayerSessionObserver*)m_observer player];
+ AVPlayer *player = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player];
if (player)
[player setVolume:volume / 100.0f];
@@ -810,7 +810,7 @@ void AVFMediaPlayerSession::setMuted(bool muted)
m_muted = muted;
- AVPlayer *player = [(AVFMediaPlayerSessionObserver*)m_observer player];
+ AVPlayer *player = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player];
if (player)
[player setMuted:muted];
@@ -832,14 +832,14 @@ void AVFMediaPlayerSession::processEOS()
// At this point, frames should not be rendered anymore.
// Clear the output layer to make sure of that.
if (m_videoOutput)
- m_videoOutput->setLayer(0);
+ m_videoOutput->setLayer(nullptr);
Q_EMIT stateChanged(m_state);
}
void AVFMediaPlayerSession::processLoadStateChange(QMediaPlayer::State newState)
{
- AVPlayerStatus currentStatus = [[(AVFMediaPlayerSessionObserver*)m_observer player] status];
+ AVPlayerStatus currentStatus = [[static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player] status];
#ifdef QT_DEBUG_AVF
qDebug() << Q_FUNC_INFO << currentStatus << ", " << m_mediaStatus << ", " << newState;
@@ -852,7 +852,7 @@ void AVFMediaPlayerSession::processLoadStateChange(QMediaPlayer::State newState)
QMediaPlayer::MediaStatus newStatus = m_mediaStatus;
- AVPlayerItem *playerItem = [(AVFMediaPlayerSessionObserver*)m_observer playerItem];
+ AVPlayerItem *playerItem = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerItem];
if (playerItem) {
// Check each track for audio and video content
@@ -874,7 +874,7 @@ void AVFMediaPlayerSession::processLoadStateChange(QMediaPlayer::State newState)
setSeekable([[playerItem seekableTimeRanges] count] > 0);
// Get the native size of the video, and reset the bounds of the player layer
- AVPlayerLayer *playerLayer = [(AVFMediaPlayerSessionObserver*)m_observer playerLayer];
+ AVPlayerLayer *playerLayer = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerLayer];
if (videoTrack && playerLayer) {
playerLayer.bounds = CGRectMake(0.0f, 0.0f,
videoTrack.naturalSize.width,
@@ -899,9 +899,9 @@ void AVFMediaPlayerSession::processLoadStateChange(QMediaPlayer::State newState)
}
- if (newState == QMediaPlayer::PlayingState && [(AVFMediaPlayerSessionObserver*)m_observer player]) {
+ if (newState == QMediaPlayer::PlayingState && [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player]) {
// Setting the rate is enough to start playback, no need to call play()
- [[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
+ [[static_cast<AVFMediaPlayerSessionObserver*>(m_observer) player] setRate:m_rate];
}
}
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.h b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.h
index 054bce166..99b6bb0b5 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.h
+++ b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.h
@@ -58,7 +58,7 @@ class QAbstractVideoSurface;
class AVFVideoFrameRenderer : public QObject
{
public:
- AVFVideoFrameRenderer(QAbstractVideoSurface *surface, QObject *parent = 0);
+ AVFVideoFrameRenderer(QAbstractVideoSurface *surface, QObject *parent = nullptr);
virtual ~AVFVideoFrameRenderer();
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm
index 0759702e8..b2c6638cc 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm
@@ -54,15 +54,15 @@ QT_USE_NAMESPACE
AVFVideoFrameRenderer::AVFVideoFrameRenderer(QAbstractVideoSurface *surface, QObject *parent)
: QObject(parent)
- , m_videoLayerRenderer(0)
+ , m_videoLayerRenderer(nullptr)
, m_surface(surface)
- , m_offscreenSurface(0)
- , m_glContext(0)
+ , m_offscreenSurface(nullptr)
+ , m_glContext(nullptr)
, m_currentBuffer(1)
, m_isContextShared(true)
{
- m_fbo[0] = 0;
- m_fbo[1] = 0;
+ m_fbo[0] = nullptr;
+ m_fbo[1] = nullptr;
}
AVFVideoFrameRenderer::~AVFVideoFrameRenderer()
@@ -155,7 +155,7 @@ QOpenGLFramebufferObject *AVFVideoFrameRenderer::initRenderer(AVPlayerLayer *lay
}
if (!m_glContext->create()) {
qWarning("failed to create QOpenGLContext");
- return 0;
+ return nullptr;
}
}
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.h b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.h
index 3def186ef..d9f6baa7e 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.h
+++ b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.h
@@ -86,7 +86,7 @@ typedef CVOpenGLTextureRef CVOGLTextureRef;
class AVFVideoFrameRenderer : public QObject
{
public:
- AVFVideoFrameRenderer(QAbstractVideoSurface *surface, QObject *parent = 0);
+ AVFVideoFrameRenderer(QAbstractVideoSurface *surface, QObject *parent = nullptr);
virtual ~AVFVideoFrameRenderer();
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.mm b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.mm
index f84718c55..70e402e6c 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer_ios.mm
@@ -54,11 +54,11 @@ QT_USE_NAMESPACE
AVFVideoFrameRenderer::AVFVideoFrameRenderer(QAbstractVideoSurface *surface, QObject *parent)
: QObject(parent)
- , m_glContext(0)
- , m_offscreenSurface(0)
+ , m_glContext(nullptr)
+ , m_offscreenSurface(nullptr)
, m_surface(surface)
- , m_textureCache(0)
- , m_videoOutput(0)
+ , m_textureCache(nullptr)
+ , m_videoOutput(nullptr)
, m_isContextShared(true)
{
}
@@ -81,7 +81,7 @@ void AVFVideoFrameRenderer::setPlayerLayer(AVPlayerLayer *layer)
Q_UNUSED(layer)
if (m_videoOutput) {
[m_videoOutput release];
- m_videoOutput = 0;
+ m_videoOutput = nullptr;
// will be re-created in first call to copyPixelBufferFromLayer
}
}
@@ -92,7 +92,7 @@ CVOGLTextureRef AVFVideoFrameRenderer::renderLayerToTexture(AVPlayerLayer *layer
// If the glContext isn't shared, it doesn't make sense to return a texture for us
if (!m_isContextShared)
- return 0;
+ return nullptr;
size_t dummyWidth = 0, dummyHeight = 0;
return createCacheTextureFromLayer(layer, dummyWidth, dummyHeight);
@@ -111,7 +111,7 @@ CVPixelBufferRef AVFVideoFrameRenderer::copyPixelBufferFromLayer(AVPlayerLayer *
#ifdef QT_DEBUG_AVF
qWarning("copyPixelBufferFromLayer: invalid layer");
#endif
- return 0;
+ return nullptr;
}
if (!m_videoOutput) {
@@ -125,7 +125,7 @@ CVPixelBufferRef AVFVideoFrameRenderer::copyPixelBufferFromLayer(AVPlayerLayer *
CMTime currentCMFrameTime = [m_videoOutput itemTimeForHostTime:currentCAFrameTime];
// happens when buffering / loading
if (CMTimeCompare(currentCMFrameTime, kCMTimeZero) < 0) {
- return 0;
+ return nullptr;
}
CVPixelBufferRef pixelBuffer = [m_videoOutput copyPixelBufferForItemTime:currentCMFrameTime
@@ -135,7 +135,7 @@ CVPixelBufferRef AVFVideoFrameRenderer::copyPixelBufferFromLayer(AVPlayerLayer *
qWarning("copyPixelBufferForItemTime returned nil");
CMTimeShow(currentCMFrameTime);
#endif
- return 0;
+ return nullptr;
}
width = CVPixelBufferGetWidth(pixelBuffer);
@@ -149,12 +149,12 @@ CVOGLTextureRef AVFVideoFrameRenderer::createCacheTextureFromLayer(AVPlayerLayer
CVPixelBufferRef pixelBuffer = copyPixelBufferFromLayer(layer, width, height);
if (!pixelBuffer)
- return 0;
+ return nullptr;
CVOGLTextureCacheFlush(m_textureCache, 0);
- CVOGLTextureRef texture = 0;
- CVReturn err = CVOGLTextureCacheCreateTextureFromImage(kCFAllocatorDefault, m_textureCache, pixelBuffer, NULL,
+ CVOGLTextureRef texture = nullptr;
+ CVReturn err = CVOGLTextureCacheCreateTextureFromImage(kCFAllocatorDefault, m_textureCache, pixelBuffer, nullptr,
GL_TEXTURE_2D, GL_RGBA,
(GLsizei) width, (GLsizei) height,
GL_BGRA, GL_UNSIGNED_BYTE, 0,
@@ -214,7 +214,7 @@ void AVFVideoFrameRenderer::initRenderer()
//Make sure we have an OpenGL context to make current
if (!m_glContext) {
//Create OpenGL context and set share context from surface
- QOpenGLContext *shareContext = 0;
+ QOpenGLContext *shareContext = nullptr;
if (m_surface) {
shareContext = qobject_cast<QOpenGLContext*>(m_surface->property("GLContext").value<QObject*>());
}
@@ -248,9 +248,9 @@ void AVFVideoFrameRenderer::initRenderer()
if (!m_textureCache) {
// Create a new open gl texture cache
- CVReturn err = CVOGLTextureCacheCreate(kCFAllocatorDefault, NULL,
+ CVReturn err = CVOGLTextureCacheCreate(kCFAllocatorDefault, nullptr,
[EAGLContext currentContext],
- NULL, &m_textureCache);
+ nullptr, &m_textureCache);
if (err) {
#ifdef QT_DEBUG_AVF
qWarning("Error at CVOGLTextureCacheCreate %d", err);
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.h b/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.h
index 26032f0be..85dc19d31 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.h
+++ b/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.h
@@ -58,13 +58,13 @@ class AVFVideoRendererControl : public QVideoRendererControl, public AVFVideoOut
Q_OBJECT
Q_INTERFACES(AVFVideoOutput)
public:
- explicit AVFVideoRendererControl(QObject *parent = 0);
+ explicit AVFVideoRendererControl(QObject *parent = nullptr);
virtual ~AVFVideoRendererControl();
- QAbstractVideoSurface *surface() const;
- void setSurface(QAbstractVideoSurface *surface);
+ QAbstractVideoSurface *surface() const override;
+ void setSurface(QAbstractVideoSurface *surface) override;
- void setLayer(void *playerLayer);
+ void setLayer(void *playerLayer) override;
private Q_SLOTS:
void updateVideoFrame(const CVTimeStamp &ts);
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm b/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm
index e40b7eb17..5f468e532 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm
@@ -75,7 +75,7 @@ public:
}
MapMode mapMode() const { return NotMapped; }
- uchar *map(MapMode, int*, int*) { return 0; }
+ uchar *map(MapMode, int*, int*) { return nullptr; }
void unmap() {}
QVariant handle() const
@@ -116,9 +116,9 @@ private:
AVFVideoRendererControl::AVFVideoRendererControl(QObject *parent)
: QVideoRendererControl(parent)
- , m_surface(0)
- , m_playerLayer(0)
- , m_frameRenderer(0)
+ , m_surface(nullptr)
+ , m_playerLayer(nullptr)
+ , m_frameRenderer(nullptr)
, m_enableOpenGL(false)
{
@@ -132,7 +132,7 @@ AVFVideoRendererControl::~AVFVideoRendererControl()
qDebug() << Q_FUNC_INFO;
#endif
m_displayLink->stop();
- [(AVPlayerLayer*)m_playerLayer release];
+ [static_cast<AVPlayerLayer*>(m_playerLayer) release];
}
QAbstractVideoSurface *AVFVideoRendererControl::surface() const
@@ -160,10 +160,10 @@ void AVFVideoRendererControl::setSurface(QAbstractVideoSurface *surface)
//If the surface changed, then the current frame renderer is no longer valid
delete m_frameRenderer;
- m_frameRenderer = 0;
+ m_frameRenderer = nullptr;
//If there is now no surface to render too
- if (m_surface == 0) {
+ if (m_surface == nullptr) {
m_displayLink->stop();
return;
}
@@ -191,8 +191,8 @@ void AVFVideoRendererControl::setLayer(void *playerLayer)
if (m_playerLayer == playerLayer)
return;
- [(AVPlayerLayer*)playerLayer retain];
- [(AVPlayerLayer*)m_playerLayer release];
+ [static_cast<AVPlayerLayer*>(playerLayer) retain];
+ [static_cast<AVPlayerLayer*>(playerLayer) release];
m_playerLayer = playerLayer;
@@ -208,7 +208,7 @@ void AVFVideoRendererControl::setLayer(void *playerLayer)
#endif
//If there is no layer to render, stop scheduling updates
- if (m_playerLayer == 0) {
+ if (m_playerLayer == nullptr) {
m_displayLink->stop();
return;
}
@@ -225,7 +225,7 @@ void AVFVideoRendererControl::updateVideoFrame(const CVTimeStamp &ts)
{
Q_UNUSED(ts)
- AVPlayerLayer *playerLayer = (AVPlayerLayer*)m_playerLayer;
+ AVPlayerLayer *playerLayer = static_cast<AVPlayerLayer*>(playerLayer);
if (!playerLayer) {
qWarning("updateVideoFrame called without AVPlayerLayer (which shouldn't happen");
@@ -240,7 +240,7 @@ void AVFVideoRendererControl::updateVideoFrame(const CVTimeStamp &ts)
CVOGLTextureRef tex = m_frameRenderer->renderLayerToTexture(playerLayer);
//Make sure we got a valid texture
- if (tex == 0)
+ if (tex == nullptr)
return;
QAbstractVideoBuffer *buffer = new TextureCacheVideoBuffer(tex);
@@ -305,7 +305,7 @@ void AVFVideoRendererControl::updateVideoFrame(const CVTimeStamp &ts)
void AVFVideoRendererControl::setupVideoOutput()
{
- AVPlayerLayer *playerLayer = (AVPlayerLayer*)m_playerLayer;
+ AVPlayerLayer *playerLayer = static_cast<AVPlayerLayer*>(playerLayer);
if (playerLayer)
m_nativeSize = QSize(playerLayer.bounds.size.width, playerLayer.bounds.size.height);
}
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideowidget.h b/src/plugins/avfoundation/mediaplayer/avfvideowidget.h
index be6f16e64..faf71f1a4 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideowidget.h
+++ b/src/plugins/avfoundation/mediaplayer/avfvideowidget.h
@@ -57,14 +57,14 @@ public:
AVFVideoWidget(QWidget *parent);
virtual ~AVFVideoWidget();
- QSize sizeHint() const;
+ QSize sizeHint() const override;
Qt::AspectRatioMode aspectRatioMode() const;
void setAspectRatioMode(Qt::AspectRatioMode mode);
void setPlayerLayer(AVPlayerLayer *layer);
protected:
- void resizeEvent(QResizeEvent *);
- void paintEvent(QPaintEvent *);
+ void resizeEvent(QResizeEvent *) override;
+ void paintEvent(QPaintEvent *) override;
private:
void updateAspectRatio();
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideowidget.mm b/src/plugins/avfoundation/mediaplayer/avfvideowidget.mm
index 7eb5a71cf..be349710c 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideowidget.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfvideowidget.mm
@@ -56,8 +56,8 @@ QT_USE_NAMESPACE
AVFVideoWidget::AVFVideoWidget(QWidget *parent)
: QWidget(parent)
, m_aspectRatioMode(Qt::KeepAspectRatio)
- , m_playerLayer(0)
- , m_nativeView(0)
+ , m_playerLayer(nullptr)
+ , m_nativeView(nullptr)
{
setAutoFillBackground(false);
}
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.h b/src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.h
index f442d666a..22379d273 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.h
+++ b/src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.h
@@ -54,30 +54,30 @@ class AVFVideoWidgetControl : public QVideoWidgetControl, public AVFVideoOutput
Q_OBJECT
Q_INTERFACES(AVFVideoOutput)
public:
- AVFVideoWidgetControl(QObject *parent = 0);
+ AVFVideoWidgetControl(QObject *parent = nullptr);
virtual ~AVFVideoWidgetControl();
- void setLayer(void *playerLayer);
+ void setLayer(void *playerLayer) override;
- QWidget *videoWidget();
+ QWidget *videoWidget() override;
- bool isFullScreen() const;
- void setFullScreen(bool fullScreen);
+ bool isFullScreen() const override;
+ void setFullScreen(bool fullScreen) override;
- Qt::AspectRatioMode aspectRatioMode() const;
- void setAspectRatioMode(Qt::AspectRatioMode mode);
+ Qt::AspectRatioMode aspectRatioMode() const override;
+ void setAspectRatioMode(Qt::AspectRatioMode mode) override;
- int brightness() const;
- void setBrightness(int brightness);
+ int brightness() const override;
+ void setBrightness(int brightness) override;
- int contrast() const;
- void setContrast(int contrast);
+ int contrast() const override;
+ void setContrast(int contrast) override;
- int hue() const;
- void setHue(int hue);
+ int hue() const override;
+ void setHue(int hue) override;
- int saturation() const;
- void setSaturation(int saturation);
+ int saturation() const override;
+ void setSaturation(int saturation) override;
private:
AVFVideoWidget *m_videoWidget;
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.mm b/src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.mm
index 287dd3add..91ece817e 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfvideowidgetcontrol.mm
@@ -56,7 +56,7 @@ AVFVideoWidgetControl::AVFVideoWidgetControl(QObject *parent)
, m_hue(0)
, m_saturation(0)
{
- m_videoWidget = new AVFVideoWidget(0);
+ m_videoWidget = new AVFVideoWidget(nullptr);
}
AVFVideoWidgetControl::~AVFVideoWidgetControl()
@@ -73,7 +73,7 @@ void AVFVideoWidgetControl::setLayer(void *playerLayer)
qDebug() << Q_FUNC_INFO << playerLayer;
#endif
- m_videoWidget->setPlayerLayer((AVPlayerLayer*)playerLayer);
+ m_videoWidget->setPlayerLayer(static_cast<AVPlayerLayer*>(playerLayer));
}
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.h b/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.h
index 18bf3fa71..763656c6c 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.h
+++ b/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.h
@@ -61,40 +61,40 @@ class AVFVideoWindowControl : public QVideoWindowControl, public AVFVideoOutput
Q_INTERFACES(AVFVideoOutput)
public:
- AVFVideoWindowControl(QObject *parent = 0);
+ AVFVideoWindowControl(QObject *parent = nullptr);
virtual ~AVFVideoWindowControl();
// QVideoWindowControl interface
public:
- WId winId() const;
- void setWinId(WId id);
+ WId winId() const override;
+ void setWinId(WId id) override;
- QRect displayRect() const;
- void setDisplayRect(const QRect &rect);
+ QRect displayRect() const override;
+ void setDisplayRect(const QRect &rect) override;
- bool isFullScreen() const;
- void setFullScreen(bool fullScreen);
+ bool isFullScreen() const override;
+ void setFullScreen(bool fullScreen) override;
- void repaint();
- QSize nativeSize() const;
+ void repaint() override;
+ QSize nativeSize() const override;
- Qt::AspectRatioMode aspectRatioMode() const;
- void setAspectRatioMode(Qt::AspectRatioMode mode);
+ Qt::AspectRatioMode aspectRatioMode() const override;
+ void setAspectRatioMode(Qt::AspectRatioMode mode) override;
- int brightness() const;
- void setBrightness(int brightness);
+ int brightness() const override;
+ void setBrightness(int brightness) override;
- int contrast() const;
- void setContrast(int contrast);
+ int contrast() const override;
+ void setContrast(int contrast) override;
- int hue() const;
- void setHue(int hue);
+ int hue() const override;
+ void setHue(int hue) override;
- int saturation() const;
- void setSaturation(int saturation);
+ int saturation() const override;
+ void setSaturation(int saturation) override;
// AVFVideoOutput interface
- void setLayer(void *playerLayer);
+ void setLayer(void *playerLayer) override;
private:
void updateAspectRatio();
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm b/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm
index 5727cb0f4..7fa41fdc2 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm
@@ -60,8 +60,8 @@ AVFVideoWindowControl::AVFVideoWindowControl(QObject *parent)
, m_hue(0)
, m_saturation(0)
, m_aspectRatioMode(Qt::IgnoreAspectRatio)
- , m_playerLayer(0)
- , m_nativeView(0)
+ , m_playerLayer(nullptr)
+ , m_nativeView(nullptr)
{
}
@@ -188,7 +188,7 @@ void AVFVideoWindowControl::setSaturation(int saturation)
void AVFVideoWindowControl::setLayer(void *playerLayer)
{
- AVPlayerLayer *layer = (AVPlayerLayer*)playerLayer;
+ AVPlayerLayer *layer = static_cast<AVPlayerLayer*>(playerLayer);
if (m_playerLayer == layer)
return;