gst: factor out the stream management and some common variables in a new class

Construct this new class from both the src and sink to be able to share code

Consolidate the previous mess of open/close/start/stop into a single pair
of open/close functions in the new stream class
This commit is contained in:
George Kiagiadakis 2024-05-29 17:56:38 +03:00 committed by Wim Taymans
parent fe5a29ac2a
commit 0c40c01477
7 changed files with 428 additions and 508 deletions

View file

@ -5,6 +5,8 @@
#ifndef __GST_PIPEWIRE_SINK_H__
#define __GST_PIPEWIRE_SINK_H__
#include "gstpipewirestream.h"
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
@ -57,28 +59,12 @@ struct _GstPipeWireSink {
GstBaseSink element;
/*< private >*/
gchar *path;
gchar *target_object;
gchar *client_name;
int fd;
GstPipeWireStream *stream;
/* video state */
gboolean negotiated;
GstPipeWireCore *core;
struct spa_hook core_listener;
GstStructure *client_properties;
struct pw_stream *stream;
struct spa_hook stream_listener;
GstStructure *stream_properties;
GstPipeWireSinkMode mode;
GstPipeWirePool *pool;
GstClock *clock;
GstClockTime last_time;
};
struct _GstPipeWireSinkClass {