From 8923c0ff6b7b3d907c3500618b3234266a0ac31b Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Wed, 4 Feb 2015 16:28:21 +0000 Subject: directshow: Fix plugging/unplugging a second camera When having more than 1 camera (like one laptop integrated webcam and a separate one) you had to restart the application for QCameraInfo::availableCameras() to work. Change-Id: I47cfa928cfd9500524b81a4bf8ec5ebff0b79879 Reviewed-by: Yoann Lopes --- src/plugins/directshow/dsserviceplugin.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/plugins/directshow/dsserviceplugin.cpp') diff --git a/src/plugins/directshow/dsserviceplugin.cpp b/src/plugins/directshow/dsserviceplugin.cpp index b59cd1dc5..f28f274e2 100644 --- a/src/plugins/directshow/dsserviceplugin.cpp +++ b/src/plugins/directshow/dsserviceplugin.cpp @@ -39,6 +39,7 @@ #include "dsvideodevicecontrol.h" #ifdef QMEDIA_DIRECTSHOW_CAMERA +#include #include #include "dscameraservice.h" #endif @@ -121,8 +122,7 @@ QByteArray DSServicePlugin::defaultDevice(const QByteArray &service) const { #ifdef QMEDIA_DIRECTSHOW_CAMERA if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); + updateDevices(); return m_defaultCameraDevice; } @@ -135,8 +135,7 @@ QList DSServicePlugin::devices(const QByteArray &service) const { #ifdef QMEDIA_DIRECTSHOW_CAMERA if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); + updateDevices(); return m_cameraDevices; } @@ -149,8 +148,7 @@ QString DSServicePlugin::deviceDescription(const QByteArray &service, const QByt { #ifdef QMEDIA_DIRECTSHOW_CAMERA if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); + updateDevices(); for (int i=0; i