mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
Add provide mode to pinossink
Add a mode to provide a stream to pinossink Small improvements, leak fixes.
This commit is contained in:
parent
ba4ef9b5d9
commit
20c50772fa
20 changed files with 309 additions and 212 deletions
|
|
@ -387,6 +387,7 @@ set_property (GObject *object,
|
|||
static void
|
||||
sink_constructed (GObject * object)
|
||||
{
|
||||
PinosNode *node = PINOS_NODE (object);
|
||||
PinosGstSink *sink = PINOS_GST_SINK (object);
|
||||
PinosGstSinkPrivate *priv = sink->priv;
|
||||
gchar *str;
|
||||
|
|
@ -397,13 +398,16 @@ sink_constructed (GObject * object)
|
|||
str = gst_caps_to_string (priv->possible_formats);
|
||||
format = g_bytes_new_take (str, strlen (str) + 1);
|
||||
|
||||
priv->input = pinos_port_new (PINOS_NODE (sink),
|
||||
priv->input = pinos_port_new (pinos_node_get_daemon (node),
|
||||
pinos_node_get_object_path (node),
|
||||
PINOS_DIRECTION_INPUT,
|
||||
"input",
|
||||
format,
|
||||
NULL);
|
||||
g_bytes_unref (format);
|
||||
|
||||
pinos_node_add_port (node, priv->input);
|
||||
|
||||
g_signal_connect (priv->input, "channel-added", (GCallback) on_channel_added, sink);
|
||||
g_signal_connect (priv->input, "channel-removed", (GCallback) on_channel_removed, sink);
|
||||
|
||||
|
|
|
|||
|
|
@ -440,6 +440,7 @@ set_property (GObject *object,
|
|||
static void
|
||||
source_constructed (GObject * object)
|
||||
{
|
||||
PinosNode *node = PINOS_NODE (object);
|
||||
PinosGstSource *source = PINOS_GST_SOURCE (object);
|
||||
PinosGstSourcePrivate *priv = source->priv;
|
||||
gchar *str;
|
||||
|
|
@ -450,7 +451,8 @@ source_constructed (GObject * object)
|
|||
str = gst_caps_to_string (priv->possible_formats);
|
||||
format = g_bytes_new_take (str, strlen (str) + 1);
|
||||
|
||||
priv->output = pinos_port_new (PINOS_NODE (source),
|
||||
priv->output = pinos_port_new (pinos_node_get_daemon (node),
|
||||
pinos_node_get_object_path (node),
|
||||
PINOS_DIRECTION_OUTPUT,
|
||||
"output",
|
||||
format,
|
||||
|
|
@ -460,15 +462,19 @@ source_constructed (GObject * object)
|
|||
g_signal_connect (priv->output, "channel-added", (GCallback) on_channel_added, source);
|
||||
g_signal_connect (priv->output, "channel-removed", (GCallback) on_channel_removed, source);
|
||||
|
||||
pinos_node_add_port (node, priv->output);
|
||||
|
||||
setup_pipeline (source, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
source_finalize (GObject * object)
|
||||
{
|
||||
PinosNode *node = PINOS_NODE (object);
|
||||
PinosGstSource *source = PINOS_GST_SOURCE (object);
|
||||
PinosGstSourcePrivate *priv = source->priv;
|
||||
|
||||
pinos_node_remove_port (node, priv->output);
|
||||
destroy_pipeline (source);
|
||||
g_clear_pointer (&priv->possible_formats, gst_caps_unref);
|
||||
pinos_properties_free (priv->props);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue