diff options
author | Jonas Rabbe <jonas.rabbe@nokia.com> | 2012-03-14 13:02:32 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-20 23:39:45 +0100 |
commit | a8ba6e3c7f181e387eb53b122d58c433b5784319 (patch) | |
tree | 8a090349fa2698f879085380e6daa625ad979bdf /src/plugins/directshow | |
parent | 61c09d1614c560de9514ac0fd3344bf0280fca33 (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/directshow')
-rw-r--r-- | src/plugins/directshow/directshow.json | 3 | ||||
-rw-r--r-- | src/plugins/directshow/directshow.pro | 3 | ||||
-rw-r--r-- | src/plugins/directshow/dsserviceplugin.cpp | 15 | ||||
-rw-r--r-- | src/plugins/directshow/dsserviceplugin.h | 3 |
4 files changed, 8 insertions, 16 deletions
diff --git a/src/plugins/directshow/directshow.json b/src/plugins/directshow/directshow.json new file mode 100644 index 000000000..a96b09827 --- /dev/null +++ b/src/plugins/directshow/directshow.json @@ -0,0 +1,3 @@ +{ + "Keys": ["com.nokia.qt.camera", "com.nokia.qt.mediaplayer"] +} diff --git a/src/plugins/directshow/directshow.pro b/src/plugins/directshow/directshow.pro index bb5bb023b..fe1cf5feb 100644 --- a/src/plugins/directshow/directshow.pro +++ b/src/plugins/directshow/directshow.pro @@ -24,3 +24,6 @@ include(camera/camera.pri) target.path += $$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE} INSTALLS += target + +OTHER_FILES += \ + directshow.json diff --git a/src/plugins/directshow/dsserviceplugin.cpp b/src/plugins/directshow/dsserviceplugin.cpp index 15b0ecfa3..d3871c844 100644 --- a/src/plugins/directshow/dsserviceplugin.cpp +++ b/src/plugins/directshow/dsserviceplugin.cpp @@ -77,18 +77,6 @@ extern const CLSID CLSID_VideoInputDeviceCategory; QT_USE_NAMESPACE -QStringList DSServicePlugin::keys() const -{ - return QStringList() -#ifdef QMEDIA_DIRECTSHOW_CAMERA - << QLatin1String(Q_MEDIASERVICE_CAMERA) -#endif -#ifdef QMEDIA_DIRECTSHOW_PLAYER - << QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER) -#endif - ; -} - QMediaService* DSServicePlugin::create(QString const& key) { #ifdef QMEDIA_DIRECTSHOW_CAMERA @@ -100,7 +88,6 @@ QMediaService* DSServicePlugin::create(QString const& key) return new DirectShowPlayerService; #endif - qDebug() << "unsupported key:" << key; return 0; } @@ -208,5 +195,3 @@ void DSServicePlugin::updateDevices() const } #endif -Q_EXPORT_PLUGIN2(qtmedia_dsengine, DSServicePlugin); - diff --git a/src/plugins/directshow/dsserviceplugin.h b/src/plugins/directshow/dsserviceplugin.h index 0a9b8973d..2c0b12619 100644 --- a/src/plugins/directshow/dsserviceplugin.h +++ b/src/plugins/directshow/dsserviceplugin.h @@ -54,8 +54,9 @@ class DSServicePlugin Q_OBJECT Q_INTERFACES(QMediaServiceSupportedDevicesInterface) Q_INTERFACES(QMediaServiceFeaturesInterface) + Q_PLUGIN_METADATA(IID "com.nokia.Qt.QMediaServiceProviderFactoryInterface/1.0", FILE "directshow.json") + public: - QStringList keys() const; QMediaService* create(QString const& key); void release(QMediaService *service); |