summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm
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/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm
parent34d15785600f98faa4a51827b452d6c488e4c10c (diff)
avfoundation: modernize by using nullptr and override
Change-Id: Ifd483f925ed69f0ba35c46facfdb571dea87c1ac Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
Diffstat (limited to 'src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm')
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm26
1 files changed, 13 insertions, 13 deletions
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);
}