From 95de9e6154d75688e81a3b79007dfe6c56d3b65b Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 21 Nov 2016 10:44:47 +0100 Subject: Use QT_CONFIG macro to check for features And remove many custom defines. Change-Id: I658cc8430d1d99ed3c0aafe03a77adce76621a29 Reviewed-by: Yoann Lopes --- src/plugins/directshow/dsserviceplugin.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/plugins/directshow/dsserviceplugin.cpp') 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 #include #include @@ -45,21 +46,16 @@ #include "dsserviceplugin.h" -#ifdef QMEDIA_DIRECTSHOW_CAMERA #include "dsvideodevicecontrol.h" #include #include "dscameraservice.h" -#endif -#ifdef QMEDIA_DIRECTSHOW_PLAYER +#if QT_CONFIG(directshow_player) #include "directshowplayerservice.h" #endif #include - -#ifdef QMEDIA_DIRECTSHOW_CAMERA - extern const CLSID CLSID_VideoInputDeviceCategory; @@ -75,7 +71,6 @@ extern const CLSID CLSID_VideoInputDeviceCategory; #endif // Q_CC_MSVC #include #include -#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 &devs = DSVideoDeviceControl::availableDevices(); if (!devs.isEmpty()) return devs.first().first; } -#endif - return QByteArray(); } @@ -142,20 +132,17 @@ QList DSServicePlugin::devices(const QByteArray &service) const { QList result; -#ifdef QMEDIA_DIRECTSHOW_CAMERA if (service == Q_MEDIASERVICE_CAMERA) { const QList &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 &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(); } -- cgit v1.2.3