From f65cf958b1a40d486854a1c2526d20e5a50a944b Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 9 Sep 2014 14:13:20 +0200 Subject: [PATCH] Fix V4L usage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ff527de0 was submitted to 5.3 while cddbe873 was submitted to 5.4. The former's behavior was not preserved when 5.3 got merged into 5.4. Change-Id: I7435ea30634001ae6e87c316eb8a8ab6f5e988e3 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Andrew den Exter --- src/gsttools/qgstutils.cpp | 8 ++++++-- src/plugins/gstreamer/camerabin/camerabin.pro | 2 -- .../gstreamer/camerabin/camerabinserviceplugin.cpp | 7 ------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp index 9740b9a0..8d484aa6 100644 --- a/src/gsttools/qgstutils.cpp +++ b/src/gsttools/qgstutils.cpp @@ -42,8 +42,10 @@ #include #include -#include -#include +#ifdef USE_V4L +# include +# include +#endif #include "qgstreamervideoinputdevicecontrol_p.h" @@ -469,6 +471,7 @@ QVector QGstUtils::enumerateCameras(GstElementFactory *fa } } +#ifdef USE_V4L QDir devDir(QStringLiteral("/dev")); devDir.setFilter(QDir::System); @@ -516,6 +519,7 @@ QVector QGstUtils::enumerateCameras(GstElementFactory *fa } qt_safe_close(fd); } +#endif // USE_V4L return devices; } diff --git a/src/plugins/gstreamer/camerabin/camerabin.pro b/src/plugins/gstreamer/camerabin/camerabin.pro index 90a1040f..bba797f5 100644 --- a/src/plugins/gstreamer/camerabin/camerabin.pro +++ b/src/plugins/gstreamer/camerabin/camerabin.pro @@ -83,8 +83,6 @@ 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 8c943529..51024b7d 100644 --- a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp @@ -38,16 +38,9 @@ #include "camerabinserviceplugin.h" - #include "camerabinservice.h" #include -#include - -#if defined(USE_V4L) -#include -#endif - QT_BEGIN_NAMESPACE template static int lengthOf(const T(&)[N]) { return N; }