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>
This commit is contained in:
3
src/plugins/gstreamer/gstreamer.json
Normal file
3
src/plugins/gstreamer/gstreamer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"Keys": ["com.nokia.qt.mediaplayer", "com.nokia.qt.audiosource", "com.nokia.qt.camera", "com.nokia.qt.audiodecode"]
|
||||
}
|
||||
@@ -107,6 +107,8 @@ contains(config_test_gstreamer_appsrc, yes) {
|
||||
LIBS += -lgstapp-0.10
|
||||
}
|
||||
|
||||
OTHER_FILES += gstreamer.json
|
||||
|
||||
|
||||
#Camerabin2 based camera backend is untested and currently disabled
|
||||
#contains(config_test_gstreamer_photography, yes) {
|
||||
|
||||
@@ -79,25 +79,6 @@
|
||||
#include <linux/videodev2.h>
|
||||
|
||||
|
||||
QStringList QGstreamerServicePlugin::keys() const
|
||||
{
|
||||
return QStringList()
|
||||
#ifdef QMEDIA_GSTREAMER_PLAYER
|
||||
<< QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)
|
||||
#endif
|
||||
#ifdef QMEDIA_GSTREAMER_AUDIO_DECODER
|
||||
<< QLatin1String(Q_MEDIASERVICE_AUDIODECODER)
|
||||
#endif
|
||||
#ifdef QMEDIA_GSTREAMER_CAPTURE
|
||||
<< QLatin1String(Q_MEDIASERVICE_AUDIOSOURCE)
|
||||
<< QLatin1String(Q_MEDIASERVICE_CAMERA)
|
||||
#elif defined(QMEDIA_GSTREAMER_CAMERABIN)
|
||||
<< QLatin1String(Q_MEDIASERVICE_CAMERA)
|
||||
#endif
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
QMediaService* QGstreamerServicePlugin::create(const QString &key)
|
||||
{
|
||||
static bool initialized = false;
|
||||
@@ -402,4 +383,3 @@ QStringList QGstreamerServicePlugin::supportedMimeTypes() const
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2(qtmedia_gstengine, QGstreamerServicePlugin);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#include <qmediaserviceproviderplugin.h>
|
||||
#include <QtCore/qset.h>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -59,8 +60,8 @@ class QGstreamerServicePlugin
|
||||
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
|
||||
Q_INTERFACES(QMediaServiceFeaturesInterface)
|
||||
Q_INTERFACES(QMediaServiceSupportedFormatsInterface)
|
||||
Q_PLUGIN_METADATA(IID "com.nokia.Qt.QMediaServiceProviderFactoryInterface/1.0" FILE "gstreamer.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QMediaService* create(QString const& key);
|
||||
void release(QMediaService *service);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user