gst: deviceprodiver: Use GstPipeWireCore and some cleanups

Quoting the commit introducing `GstPipeWireCore`:
```
Make all sources in the same process with the same fd share the
connection to the server. This makes it possible to set the same
fd on multiple sources/sinks and have them all use the same
connection, like when capturing multiple monitors from screencast
with the portal.
```

Do the same for `GstPipeWireDeviceProvider`, so it can share a
connection with device sinks as well. This will be needed for fd based
connections introduced in the next commit.

Further more it allows some cleanups.

1: 70652d1a37
This commit is contained in:
Robert Mader 2022-12-27 01:57:45 +01:00
parent b0853ad34a
commit 2bc3e0ca10
2 changed files with 58 additions and 123 deletions

View file

@ -28,10 +28,11 @@
#include "config.h"
#include <pipewire/pipewire.h>
#include <gst/gst.h>
#include <pipewire/pipewire.h>
#include <gst/gstpipewirecore.h>
G_BEGIN_DECLS
typedef struct _GstPipeWireDevice GstPipeWireDevice;
@ -82,16 +83,14 @@ struct _GstPipeWireDeviceProvider {
gchar *client_name;
struct pw_thread_loop *loop;
struct pw_context *context;
struct pw_core *core;
GstPipeWireCore *core;
struct spa_hook core_listener;
struct pw_registry *registry;
struct spa_hook registry_listener;
struct spa_list nodes;
struct spa_list pending;
int seq;
struct pw_registry *registry;
int error;
gboolean end;
gboolean list_only;