gst: share the core between connections

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.

Fixes #241
This commit is contained in:
Wim Taymans 2020-07-13 17:42:09 +02:00
parent ba96eecba0
commit 70652d1a37
7 changed files with 328 additions and 188 deletions

View file

@ -30,6 +30,7 @@
#include <pipewire/pipewire.h>
#include <gst/gstpipewirepool.h>
#include <gst/gstpipewirecore.h>
G_BEGIN_DECLS
@ -75,12 +76,8 @@ struct _GstPipeWireSrc {
GstClockTime min_latency;
GstClockTime max_latency;
struct pw_thread_loop *loop;
struct pw_context *context;
struct pw_core *core;
GstPipeWireCore *core;
struct spa_hook core_listener;
int last_error;
int last_seq;
int pending_seq;