mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
connect -> link
Original commit message from CVS: connect -> link
This commit is contained in:
parent
876d74a282
commit
6877e9592f
34 changed files with 86 additions and 86 deletions
|
@ -29,8 +29,8 @@ main (int argc, char *argv[])
|
||||||
sinkpad = gst_element_get_pad (sink, "sink");
|
sinkpad = gst_element_get_pad (sink, "sink");
|
||||||
g_return_val_if_fail (srcpad != NULL, -1);
|
g_return_val_if_fail (srcpad != NULL, -1);
|
||||||
|
|
||||||
g_print ("--- connecting\n");
|
g_print ("--- linking\n");
|
||||||
gst_pad_connect (srcpad, sinkpad);
|
gst_pad_link (srcpad, sinkpad);
|
||||||
|
|
||||||
g_print ("--- setting up\n");
|
g_print ("--- setting up\n");
|
||||||
gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
|
gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
|
||||||
|
|
|
@ -52,8 +52,8 @@ int main(int argc,char *argv[])
|
||||||
|
|
||||||
gst_bin_add(GST_BIN(thread), osssink);
|
gst_bin_add(GST_BIN(thread), osssink);
|
||||||
|
|
||||||
gst_pad_connect(gst_element_get_pad(queue,"src"),
|
gst_pad_link(gst_element_get_pad(queue,"src"),
|
||||||
gst_element_get_pad(osssink,"sink"));
|
gst_element_get_pad(osssink,"sink"));
|
||||||
|
|
||||||
if (!gst_pipeline_autoplug(GST_PIPELINE(pipeline))) {
|
if (!gst_pipeline_autoplug(GST_PIPELINE(pipeline))) {
|
||||||
g_print("cannot autoplug pipeline\n");
|
g_print("cannot autoplug pipeline\n");
|
||||||
|
|
|
@ -29,8 +29,8 @@ main (int argc, char *argv[])
|
||||||
sinkpad = gst_element_get_pad (sink, "sink");
|
sinkpad = gst_element_get_pad (sink, "sink");
|
||||||
g_return_val_if_fail (srcpad != NULL, -1);
|
g_return_val_if_fail (srcpad != NULL, -1);
|
||||||
|
|
||||||
g_print ("--- connecting\n");
|
g_print ("--- linking\n");
|
||||||
gst_pad_connect (srcpad, sinkpad);
|
gst_pad_link (srcpad, sinkpad);
|
||||||
|
|
||||||
g_print ("--- setting up\n");
|
g_print ("--- setting up\n");
|
||||||
gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
|
gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
|
||||||
|
|
|
@ -52,8 +52,8 @@ int main(int argc,char *argv[])
|
||||||
|
|
||||||
gst_bin_add(GST_BIN(thread), osssink);
|
gst_bin_add(GST_BIN(thread), osssink);
|
||||||
|
|
||||||
gst_pad_connect(gst_element_get_pad(queue,"src"),
|
gst_pad_link(gst_element_get_pad(queue,"src"),
|
||||||
gst_element_get_pad(osssink,"sink"));
|
gst_element_get_pad(osssink,"sink"));
|
||||||
|
|
||||||
if (!gst_pipeline_autoplug(GST_PIPELINE(pipeline))) {
|
if (!gst_pipeline_autoplug(GST_PIPELINE(pipeline))) {
|
||||||
g_print("cannot autoplug pipeline\n");
|
g_print("cannot autoplug pipeline\n");
|
||||||
|
|
|
@ -160,17 +160,17 @@ gst_bstest_class_init (GstBsTestClass * klass)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstPadConnectReturn
|
static GstPadLinkReturn
|
||||||
gst_bstest_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data)
|
gst_bstest_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data)
|
||||||
{
|
{
|
||||||
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
|
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
/* thomas: I was trying to fix this old test, one of these two pads
|
/* thomas: I was trying to fix this old test, one of these two pads
|
||||||
* needs to be dropped according to the new api, which one ? */
|
* needs to be dropped according to the new api, which one ? */
|
||||||
return gst_pad_proxy_connect (pad, bstest->sinkpad, caps);
|
return gst_pad_proxy_link (pad, bstest->sinkpad, caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstPadConnectReturn
|
static GstPadLinkReturn
|
||||||
gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
|
gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
|
||||||
{
|
{
|
||||||
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
|
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
|
||||||
|
|
|
@ -185,7 +185,7 @@ main (int argc, char *argv[])
|
||||||
bs = gst_element_factory_make ("bstest", "bs");
|
bs = gst_element_factory_make ("bstest", "bs");
|
||||||
g_assert (bs);
|
g_assert (bs);
|
||||||
|
|
||||||
gst_element_connect_many (src, bs, sink);
|
gst_element_link_many (src, bs, sink);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, bs, sink);
|
gst_bin_add_many (GST_BIN (pipeline), src, bs, sink);
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ create_pipeline (void)
|
||||||
fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
|
fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
|
||||||
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
||||||
|
|
||||||
gst_element_connect (fakesrc, fakesink);
|
gst_element_link (fakesrc, fakesink);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ create_pipeline (void)
|
||||||
gst_bin_add (GST_BIN (bin), fakesink);
|
gst_bin_add (GST_BIN (bin), fakesink);
|
||||||
gst_element_add_ghost_pad (bin, gst_element_get_pad (fakesink, "sink"), "sink");
|
gst_element_add_ghost_pad (bin, gst_element_get_pad (fakesink, "sink"), "sink");
|
||||||
|
|
||||||
gst_element_connect (fakesrc, bin);
|
gst_element_link (fakesrc, bin);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), fakesrc, bin, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), fakesrc, bin, NULL);
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,10 @@ create_pipeline (void)
|
||||||
queue = gst_element_factory_make ("queue", "queue");
|
queue = gst_element_factory_make ("queue", "queue");
|
||||||
gst_bin_add (GST_BIN (thread), fakesink);
|
gst_bin_add (GST_BIN (thread), fakesink);
|
||||||
gst_bin_add (GST_BIN (thread), queue);
|
gst_bin_add (GST_BIN (thread), queue);
|
||||||
gst_element_connect (queue, fakesink);
|
gst_element_link (queue, fakesink);
|
||||||
gst_element_add_ghost_pad (thread, gst_element_get_pad (queue, "sink"), "sink");
|
gst_element_add_ghost_pad (thread, gst_element_get_pad (queue, "sink"), "sink");
|
||||||
|
|
||||||
gst_element_connect (fakesrc, thread);
|
gst_element_link (fakesrc, thread);
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (pipeline), fakesrc);
|
gst_bin_add (GST_BIN (pipeline), fakesrc);
|
||||||
gst_bin_add (GST_BIN (pipeline), thread);
|
gst_bin_add (GST_BIN (pipeline), thread);
|
||||||
|
|
|
@ -30,7 +30,7 @@ main (gint argc, gchar *argv[])
|
||||||
|
|
||||||
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
||||||
|
|
||||||
gst_element_connect (fakesrc, fakesink);
|
gst_element_link (fakesrc, fakesink);
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (bin), fakesink);
|
gst_bin_add (GST_BIN (bin), fakesink);
|
||||||
gst_bin_add (GST_BIN (pipeline), bin);
|
gst_bin_add (GST_BIN (pipeline), bin);
|
||||||
|
|
|
@ -47,7 +47,7 @@ main (int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_element_connect_many (src, id, sink, NULL);
|
gst_element_link_many (src, id, sink, NULL);
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, id, sink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, id, sink, NULL);
|
||||||
|
|
||||||
clock = gst_bin_get_clock (GST_BIN (pipeline));
|
clock = gst_bin_get_clock (GST_BIN (pipeline));
|
||||||
|
|
|
@ -223,8 +223,8 @@ int main(int argc,char *argv[]) {
|
||||||
testelement = gst_element_factory_make ("dptest", "testelement");
|
testelement = gst_element_factory_make ("dptest", "testelement");
|
||||||
g_assert (testelement);
|
g_assert (testelement);
|
||||||
|
|
||||||
gst_element_connect (src, testelement);
|
gst_element_link (src, testelement);
|
||||||
gst_element_connect (testelement, sink);
|
gst_element_link (testelement, sink);
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (pipeline), src);
|
gst_bin_add (GST_BIN (pipeline), src);
|
||||||
gst_bin_add (GST_BIN (pipeline), testelement);
|
gst_bin_add (GST_BIN (pipeline), testelement);
|
||||||
|
|
|
@ -54,14 +54,14 @@ main (int argc, char *argv[])
|
||||||
gst_bin_add (GST_BIN (pipeline), src);
|
gst_bin_add (GST_BIN (pipeline), src);
|
||||||
gst_bin_add (GST_BIN (pipeline), sink);
|
gst_bin_add (GST_BIN (pipeline), sink);
|
||||||
|
|
||||||
/* connect */
|
/* link */
|
||||||
g_print ("Connecting elements\n");
|
g_print ("Linking elements\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
|
|
||||||
/* we expect this to give an error */
|
/* we expect this to give an error */
|
||||||
if (gst_bin_iterate (GST_BIN (pipeline)) != FALSE)
|
if (gst_bin_iterate (GST_BIN (pipeline)) != FALSE)
|
||||||
{
|
{
|
||||||
g_warning ("Iterating a bin with unconnected elements should return FALSE !\n");
|
g_warning ("Iterating a bin with unlinked elements should return FALSE !\n");
|
||||||
retval = 1;
|
retval = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ main (int argc, char *argv[])
|
||||||
/* we expect this to work */
|
/* we expect this to work */
|
||||||
if (gst_bin_iterate (GST_BIN (pipeline)) != TRUE)
|
if (gst_bin_iterate (GST_BIN (pipeline)) != TRUE)
|
||||||
{
|
{
|
||||||
g_error ("Iterating a bin with connected elements should return TRUE !\n");
|
g_error ("Iterating a bin with linked elements should return TRUE !\n");
|
||||||
retval = 1;
|
retval = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,16 +70,16 @@ main (int argc, char *argv[])
|
||||||
gst_bin_add (GST_BIN (pipeline), src);
|
gst_bin_add (GST_BIN (pipeline), src);
|
||||||
gst_bin_add (GST_BIN (pipeline), tee);
|
gst_bin_add (GST_BIN (pipeline), tee);
|
||||||
|
|
||||||
/* connect input part */
|
/* link input part */
|
||||||
g_print ("Connecting input elements\n");
|
g_print ("Linking input elements\n");
|
||||||
gst_pad_connect (gst_element_get_pad (src, "src"),
|
gst_pad_link (gst_element_get_pad (src, "src"),
|
||||||
gst_element_get_pad (tee, "sink"));
|
gst_element_get_pad (tee, "sink"));
|
||||||
|
|
||||||
/* request one pad from tee */
|
/* request one pad from tee */
|
||||||
g_print ("Requesting first pad\n");
|
g_print ("Requesting first pad\n");
|
||||||
tee_src1 = gst_element_get_request_pad (tee, "src%d");
|
tee_src1 = gst_element_get_request_pad (tee, "src%d");
|
||||||
gst_bin_add (GST_BIN (pipeline), sink1);
|
gst_bin_add (GST_BIN (pipeline), sink1);
|
||||||
gst_pad_connect (tee_src1, gst_element_get_pad (sink1, "sink"));
|
gst_pad_link (tee_src1, gst_element_get_pad (sink1, "sink"));
|
||||||
|
|
||||||
/* set to play */
|
/* set to play */
|
||||||
g_print ("Doing 1 iteration\n");
|
g_print ("Doing 1 iteration\n");
|
||||||
|
@ -91,9 +91,9 @@ main (int argc, char *argv[])
|
||||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||||
tee_src2 = gst_element_get_request_pad (tee, "src%d");
|
tee_src2 = gst_element_get_request_pad (tee, "src%d");
|
||||||
gst_bin_add (GST_BIN (pipeline), sink2);
|
gst_bin_add (GST_BIN (pipeline), sink2);
|
||||||
gst_pad_connect (tee_src2, gst_element_get_pad (sink2, "sink"));
|
gst_pad_link (tee_src2, gst_element_get_pad (sink2, "sink"));
|
||||||
|
|
||||||
/* now we have two fakesinks connected, iterate */
|
/* now we have two fakesinks linked, iterate */
|
||||||
g_print ("Doing 1 iteration\n");
|
g_print ("Doing 1 iteration\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
gst_bin_iterate (GST_BIN (pipeline));
|
gst_bin_iterate (GST_BIN (pipeline));
|
||||||
|
@ -146,11 +146,11 @@ main (int argc, char *argv[])
|
||||||
/* remove the first one, iterate */
|
/* remove the first one, iterate */
|
||||||
g_print ("Removing first sink\n");
|
g_print ("Removing first sink\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||||
gst_pad_disconnect (tee_src1, gst_element_get_pad (sink1, "sink"));
|
gst_pad_unlink (tee_src1, gst_element_get_pad (sink1, "sink"));
|
||||||
gst_pad_destroy (tee_src1);
|
gst_pad_destroy (tee_src1);
|
||||||
gst_bin_remove (GST_BIN (pipeline), sink1);
|
gst_bin_remove (GST_BIN (pipeline), sink1);
|
||||||
|
|
||||||
/* only second fakesink connected, iterate */
|
/* only second fakesink linked, iterate */
|
||||||
g_print ("Doing 1 iteration\n");
|
g_print ("Doing 1 iteration\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
gst_bin_iterate (GST_BIN (pipeline));
|
gst_bin_iterate (GST_BIN (pipeline));
|
||||||
|
|
|
@ -32,7 +32,7 @@ create_bin_ghostpads (void)
|
||||||
gst_bin_add (GST_BIN (bin), element1);
|
gst_bin_add (GST_BIN (bin), element1);
|
||||||
element2 = gst_element_factory_make ("fakesink", NULL);
|
element2 = gst_element_factory_make ("fakesink", NULL);
|
||||||
gst_bin_add (GST_BIN (bin), element2);
|
gst_bin_add (GST_BIN (bin), element2);
|
||||||
gst_element_connect_pads (element1, "src", element2, "sink");
|
gst_element_link_pads (element1, "src", element2, "sink");
|
||||||
gst_element_add_ghost_pad (bin, gst_element_get_pad (element1, "sink"), "ghost_sink");
|
gst_element_add_ghost_pad (bin, gst_element_get_pad (element1, "sink"), "ghost_sink");
|
||||||
|
|
||||||
return bin;
|
return bin;
|
||||||
|
|
|
@ -42,28 +42,28 @@ main (int argc, gchar *argv[])
|
||||||
for (i=0; i<iters/2; i++) {
|
for (i=0; i<iters/2; i++) {
|
||||||
element = gst_element_factory_make ("fakesink", NULL);
|
element = gst_element_factory_make ("fakesink", NULL);
|
||||||
element2 = gst_element_factory_make ("fakesrc", NULL);
|
element2 = gst_element_factory_make ("fakesrc", NULL);
|
||||||
gst_element_connect_pads (element, "sink", element2, "src");
|
gst_element_link_pads (element, "sink", element2, "src");
|
||||||
g_assert (GST_PAD_IS_CONNECTED (gst_element_get_pad (element2, "src")));
|
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
|
||||||
g_assert (GST_PAD_IS_CONNECTED (gst_element_get_pad (element, "sink")));
|
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element, "sink")));
|
||||||
gst_object_unref (GST_OBJECT (element));
|
gst_object_unref (GST_OBJECT (element));
|
||||||
g_assert (!GST_PAD_IS_CONNECTED (gst_element_get_pad (element2, "src")));
|
g_assert (!GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
|
||||||
gst_object_unref (GST_OBJECT (element2));
|
gst_object_unref (GST_OBJECT (element2));
|
||||||
}
|
}
|
||||||
g_print ("create/connect/unref %d elements %ld\n", iters/2, vmsize()-usage1);
|
g_print ("create/link/unref %d elements %ld\n", iters/2, vmsize()-usage1);
|
||||||
|
|
||||||
for (i=0; i<iters/2; i++) {
|
for (i=0; i<iters/2; i++) {
|
||||||
element = gst_element_factory_make ("fakesink", NULL);
|
element = gst_element_factory_make ("fakesink", NULL);
|
||||||
element2 = gst_element_factory_make ("fakesrc", NULL);
|
element2 = gst_element_factory_make ("fakesrc", NULL);
|
||||||
gst_element_connect_pads (element, "sink", element2, "src");
|
gst_element_link_pads (element, "sink", element2, "src");
|
||||||
g_assert (GST_PAD_IS_CONNECTED (gst_element_get_pad (element2, "src")));
|
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
|
||||||
g_assert (GST_PAD_IS_CONNECTED (gst_element_get_pad (element, "sink")));
|
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element, "sink")));
|
||||||
gst_object_destroy (GST_OBJECT (element));
|
gst_object_destroy (GST_OBJECT (element));
|
||||||
g_assert (GST_OBJECT_DESTROYED (element));
|
g_assert (GST_OBJECT_DESTROYED (element));
|
||||||
g_assert (!GST_PAD_IS_CONNECTED (gst_element_get_pad (element2, "src")));
|
g_assert (!GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
|
||||||
gst_object_unref (GST_OBJECT (element2));
|
gst_object_unref (GST_OBJECT (element2));
|
||||||
gst_object_unref (GST_OBJECT (element));
|
gst_object_unref (GST_OBJECT (element));
|
||||||
}
|
}
|
||||||
g_print ("create/connect/destroy %d elements %ld\n", iters/2, vmsize()-usage1);
|
g_print ("create/link/destroy %d elements %ld\n", iters/2, vmsize()-usage1);
|
||||||
|
|
||||||
element = gst_element_factory_make ("fakesink", NULL);;
|
element = gst_element_factory_make ("fakesink", NULL);;
|
||||||
pad = gst_element_get_pad (element, "sink");
|
pad = gst_element_get_pad (element, "sink");
|
||||||
|
|
|
@ -36,7 +36,7 @@ create_thread_ghostpads (void)
|
||||||
gst_element_set_name (element2, "test2");
|
gst_element_set_name (element2, "test2");
|
||||||
gst_element_add_pad (element2, gst_pad_new ("sink1", GST_PAD_SINK));
|
gst_element_add_pad (element2, gst_pad_new ("sink1", GST_PAD_SINK));
|
||||||
gst_bin_add (GST_BIN (thread), element2);
|
gst_bin_add (GST_BIN (thread), element2);
|
||||||
gst_element_connect (element1, "src1", element2, "sink1");
|
gst_element_link (element1, "src1", element2, "sink1");
|
||||||
gst_element_add_ghost_pad (thread, gst_element_get_pad (element2, "sink1"), "sink1");
|
gst_element_add_ghost_pad (thread, gst_element_get_pad (element2, "sink1"), "sink1");
|
||||||
|
|
||||||
return thread;
|
return thread;
|
||||||
|
|
|
@ -29,7 +29,7 @@ construct_pipeline (GstElement *pipeline)
|
||||||
queue = gst_element_factory_make ("queue", NULL);
|
queue = gst_element_factory_make ("queue", NULL);
|
||||||
thread = gst_element_factory_make ("thread", NULL);
|
thread = gst_element_factory_make ("thread", NULL);
|
||||||
|
|
||||||
gst_element_connect_many (src, queue, identity, sink, NULL);
|
gst_element_link_many (src, queue, identity, sink, NULL);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, queue, thread, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, queue, thread, NULL);
|
||||||
gst_bin_add_many (GST_BIN (thread), identity, sink, NULL);
|
gst_bin_add_many (GST_BIN (thread), identity, sink, NULL);
|
||||||
|
|
|
@ -21,7 +21,7 @@ construct_pipeline (GstElement *pipeline)
|
||||||
g_assert (identity);
|
g_assert (identity);
|
||||||
g_assert (sink);
|
g_assert (sink);
|
||||||
|
|
||||||
gst_element_connect_many (src, identity, sink, NULL);
|
gst_element_link_many (src, identity, sink, NULL);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, identity, sink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, identity, sink, NULL);
|
||||||
|
|
||||||
|
|
|
@ -160,17 +160,17 @@ gst_bstest_class_init (GstBsTestClass * klass)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstPadConnectReturn
|
static GstPadLinkReturn
|
||||||
gst_bstest_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data)
|
gst_bstest_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data)
|
||||||
{
|
{
|
||||||
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
|
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
/* thomas: I was trying to fix this old test, one of these two pads
|
/* thomas: I was trying to fix this old test, one of these two pads
|
||||||
* needs to be dropped according to the new api, which one ? */
|
* needs to be dropped according to the new api, which one ? */
|
||||||
return gst_pad_proxy_connect (pad, bstest->sinkpad, caps);
|
return gst_pad_proxy_link (pad, bstest->sinkpad, caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstPadConnectReturn
|
static GstPadLinkReturn
|
||||||
gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
|
gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
|
||||||
{
|
{
|
||||||
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
|
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
|
||||||
|
|
|
@ -185,7 +185,7 @@ main (int argc, char *argv[])
|
||||||
bs = gst_element_factory_make ("bstest", "bs");
|
bs = gst_element_factory_make ("bstest", "bs");
|
||||||
g_assert (bs);
|
g_assert (bs);
|
||||||
|
|
||||||
gst_element_connect_many (src, bs, sink);
|
gst_element_link_many (src, bs, sink);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, bs, sink);
|
gst_bin_add_many (GST_BIN (pipeline), src, bs, sink);
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ create_pipeline (void)
|
||||||
fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
|
fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
|
||||||
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
||||||
|
|
||||||
gst_element_connect (fakesrc, fakesink);
|
gst_element_link (fakesrc, fakesink);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ create_pipeline (void)
|
||||||
gst_bin_add (GST_BIN (bin), fakesink);
|
gst_bin_add (GST_BIN (bin), fakesink);
|
||||||
gst_element_add_ghost_pad (bin, gst_element_get_pad (fakesink, "sink"), "sink");
|
gst_element_add_ghost_pad (bin, gst_element_get_pad (fakesink, "sink"), "sink");
|
||||||
|
|
||||||
gst_element_connect (fakesrc, bin);
|
gst_element_link (fakesrc, bin);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), fakesrc, bin, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), fakesrc, bin, NULL);
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,10 @@ create_pipeline (void)
|
||||||
queue = gst_element_factory_make ("queue", "queue");
|
queue = gst_element_factory_make ("queue", "queue");
|
||||||
gst_bin_add (GST_BIN (thread), fakesink);
|
gst_bin_add (GST_BIN (thread), fakesink);
|
||||||
gst_bin_add (GST_BIN (thread), queue);
|
gst_bin_add (GST_BIN (thread), queue);
|
||||||
gst_element_connect (queue, fakesink);
|
gst_element_link (queue, fakesink);
|
||||||
gst_element_add_ghost_pad (thread, gst_element_get_pad (queue, "sink"), "sink");
|
gst_element_add_ghost_pad (thread, gst_element_get_pad (queue, "sink"), "sink");
|
||||||
|
|
||||||
gst_element_connect (fakesrc, thread);
|
gst_element_link (fakesrc, thread);
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (pipeline), fakesrc);
|
gst_bin_add (GST_BIN (pipeline), fakesrc);
|
||||||
gst_bin_add (GST_BIN (pipeline), thread);
|
gst_bin_add (GST_BIN (pipeline), thread);
|
||||||
|
|
|
@ -30,7 +30,7 @@ main (gint argc, gchar *argv[])
|
||||||
|
|
||||||
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
||||||
|
|
||||||
gst_element_connect (fakesrc, fakesink);
|
gst_element_link (fakesrc, fakesink);
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (bin), fakesink);
|
gst_bin_add (GST_BIN (bin), fakesink);
|
||||||
gst_bin_add (GST_BIN (pipeline), bin);
|
gst_bin_add (GST_BIN (pipeline), bin);
|
||||||
|
|
|
@ -47,7 +47,7 @@ main (int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_element_connect_many (src, id, sink, NULL);
|
gst_element_link_many (src, id, sink, NULL);
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, id, sink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, id, sink, NULL);
|
||||||
|
|
||||||
clock = gst_bin_get_clock (GST_BIN (pipeline));
|
clock = gst_bin_get_clock (GST_BIN (pipeline));
|
||||||
|
|
|
@ -223,8 +223,8 @@ int main(int argc,char *argv[]) {
|
||||||
testelement = gst_element_factory_make ("dptest", "testelement");
|
testelement = gst_element_factory_make ("dptest", "testelement");
|
||||||
g_assert (testelement);
|
g_assert (testelement);
|
||||||
|
|
||||||
gst_element_connect (src, testelement);
|
gst_element_link (src, testelement);
|
||||||
gst_element_connect (testelement, sink);
|
gst_element_link (testelement, sink);
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (pipeline), src);
|
gst_bin_add (GST_BIN (pipeline), src);
|
||||||
gst_bin_add (GST_BIN (pipeline), testelement);
|
gst_bin_add (GST_BIN (pipeline), testelement);
|
||||||
|
|
|
@ -54,14 +54,14 @@ main (int argc, char *argv[])
|
||||||
gst_bin_add (GST_BIN (pipeline), src);
|
gst_bin_add (GST_BIN (pipeline), src);
|
||||||
gst_bin_add (GST_BIN (pipeline), sink);
|
gst_bin_add (GST_BIN (pipeline), sink);
|
||||||
|
|
||||||
/* connect */
|
/* link */
|
||||||
g_print ("Connecting elements\n");
|
g_print ("Linking elements\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
|
|
||||||
/* we expect this to give an error */
|
/* we expect this to give an error */
|
||||||
if (gst_bin_iterate (GST_BIN (pipeline)) != FALSE)
|
if (gst_bin_iterate (GST_BIN (pipeline)) != FALSE)
|
||||||
{
|
{
|
||||||
g_warning ("Iterating a bin with unconnected elements should return FALSE !\n");
|
g_warning ("Iterating a bin with unlinked elements should return FALSE !\n");
|
||||||
retval = 1;
|
retval = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ main (int argc, char *argv[])
|
||||||
/* we expect this to work */
|
/* we expect this to work */
|
||||||
if (gst_bin_iterate (GST_BIN (pipeline)) != TRUE)
|
if (gst_bin_iterate (GST_BIN (pipeline)) != TRUE)
|
||||||
{
|
{
|
||||||
g_error ("Iterating a bin with connected elements should return TRUE !\n");
|
g_error ("Iterating a bin with linked elements should return TRUE !\n");
|
||||||
retval = 1;
|
retval = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,16 +70,16 @@ main (int argc, char *argv[])
|
||||||
gst_bin_add (GST_BIN (pipeline), src);
|
gst_bin_add (GST_BIN (pipeline), src);
|
||||||
gst_bin_add (GST_BIN (pipeline), tee);
|
gst_bin_add (GST_BIN (pipeline), tee);
|
||||||
|
|
||||||
/* connect input part */
|
/* link input part */
|
||||||
g_print ("Connecting input elements\n");
|
g_print ("Linking input elements\n");
|
||||||
gst_pad_connect (gst_element_get_pad (src, "src"),
|
gst_pad_link (gst_element_get_pad (src, "src"),
|
||||||
gst_element_get_pad (tee, "sink"));
|
gst_element_get_pad (tee, "sink"));
|
||||||
|
|
||||||
/* request one pad from tee */
|
/* request one pad from tee */
|
||||||
g_print ("Requesting first pad\n");
|
g_print ("Requesting first pad\n");
|
||||||
tee_src1 = gst_element_get_request_pad (tee, "src%d");
|
tee_src1 = gst_element_get_request_pad (tee, "src%d");
|
||||||
gst_bin_add (GST_BIN (pipeline), sink1);
|
gst_bin_add (GST_BIN (pipeline), sink1);
|
||||||
gst_pad_connect (tee_src1, gst_element_get_pad (sink1, "sink"));
|
gst_pad_link (tee_src1, gst_element_get_pad (sink1, "sink"));
|
||||||
|
|
||||||
/* set to play */
|
/* set to play */
|
||||||
g_print ("Doing 1 iteration\n");
|
g_print ("Doing 1 iteration\n");
|
||||||
|
@ -91,9 +91,9 @@ main (int argc, char *argv[])
|
||||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||||
tee_src2 = gst_element_get_request_pad (tee, "src%d");
|
tee_src2 = gst_element_get_request_pad (tee, "src%d");
|
||||||
gst_bin_add (GST_BIN (pipeline), sink2);
|
gst_bin_add (GST_BIN (pipeline), sink2);
|
||||||
gst_pad_connect (tee_src2, gst_element_get_pad (sink2, "sink"));
|
gst_pad_link (tee_src2, gst_element_get_pad (sink2, "sink"));
|
||||||
|
|
||||||
/* now we have two fakesinks connected, iterate */
|
/* now we have two fakesinks linked, iterate */
|
||||||
g_print ("Doing 1 iteration\n");
|
g_print ("Doing 1 iteration\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
gst_bin_iterate (GST_BIN (pipeline));
|
gst_bin_iterate (GST_BIN (pipeline));
|
||||||
|
@ -146,11 +146,11 @@ main (int argc, char *argv[])
|
||||||
/* remove the first one, iterate */
|
/* remove the first one, iterate */
|
||||||
g_print ("Removing first sink\n");
|
g_print ("Removing first sink\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||||
gst_pad_disconnect (tee_src1, gst_element_get_pad (sink1, "sink"));
|
gst_pad_unlink (tee_src1, gst_element_get_pad (sink1, "sink"));
|
||||||
gst_pad_destroy (tee_src1);
|
gst_pad_destroy (tee_src1);
|
||||||
gst_bin_remove (GST_BIN (pipeline), sink1);
|
gst_bin_remove (GST_BIN (pipeline), sink1);
|
||||||
|
|
||||||
/* only second fakesink connected, iterate */
|
/* only second fakesink linked, iterate */
|
||||||
g_print ("Doing 1 iteration\n");
|
g_print ("Doing 1 iteration\n");
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
gst_bin_iterate (GST_BIN (pipeline));
|
gst_bin_iterate (GST_BIN (pipeline));
|
||||||
|
|
|
@ -32,7 +32,7 @@ create_bin_ghostpads (void)
|
||||||
gst_bin_add (GST_BIN (bin), element1);
|
gst_bin_add (GST_BIN (bin), element1);
|
||||||
element2 = gst_element_factory_make ("fakesink", NULL);
|
element2 = gst_element_factory_make ("fakesink", NULL);
|
||||||
gst_bin_add (GST_BIN (bin), element2);
|
gst_bin_add (GST_BIN (bin), element2);
|
||||||
gst_element_connect_pads (element1, "src", element2, "sink");
|
gst_element_link_pads (element1, "src", element2, "sink");
|
||||||
gst_element_add_ghost_pad (bin, gst_element_get_pad (element1, "sink"), "ghost_sink");
|
gst_element_add_ghost_pad (bin, gst_element_get_pad (element1, "sink"), "ghost_sink");
|
||||||
|
|
||||||
return bin;
|
return bin;
|
||||||
|
|
|
@ -42,28 +42,28 @@ main (int argc, gchar *argv[])
|
||||||
for (i=0; i<iters/2; i++) {
|
for (i=0; i<iters/2; i++) {
|
||||||
element = gst_element_factory_make ("fakesink", NULL);
|
element = gst_element_factory_make ("fakesink", NULL);
|
||||||
element2 = gst_element_factory_make ("fakesrc", NULL);
|
element2 = gst_element_factory_make ("fakesrc", NULL);
|
||||||
gst_element_connect_pads (element, "sink", element2, "src");
|
gst_element_link_pads (element, "sink", element2, "src");
|
||||||
g_assert (GST_PAD_IS_CONNECTED (gst_element_get_pad (element2, "src")));
|
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
|
||||||
g_assert (GST_PAD_IS_CONNECTED (gst_element_get_pad (element, "sink")));
|
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element, "sink")));
|
||||||
gst_object_unref (GST_OBJECT (element));
|
gst_object_unref (GST_OBJECT (element));
|
||||||
g_assert (!GST_PAD_IS_CONNECTED (gst_element_get_pad (element2, "src")));
|
g_assert (!GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
|
||||||
gst_object_unref (GST_OBJECT (element2));
|
gst_object_unref (GST_OBJECT (element2));
|
||||||
}
|
}
|
||||||
g_print ("create/connect/unref %d elements %ld\n", iters/2, vmsize()-usage1);
|
g_print ("create/link/unref %d elements %ld\n", iters/2, vmsize()-usage1);
|
||||||
|
|
||||||
for (i=0; i<iters/2; i++) {
|
for (i=0; i<iters/2; i++) {
|
||||||
element = gst_element_factory_make ("fakesink", NULL);
|
element = gst_element_factory_make ("fakesink", NULL);
|
||||||
element2 = gst_element_factory_make ("fakesrc", NULL);
|
element2 = gst_element_factory_make ("fakesrc", NULL);
|
||||||
gst_element_connect_pads (element, "sink", element2, "src");
|
gst_element_link_pads (element, "sink", element2, "src");
|
||||||
g_assert (GST_PAD_IS_CONNECTED (gst_element_get_pad (element2, "src")));
|
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
|
||||||
g_assert (GST_PAD_IS_CONNECTED (gst_element_get_pad (element, "sink")));
|
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element, "sink")));
|
||||||
gst_object_destroy (GST_OBJECT (element));
|
gst_object_destroy (GST_OBJECT (element));
|
||||||
g_assert (GST_OBJECT_DESTROYED (element));
|
g_assert (GST_OBJECT_DESTROYED (element));
|
||||||
g_assert (!GST_PAD_IS_CONNECTED (gst_element_get_pad (element2, "src")));
|
g_assert (!GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
|
||||||
gst_object_unref (GST_OBJECT (element2));
|
gst_object_unref (GST_OBJECT (element2));
|
||||||
gst_object_unref (GST_OBJECT (element));
|
gst_object_unref (GST_OBJECT (element));
|
||||||
}
|
}
|
||||||
g_print ("create/connect/destroy %d elements %ld\n", iters/2, vmsize()-usage1);
|
g_print ("create/link/destroy %d elements %ld\n", iters/2, vmsize()-usage1);
|
||||||
|
|
||||||
element = gst_element_factory_make ("fakesink", NULL);;
|
element = gst_element_factory_make ("fakesink", NULL);;
|
||||||
pad = gst_element_get_pad (element, "sink");
|
pad = gst_element_get_pad (element, "sink");
|
||||||
|
|
|
@ -36,7 +36,7 @@ create_thread_ghostpads (void)
|
||||||
gst_element_set_name (element2, "test2");
|
gst_element_set_name (element2, "test2");
|
||||||
gst_element_add_pad (element2, gst_pad_new ("sink1", GST_PAD_SINK));
|
gst_element_add_pad (element2, gst_pad_new ("sink1", GST_PAD_SINK));
|
||||||
gst_bin_add (GST_BIN (thread), element2);
|
gst_bin_add (GST_BIN (thread), element2);
|
||||||
gst_element_connect (element1, "src1", element2, "sink1");
|
gst_element_link (element1, "src1", element2, "sink1");
|
||||||
gst_element_add_ghost_pad (thread, gst_element_get_pad (element2, "sink1"), "sink1");
|
gst_element_add_ghost_pad (thread, gst_element_get_pad (element2, "sink1"), "sink1");
|
||||||
|
|
||||||
return thread;
|
return thread;
|
||||||
|
|
|
@ -29,7 +29,7 @@ construct_pipeline (GstElement *pipeline)
|
||||||
queue = gst_element_factory_make ("queue", NULL);
|
queue = gst_element_factory_make ("queue", NULL);
|
||||||
thread = gst_element_factory_make ("thread", NULL);
|
thread = gst_element_factory_make ("thread", NULL);
|
||||||
|
|
||||||
gst_element_connect_many (src, queue, identity, sink, NULL);
|
gst_element_link_many (src, queue, identity, sink, NULL);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, queue, thread, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, queue, thread, NULL);
|
||||||
gst_bin_add_many (GST_BIN (thread), identity, sink, NULL);
|
gst_bin_add_many (GST_BIN (thread), identity, sink, NULL);
|
||||||
|
|
|
@ -21,7 +21,7 @@ construct_pipeline (GstElement *pipeline)
|
||||||
g_assert (identity);
|
g_assert (identity);
|
||||||
g_assert (sink);
|
g_assert (sink);
|
||||||
|
|
||||||
gst_element_connect_many (src, identity, sink, NULL);
|
gst_element_link_many (src, identity, sink, NULL);
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, identity, sink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, identity, sink, NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue