From cd1eef45e976f6d2f02abff1648e1e0f7e07a71f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 31 Oct 2016 10:43:06 +0100 Subject: Remove Blackberry specific code paths Change-Id: I187085984eb1b25d7f3de163dc05122df1259720 Reviewed-by: Rafael Roquetto --- src/plugins/qnx/bbserviceplugin.cpp | 139 --------------------- src/plugins/qnx/bbserviceplugin.h | 84 ------------- src/plugins/qnx/blackberry_mediaservice.json | 4 - .../qnx/mediaplayer/bpsmediaplayercontrol.cpp | 119 ------------------ .../qnx/mediaplayer/bpsmediaplayercontrol.h | 64 ---------- src/plugins/qnx/mediaplayer/mediaplayer.pri | 19 +-- .../mediaplayer/mmrenderermediaplayerservice.cpp | 8 +- src/plugins/qnx/qnx.pro | 15 +-- 8 files changed, 10 insertions(+), 442 deletions(-) delete mode 100644 src/plugins/qnx/bbserviceplugin.cpp delete mode 100644 src/plugins/qnx/bbserviceplugin.h delete mode 100644 src/plugins/qnx/blackberry_mediaservice.json delete mode 100644 src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.cpp delete mode 100644 src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.h (limited to 'src/plugins/qnx') diff --git a/src/plugins/qnx/bbserviceplugin.cpp b/src/plugins/qnx/bbserviceplugin.cpp deleted file mode 100644 index e83d1caa3..000000000 --- a/src/plugins/qnx/bbserviceplugin.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 "bbserviceplugin.h" - -#include "bbcamerainfocontrol.h" -#include "bbcameraservice.h" -#include "bbcamerasession.h" -#include "bbvideodeviceselectorcontrol.h" -#include "mmrenderermediaplayerservice.h" - -#include - -QT_BEGIN_NAMESPACE - -BbServicePlugin::BbServicePlugin() -{ -} - -QMediaService *BbServicePlugin::create(const QString &key) -{ - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) - return new BbCameraService(); - - if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) - return new MmRendererMediaPlayerService(); - - return 0; -} - -void BbServicePlugin::release(QMediaService *service) -{ - delete service; -} - -QMediaServiceProviderHint::Features BbServicePlugin::supportedFeatures(const QByteArray &service) const -{ - Q_UNUSED(service) - return QMediaServiceProviderHint::Features(); -} - -QByteArray BbServicePlugin::defaultDevice(const QByteArray &service) const -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - return m_defaultCameraDevice; - } - - return QByteArray(); -} - -QList BbServicePlugin::devices(const QByteArray &service) const -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - return m_cameraDevices; - } - - return QList(); -} - -QString BbServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device) -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - for (int i = 0; i < m_cameraDevices.count(); i++) - if (m_cameraDevices[i] == device) - return m_cameraDescriptions[i]; - } - - return QString(); -} - -void BbServicePlugin::updateDevices() const -{ - m_defaultCameraDevice.clear(); - BbVideoDeviceSelectorControl::enumerateDevices(&m_cameraDevices, &m_cameraDescriptions); - - if (m_cameraDevices.isEmpty()) { - qWarning() << "No camera devices found"; - } else { - m_defaultCameraDevice = m_cameraDevices.contains(BbCameraSession::cameraIdentifierRear()) - ? BbCameraSession::cameraIdentifierRear() - : m_cameraDevices.first(); - } -} - -QCamera::Position BbServicePlugin::cameraPosition(const QByteArray &device) const -{ - return BbCameraInfoControl::position(device); -} - -int BbServicePlugin::cameraOrientation(const QByteArray &device) const -{ - return BbCameraInfoControl::orientation(device); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qnx/bbserviceplugin.h b/src/plugins/qnx/bbserviceplugin.h deleted file mode 100644 index e2e77c233..000000000 --- a/src/plugins/qnx/bbserviceplugin.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 BBRSERVICEPLUGIN_H -#define BBRSERVICEPLUGIN_H - -#include - -QT_BEGIN_NAMESPACE - -class BbServicePlugin - : public QMediaServiceProviderPlugin, - public QMediaServiceSupportedDevicesInterface, - public QMediaServiceDefaultDeviceInterface, - public QMediaServiceCameraInfoInterface, - public QMediaServiceFeaturesInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceSupportedDevicesInterface) - Q_INTERFACES(QMediaServiceDefaultDeviceInterface) - Q_INTERFACES(QMediaServiceCameraInfoInterface) - Q_INTERFACES(QMediaServiceFeaturesInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "blackberry_mediaservice.json") -public: - BbServicePlugin(); - - QMediaService *create(const QString &key) Q_DECL_OVERRIDE; - void release(QMediaService *service) Q_DECL_OVERRIDE; - QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const Q_DECL_OVERRIDE; - - QByteArray defaultDevice(const QByteArray &service) const Q_DECL_OVERRIDE; - QList devices(const QByteArray &service) const Q_DECL_OVERRIDE; - QString deviceDescription(const QByteArray &service, const QByteArray &device) Q_DECL_OVERRIDE; - QVariant deviceProperty(const QByteArray &service, const QByteArray &device, const QByteArray &property) Q_DECL_OVERRIDE; - - QCamera::Position cameraPosition(const QByteArray &device) const Q_DECL_OVERRIDE; - int cameraOrientation(const QByteArray &device) const Q_DECL_OVERRIDE; - -private: - void updateDevices() const; - - mutable QByteArray m_defaultCameraDevice; - mutable QList m_cameraDevices; - mutable QStringList m_cameraDescriptions; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/qnx/blackberry_mediaservice.json b/src/plugins/qnx/blackberry_mediaservice.json deleted file mode 100644 index 2a59cc770..000000000 --- a/src/plugins/qnx/blackberry_mediaservice.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Keys": ["blackberrymultimedia"], - "Services": ["org.qt-project.qt.camera", "org.qt-project.qt.mediaplayer"] -} diff --git a/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.cpp b/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.cpp deleted file mode 100644 index 35bdb8360..000000000 --- a/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 "bpsmediaplayercontrol.h" -#include "mmrenderervideowindowcontrol.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -BpsMediaPlayerControl::BpsMediaPlayerControl(QObject *parent) - : MmRendererMediaPlayerControl(parent), - m_eventMonitor(0) -{ - openConnection(); -} - -BpsMediaPlayerControl::~BpsMediaPlayerControl() -{ - destroy(); -} - -void BpsMediaPlayerControl::startMonitoring(int contextId, const QString &contextName) -{ - m_eventMonitor = mmrenderer_request_events(contextName.toLatin1().constData(), 0, contextId); - if (!m_eventMonitor) { - qDebug() << "Unable to request multimedia events"; - emit error(0, "Unable to request multimedia events"); - } -} - -void BpsMediaPlayerControl::stopMonitoring() -{ - if (m_eventMonitor) { - mmrenderer_stop_events(m_eventMonitor); - m_eventMonitor = 0; - } -} - -bool BpsMediaPlayerControl::nativeEventFilter(const QByteArray &eventType, void *message, long *result) -{ - Q_UNUSED(result) - Q_UNUSED(eventType) - - bps_event_t * const event = static_cast(message); - if (!event || - (bps_event_get_domain(event) != mmrenderer_get_domain() && - bps_event_get_domain(event) != screen_get_domain())) - return false; - - if (event && bps_event_get_domain(event) == screen_get_domain()) { - const screen_event_t screen_event = screen_event_get_event(event); - if (MmRendererVideoWindowControl *control = videoWindowControl()) - control->screenEventHandler(screen_event); - } - - if (bps_event_get_domain(event) == mmrenderer_get_domain()) { - if (bps_event_get_code(event) == MMRENDERER_STATE_CHANGE) { - const mmrenderer_state_t newState = mmrenderer_event_get_state(event); - if (newState == MMR_STOPPED) { - handleMmStopped(); - return false; - } - } - - if (bps_event_get_code(event) == MMRENDERER_STATUS_UPDATE) { - const qint64 newPosition = QString::fromLatin1(mmrenderer_event_get_position(event)). - toLongLong(); - handleMmStatusUpdate(newPosition); - - const QString status = QString::fromLatin1(mmrenderer_event_get_bufferstatus(event)); - setMmBufferStatus(status); - - const QString level = QString::fromLatin1(mmrenderer_event_get_bufferlevel(event)); - setMmBufferLevel(level); - } - } - - return false; -} - -QT_END_NAMESPACE diff --git a/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.h b/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.h deleted file mode 100644 index d9789d689..000000000 --- a/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 BPSMEDIAPLAYERCONTROL_H -#define BPSMEDIAPLAYERCONTROL_H - -#include "mmrenderermediaplayercontrol.h" - -QT_BEGIN_NAMESPACE - -class BpsMediaPlayerControl Q_DECL_FINAL : public MmRendererMediaPlayerControl -{ - Q_OBJECT -public: - explicit BpsMediaPlayerControl(QObject *parent = 0); - ~BpsMediaPlayerControl(); - - void startMonitoring(int contextId, const QString &contextName) Q_DECL_OVERRIDE; - void stopMonitoring() Q_DECL_OVERRIDE; - - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; - -private: - mmrenderer_monitor_t *m_eventMonitor; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/qnx/mediaplayer/mediaplayer.pri b/src/plugins/qnx/mediaplayer/mediaplayer.pri index 9d74dd481..756857cce 100644 --- a/src/plugins/qnx/mediaplayer/mediaplayer.pri +++ b/src/plugins/qnx/mediaplayer/mediaplayer.pri @@ -7,8 +7,8 @@ HEADERS += \ $$PWD/mmrenderermetadatareadercontrol.h \ $$PWD/mmrendererplayervideorenderercontrol.h \ $$PWD/mmrendererutil.h \ - $$PWD/mmrenderervideowindowcontrol.h - + $$PWD/mmrenderervideowindowcontrol.h \ + $$PWD/ppsmediaplayercontrol.h SOURCES += \ $$PWD/mmrenderermediaplayercontrol.cpp \ $$PWD/mmrenderermediaplayerservice.cpp \ @@ -16,16 +16,7 @@ SOURCES += \ $$PWD/mmrenderermetadatareadercontrol.cpp \ $$PWD/mmrendererplayervideorenderercontrol.cpp \ $$PWD/mmrendererutil.cpp \ - $$PWD/mmrenderervideowindowcontrol.cpp - -QMAKE_USE += mmrenderer + $$PWD/mmrenderervideowindowcontrol.cpp \ + $$PWD/ppsmediaplayercontrol.cpp -blackberry { - HEADERS += $$PWD/bpsmediaplayercontrol.h - SOURCES += $$PWD/bpsmediaplayercontrol.cpp -} else { - HEADERS += $$PWD/ppsmediaplayercontrol.h - SOURCES += $$PWD/ppsmediaplayercontrol.cpp - QT += core-private - LIBS += -lpps -} +QMAKE_USE += mmrenderer pps diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp index 2709a99dd..e253c68d8 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp +++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp @@ -44,13 +44,7 @@ #include "mmrendererutil.h" #include "mmrenderervideowindowcontrol.h" -#ifdef Q_OS_BLACKBERRY -#include "bpsmediaplayercontrol.h" -typedef BpsMediaPlayerControl PlatformSpecificMediaPlayerControl; -#else #include "ppsmediaplayercontrol.h" -typedef PpsMediaPlayerControl PlatformSpecificMediaPlayerControl; -#endif QT_BEGIN_NAMESPACE @@ -78,7 +72,7 @@ QMediaControl *MmRendererMediaPlayerService::requestControl(const char *name) { if (qstrcmp(name, QMediaPlayerControl_iid) == 0) { if (!m_mediaPlayerControl) { - m_mediaPlayerControl = new PlatformSpecificMediaPlayerControl; + m_mediaPlayerControl = new PpsMediaPlayerControl; updateControls(); } return m_mediaPlayerControl; diff --git a/src/plugins/qnx/qnx.pro b/src/plugins/qnx/qnx.pro index 4d76fa5f7..87b3c4dc5 100644 --- a/src/plugins/qnx/qnx.pro +++ b/src/plugins/qnx/qnx.pro @@ -1,21 +1,14 @@ TARGET = qtmedia_qnx -QT += multimedia-private gui-private +QT += multimedia-private gui-private core-private LIBS += -lscreen include(common/common.pri) include(mediaplayer/mediaplayer.pri) -blackberry { - include(camera/camera.pri) - HEADERS += bbserviceplugin.h - SOURCES += bbserviceplugin.cpp - OTHER_FILES += blackberry_mediaservice.json -} else { - HEADERS += neutrinoserviceplugin.h - SOURCES += neutrinoserviceplugin.cpp - OTHER_FILES += neutrino_mediaservice.json -} +HEADERS += neutrinoserviceplugin.h +SOURCES += neutrinoserviceplugin.cpp +OTHER_FILES += neutrino_mediaservice.json PLUGIN_TYPE = mediaservice PLUGIN_CLASS_NAME = BbServicePlugin -- cgit v1.2.3