diff options
author | Jerome Laheurte <jlaheurte@quividi.net> | 2018-08-16 12:35:50 +0200 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2018-08-19 16:58:22 -0400 |
commit | 203d1825c51481b6efe7ae2b275742cd789452c4 (patch) | |
tree | b6e8fd03f2516a743d478d2266128ab6915b6897 /sys | |
parent | dabb2ef740219082f05bb9f7e0cf425cfae32dfc (diff) |
ksvideosrc: fix device enumeration when hotplugging a camera
Since both audio and video capture devices declare the KSCATEGORY_CAPTURE interface,
plugging a camera that supports both could result in an audio device being mistaken
for a video one.
https://bugzilla.gnome.org/show_bug.cgi?id=796958
Diffstat (limited to 'sys')
-rw-r--r-- | sys/winks/ksdeviceprovider.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/winks/ksdeviceprovider.c b/sys/winks/ksdeviceprovider.c index 609794d44..b54cba2c6 100644 --- a/sys/winks/ksdeviceprovider.c +++ b/sys/winks/ksdeviceprovider.c @@ -338,13 +338,14 @@ msg_window_message_proc (HWND window_handle, UINT message, bcdi = (PDEV_BROADCAST_DEVICEINTERFACE) lparam; - if (!IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_CAPTURE) && - !IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_RENDER)) + /* Since both video and audio capture device declare KSCATEGORY_CAPTURE, we filter on + KSCATEGORY_VIDEO here. To add audio support we should accept also KSCATEGORY_AUDIO. */ + if (!IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_VIDEO)) break; devices = ks_enumerate_devices (&bcdi->dbcc_classguid, - &bcdi->dbcc_classguid); + &KSCATEGORY_CAPTURE); if (devices == NULL) break; @@ -356,7 +357,7 @@ msg_window_message_proc (HWND window_handle, UINT message, if ((source == NULL) && (g_ascii_strcasecmp (entry->path, bcdi->dbcc_name) == 0)) - source = new_video_source (entry); + source = new_video_source (entry); /* Or audio source, not implemented yet */ ks_device_entry_free (entry); } |