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>
This commit is contained in:
Lisandro Damián Nicanor Pérez Meyer
2014-07-10 19:19:37 -03:00
committed by Yoann Lopes
parent da77331952
commit ff527de013
12 changed files with 91 additions and 11 deletions

View File

@@ -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

View File

@@ -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
}