diff options
-rw-r--r-- | src/plugins/directshow/dsserviceplugin.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/directshow/dsserviceplugin.cpp b/src/plugins/directshow/dsserviceplugin.cpp index 51be7e500..cb4f0cdf9 100644 --- a/src/plugins/directshow/dsserviceplugin.cpp +++ b/src/plugins/directshow/dsserviceplugin.cpp @@ -123,7 +123,9 @@ QMediaServiceProviderHint::Features DSServicePlugin::supportedFeatures( QByteArray DSServicePlugin::defaultDevice(const QByteArray &service) const { if (service == Q_MEDIASERVICE_CAMERA) { + addRefCount(); const QList<DSVideoDeviceInfo> &devs = DSVideoDeviceControl::availableDevices(); + releaseRefCount(); if (!devs.isEmpty()) return devs.first().first; } @@ -135,7 +137,9 @@ QList<QByteArray> DSServicePlugin::devices(const QByteArray &service) const QList<QByteArray> result; if (service == Q_MEDIASERVICE_CAMERA) { + addRefCount(); const QList<DSVideoDeviceInfo> &devs = DSVideoDeviceControl::availableDevices(); + releaseRefCount(); for (const DSVideoDeviceInfo &info : devs) result.append(info.first); } @@ -146,7 +150,9 @@ QList<QByteArray> DSServicePlugin::devices(const QByteArray &service) const QString DSServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device) { if (service == Q_MEDIASERVICE_CAMERA) { + addRefCount(); const QList<DSVideoDeviceInfo> &devs = DSVideoDeviceControl::availableDevices(); + releaseRefCount(); for (const DSVideoDeviceInfo &info : devs) { if (info.first == device) return info.second; |