uvcserviceplugin.h 1.08 KB
Newer Older
Thiago Santini's avatar
Thiago Santini committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#ifndef UVCSERVICEPLUGIN_H
#define UVCSERVICEPLUGIN_H

#include <QtMultimedia/QMediaServiceProviderPlugin>

#include "libuvc/libuvc.h"

#include "uvccameraservice.h"
#include "uvcvideodevicecontrol.h"

class UVCServicePlugin
    : public QMediaServiceProviderPlugin
    , public QMediaServiceSupportedDevicesInterface
    //, public QMediaServiceDefaultDeviceInterface
    //, public QMediaServiceFeaturesInterface
{
    Q_OBJECT
    Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
    //Q_INTERFACES(QMediaServiceDefaultDeviceInterface)
    //Q_INTERFACES(QMediaServiceFeaturesInterface)

#if QT_VERSION >= 0x050000
    Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "uvcengine.json")
#endif // QT_VERSION >= 0x050000

public:
    QMediaService *create(const QString &key);
    void release(QMediaService *service);

    QByteArray defaultDevice(const QByteArray &service) const;
    QList<QByteArray> devices(const QByteArray &service) const;
    QString deviceDescription(const QByteArray &service, const QByteArray &device);

private:
};

#endif // UVCSERVICEPLUGIN_H