summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>2014-07-10 19:19:37 -0300
committerYoann Lopes <yoann.lopes@digia.com>2014-08-18 15:07:47 +0200
commitff527de0133d597293459cc7d0f03f6203995cc6 (patch)
treea50e1e129524d6f2eaf3b97444167f1134bdffb9 /src
parentda77331952f38992fbd4a650a02ad975a4efaa36 (diff)
Detect V4L availability
Do not build related stuff if not found. Makes GStreamer support available on Hurd. Task-number: QTBUG-39762 Change-Id: I1f70b6975e5bef99ab2441aac4d90508bc8b64bd Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gsttools/gsttools.pro2
-rw-r--r--src/gsttools/qgstreamervideoinputdevicecontrol.cpp5
-rw-r--r--src/plugins/gstreamer/camerabin/camerabin.pro2
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp5
-rw-r--r--src/plugins/gstreamer/mediacapture/mediacapture.pro21
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp9
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.h2
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp3
-rw-r--r--src/plugins/plugins.pro4
9 files changed, 42 insertions, 11 deletions
diff --git a/src/gsttools/gsttools.pro b/src/gsttools/gsttools.pro
index 15edd04d2..7c809a777 100644
--- a/src/gsttools/gsttools.pro
+++ b/src/gsttools/gsttools.pro
@@ -100,6 +100,8 @@ config_gstreamer_appsrc {
LIBS_PRIVATE += -lgstapp-0.10
}
+config_linux_v4l: DEFINES += USE_V4L
+
HEADERS += $$PRIVATE_HEADERS
DESTDIR = $$QT.multimedia.libs
diff --git a/src/gsttools/qgstreamervideoinputdevicecontrol.cpp b/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
index e4e202caf..dc008712e 100644
--- a/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
+++ b/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
@@ -45,7 +45,10 @@
#include <QtCore/QDebug>
#include <private/qcore_unix_p.h>
+
+#if defined(USE_V4L)
#include <linux/videodev2.h>
+#endif
QGstreamerVideoInputDeviceControl::QGstreamerVideoInputDeviceControl(QObject *parent)
:QVideoDeviceSelectorControl(parent), m_source(0), m_selectedDevice(0)
@@ -118,6 +121,7 @@ void QGstreamerVideoInputDeviceControl::update()
return;
}
+#if defined(USE_V4L)
QDir devDir("/dev");
devDir.setFilter(QDir::System);
@@ -158,4 +162,5 @@ void QGstreamerVideoInputDeviceControl::update()
}
qt_safe_close(fd);
}
+#endif
}
diff --git a/src/plugins/gstreamer/camerabin/camerabin.pro b/src/plugins/gstreamer/camerabin/camerabin.pro
index 9efa0812a..9ed821cb9 100644
--- a/src/plugins/gstreamer/camerabin/camerabin.pro
+++ b/src/plugins/gstreamer/camerabin/camerabin.pro
@@ -81,6 +81,8 @@ config_gstreamer_photography {
DEFINES += GST_USE_UNSTABLE_API #prevents warnings because of unstable photography API
}
+config_linux_v4l: DEFINES += USE_V4L
+
OTHER_FILES += \
camerabin.json
diff --git a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
index 3decd6070..5fb419aae 100644
--- a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
@@ -51,7 +51,10 @@
#include <private/qgstutils_p.h>
#include <private/qcore_unix_p.h>
+
+#if defined(USE_V4L)
#include <linux/videodev2.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -132,6 +135,7 @@ void CameraBinServicePlugin::updateDevices() const
m_cameraDevices.clear();
m_cameraDescriptions.clear();
+#if defined(USE_V4L)
QDir devDir("/dev");
devDir.setFilter(QDir::System);
@@ -173,6 +177,7 @@ void CameraBinServicePlugin::updateDevices() const
if (!m_cameraDevices.isEmpty())
m_defaultCameraDevice = m_cameraDevices.first();
+#endif
}
QT_END_NAMESPACE
diff --git a/src/plugins/gstreamer/mediacapture/mediacapture.pro b/src/plugins/gstreamer/mediacapture/mediacapture.pro
index e8d039f8d..5baa0fd8f 100644
--- a/src/plugins/gstreamer/mediacapture/mediacapture.pro
+++ b/src/plugins/gstreamer/mediacapture/mediacapture.pro
@@ -15,7 +15,6 @@ HEADERS += $$PWD/qgstreamercaptureservice.h \
$$PWD/qgstreamerrecordercontrol.h \
$$PWD/qgstreamermediacontainercontrol.h \
$$PWD/qgstreamercameracontrol.h \
- $$PWD/qgstreamerv4l2input.h \
$$PWD/qgstreamercapturemetadatacontrol.h \
$$PWD/qgstreamerimagecapturecontrol.h \
$$PWD/qgstreamerimageencode.h \
@@ -28,7 +27,6 @@ SOURCES += $$PWD/qgstreamercaptureservice.cpp \
$$PWD/qgstreamerrecordercontrol.cpp \
$$PWD/qgstreamermediacontainercontrol.cpp \
$$PWD/qgstreamercameracontrol.cpp \
- $$PWD/qgstreamerv4l2input.cpp \
$$PWD/qgstreamercapturemetadatacontrol.cpp \
$$PWD/qgstreamerimagecapturecontrol.cpp \
$$PWD/qgstreamerimageencode.cpp \
@@ -37,13 +35,18 @@ SOURCES += $$PWD/qgstreamercaptureservice.cpp \
# Camera usage with gstreamer needs to have
#CONFIG += use_gstreamer_camera
-use_gstreamer_camera {
-DEFINES += USE_GSTREAMER_CAMERA
+use_gstreamer_camera:config_linux_v4l {
+ DEFINES += USE_GSTREAMER_CAMERA
+
+ OTHER_FILES += \
+ mediacapturecamera.json
+
+ HEADERS += \
+ $$PWD/qgstreamerv4l2input.h
+ SOURCES += \
+ $$PWD/qgstreamerv4l2input.cpp
-OTHER_FILES += \
- mediacapturecamera.json
} else {
-OTHER_FILES += \
- mediacapture.json
+ OTHER_FILES += \
+ mediacapture.json
}
-
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp
index 92b362fb8..2278f926f 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp
@@ -48,9 +48,12 @@
#include "qgstreamerimageencode.h"
#include "qgstreamercameracontrol.h"
#include <private/qgstreamerbushelper_p.h>
-#include "qgstreamerv4l2input.h"
#include "qgstreamercapturemetadatacontrol.h"
+#if defined(USE_GSTREAMER_CAMERA)
+#include "qgstreamerv4l2input.h"
+#endif
+
#include "qgstreamerimagecapturecontrol.h"
#include <private/qgstreameraudioinputselector_p.h>
#include <private/qgstreamervideoinputdevicecontrol_p.h>
@@ -74,7 +77,9 @@ QGstreamerCaptureService::QGstreamerCaptureService(const QString &service, QObje
m_cameraControl = 0;
m_metaDataControl = 0;
+#if defined(USE_GSTREAMER_CAMERA)
m_videoInput = 0;
+#endif
m_audioInputSelector = 0;
m_videoInputDevice = 0;
@@ -90,6 +95,7 @@ QGstreamerCaptureService::QGstreamerCaptureService(const QString &service, QObje
m_captureSession = new QGstreamerCaptureSession(QGstreamerCaptureSession::Audio, this);
}
+#if defined(USE_GSTREAMER_CAMERA)
if (service == Q_MEDIASERVICE_CAMERA) {
m_captureSession = new QGstreamerCaptureSession(QGstreamerCaptureSession::AudioAndVideo, this);
m_cameraControl = new QGstreamerCameraControl(m_captureSession);
@@ -111,6 +117,7 @@ QGstreamerCaptureService::QGstreamerCaptureService(const QString &service, QObje
#endif
m_imageCaptureControl = new QGstreamerImageCaptureControl(m_captureSession);
}
+#endif
m_audioInputSelector = new QGstreamerAudioInputSelector(this);
connect(m_audioInputSelector, SIGNAL(activeInputChanged(QString)), m_captureSession, SLOT(setCaptureDevice(QString)));
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.h b/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.h
index fc29b4f34..563c48c28 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.h
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.h
@@ -78,7 +78,9 @@ private:
QGstreamerCaptureSession *m_captureSession;
QGstreamerCameraControl *m_cameraControl;
+#if defined(USE_GSTREAMER_CAMERA)
QGstreamerV4L2Input *m_videoInput;
+#endif
QGstreamerCaptureMetaDataControl *m_metaDataControl;
QAudioInputSelectorControl *m_audioInputSelector;
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
index 8b88fbb71..77a6c3650 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
@@ -52,7 +52,10 @@
#include <private/qgstutils_p.h>
#include <private/qcore_unix_p.h>
+
+#if defined(USE_GSTREAMER_CAMERA)
#include <linux/videodev2.h>
+#endif
QMediaService* QGstreamerCaptureServicePlugin::create(const QString &key)
{
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 2677e269b..6a23fd2a3 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -43,7 +43,9 @@ unix:!mac:!android {
}
# v4l is turned off because it is not supported in Qt 5
- # !maemo*:SUBDIRS += v4l
+ # config_linux_v4l {
+ # !maemo*:SUBDIRS += v4l
+ # }
}
mac:!simulator {