summaryrefslogtreecommitdiffstats
path: root/src/plugins/directshow/dsserviceplugin.cpp
diff options
context:
space:
mode:
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 4b84841bd..9060bac7c 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>
@@ -46,21 +47,16 @@
#include "directshowglobal.h"
#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;
@@ -76,7 +72,6 @@ extern const CLSID CLSID_VideoInputDeviceCategory;
#endif // Q_CC_MSVC
#include <windows.h>
#include <ocidl.h>
-#endif
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qtDirectShowPlugin, "qt.multimedia.plugins.directshow")
@@ -99,13 +94,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;
@@ -132,14 +125,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();
}
@@ -147,20 +137,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) {
@@ -168,6 +155,5 @@ QString DSServicePlugin::deviceDescription(const QByteArray &service, const QByt
return info.second;
}
}
-#endif
return QString();
}