mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
va: sort the device queue
If so, the elements will be registered per drm node in order of renderD128, renderD129, ... etc, an element with constant name will be registered on renderD128 on a hardware with multiple drm nodes. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1988>
This commit is contained in:
parent
95e1ce7e7a
commit
956d6e8ff7
1 changed files with 10 additions and 1 deletions
|
@ -55,6 +55,14 @@ gst_va_device_new (GstVaDisplay * display, const gchar * render_device_path)
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gint
|
||||||
|
compare_device_path (gconstpointer a, gconstpointer b, gpointer user_data)
|
||||||
|
{
|
||||||
|
const GstVaDevice *pa = a, *pb = b;
|
||||||
|
|
||||||
|
return strcmp (pa->render_device_path, pb->render_device_path);
|
||||||
|
}
|
||||||
|
|
||||||
GList *
|
GList *
|
||||||
gst_va_device_find_devices (void)
|
gst_va_device_find_devices (void)
|
||||||
{
|
{
|
||||||
|
@ -80,9 +88,10 @@ gst_va_device_find_devices (void)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
GST_INFO ("Found VA-API device: %s", path);
|
GST_INFO ("Found VA-API device: %s", path);
|
||||||
g_queue_push_tail (&devices, gst_va_device_new (dpy, path));
|
g_queue_push_head (&devices, gst_va_device_new (dpy, path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_queue_sort (&devices, compare_device_path, NULL);
|
||||||
g_list_free_full (udev_devices, g_object_unref);
|
g_list_free_full (udev_devices, g_object_unref);
|
||||||
g_object_unref (client);
|
g_object_unref (client);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue