diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-03-03 18:18:12 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-03-03 18:18:12 +0100 |
commit | b348c9e7b0896f4eda4453c53bfffd5219489cbb (patch) | |
tree | 2f383b223fd3ba1a8faac28c4576652ec61d34d9 /src | |
parent | 33b27c3c15aaca611d5ed0164afa3cd2e9f891a7 (diff) | |
parent | f39d8b73ee36de7dea09c2acdc9853d821cb1f93 (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
src/gsttools/qgstutils.cpp
Change-Id: Ic54ab6c6560ded0db4b98f83256d997bee828083
Diffstat (limited to 'src')
-rw-r--r-- | src/gsttools/qgstutils.cpp | 7 | ||||
-rw-r--r-- | src/plugins/plugins.pro | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp index 55a0be1e4..61ba09e76 100644 --- a/src/gsttools/qgstutils.cpp +++ b/src/gsttools/qgstutils.cpp @@ -42,6 +42,7 @@ #include <QtCore/qstringlist.h> #include <QtGui/qimage.h> #include <qaudioformat.h> +#include <QtCore/qelapsedtimer.h> #include <QtMultimedia/qvideosurfaceformat.h> #include <gst/audio/audio.h> @@ -510,6 +511,10 @@ Q_GLOBAL_STATIC(FactoryCameraInfoMap, qt_camera_device_info); QVector<QGstUtils::CameraInfo> QGstUtils::enumerateCameras(GstElementFactory *factory) { + static QElapsedTimer camerasCacheAgeTimer; + if (camerasCacheAgeTimer.isValid() && camerasCacheAgeTimer.elapsed() > 500) // ms + qt_camera_device_info()->clear(); + FactoryCameraInfoMap::const_iterator it = qt_camera_device_info()->constFind(factory); if (it != qt_camera_device_info()->constEnd()) return *it; @@ -568,6 +573,7 @@ QVector<QGstUtils::CameraInfo> QGstUtils::enumerateCameras(GstElementFactory *fa } if (!devices.isEmpty() || !hasVideoSource) { + camerasCacheAgeTimer.restart(); return devices; } } @@ -626,6 +632,7 @@ QVector<QGstUtils::CameraInfo> QGstUtils::enumerateCameras(GstElementFactory *fa } qt_safe_close(fd); } + camerasCacheAgeTimer.restart(); #endif // USE_V4L return devices; diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index aa28bdd1b..dc1979187 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -6,7 +6,11 @@ TEMPLATE = subdirs -SUBDIRS += m3u videonode +SUBDIRS += m3u + +qtHaveModule(quick) { + SUBDIRS += videonode +} android { SUBDIRS += android opensles |