summaryrefslogtreecommitdiffstats
path: root/src/plugins/directshow/dsserviceplugin.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-21 10:44:47 +0100
committerYoann Lopes <yoann.lopes@qt.io>2017-02-27 10:30:55 +0000
commit95de9e6154d75688e81a3b79007dfe6c56d3b65b (patch)
treea9effd19086e8b29651414fd657d963e8de47cba /src/plugins/directshow/dsserviceplugin.cpp
parent8d0e08e96ffd8cd78fbb4a01f250dfb46117c636 (diff)
Use QT_CONFIG macro to check for features
And remove many custom defines. Change-Id: I658cc8430d1d99ed3c0aafe03a77adce76621a29 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src/plugins/directshow/dsserviceplugin.cpp')
-rw-r--r--src/plugins/directshow/dsserviceplugin.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/plugins/directshow/dsserviceplugin.cpp b/src/plugins/directshow/dsserviceplugin.cpp
index 6f31ce7e2..6d8f97f52 100644
--- a/src/plugins/directshow/dsserviceplugin.cpp
+++ b/src/plugins/directshow/dsserviceplugin.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <dshow.h>
#include <QtCore/qstring.h>
@@ -45,21 +46,16 @@
#include "dsserviceplugin.h"
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
#include "dsvideodevicecontrol.h"
#include <dshow.h>
#include "dscameraservice.h"
-#endif
-#ifdef QMEDIA_DIRECTSHOW_PLAYER
+#if QT_CONFIG(directshow_player)
#include "directshowplayerservice.h"
#endif
#include <qmediaserviceproviderplugin.h>
-
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
-
extern const CLSID CLSID_VideoInputDeviceCategory;
@@ -75,7 +71,6 @@ extern const CLSID CLSID_VideoInputDeviceCategory;
#endif // Q_CC_MSVC
#include <windows.h>
#include <ocidl.h>
-#endif
QT_USE_NAMESPACE
@@ -94,13 +89,11 @@ void releaseRefCount()
QMediaService* DSServicePlugin::create(QString const& key)
{
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) {
addRefCount();
return new DSCameraService;
}
-#endif
-#ifdef QMEDIA_DIRECTSHOW_PLAYER
+#if QT_CONFIG(directshow_player)
if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) {
addRefCount();
return new DirectShowPlayerService;
@@ -127,14 +120,11 @@ QMediaServiceProviderHint::Features DSServicePlugin::supportedFeatures(
QByteArray DSServicePlugin::defaultDevice(const QByteArray &service) const
{
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (service == Q_MEDIASERVICE_CAMERA) {
const QList<DSVideoDeviceInfo> &devs = DSVideoDeviceControl::availableDevices();
if (!devs.isEmpty())
return devs.first().first;
}
-#endif
-
return QByteArray();
}
@@ -142,20 +132,17 @@ QList<QByteArray> DSServicePlugin::devices(const QByteArray &service) const
{
QList<QByteArray> result;
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (service == Q_MEDIASERVICE_CAMERA) {
const QList<DSVideoDeviceInfo> &devs = DSVideoDeviceControl::availableDevices();
for (const DSVideoDeviceInfo &info : devs)
result.append(info.first);
}
-#endif
return result;
}
QString DSServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device)
{
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (service == Q_MEDIASERVICE_CAMERA) {
const QList<DSVideoDeviceInfo> &devs = DSVideoDeviceControl::availableDevices();
for (const DSVideoDeviceInfo &info : devs) {
@@ -163,6 +150,5 @@ QString DSServicePlugin::deviceDescription(const QByteArray &service, const QByt
return info.second;
}
}
-#endif
return QString();
}