diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-04-09 16:09:39 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-04-14 14:49:56 +0000 |
commit | f9145aca166ad2ca1514524ce88ded7834eb207c (patch) | |
tree | 66e6acb2ae354361250c0b3228a6c3cdb0366cfe /src/plugins/directshow/camera/dsvideodevicecontrol.h | |
parent | 07606dde9a1f6b89f582ff8f1fbc53e2d4eb2c22 (diff) |
DirectShow: correctly update camera list.
8923c0ff fixed the list not being updated after plugging/unplugging a
camera from the system. However, it was only a partial fix affecting
only QCameraInfo::availableCameras(). DSVideoDeviceControl was still
internally keeping a list of cameras that was never updated, causing
the QCamera constructor to not take into account new or removed
cameras.
Change-Id: Ie5e79c46002017b1e85bfc53c6391a2a747361a0
Task-number: QTBUG-39708
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins/directshow/camera/dsvideodevicecontrol.h')
-rw-r--r-- | src/plugins/directshow/camera/dsvideodevicecontrol.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/directshow/camera/dsvideodevicecontrol.h b/src/plugins/directshow/camera/dsvideodevicecontrol.h index a6d471088..0ba7ce36a 100644 --- a/src/plugins/directshow/camera/dsvideodevicecontrol.h +++ b/src/plugins/directshow/camera/dsvideodevicecontrol.h @@ -42,6 +42,8 @@ class DSCameraSession; //QTM_USE_NAMESPACE +typedef QPair<QByteArray, QString> DSVideoDeviceInfo; + class DSVideoDeviceControl : public QVideoDeviceSelectorControl { Q_OBJECT @@ -54,17 +56,15 @@ public: int defaultDevice() const; int selectedDevice() const; - static void enumerateDevices(QList<QByteArray> *devices, QStringList *descriptions); + static const QList<DSVideoDeviceInfo> &availableDevices(); public Q_SLOTS: void setSelectedDevice(int index); private: - DSCameraSession* m_session; - - QList<QByteArray> m_devices; - QStringList m_descriptions; + static void updateDevices(); + DSCameraSession* m_session; int selected; }; |