summaryrefslogtreecommitdiffstats
path: root/src/plugins/multimedia/darwin/qdarwinintegration.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/multimedia/darwin/qdarwinintegration.mm')
-rw-r--r--src/plugins/multimedia/darwin/qdarwinintegration.mm70
1 files changed, 15 insertions, 55 deletions
diff --git a/src/plugins/multimedia/darwin/qdarwinintegration.mm b/src/plugins/multimedia/darwin/qdarwinintegration.mm
index 0f2ff14e7..0e880447e 100644
--- a/src/plugins/multimedia/darwin/qdarwinintegration.mm
+++ b/src/plugins/multimedia/darwin/qdarwinintegration.mm
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qdarwinintegration_p.h"
#include <avfmediaplayer_p.h>
@@ -65,65 +29,61 @@ public:
QPlatformMediaIntegration* create(const QString &name) override
{
- if (name == QLatin1String("darwin"))
+ if (name == u"darwin")
return new QDarwinIntegration;
return nullptr;
}
};
-
-QDarwinIntegration::QDarwinIntegration()
+QDarwinIntegration::QDarwinIntegration() : QPlatformMediaIntegration(QLatin1String("darwin"))
{
#if defined(Q_OS_MACOS) && QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_11_0)
if (__builtin_available(macOS 11.0, *))
VTRegisterSupplementalVideoDecoderIfAvailable(kCMVideoCodecType_VP9);
#endif
- m_videoDevices = new QAVFVideoDevices(this);
}
-QDarwinIntegration::~QDarwinIntegration()
+QPlatformMediaFormatInfo *QDarwinIntegration::createFormatInfo()
{
- delete m_formatInfo;
+ return new QDarwinFormatInfo();
}
-QPlatformMediaFormatInfo *QDarwinIntegration::formatInfo()
+QPlatformVideoDevices *QDarwinIntegration::createVideoDevices()
{
- if (!m_formatInfo)
- m_formatInfo = new QDarwinFormatInfo();
- return m_formatInfo;
+ return new QAVFVideoDevices(this);
}
-QPlatformAudioDecoder *QDarwinIntegration::createAudioDecoder(QAudioDecoder *decoder)
+QMaybe<QPlatformAudioDecoder *> QDarwinIntegration::createAudioDecoder(QAudioDecoder *decoder)
{
return new AVFAudioDecoder(decoder);
}
-QPlatformMediaCaptureSession *QDarwinIntegration::createCaptureSession()
+QMaybe<QPlatformMediaCaptureSession *> QDarwinIntegration::createCaptureSession()
{
return new AVFCameraService;
}
-QPlatformMediaPlayer *QDarwinIntegration::createPlayer(QMediaPlayer *player)
+QMaybe<QPlatformMediaPlayer *> QDarwinIntegration::createPlayer(QMediaPlayer *player)
{
return new AVFMediaPlayer(player);
}
-QPlatformCamera *QDarwinIntegration::createCamera(QCamera *camera)
+QMaybe<QPlatformCamera *> QDarwinIntegration::createCamera(QCamera *camera)
{
return new AVFCamera(camera);
}
-QPlatformMediaRecorder *QDarwinIntegration::createRecorder(QMediaRecorder *recorder)
+QMaybe<QPlatformMediaRecorder *> QDarwinIntegration::createRecorder(QMediaRecorder *recorder)
{
return new AVFMediaEncoder(recorder);
}
-QPlatformImageCapture *QDarwinIntegration::createImageCapture(QImageCapture *imageCapture)
+QMaybe<QPlatformImageCapture *> QDarwinIntegration::createImageCapture(QImageCapture *imageCapture)
{
return new AVFImageCapture(imageCapture);
}
-QPlatformVideoSink *QDarwinIntegration::createVideoSink(QVideoSink *sink)
+QMaybe<QPlatformVideoSink *> QDarwinIntegration::createVideoSink(QVideoSink *sink)
{
return new AVFVideoSink(sink);
}