diff options
Diffstat (limited to 'src/plugins/qnx')
9 files changed, 34 insertions, 316 deletions
diff --git a/src/plugins/qnx/mediaplayer/mediaplayer.pri b/src/plugins/qnx/mediaplayer/mediaplayer.pri index f39b542cc..4c4363a91 100644 --- a/src/plugins/qnx/mediaplayer/mediaplayer.pri +++ b/src/plugins/qnx/mediaplayer/mediaplayer.pri @@ -1,7 +1,6 @@ INCLUDEPATH += $$PWD HEADERS += \ - $$PWD/mmrendereraudiorolecontrol.h \ $$PWD/mmrenderermediaplayercontrol.h \ $$PWD/mmrenderermediaplayerservice.h \ $$PWD/mmrenderermetadata.h \ @@ -10,10 +9,8 @@ HEADERS += \ $$PWD/mmrendererutil.h \ $$PWD/mmrenderervideowindowcontrol.h \ $$PWD/mmreventmediaplayercontrol.h \ - $$PWD/mmreventthread.h \ - $$PWD/mmrenderercustomaudiorolecontrol.h + $$PWD/mmreventthread.h SOURCES += \ - $$PWD/mmrendereraudiorolecontrol.cpp \ $$PWD/mmrenderermediaplayercontrol.cpp \ $$PWD/mmrenderermediaplayerservice.cpp \ $$PWD/mmrenderermetadata.cpp \ @@ -22,7 +19,6 @@ SOURCES += \ $$PWD/mmrendererutil.cpp \ $$PWD/mmrenderervideowindowcontrol.cpp \ $$PWD/mmreventmediaplayercontrol.cpp \ - $$PWD/mmreventthread.cpp \ - $$PWD/mmrenderercustomaudiorolecontrol.cpp + $$PWD/mmreventthread.cpp QMAKE_USE += mmrenderer diff --git a/src/plugins/qnx/mediaplayer/mmrendereraudiorolecontrol.cpp b/src/plugins/qnx/mediaplayer/mmrendereraudiorolecontrol.cpp deleted file mode 100644 index e470ed4c5..000000000 --- a/src/plugins/qnx/mediaplayer/mmrendereraudiorolecontrol.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 QNX Software Systems. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "mmrendereraudiorolecontrol.h" -#include "mmrendererutil.h" - -QT_BEGIN_NAMESPACE - -MmRendererAudioRoleControl::MmRendererAudioRoleControl(QObject *parent) - : QAudioRoleControl(parent) - , m_role(QAudio::UnknownRole) -{ -} - -QAudio::Role MmRendererAudioRoleControl::audioRole() const -{ - return m_role; -} - -void MmRendererAudioRoleControl::setAudioRole(QAudio::Role role) -{ - if (m_role != role) { - m_role = role; - emit audioRoleChanged(m_role); - } -} - -QList<QAudio::Role> MmRendererAudioRoleControl::supportedAudioRoles() const -{ - return qnxSupportedAudioRoles(); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qnx/mediaplayer/mmrendereraudiorolecontrol.h b/src/plugins/qnx/mediaplayer/mmrendereraudiorolecontrol.h deleted file mode 100644 index d0d2165eb..000000000 --- a/src/plugins/qnx/mediaplayer/mmrendereraudiorolecontrol.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 QNX Software Systems. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef MMRENDERERAUDIOROLECONTROL_H -#define MMRENDERERAUDIOROLECONTROL_H - -#include <qaudiorolecontrol.h> - -QT_BEGIN_NAMESPACE - -class MmRendererAudioRoleControl : public QAudioRoleControl -{ - Q_OBJECT -public: - explicit MmRendererAudioRoleControl(QObject *parent = 0); - - QAudio::Role audioRole() const override; - void setAudioRole(QAudio::Role role) override; - - QList<QAudio::Role> supportedAudioRoles() const override; - -private: - QAudio::Role m_role; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/qnx/mediaplayer/mmrenderercustomaudiorolecontrol.cpp b/src/plugins/qnx/mediaplayer/mmrenderercustomaudiorolecontrol.cpp deleted file mode 100644 index c8971d41c..000000000 --- a/src/plugins/qnx/mediaplayer/mmrenderercustomaudiorolecontrol.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 QNX Software Systems. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "mmrenderercustomaudiorolecontrol.h" -#include "mmrendererutil.h" - -QT_BEGIN_NAMESPACE - -MmRendererCustomAudioRoleControl::MmRendererCustomAudioRoleControl(QObject *parent) - : QCustomAudioRoleControl(parent) -{ -} - -QString MmRendererCustomAudioRoleControl::customAudioRole() const -{ - return m_role; -} - -void MmRendererCustomAudioRoleControl::setCustomAudioRole(const QString &role) -{ - if (m_role != role) { - m_role = role; - emit customAudioRoleChanged(m_role); - } -} - -QStringList MmRendererCustomAudioRoleControl::supportedCustomAudioRoles() const -{ - return QStringList(); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qnx/mediaplayer/mmrenderercustomaudiorolecontrol.h b/src/plugins/qnx/mediaplayer/mmrenderercustomaudiorolecontrol.h deleted file mode 100644 index ff16f9355..000000000 --- a/src/plugins/qnx/mediaplayer/mmrenderercustomaudiorolecontrol.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 QNX Software Systems. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef MMRENDERERCUSTOMAUDIOROLECONTROL_H -#define MMRENDERERCUSTOMAUDIOROLECONTROL_H - -#include <qcustomaudiorolecontrol.h> - -QT_BEGIN_NAMESPACE - -class MmRendererCustomAudioRoleControl : public QCustomAudioRoleControl -{ - Q_OBJECT -public: - explicit MmRendererCustomAudioRoleControl(QObject *parent = 0); - - QString customAudioRole() const Q_DECL_OVERRIDE; - void setCustomAudioRole(const QString &role) Q_DECL_OVERRIDE; - - QStringList supportedCustomAudioRoles() const Q_DECL_OVERRIDE; - -private: - QString m_role; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp b/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp index fc48ed818..f414b5ff3 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp +++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp @@ -216,11 +216,10 @@ void MmRendererMediaPlayerControl::attach() return; } - if (m_audioId != -1 && m_audioRoleControl) { - QAudio::Role audioRole = m_audioRoleControl->audioRole(); - QString audioType = (audioRole == QAudio::CustomRole && m_customAudioRoleControl) - ? m_customAudioRoleControl->customAudioRole() - : qnxAudioType(audioRole); + if (m_audioId != -1) { + QString audioType = m_role == QAudio::CustomRole + ? m_customRole + : qnxAudioType(m_role); QByteArray latin1AudioType = audioType.toLatin1(); if (!audioType.isEmpty() && latin1AudioType == audioType) { strm_dict_t *dict = strm_dict_new(); @@ -564,6 +563,28 @@ void MmRendererMediaPlayerControl::stop() stopInternal(StopMmRenderer); } +void MmRendererMediaPlayerControl::setAudioRole(QAudio::Role role) +{ + m_role = role; + m_customRole.clear(); +} + +QList<QAudio::Role> MmRendererMediaPlayerControl::supportedAudioRoles() const +{ + return qnxSupportedAudioRoles(); +} + +void MmRendererMediaPlayerControl::setCustomAudioRole(const QString &role) +{ + m_role = QAudio::CustomRole; + m_customRole = role; +} + +QStringList MmRendererMediaPlayerControl::supportedCustomAudioRoles() const +{ + return QStringList(); +} + MmRendererPlayerVideoRendererControl *MmRendererMediaPlayerControl::videoRendererControl() const { return m_videoRendererControl; @@ -584,16 +605,6 @@ void MmRendererMediaPlayerControl::setMetaDataReaderControl(MmRendererMetaDataRe m_metaDataReaderControl = metaDataReaderControl; } -void MmRendererMediaPlayerControl::setAudioRoleControl(MmRendererAudioRoleControl *audioRoleControl) -{ - m_audioRoleControl = audioRoleControl; -} - -void MmRendererMediaPlayerControl::setCustomAudioRoleControl(MmRendererCustomAudioRoleControl *customAudioRoleControl) -{ - m_customAudioRoleControl = customAudioRoleControl; -} - void MmRendererMediaPlayerControl::setMmPosition(qint64 newPosition) { if (newPosition != 0 && newPosition != m_position) { diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h b/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h index 3426ef2f2..c193fcd31 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h +++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h @@ -99,14 +99,18 @@ public: void pause() override; void stop() override; + void setAudioRole(QAudio::Role role) override; + QList<QAudio::Role> supportedAudioRoles() const override; + + void setCustomAudioRole(const QString &role) override; + QStringList supportedCustomAudioRoles() const override; + MmRendererPlayerVideoRendererControl *videoRendererControl() const; void setVideoRendererControl(MmRendererPlayerVideoRendererControl *videoControl); MmRendererVideoWindowControl *videoWindowControl() const; void setVideoWindowControl(MmRendererVideoWindowControl *videoControl); void setMetaDataReaderControl(MmRendererMetaDataReaderControl *metaDataReaderControl); - void setAudioRoleControl(MmRendererAudioRoleControl *audioRoleControl); - void setCustomAudioRoleControl(MmRendererCustomAudioRoleControl *customAudioRoleControl); protected: virtual void startMonitoring() = 0; @@ -164,8 +168,6 @@ private: QPointer<MmRendererPlayerVideoRendererControl> m_videoRendererControl; QPointer<MmRendererVideoWindowControl> m_videoWindowControl; QPointer<MmRendererMetaDataReaderControl> m_metaDataReaderControl; - QPointer<MmRendererAudioRoleControl> m_audioRoleControl; - QPointer<MmRendererCustomAudioRoleControl> m_customAudioRoleControl; MmRendererMetaData m_metaData; qint64 m_position; QMediaPlayer::MediaStatus m_mediaStatus; diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp index 190cb8b80..138d8e74e 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp +++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp @@ -38,8 +38,6 @@ ****************************************************************************/ #include "mmrenderermediaplayerservice.h" -#include "mmrendereraudiorolecontrol.h" -#include "mmrenderercustomaudiorolecontrol.h" #include "mmrenderermediaplayercontrol.h" #include "mmrenderermetadatareadercontrol.h" #include "mmrendererplayervideorenderercontrol.h" @@ -68,8 +66,6 @@ MmRendererMediaPlayerService::~MmRendererMediaPlayerService() delete m_videoWindowControl; delete m_mediaPlayerControl; delete m_metaDataReaderControl; - delete m_audioRoleControl; - delete m_customAudioRoleControl; } QMediaControl *MmRendererMediaPlayerService::requestControl(const char *name) @@ -86,18 +82,6 @@ QMediaControl *MmRendererMediaPlayerService::requestControl(const char *name) updateControls(); } return m_metaDataReaderControl; - } else if (qstrcmp(name, QAudioRoleControl_iid) == 0) { - if (!m_audioRoleControl) { - m_audioRoleControl = new MmRendererAudioRoleControl(); - updateControls(); - } - return m_audioRoleControl; - } else if (qstrcmp(name, QCustomAudioRoleControl_iid) == 0) { - if (!m_customAudioRoleControl) { - m_customAudioRoleControl = new MmRendererCustomAudioRoleControl(); - updateControls(); - } - return m_customAudioRoleControl; } else if (qstrcmp(name, QVideoRendererControl_iid) == 0) { if (!m_appHasDrmPermissionChecked) { m_appHasDrmPermission = checkForDrmPermission(); @@ -136,10 +120,6 @@ void MmRendererMediaPlayerService::releaseControl(QMediaControl *control) m_mediaPlayerControl = 0; if (control == m_metaDataReaderControl) m_metaDataReaderControl = 0; - if (control == m_audioRoleControl) - m_audioRoleControl = 0; - if (control == m_customAudioRoleControl) - m_customAudioRoleControl = 0; delete control; } @@ -153,12 +133,6 @@ void MmRendererMediaPlayerService::updateControls() if (m_metaDataReaderControl && m_mediaPlayerControl) m_mediaPlayerControl->setMetaDataReaderControl(m_metaDataReaderControl); - - if (m_audioRoleControl && m_mediaPlayerControl) - m_mediaPlayerControl->setAudioRoleControl(m_audioRoleControl); - - if (m_customAudioRoleControl && m_mediaPlayerControl) - m_mediaPlayerControl->setCustomAudioRoleControl(m_customAudioRoleControl); } QT_END_NAMESPACE diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.h b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.h index ab3054af5..47e8d01d3 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.h +++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.h @@ -44,8 +44,6 @@ QT_BEGIN_NAMESPACE -class MmRendererAudioRoleControl; -class MmRendererCustomAudioRoleControl; class MmRendererMediaPlayerControl; class MmRendererMetaDataReaderControl; class MmRendererPlayerVideoRendererControl; @@ -68,8 +66,6 @@ private: QPointer<MmRendererVideoWindowControl> m_videoWindowControl; QPointer<MmRendererMediaPlayerControl> m_mediaPlayerControl; QPointer<MmRendererMetaDataReaderControl> m_metaDataReaderControl; - QPointer<MmRendererAudioRoleControl> m_audioRoleControl; - QPointer<MmRendererCustomAudioRoleControl> m_customAudioRoleControl; bool m_appHasDrmPermission : 1; bool m_appHasDrmPermissionChecked : 1; |