mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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
This commit is contained in:
parent
dabb2ef740
commit
203d1825c5
1 changed files with 5 additions and 4 deletions
|
@ -338,13 +338,14 @@ msg_window_message_proc (HWND window_handle, UINT message,
|
||||||
|
|
||||||
bcdi = (PDEV_BROADCAST_DEVICEINTERFACE) lparam;
|
bcdi = (PDEV_BROADCAST_DEVICEINTERFACE) lparam;
|
||||||
|
|
||||||
if (!IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_CAPTURE) &&
|
/* Since both video and audio capture device declare KSCATEGORY_CAPTURE, we filter on
|
||||||
!IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_RENDER))
|
KSCATEGORY_VIDEO here. To add audio support we should accept also KSCATEGORY_AUDIO. */
|
||||||
|
if (!IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_VIDEO))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
devices =
|
devices =
|
||||||
ks_enumerate_devices (&bcdi->dbcc_classguid,
|
ks_enumerate_devices (&bcdi->dbcc_classguid,
|
||||||
&bcdi->dbcc_classguid);
|
&KSCATEGORY_CAPTURE);
|
||||||
if (devices == NULL)
|
if (devices == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -356,7 +357,7 @@ msg_window_message_proc (HWND window_handle, UINT message,
|
||||||
|
|
||||||
if ((source == NULL) &&
|
if ((source == NULL) &&
|
||||||
(g_ascii_strcasecmp (entry->path, bcdi->dbcc_name) == 0))
|
(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);
|
ks_device_entry_free (entry);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue