From 9196fee58349558593fd7edf4768b189c25f6293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 25 Feb 2022 11:43:00 -0600 Subject: [PATCH] winegstreamer: Link the container pads and activate ours. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391 Signed-off-by: RĂ©mi Bernon Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/winegstreamer/wg_transform.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 0772915e46f..c5aa4acb2cc 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -46,6 +46,7 @@ struct wg_transform { GstElement *container; GstPad *my_src, *my_sink; + GstPad *their_sink, *their_src; }; static GstFlowReturn transform_sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *buffer) @@ -64,6 +65,8 @@ NTSTATUS wg_transform_destroy(void *args) struct wg_transform *transform = args; gst_element_set_state(transform->container, GST_STATE_NULL); + g_object_unref(transform->their_sink); + g_object_unref(transform->their_src); g_object_unref(transform->container); g_object_unref(transform->my_sink); g_object_unref(transform->my_src); @@ -237,6 +240,19 @@ NTSTATUS wg_transform_create(void *args) goto out; } + if (!(transform->their_sink = gst_element_get_static_pad(first, "sink"))) + goto out; + if (!(transform->their_src = gst_element_get_static_pad(last, "src"))) + goto out; + if (gst_pad_link(transform->my_src, transform->their_sink) < 0) + goto out; + if (gst_pad_link(transform->their_src, transform->my_sink) < 0) + goto out; + if (!gst_pad_set_active(transform->my_sink, 1)) + goto out; + if (!gst_pad_set_active(transform->my_src, 1)) + goto out; + gst_element_set_state(transform->container, GST_STATE_PAUSED); if (!gst_element_get_state(transform->container, NULL, NULL, -1)) goto out; @@ -249,6 +265,10 @@ NTSTATUS wg_transform_create(void *args) return STATUS_SUCCESS; out: + if (transform->their_sink) + gst_object_unref(transform->their_sink); + if (transform->their_src) + gst_object_unref(transform->their_src); if (transform->my_sink) gst_object_unref(transform->my_sink); if (sink_caps)