Commit 9196fee5 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Link the container pads and activate ours.

parent aa867c6c
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment