gst: deviceprodiver: Sort devices by session priority

Applications using the device provider typically list devices in the
order they were added. In order to ensure that apps pick nodes like cameras
with the highest priority by default, sort devices accordingly.

This unfortunately does not not have an effect on nodes added later,
e.g. on hotplug.

Closes https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3072
This commit is contained in:
Robert Mader 2023-03-10 23:21:13 +01:00
parent fe1b9c2d49
commit 8fff69353b
2 changed files with 42 additions and 5 deletions

View file

@ -39,6 +39,7 @@ struct _GstPipeWireDevice {
uint64_t serial;
int fd;
const gchar *element;
int priority;
};
struct _GstPipeWireDeviceClass {