gst_device_get_device_class reports "Video/Source" for ksvideosrc and "Source/Video" for mfvideosrc
I'm looking for video devices in my code roughly like this:
GstDeviceMonitor *monitor = gst_device_monitor_new();
gst_device_monitor_add_filter (monitor, "Video/Source", NULL);
GList *devices = gst_device_monitor_get_devices (monitor);
while(devices != NULL) {
GstDevice *device = (GstDevice*)(devices->data);
gchar *deviceClass = gst_device_get_device_class(device);
// Now deviceClass is "Source/Video" if it's a mfvideosrc and "Video/Source" if it's a ksvideosrc
g_free(deviceClass);
gst_object_unref (device);
devices = g_list_delete_link (devices, devices);
}
gst_object_unref(monitor);
mfvideosrc and ksvideosrc report their class differently. At least with gstreamer 1.16, "Video/Source" is used by every source plugin and it's also what needs to be added in the filter.
gst-inspect gives consistent, but weird output for both:
For ksvideosrc:
gst-inspect-1.0 ksvideosrc
Factory Details:
...
Klass Source/Video/Hardware
...
For mfvideosrc:
gst-inspect-1.0 mfvideosrc
Factory Details:
...
Klass Source/Video/Hardware
...
Is this behavior intentional, or is it a bug?