#include "dsvideodevicecontrol.h"
#ifdef QMEDIA_DIRECTSHOW_CAMERA
+#include <QtCore/QElapsedTimer>
#include <dshow.h>
#include "dscameraservice.h"
#endif
{
#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (service == Q_MEDIASERVICE_CAMERA) {
- if (m_cameraDevices.isEmpty())
- updateDevices();
+ updateDevices();
return m_defaultCameraDevice;
}
{
#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (service == Q_MEDIASERVICE_CAMERA) {
- if (m_cameraDevices.isEmpty())
- updateDevices();
+ updateDevices();
return m_cameraDevices;
}
{
#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (service == Q_MEDIASERVICE_CAMERA) {
- if (m_cameraDevices.isEmpty())
- updateDevices();
+ updateDevices();
for (int i=0; i<m_cameraDevices.count(); i++)
if (m_cameraDevices[i] == device)
void DSServicePlugin::updateDevices() const
{
+ static QElapsedTimer timer;
+ if (timer.isValid() && timer.elapsed() < 500) // ms
+ return;
+
addRefCount();
m_defaultCameraDevice.clear();
}
releaseRefCount();
+ timer.restart();
}
#endif