Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts: src/gsttools/qgstutils.cpp Change-Id: Ic54ab6c6560ded0db4b98f83256d997bee828083
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
#include <QtCore/qstringlist.h>
|
#include <QtCore/qstringlist.h>
|
||||||
#include <QtGui/qimage.h>
|
#include <QtGui/qimage.h>
|
||||||
#include <qaudioformat.h>
|
#include <qaudioformat.h>
|
||||||
|
#include <QtCore/qelapsedtimer.h>
|
||||||
#include <QtMultimedia/qvideosurfaceformat.h>
|
#include <QtMultimedia/qvideosurfaceformat.h>
|
||||||
|
|
||||||
#include <gst/audio/audio.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)
|
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);
|
FactoryCameraInfoMap::const_iterator it = qt_camera_device_info()->constFind(factory);
|
||||||
if (it != qt_camera_device_info()->constEnd())
|
if (it != qt_camera_device_info()->constEnd())
|
||||||
return *it;
|
return *it;
|
||||||
@@ -568,6 +573,7 @@ QVector<QGstUtils::CameraInfo> QGstUtils::enumerateCameras(GstElementFactory *fa
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!devices.isEmpty() || !hasVideoSource) {
|
if (!devices.isEmpty() || !hasVideoSource) {
|
||||||
|
camerasCacheAgeTimer.restart();
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -626,6 +632,7 @@ QVector<QGstUtils::CameraInfo> QGstUtils::enumerateCameras(GstElementFactory *fa
|
|||||||
}
|
}
|
||||||
qt_safe_close(fd);
|
qt_safe_close(fd);
|
||||||
}
|
}
|
||||||
|
camerasCacheAgeTimer.restart();
|
||||||
#endif // USE_V4L
|
#endif // USE_V4L
|
||||||
|
|
||||||
return devices;
|
return devices;
|
||||||
|
|||||||
@@ -6,7 +6,11 @@
|
|||||||
|
|
||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
SUBDIRS += m3u videonode
|
SUBDIRS += m3u
|
||||||
|
|
||||||
|
qtHaveModule(quick) {
|
||||||
|
SUBDIRS += videonode
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
SUBDIRS += android opensles
|
SUBDIRS += android opensles
|
||||||
|
|||||||
Reference in New Issue
Block a user