summaryrefslogtreecommitdiffstats
path: root/src/gsttools
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/gsttools
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/gsttools')
-rw-r--r--src/gsttools/gsttools.pro11
-rw-r--r--src/gsttools/qgstreameraudioinputselector.cpp5
-rw-r--r--src/gsttools/qgstutils.cpp7
3 files changed, 9 insertions, 14 deletions
diff --git a/src/gsttools/gsttools.pro b/src/gsttools/gsttools.pro
index e84454980..edbf603e3 100644
--- a/src/gsttools/gsttools.pro
+++ b/src/gsttools/gsttools.pro
@@ -8,17 +8,13 @@ QT = core-private multimedia-private gui-private
!static:DEFINES += QT_MAKEDLL
DEFINES += GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26
-qtConfig(alsa) {
- DEFINES += HAVE_ALSA
+qtConfig(alsa): \
QMAKE_USE += alsa
-}
QMAKE_USE += gstreamer
-qtConfig(resourcepolicy) {
- DEFINES += HAVE_RESOURCE_POLICY
+qtConfig(resourcepolicy): \
QMAKE_USE += libresourceqt5
-}
# Header files must go inside source directory of a module
# to be installed by syncqt.
@@ -101,11 +97,8 @@ qtConfig(gstreamer_app) {
QMAKE_USE += gstreamer_app
PRIVATE_HEADERS += qgstappsrc_p.h
SOURCES += qgstappsrc.cpp
- DEFINES += HAVE_GST_APPSRC
}
-qtConfig(linux_v4l): DEFINES += USE_V4L
-
HEADERS += $$PRIVATE_HEADERS
DESTDIR = $$QT.multimedia.libs
diff --git a/src/gsttools/qgstreameraudioinputselector.cpp b/src/gsttools/qgstreameraudioinputselector.cpp
index 668347f5c..6d74feb1b 100644
--- a/src/gsttools/qgstreameraudioinputselector.cpp
+++ b/src/gsttools/qgstreameraudioinputselector.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#include "qgstreameraudioinputselector_p.h"
#include <QtCore/QDir>
@@ -44,7 +45,7 @@
#include <gst/gst.h>
-#ifdef HAVE_ALSA
+#if QT_CONFIG(alsa)
#include <alsa/asoundlib.h>
#endif
@@ -115,7 +116,7 @@ void QGstreamerAudioInputSelector::update()
void QGstreamerAudioInputSelector::updateAlsaDevices()
{
-#ifdef HAVE_ALSA
+#if QT_CONFIG(alsa)
void **hints, **n;
if (snd_device_name_hint(-1, "pcm", &hints) < 0) {
qWarning()<<"no alsa devices available";
diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp
index a2b35073c..2f8a39d67 100644
--- a/src/gsttools/qgstutils.cpp
+++ b/src/gsttools/qgstutils.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#include "qgstutils_p.h"
#include <QtCore/qdatetime.h>
@@ -58,7 +59,7 @@
template<typename T, int N> static int lengthOf(const T (&)[N]) { return N; }
-#ifdef USE_V4L
+#if QT_CONFIG(linux_v4l)
# include <private/qcore_unix_p.h>
# include <linux/videodev2.h>
#endif
@@ -620,7 +621,7 @@ QVector<QGstUtils::CameraInfo> QGstUtils::enumerateCameras(GstElementFactory *fa
}
}
-#ifdef USE_V4L
+#if QT_CONFIG(linux_v4l)
QDir devDir(QStringLiteral("/dev"));
devDir.setFilter(QDir::System);
@@ -675,7 +676,7 @@ QVector<QGstUtils::CameraInfo> QGstUtils::enumerateCameras(GstElementFactory *fa
qt_safe_close(fd);
}
camerasCacheAgeTimer.restart();
-#endif // USE_V4L
+#endif // linux_v4l
return devices;
}