ksvideosrc: only list capture devices

This commit is contained in:
Andoni Morales Alastruey 2015-02-10 13:32:00 +01:00
parent fdae6af7de
commit 7bc0fa5d70

View file

@ -54,6 +54,7 @@ ks_enumerate_devices (const GUID * category)
for (i = 0;; i++) { for (i = 0;; i++) {
BOOL success; BOOL success;
SP_DEVICE_INTERFACE_DATA if_data = { 0, }; SP_DEVICE_INTERFACE_DATA if_data = { 0, };
SP_DEVICE_INTERFACE_DATA if_alias_data = { 0,};
SP_DEVICE_INTERFACE_DETAIL_DATA_W *if_detail_data; SP_DEVICE_INTERFACE_DETAIL_DATA_W *if_detail_data;
DWORD if_detail_data_size; DWORD if_detail_data_size;
SP_DEVINFO_DATA devinfo_data = { 0, }; SP_DEVINFO_DATA devinfo_data = { 0, };
@ -66,6 +67,13 @@ ks_enumerate_devices (const GUID * category)
if (!success) /* all devices enumerated? */ if (!success) /* all devices enumerated? */
break; break;
/* Enumerate only capture devices */
if_alias_data.cbSize = sizeof (SP_DEVICE_INTERFACE_DATA);
success = SetupDiGetDeviceInterfaceAlias (devinfo, &if_data, &KSCATEGORY_CAPTURE,
&if_alias_data);
if (!success)
continue;
if_detail_data_size = (MAX_PATH - 1) * sizeof (gunichar2); if_detail_data_size = (MAX_PATH - 1) * sizeof (gunichar2);
if_detail_data = g_malloc0 (if_detail_data_size); if_detail_data = g_malloc0 (if_detail_data_size);
if_detail_data->cbSize = sizeof (SP_DEVICE_INTERFACE_DETAIL_DATA_W); if_detail_data->cbSize = sizeof (SP_DEVICE_INTERFACE_DETAIL_DATA_W);