\internal
Writing a audio plugin is achieved by subclassing this base class,
- reimplementing the pure virtual functions keys(), availableDevices(),
+ reimplementing the pure virtual functions availableDevices(),
createInput(), createOutput() and createDeviceInfo() then exporting
- the class with the Q_EXPORT_PLUGIN2() macro.
+ the class with the Q_PLUGIN_METADATA() macro.
+
+ The json file containing the meta data should contain a list of keys
+ matching the plugin. Add "default" to your list of keys available
+ to override the default audio device to be provided by your plugin.
+
+ \code
+ { "Keys": [ "default" ] }
+ \endcode
Unit tests are available to help in debugging new plugins.
creating a plugin subclassing QAudioSystemPlugin, QAbstractAudioDeviceInfo,
QAbstractAudioOutput and QAbstractAudioInput.
- Add "default" to your list of keys() available to override the default
- audio device to be provided by your plugin.
-audio-backend configure option will force compiling in of the builtin backend
into the QtMultimedia library at compile time. This is automatic by default
--- /dev/null
+{
+ "Keys": ["org.qt-project.qt.radio"]
+}
#include <qmediaserviceprovider.h>
-QStringList V4LServicePlugin::keys() const
-{
- return QStringList() <<
- QLatin1String(Q_MEDIASERVICE_RADIO);
-}
-
QMediaService* V4LServicePlugin::create(QString const& key)
{
if (key == QLatin1String(Q_MEDIASERVICE_RADIO))
{
return QString();
}
-
-
-Q_EXPORT_PLUGIN2(qtmedia_v4lengine, V4LServicePlugin);
-
{
Q_OBJECT
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
+ Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "v4l.json")
public:
- QStringList keys() const;
QMediaService* create(QString const& key);
void release(QMediaService *service);
--- /dev/null
+{
+ "Keys": ["org.qt-project.qt.mediaplayer"]
+}
#endif
#include <qmediaserviceprovider.h>
-QStringList WMFServicePlugin::keys() const
-{
- return QStringList()
-#ifdef QMEDIA_MEDIAFOUNDATION_PLAYER
- << QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)
-#endif
- ;
-}
-
QMediaService* WMFServicePlugin::create(QString const& key)
{
#ifdef QMEDIA_MEDIAFOUNDATION_PLAYER
return QString();
}
-Q_EXPORT_PLUGIN2(qtmedia_wmfengine, WMFServicePlugin);
-
Q_OBJECT
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
Q_INTERFACES(QMediaServiceFeaturesInterface)
+ Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "wmf.json")
public:
- QStringList keys() const;
QMediaService* create(QString const& key);
void release(QMediaService *service);