summaryrefslogtreecommitdiffstats
path: root/src/plugins/m3u
diff options
context:
space:
mode:
authorJonas Rabbe <jonas.rabbe@nokia.com>2012-03-14 13:02:32 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-20 23:39:45 +0100
commita8ba6e3c7f181e387eb53b122d58c433b5784319 (patch)
tree8a090349fa2698f879085380e6daa625ad979bdf /src/plugins/m3u
parent61c09d1614c560de9514ac0fd3344bf0280fca33 (diff)
Updated plugins to use new plugin architecture
Changed QMediaPluginLoader to use QFactoryLoader instead of QPluginLoader and used metadata to get keys. Removed QAudioPluginLoader and changed audio classes to use instead use QMediaPluginLoader. The plugins must include the Q_PLUGIN_METADATA macro, and no longer use the Q_PLUGIN_EXPORT/Q_PLUGIN_EXPORT2 macros. A json file has been added for each plugin which can contain metadata which is available to the plugin loader before the plugin is actually loaded, and is used to read the keys for the plugin, e.g. supported services. QFactoryInterface will be deprecated and has been removed from all plugins. Change-Id: I035b82f9c9c65717bebf704d560ea8f891df21da Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Diffstat (limited to 'src/plugins/m3u')
-rw-r--r--src/plugins/m3u/m3u.json3
-rw-r--r--src/plugins/m3u/m3u.pro6
-rw-r--r--src/plugins/m3u/main.cpp47
-rw-r--r--src/plugins/m3u/qm3uhandler.cpp5
-rw-r--r--src/plugins/m3u/qm3uhandler.h8
5 files changed, 11 insertions, 58 deletions
diff --git a/src/plugins/m3u/m3u.json b/src/plugins/m3u/m3u.json
new file mode 100644
index 000000000..2d69fab8e
--- /dev/null
+++ b/src/plugins/m3u/m3u.json
@@ -0,0 +1,3 @@
+{
+ "Keys": ["m3u"]
+}
diff --git a/src/plugins/m3u/m3u.pro b/src/plugins/m3u/m3u.pro
index cd73b1405..98d16c777 100644
--- a/src/plugins/m3u/m3u.pro
+++ b/src/plugins/m3u/m3u.pro
@@ -9,8 +9,10 @@ DESTDIR = $$QT.multimedia.plugins/$${PLUGIN_TYPE}
HEADERS += qm3uhandler.h
-SOURCES += main.cpp \
- qm3uhandler.cpp
+SOURCES += qm3uhandler.cpp
target.path += $$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
INSTALLS += target
+
+OTHER_FILES += \
+ m3u.json
diff --git a/src/plugins/m3u/main.cpp b/src/plugins/m3u/main.cpp
deleted file mode 100644
index 45855fb34..000000000
--- a/src/plugins/m3u/main.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qm3uhandler.h"
-#include <qstringlist.h>
-
-
-Q_EXPORT_STATIC_PLUGIN(QM3uPlaylistPlugin)
-Q_EXPORT_PLUGIN2(qtmultimedia_m3u, QM3uPlaylistPlugin)
diff --git a/src/plugins/m3u/qm3uhandler.cpp b/src/plugins/m3u/qm3uhandler.cpp
index 0f8d5da89..a03e8025e 100644
--- a/src/plugins/m3u/qm3uhandler.cpp
+++ b/src/plugins/m3u/qm3uhandler.cpp
@@ -212,11 +212,6 @@ bool QM3uPlaylistPlugin::canWrite(QIODevice *device, const QByteArray &format) c
return device->isOpen() && device->isWritable() && format == "m3u";
}
-QStringList QM3uPlaylistPlugin::keys() const
-{
- return QStringList() << QLatin1String("m3u");
-}
-
QMediaPlaylistReader *QM3uPlaylistPlugin::createReader(QIODevice *device, const QByteArray &format)
{
Q_UNUSED(format);
diff --git a/src/plugins/m3u/qm3uhandler.h b/src/plugins/m3u/qm3uhandler.h
index 5d8e0e461..b0dd29230 100644
--- a/src/plugins/m3u/qm3uhandler.h
+++ b/src/plugins/m3u/qm3uhandler.h
@@ -43,13 +43,15 @@
#define QM3UHANDLER_H
#include <private/qmediaplaylistioplugin_p.h>
-#include <QObject>
+#include <QtCore/QObject>
QT_USE_NAMESPACE
class QM3uPlaylistPlugin : public QMediaPlaylistIOPlugin
{
-Q_OBJECT
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "com.nokia.Qt.QMediaPlaylistIOInterface" FILE "m3u.json")
+
public:
explicit QM3uPlaylistPlugin(QObject *parent = 0);
virtual ~QM3uPlaylistPlugin();
@@ -59,8 +61,6 @@ public:
virtual bool canWrite(QIODevice *device, const QByteArray &format) const;
- virtual QStringList keys() const;
-
virtual QMediaPlaylistReader *createReader(QIODevice *device, const QByteArray &format = QByteArray());
virtual QMediaPlaylistReader *createReader(const QUrl& location, const QByteArray &format = QByteArray());