From f1af3cca60626e5fe00ff80f5ede1ea4ce99f23e Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Thu, 9 Jan 2003 20:02:34 +0000 Subject: [PATCH] code cleanups and further deprecation fixes Original commit message from CVS: code cleanups and further deprecation fixes --- configure.ac | 3 ++ examples/cutter/cutter.c | 27 +++------- examples/queue/queue.c | 17 ++---- examples/queue3/queue3.c | 16 ++---- examples/queue4/queue4.c | 13 +---- examples/typefind/typefind.c | 3 +- examples/xml/createxml.c | 11 +--- gst/Makefile.am | 2 +- gst/autoplug/gstautoplugger.c | 74 +++++++++++++------------- gst/autoplug/gstspider.c | 64 +++++++++++----------- gst/autoplug/gstspideridentity.c | 2 +- gst/autoplug/gststaticautoplug.c | 32 +++++------ gst/autoplug/gststaticautoplugrender.c | 30 +++++------ gst/autoplug/spidertest.c | 10 ++-- gst/elements/gstidentity.c | 2 +- gst/elements/gsttee.c | 4 +- gst/gstcompat.h | 15 ++++++ gst/gstelement.c | 4 +- gst/gstpad.c | 68 +++++++++++------------ gst/gstpad.h | 14 ++--- gst/gstparse.c | 18 +++---- gst/gstparse.h | 2 +- gst/gstqueue.c | 2 +- plugins/elements/gstidentity.c | 2 +- plugins/elements/gstqueue.c | 2 +- plugins/elements/gsttee.c | 4 +- tests/lat.c | 10 ++-- tests/old/examples/cutter/cutter.c | 27 +++------- tests/old/examples/queue/queue.c | 17 ++---- tests/old/examples/queue3/queue3.c | 16 ++---- tests/old/examples/queue4/queue4.c | 13 +---- tests/old/examples/typefind/typefind.c | 3 +- tests/old/examples/xml/createxml.c | 11 +--- tests/old/testsuite/threads/threadc.c | 4 +- tests/old/testsuite/threads/threadd.c | 4 +- tests/old/testsuite/threads/threade.c | 4 +- tests/old/testsuite/threads/threadf.c | 6 +-- tests/threadstate/threadstate1.c | 4 +- tests/threadstate/threadstate3.c | 4 +- testsuite/threads/threadc.c | 4 +- testsuite/threads/threadd.c | 4 +- testsuite/threads/threade.c | 4 +- testsuite/threads/threadf.c | 6 +-- 43 files changed, 245 insertions(+), 337 deletions(-) diff --git a/configure.ac b/configure.ac index 9baf00cc94..6e5ba70b62 100644 --- a/configure.ac +++ b/configure.ac @@ -88,6 +88,9 @@ dnl this is so we can make GST_CFLAGS for external modules available dnl without mixing in internal (uninstalled) CFLAGS dnl +dnl disable deprecated functions internally +GST_INT_CFLAGS="-DGST_DISABLE_DEPRECATED" + AC_MSG_CHECKING(for large file support) AC_TRY_RUN([ #define _LARGEFILE_SOURCE diff --git a/examples/cutter/cutter.c b/examples/cutter/cutter.c index b19d90a5f5..c79350ca22 100644 --- a/examples/cutter/cutter.c +++ b/examples/cutter/cutter.c @@ -35,8 +35,8 @@ char buffer[255]; void cut_start (GstElement *element) { g_print ("\nDEBUG: main: cut start\n"); - /* we should pause the pipeline, disconnect cutter and disksink - * create a new disksink to a real file, reconnect, and set to play + /* we should pause the pipeline, unlink cutter and disksink + * create a new disksink to a real file, relink, and set to play */ g_print ("DEBUG: cut_start: main_bin pausing\n"); gst_element_set_state (main_bin, GST_STATE_PAUSED); @@ -71,8 +71,8 @@ void cut_start_signal (GstElement *element) void cut_stop (GstElement *element) { g_print ("\nDEBUG: main: cut stop\n"); - /* we should pause the pipeline, disconnect disksink, create a fake disksink, - * connect to pipeline, and set to play + /* we should pause the pipeline, unlink disksink, create a fake disksink, + * link to pipeline, and set to play */ g_print ("DEBUG: cut_stop: main_bin paused\n"); gst_element_set_state (main_bin, GST_STATE_PAUSED); @@ -154,22 +154,9 @@ int main (int argc, char *argv[]) gst_bin_add (GST_BIN (main_bin), audiosrc); gst_bin_add (GST_BIN (thread), queue); - gst_bin_add (GST_BIN (thread), cutter); - gst_bin_add (GST_BIN (thread), encoder); - gst_bin_add (GST_BIN (thread), disksink); - - /* connect adder and disksink */ - - gst_pad_connect (gst_element_get_pad (audiosrc, "src"), - gst_element_get_pad (queue, "sink")); - - gst_pad_connect (gst_element_get_pad (queue, "src"), - gst_element_get_pad (cutter, "sink")); - gst_pad_connect (gst_element_get_pad (cutter, "src"), - gst_element_get_pad (encoder, "sink")); - gst_pad_connect (gst_element_get_pad (encoder, "src"), - gst_element_get_pad (disksink, "sink")); + gst_bin_add_many (GST_BIN (thread), cutter, encoder, disksink, NULL); + gst_element_link_many (audiosrc, queue, cutter, encoder, disksink, NULL); gst_bin_add (GST_BIN (main_bin), thread); /* set signal handlers */ @@ -186,7 +173,7 @@ int main (int argc, char *argv[]) g_print ("setting thread to play\n"); gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING); */ - while (playing) + while (playing) { /* g_print ("> "); */ gst_bin_iterate (GST_BIN (main_bin)); diff --git a/examples/queue/queue.c b/examples/queue/queue.c index e68b278c56..5f3a9c0462 100644 --- a/examples/queue/queue.c +++ b/examples/queue/queue.c @@ -37,23 +37,12 @@ int main(int argc,char *argv[]) g_assert(osssink != NULL); /* add objects to the main pipeline */ - gst_bin_add(GST_BIN(bin), filesrc); - gst_bin_add(GST_BIN(bin), parse); - gst_bin_add(GST_BIN(bin), decode); - gst_bin_add(GST_BIN(bin), queue); + gst_bin_add_many (GST_BIN (bin), filesrc, parse, decode, queue, NULL); gst_bin_add(GST_BIN(thread), osssink); - gst_bin_add(GST_BIN(bin), thread); - - gst_pad_connect(gst_element_get_pad(filesrc,"src"), - gst_element_get_pad(parse,"sink")); - gst_pad_connect(gst_element_get_pad(parse,"src"), - gst_element_get_pad(decode,"sink")); - gst_pad_connect(gst_element_get_pad(decode,"src"), - gst_element_get_pad(queue,"sink")); - gst_pad_connect(gst_element_get_pad(queue,"src"), - gst_element_get_pad(osssink,"sink")); + + gst_element_link_many (filesrc, parse, decode, queue, osssink, NULL); /* start playing */ gst_element_set_state(GST_ELEMENT(bin), GST_STATE_PLAYING); diff --git a/examples/queue3/queue3.c b/examples/queue3/queue3.c index e2c1d38743..da92fcf7b3 100644 --- a/examples/queue3/queue3.c +++ b/examples/queue3/queue3.c @@ -4,14 +4,14 @@ gboolean playing; /* eos will be called when the src element has an end of stream */ -void eos(GstElement *element, gpointer data) +void eos(GstElement *element, gpointer data) { g_print("have eos, quitting\n"); playing = FALSE; } -int main(int argc,char *argv[]) +int main(int argc,char *argv[]) { GstElement *filesrc, *osssink, *queue, *parse, *decode; GstElement *bin; @@ -55,18 +55,8 @@ int main(int argc,char *argv[]) gst_bin_add(GST_BIN(thread), parse); gst_bin_add(GST_BIN(thread), decode); gst_bin_add(GST_BIN(thread), osssink); - - gst_pad_connect(gst_element_get_pad(filesrc,"src"), - gst_element_get_pad(queue,"sink")); - gst_pad_connect(gst_element_get_pad(queue,"src"), - gst_element_get_pad(parse,"sink")); - gst_pad_connect(gst_element_get_pad(parse,"src"), - gst_element_get_pad(decode,"sink")); - gst_pad_connect(gst_element_get_pad(decode,"src"), - gst_element_get_pad(osssink,"sink")); - - gst_bin_add(GST_BIN(bin), thread); + gst_element_link_many (filesrc, queue, parse, decode, osssink, NULL); /* make it ready */ gst_element_set_state(GST_ELEMENT(bin), GST_STATE_READY); diff --git a/examples/queue4/queue4.c b/examples/queue4/queue4.c index e2c4025f5b..193b12fa30 100644 --- a/examples/queue4/queue4.c +++ b/examples/queue4/queue4.c @@ -60,19 +60,8 @@ int main(int argc,char *argv[]) gst_bin_add(GST_BIN(thread), queue2); gst_bin_add(GST_BIN(thread2), osssink); - - gst_pad_connect(gst_element_get_pad(filesrc,"src"), - gst_element_get_pad(queue,"sink")); - gst_pad_connect(gst_element_get_pad(queue,"src"), - gst_element_get_pad(parse,"sink")); - gst_pad_connect(gst_element_get_pad(parse,"src"), - gst_element_get_pad(decode,"sink")); - gst_pad_connect(gst_element_get_pad(decode,"src"), - gst_element_get_pad(queue2,"sink")); - - gst_pad_connect(gst_element_get_pad(queue2,"src"), - gst_element_get_pad(osssink,"sink")); + gst_element_link_many (filesrc, queue, parse, decode, queue2, osssink, NULL); gst_bin_add(GST_BIN(bin), thread); gst_bin_add(GST_BIN(bin), thread2); diff --git a/examples/typefind/typefind.c b/examples/typefind/typefind.c index 0a66e26e61..1f5352411a 100644 --- a/examples/typefind/typefind.c +++ b/examples/typefind/typefind.c @@ -46,8 +46,7 @@ main(int argc, char *argv[]) g_signal_connect (G_OBJECT (typefind), "have_type", G_CALLBACK (type_found), NULL); - gst_pad_connect(gst_element_get_pad(filesrc,"src"), - gst_element_get_pad(typefind,"sink")); + gst_element_link (filesrc, typefind); /* start playing */ gst_element_set_state(GST_ELEMENT(bin), GST_STATE_PLAYING); diff --git a/examples/xml/createxml.c b/examples/xml/createxml.c index 137f494c14..568851368e 100644 --- a/examples/xml/createxml.c +++ b/examples/xml/createxml.c @@ -71,17 +71,8 @@ int main(int argc,char *argv[]) gst_bin_add (GST_BIN (thread), queue2); gst_bin_add (GST_BIN (thread2), osssink); - - gst_pad_connect (gst_element_get_pad (filesrc,"src"), - gst_element_get_pad (queue,"sink")); - gst_pad_connect (gst_element_get_pad (queue,"src"), - gst_element_get_pad (decode,"sink")); - gst_pad_connect (gst_element_get_pad (decode,"src"), - gst_element_get_pad (queue2,"sink")); - - gst_pad_connect (gst_element_get_pad (queue2,"src"), - gst_element_get_pad (osssink,"sink")); + gst_element_link_many (filesrc, queue, decode, queue2, osssink, NULL); gst_bin_add (GST_BIN (pipeline), thread); gst_bin_add (GST_BIN (pipeline), thread2); diff --git a/gst/Makefile.am b/gst/Makefile.am index a6d6ae2e63..db590cad6c 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -94,7 +94,7 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \ BUILT_SOURCES = gstmarshal.h gstmarshal.c gstenumtypes.h gstenumtypes.c libgstreamer_@GST_MAJORMINOR@_la_CFLAGS = -D_GNU_SOURCE \ - $(LIBGST_CFLAGS) \ + $(GST_CFLAGS) \ -DG_LOG_DOMAIN=g_log_domain_gstreamer \ -DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" libgstreamer_@GST_MAJORMINOR@_la_LIBADD = $(LIBGST_LIBS) parse/libgstparse.la registries/libgstxmlregistry.la diff --git a/gst/autoplug/gstautoplugger.c b/gst/autoplug/gstautoplugger.c index a8b62fb11c..be79669d96 100644 --- a/gst/autoplug/gstautoplugger.c +++ b/gst/autoplug/gstautoplugger.c @@ -96,8 +96,8 @@ static void gst_autoplugger_external_src_caps_changed (GstPad *pad, GstCaps *cap static void gst_autoplugger_external_sink_caps_nego_failed (GstPad *pad, gboolean *result, GstAutoplugger *autoplugger); static void gst_autoplugger_external_src_caps_nego_failed (GstPad *pad, gboolean *result, GstAutoplugger *autoplugger); /* defined but not used -static void gst_autoplugger_external_sink_connected (GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger); -static void gst_autoplugger_external_src_connected (GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger); +static void gst_autoplugger_external_sink_linked (GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger); +static void gst_autoplugger_external_src_linked (GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger); */ static void gst_autoplugger_cache_first_buffer (GstElement *element,GstBuffer *buf,GstAutoplugger *autoplugger); static void gst_autoplugger_cache_empty (GstElement *element, GstAutoplugger *autoplugger); @@ -192,10 +192,10 @@ gst_autoplugger_init (GstAutoplugger *autoplugger) G_CALLBACK (gst_autoplugger_external_sink_caps_nego_failed), autoplugger); g_signal_connect (G_OBJECT (autoplugger->cache_srcpad), "caps_nego_failed", G_CALLBACK (gst_autoplugger_external_src_caps_nego_failed), autoplugger); -/* g_signal_connect (G_OBJECT (autoplugger->cache_sinkpad), "connected", */ -/* gst_autoplugger_external_sink_connected, autoplugger);*/ -/* g_signal_connect (G_OBJECT (autoplugger->cache_srcpad), "connected", */ -/* gst_autoplugger_external_src_connected, autoplugger); */ +/* g_signal_connect (G_OBJECT (autoplugger->cache_sinkpad), "linked", */ +/* gst_autoplugger_external_sink_linked, autoplugger);*/ +/* g_signal_connect (G_OBJECT (autoplugger->cache_srcpad), "linked", */ +/* gst_autoplugger_external_src_linked, autoplugger); */ /* ghost both of these pads to the outside world */ gst_element_add_ghost_pad (GST_ELEMENT(autoplugger), autoplugger->cache_sinkpad, "sink"); @@ -204,12 +204,12 @@ gst_autoplugger_init (GstAutoplugger *autoplugger) /* defined but not used G_GNUC_UNUSED static void -gst_autoplugger_external_sink_connected(GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger) +gst_autoplugger_external_sink_linked(GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger) { GstPadTemplate *peertemplate; GstCaps *peercaps, *peertemplatecaps; - GST_INFO(GST_CAT_AUTOPLUG, "have cache:sink connected");*/ + GST_INFO(GST_CAT_AUTOPLUG, "have cache:sink linked");*/ /* autoplugger->sinkpadpeer = peerpad; */ /* if (autoplugger->sinkpadpeer) { @@ -229,12 +229,12 @@ gst_autoplugger_external_sink_connected(GstPad *pad, GstPad *peerpad, GstAutoplu } G_GNUC_UNUSED static void -gst_autoplugger_external_src_connected(GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger) +gst_autoplugger_external_src_linked(GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger) { GstPadTemplate *peertemplate; GstCaps *peercaps, *peertemplatecaps; - GST_INFO(GST_CAT_AUTOPLUG, "have cache:src connected");*/ + GST_INFO(GST_CAT_AUTOPLUG, "have cache:src linked");*/ /* autoplugger->srcpadpeer = peerpad; */ /* if (autoplugger->srcpadpeer) { @@ -278,14 +278,14 @@ gst_autoplugger_autoplug(GstAutoplugger *autoplugger,GstPad *srcpad,GstCaps *src GstPad *sinkpad; sinkpad = GST_PAD(GST_PAD_PEER(srcpad)); - GST_DEBUG(GST_CAT_AUTOPLUG,"disconnecting %s:%s and %s:%s to autoplug between them", + GST_DEBUG(GST_CAT_AUTOPLUG,"unlinking %s:%s and %s:%s to autoplug between them", GST_DEBUG_PAD_NAME(srcpad),GST_DEBUG_PAD_NAME(sinkpad)); GST_DEBUG(GST_CAT_AUTOPLUG,"srcpadcaps are of type %s",gst_caps_get_mime(srccaps)); GST_DEBUG(GST_CAT_AUTOPLUG,"sinkpadcaps are of type %s",gst_caps_get_mime(sinkcaps)); - /* disconnect the pads */ - GST_DEBUG(GST_CAT_AUTOPLUG, "disconnecting the pads that will be joined by an autobin"); - gst_pad_disconnect(srcpad,sinkpad); + /* unlink the pads */ + GST_DEBUG(GST_CAT_AUTOPLUG, "unlinking the pads that will be joined by an autobin"); + gst_pad_unlink(srcpad,sinkpad); if (!autoplugger->autoplug) { autoplugger->autoplug = gst_autoplug_factory_make("static"); @@ -307,9 +307,9 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger)); /* attach the autoplugged bin */ GST_DEBUG(GST_CAT_AUTOPLUG, "attaching the autoplugged bin between the two pads"); - gst_pad_connect(srcpad,gst_element_get_pad(autoplugger->autobin,"sink")); + gst_pad_link(srcpad,gst_element_get_pad(autoplugger->autobin,"sink")); gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger)); - gst_pad_connect(gst_element_get_pad(autoplugger->autobin,"src_00"),sinkpad); + gst_pad_link(gst_element_get_pad(autoplugger->autobin,"src_00"),sinkpad); gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger)); /* FIXME try to force the renego */ @@ -409,20 +409,20 @@ gst_autoplugger_cache_empty(GstElement *element, GstAutoplugger *autoplugger) /* try to PAUSE the whole thing */ gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED); - /* disconnect the cache from its peers */ - GST_DEBUG(GST_CAT_AUTOPLUG, "disconnecting autoplugcache from its peers"); + /* unlink the cache from its peers */ + GST_DEBUG(GST_CAT_AUTOPLUG, "unlinking autoplugcache from its peers"); cache_sinkpad_peer = GST_PAD (GST_PAD_PEER(autoplugger->cache_sinkpad)); cache_srcpad_peer = GST_PAD (GST_PAD_PEER(autoplugger->cache_srcpad)); - gst_pad_disconnect(cache_sinkpad_peer,autoplugger->cache_sinkpad); - gst_pad_disconnect(autoplugger->cache_srcpad,cache_srcpad_peer); + gst_pad_unlink(cache_sinkpad_peer,autoplugger->cache_sinkpad); + gst_pad_unlink(autoplugger->cache_srcpad,cache_srcpad_peer); /* remove the cache from self */ GST_DEBUG(GST_CAT_AUTOPLUG, "removing the cache from the autoplugger"); gst_bin_remove (GST_BIN(autoplugger), autoplugger->cache); - /* connect the two pads */ - GST_DEBUG(GST_CAT_AUTOPLUG, "reconnecting the autoplugcache's former peers"); - gst_pad_connect(cache_sinkpad_peer,cache_srcpad_peer); + /* link the two pads */ + GST_DEBUG(GST_CAT_AUTOPLUG, "relinking the autoplugcache's former peers"); + gst_pad_link(cache_sinkpad_peer,cache_srcpad_peer); autoplugger->paused--; if (autoplugger->paused == 0) @@ -446,13 +446,13 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger)); /* try to PAUSE the whole thing */ gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED); - /* first disconnect the typefind and shut it down */ - GST_DEBUG(GST_CAT_AUTOPLUG, "disconnecting typefind from the cache"); - gst_pad_disconnect(autoplugger->cache_srcpad,autoplugger->typefind_sinkpad); + /* first unlink the typefind and shut it down */ + GST_DEBUG(GST_CAT_AUTOPLUG, "unlinking typefind from the cache"); + gst_pad_unlink(autoplugger->cache_srcpad,autoplugger->typefind_sinkpad); gst_bin_remove(GST_BIN(autoplugger),autoplugger->typefind); /* FIXME FIXME now we'd compare caps and see if we need to autoplug something in the middle, but for */ - /* now we're going to just reconnect where we left off */ + /* now we're going to just relink where we left off */ /* FIXME FIXME FIXME!!!: this should really be done in the caps failure!!! */ /* if (!autoplugger->autoplug) { @@ -464,22 +464,22 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger)); gst_bin_add(GST_BIN(autoplugger),autoplugger->autobin); * * re-attach the srcpad's original peer to the cache * -* GST_DEBUG(GST_CAT_AUTOPLUG, "reconnecting the cache to the downstream peer"); * -* gst_pad_connect(autoplugger->cache_srcpad,autoplugger->srcpadpeer); * +* GST_DEBUG(GST_CAT_AUTOPLUG, "relinking the cache to the downstream peer"); * +* gst_pad_link(autoplugger->cache_srcpad,autoplugger->srcpadpeer); * * attach the autoplugged bin * GST_DEBUG(GST_CAT_AUTOPLUG, "attaching the autoplugged bin between cache and downstream peer"); - gst_pad_connect(autoplugger->cache_srcpad,gst_element_get_pad(autoplugger->autobin,"sink")); - gst_pad_connect(gst_element_get_pad(autoplugger->autobin,"src_00"),autoplugger->srcpadpeer); + gst_pad_link(autoplugger->cache_srcpad,gst_element_get_pad(autoplugger->autobin,"sink")); + gst_pad_link(gst_element_get_pad(autoplugger->autobin,"src_00"),autoplugger->srcpadpeer); */ - /* FIXME set the caps on the new connection + /* FIXME set the caps on the new link * GST_DEBUG(GST_CAT_AUTOPLUG,"forcing caps on the typefound pad"); * gst_pad_set_caps(autoplugger->cache_srcpad,caps); * reattach the original outside srcpad */ GST_DEBUG(GST_CAT_AUTOPLUG,"re-attaching downstream peer to autoplugcache"); - gst_pad_connect(autoplugger->cache_srcpad,autoplugger->srcpadpeer); + gst_pad_link(autoplugger->cache_srcpad,autoplugger->srcpadpeer); /* now reset the autoplugcache */ GST_DEBUG(GST_CAT_AUTOPLUG, "resetting the cache to send first buffer(s) again"); @@ -522,9 +522,9 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger)); gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED); /* detach the srcpad */ - GST_DEBUG(GST_CAT_AUTOPLUG, "disconnecting cache from its downstream peer"); + GST_DEBUG(GST_CAT_AUTOPLUG, "unlinking cache from its downstream peer"); autoplugger->srcpadpeer = GST_PAD(GST_PAD_PEER(autoplugger->cache_srcpad)); - gst_pad_disconnect(autoplugger->cache_srcpad,autoplugger->srcpadpeer); + gst_pad_unlink(autoplugger->cache_srcpad,autoplugger->srcpadpeer); /* instantiate the typefind and set up the signal handlers */ if (!autoplugger->typefind) { @@ -535,9 +535,9 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger)); G_CALLBACK (gst_autoplugger_type_find_have_type), autoplugger); } /* add it to self and attach it */ - GST_DEBUG(GST_CAT_AUTOPLUG, "adding typefind to self and connecting to cache"); + GST_DEBUG(GST_CAT_AUTOPLUG, "adding typefind to self and linking to cache"); gst_bin_add(GST_BIN(autoplugger),autoplugger->typefind); - gst_pad_connect(autoplugger->cache_srcpad,autoplugger->typefind_sinkpad); + gst_pad_link(autoplugger->cache_srcpad,autoplugger->typefind_sinkpad); /* bring the typefind into playing state */ GST_DEBUG(GST_CAT_AUTOPLUG, "setting typefind state to PLAYING"); diff --git a/gst/autoplug/gstspider.c b/gst/autoplug/gstspider.c index 3c59fa5d01..d5116c27dd 100644 --- a/gst/autoplug/gstspider.c +++ b/gst/autoplug/gstspider.c @@ -2,7 +2,7 @@ * Copyright (C) 2002 Erik Walthinsen * 2002 Wim Taymans * - * gstspider.c: element to automatically connect sinks and sources + * gstspider.c: element to automatically link sinks and sources * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -25,7 +25,7 @@ * - handle automatic removal of unneeded elements * - make the spider handle and send events (esp. new media) * - decide if we plug pads or elements, currently it's a mess - * - allow disconnecting + * - allow unlinking * - implement proper saving/loading from xml * - implement a way to allow merging/splitting (aka tee) * - find ways to define which elements to use when plugging @@ -276,7 +276,7 @@ gst_spider_unused_elementname (GstBin *bin, const gchar *startwith) return name; } static void -gst_spider_connect_sometimes (GstElement *src, GstPad *pad, GstSpiderConnection *conn) +gst_spider_link_sometimes (GstElement *src, GstPad *pad, GstSpiderConnection *conn) { gboolean restart = FALSE; gulong signal_id = conn->signal_id; @@ -291,7 +291,7 @@ gst_spider_connect_sometimes (GstElement *src, GstPad *pad, GstSpiderConnection } /* try to autoplug the elements */ - if (gst_spider_plug_from_srcpad (conn, pad) != GST_PAD_CONNECT_REFUSED) { + if (gst_spider_plug_from_srcpad (conn, pad) != GST_PAD_LINK_REFUSED) { GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "%s:%s was autoplugged to %s:%s, removing callback", GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (sinkpad)); g_signal_handler_disconnect (src, signal_id); signal_id = 0; @@ -405,8 +405,8 @@ gst_spider_identity_plug (GstSpiderIdentity *ident) { if (GST_PAD_PEER (ident->src)) { - /* Hey, the ident is connected on both sides */ - g_warning ("Trying to autoplug a connected element. Aborting..."); + /* Hey, the ident is linked on both sides */ + g_warning ("Trying to autoplug a linked element. Aborting..."); return; } else { dir = GST_PAD_SINK; @@ -416,13 +416,13 @@ gst_spider_identity_plug (GstSpiderIdentity *ident) { dir = GST_PAD_SRC; } else { - /* the ident isn't connected on either side */ - g_warning ("Trying to autoplug an unconnected element. Aborting..."); + /* the ident isn't linked on either side */ + g_warning ("Trying to autoplug an unlinked element. Aborting..."); return; } } - /* now iterate all possible pads and connect when needed */ + /* now iterate all possible pads and link when needed */ padlist = gst_element_get_pad_list (GST_ELEMENT (spider)); while (padlist) { @@ -432,10 +432,10 @@ gst_spider_identity_plug (GstSpiderIdentity *ident) g_assert (GST_IS_PAD (padlist->data)); otherpad = (GstPad *) GST_GPAD_REALPAD (padlist->data); peer = (GstSpiderIdentity *) GST_PAD_PARENT (otherpad); - /* we only want to connect to the other side */ + /* we only want to link to the other side */ if (dir != GST_PAD_DIRECTION (otherpad)) { - /* we only connect to plugged in elements */ + /* we only link to plugged in elements */ if (peer->plugged == TRUE) { /* plug in the right direction */ @@ -487,7 +487,7 @@ gst_spider_identity_unplug (GstSpiderIdentity *ident) } ident->plugged = FALSE; } -/* connects src to sink using the elementfactories in plugpath +/* links src to sink using the elementfactories in plugpath * plugpath will be removed afterwards */ static GstPadConnectReturn gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) @@ -498,7 +498,7 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) /* exit if plugging is already done */ if ((GstElement *) conn->src == conn->current) - return GST_PAD_CONNECT_DONE; + return GST_PAD_LINK_DONE; /* try to shorten the list at the end and not duplicate link code */ if (plugpath != NULL) @@ -514,7 +514,7 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) } } - /* do the connecting */ + /* do the linking */ while (conn->current != (GstElement *) (endelements == NULL ? conn->src : endelements->data)) { /* get sink element to plug, src is conn->current */ @@ -525,13 +525,13 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) element = gst_element_factory_create ((GstElementFactory *) plugpath->data, NULL); gst_bin_add (GST_BIN (spider), element); } - /* insert and connect new element */ - if (!gst_element_connect (conn->current, element)) + /* insert and link new element */ + if (!gst_element_link (conn->current, element)) { - /* check if the src has SOMETIMES templates. If so, connect a callback */ + /* check if the src has SOMETIMES templates. If so, link a callback */ GList *templs = gst_element_get_pad_template_list (conn->current); - /* remove element that couldn't be connected, if it wasn't the endpoint */ + /* remove element that couldn't be linked, if it wasn't the endpoint */ if (element != (GstElement *) conn->src) gst_bin_remove (GST_BIN (spider), element); @@ -539,17 +539,17 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) GstPadTemplate *templ = (GstPadTemplate *) templs->data; if ((GST_PAD_TEMPLATE_DIRECTION (templ) == GST_PAD_SRC) && (GST_PAD_TEMPLATE_PRESENCE(templ) == GST_PAD_SOMETIMES)) { - GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "adding callback to connect element %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src)); + GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "adding callback to link element %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src)); conn->signal_id = g_signal_connect (G_OBJECT (conn->current), "new_pad", - G_CALLBACK (gst_spider_connect_sometimes), conn); + G_CALLBACK (gst_spider_link_sometimes), conn); g_list_free (plugpath); - return GST_PAD_CONNECT_DELAYED; + return GST_PAD_LINK_DELAYED; } templs = g_list_next (templs); } - GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "no chance to connect element %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src)); + GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "no chance to link element %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src)); g_list_free (plugpath); - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; } GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "added element %s and attached it to element %s", GST_ELEMENT_NAME (element), GST_ELEMENT_NAME (conn->current)); gst_spider_link_add (conn, element); @@ -564,9 +564,9 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) endelements = g_list_delete_link (endelements, endelements); } - return GST_PAD_CONNECT_DONE; + return GST_PAD_LINK_DONE; } -/* checks, if src is already connected to an element from factory fac on direction dir */ +/* checks, if src is already linked to an element from factory fac on direction dir */ static GstElement * gst_spider_find_element_to_plug (GstElement *src, GstElementFactory *fac, GstPadDirection dir) { @@ -575,10 +575,10 @@ gst_spider_find_element_to_plug (GstElement *src, GstElementFactory *fac, GstPad while (padlist) { GstPad *pad = (GstPad *) GST_PAD_REALIZE (padlist->data); - /* is the pad on the right side and is it connected? */ + /* is the pad on the right side and is it linked? */ if ((GST_PAD_DIRECTION (pad) == dir) && (pad = (GstPad *) (GST_RPAD_PEER (pad)))) { - /* is the element the pad is connected to of the right type? */ + /* is the element the pad is linked to of the right type? */ GstElement *element = GST_PAD_PARENT (pad); if (GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element))->elementfactory == fac) { return element; @@ -595,11 +595,11 @@ gst_spider_plug (GstSpiderConnection *conn) { GstSpider *spider = (GstSpider *) GST_OBJECT_PARENT (conn->src); if ((GstElement *) conn->src == conn->current) - return GST_PAD_CONNECT_DONE; + return GST_PAD_LINK_DONE; if ((GstElement *) spider->sink_ident == conn->current) return gst_spider_plug_from_srcpad (conn, spider->sink_ident->src); g_warning ("FIXME: autoplugging only possible from GstSpiderIdentity conn->sink yet (yep, that's technical)\n"); - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; } /* try to establish the link using this pad */ static GstPadConnectReturn @@ -637,7 +637,7 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad) /* if there is no way to plug: return */ if (plugpath == NULL) { GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "no chance to plug from %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src)); - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; } GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "found a link that needs %d elements", g_list_length (plugpath)); @@ -657,7 +657,7 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad) result = gst_spider_create_and_plug (conn, plugpath); /* reset the "current" element */ - if (result == GST_PAD_CONNECT_REFUSED) + if (result == GST_PAD_LINK_REFUSED) { gst_spider_link_reset (conn, startelement); } @@ -669,7 +669,7 @@ GstElementDetails gst_spider_details = { "Spider", "Generic", "LGPL", - "Automatically connect sinks and sources", + "Automatically link sinks and sources", VERSION, "Benjamin Otte ", "(C) 2002", diff --git a/gst/autoplug/gstspideridentity.c b/gst/autoplug/gstspideridentity.c index adcb14cc9b..f45f5a2ce0 100644 --- a/gst/autoplug/gstspideridentity.c +++ b/gst/autoplug/gstspideridentity.c @@ -235,7 +235,7 @@ gst_spider_identity_link (GstPad *pad, GstCaps *caps) if (otherpad != NULL) return gst_pad_proxy_link (otherpad, caps); - return GST_PAD_CONNECT_OK; + return GST_PAD_LINK_OK; } static GstCaps* diff --git a/gst/autoplug/gststaticautoplug.c b/gst/autoplug/gststaticautoplug.c index cf021c41b1..49ccc97295 100644 --- a/gst/autoplug/gststaticautoplug.c +++ b/gst/autoplug/gststaticautoplug.c @@ -125,7 +125,7 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest) if (gst_caps_is_always_compatible (gst_pad_template_get_caps (srctemp), gst_pad_template_get_caps (desttemp))) { GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, - "factory \"%s\" can connect with factory \"%s\"\n", GST_OBJECT_NAME (src), + "factory \"%s\" can link with factory \"%s\"\n", GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest)); return TRUE; } @@ -136,7 +136,7 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest) srctemps = g_list_next (srctemps); } GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, - "factory \"%s\" cannot connect with factory \"%s\"\n", GST_OBJECT_NAME (src), + "factory \"%s\" cannot link with factory \"%s\"\n", GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest)); return FALSE; } @@ -145,26 +145,26 @@ static gboolean gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink) { const GList *sinkpads; - gboolean connected = FALSE; + gboolean linked = FALSE; - GST_DEBUG (0,"gstpipeline: autoplug pad connect function for \"%s\" to \"%s\"", + GST_DEBUG (0,"gstpipeline: autoplug pad link function for \"%s\" to \"%s\"", GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink)); sinkpads = gst_element_get_pad_list(sink); while (sinkpads) { GstPad *sinkpad = (GstPad *)sinkpads->data; - /* if we have a match, connect the pads */ + /* if we have a match, link the pads */ if (gst_pad_get_direction(sinkpad) == GST_PAD_SINK && - !GST_PAD_IS_CONNECTED(sinkpad)) + !GST_PAD_IS_LINKED(sinkpad)) { if (gst_caps_is_always_compatible (gst_pad_get_caps(pad), gst_pad_get_caps(sinkpad))) { - gst_pad_connect(pad, sinkpad); - GST_DEBUG (0,"gstpipeline: autoconnect pad \"%s\" in element %s <-> ", GST_PAD_NAME (pad), + gst_pad_link(pad, sinkpad); + GST_DEBUG (0,"gstpipeline: autolink pad \"%s\" in element %s <-> ", GST_PAD_NAME (pad), GST_ELEMENT_NAME(src)); GST_DEBUG (0,"pad \"%s\" in element %s", GST_PAD_NAME (sinkpad), GST_ELEMENT_NAME(sink)); - connected = TRUE; + linked = TRUE; break; } else { @@ -174,10 +174,10 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink) sinkpads = g_list_next(sinkpads); } - if (!connected) { + if (!linked) { GST_DEBUG (0,"gstpipeline: no path to sinks for type"); } - return connected; + return linked; } typedef struct { @@ -217,21 +217,21 @@ static void gst_autoplug_pads_autoplug (GstElement *src, GstElement *sink) { const GList *srcpads; - gboolean connected = FALSE; + gboolean linked = FALSE; srcpads = gst_element_get_pad_list(src); - while (srcpads && !connected) { + while (srcpads && !linked) { GstPad *srcpad = (GstPad *)srcpads->data; if (gst_pad_get_direction(srcpad) == GST_PAD_SRC) - connected = gst_autoplug_pads_autoplug_func (src, srcpad, sink); + linked = gst_autoplug_pads_autoplug_func (src, srcpad, sink); srcpads = g_list_next(srcpads); } - if (!connected) { - GST_DEBUG (0,"gstpipeline: delaying pad connections for \"%s\" to \"%s\"", + if (!linked) { + GST_DEBUG (0,"gstpipeline: delaying pad links for \"%s\" to \"%s\"", GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink)); g_signal_connect (G_OBJECT(src), "new_pad", G_CALLBACK (gst_autoplug_pads_autoplug_func), sink); diff --git a/gst/autoplug/gststaticautoplugrender.c b/gst/autoplug/gststaticautoplugrender.c index 6b37385f15..376fb01158 100644 --- a/gst/autoplug/gststaticautoplugrender.c +++ b/gst/autoplug/gststaticautoplugrender.c @@ -154,7 +154,7 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest) if (desttemp->direction == GST_PAD_SINK && desttemp->presence != GST_PAD_REQUEST) { if (gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (srctemp), GST_PAD_TEMPLATE_CAPS (desttemp))) { GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, - "factory \"%s\" can connect with factory \"%s\"", + "factory \"%s\" can link with factory \"%s\"", GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest)); return TRUE; } @@ -163,7 +163,7 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest) } } GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, - "factory \"%s\" cannot connect with factory \"%s\"", + "factory \"%s\" cannot link with factory \"%s\"", GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest)); return FALSE; } @@ -172,10 +172,10 @@ static gboolean gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink) { const GList *sinkpads; - gboolean connected = FALSE; + gboolean linked = FALSE; GstElementState state = GST_STATE (gst_element_get_parent (src)); - GST_DEBUG (0,"gstpipeline: autoplug pad connect function for %s %s:%s to \"%s\"", + GST_DEBUG (0,"gstpipeline: autoplug pad link function for %s %s:%s to \"%s\"", GST_ELEMENT_NAME (src), GST_DEBUG_PAD_NAME(pad), GST_ELEMENT_NAME(sink)); if (state == GST_STATE_PLAYING) @@ -185,12 +185,12 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink) while (sinkpads) { GstPad *sinkpad = (GstPad *)sinkpads->data; - /* if we have a match, connect the pads */ + /* if we have a match, link the pads */ if (gst_pad_get_direction(sinkpad) == GST_PAD_SINK && - !GST_PAD_IS_CONNECTED (pad) && !GST_PAD_IS_CONNECTED(sinkpad)) + !GST_PAD_IS_LINKED (pad) && !GST_PAD_IS_LINKED(sinkpad)) { - if ((connected = gst_pad_connect (pad, sinkpad))) { + if ((linked = gst_pad_link (pad, sinkpad))) { break; } else { @@ -203,34 +203,34 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink) if (state == GST_STATE_PLAYING) gst_element_set_state (GST_ELEMENT (gst_element_get_parent (src)), GST_STATE_PLAYING); - if (!connected) { + if (!linked) { GST_DEBUG (0,"gstpipeline: no path to sinks for type"); } - return connected; + return linked; } static void gst_autoplug_pads_autoplug (GstElement *src, GstElement *sink) { const GList *srcpads; - gboolean connected = FALSE; + gboolean linked = FALSE; srcpads = gst_element_get_pad_list(src); - while (srcpads && !connected) { + while (srcpads && !linked) { GstPad *srcpad = (GstPad *)srcpads->data; if (gst_pad_get_direction(srcpad) == GST_PAD_SRC) { - connected = gst_autoplug_pads_autoplug_func (src, srcpad, sink); - if (connected) + linked = gst_autoplug_pads_autoplug_func (src, srcpad, sink); + if (linked) break; } srcpads = g_list_next(srcpads); } - if (!connected) { - GST_DEBUG (0,"gstpipeline: delaying pad connections for \"%s\" to \"%s\"", + if (!linked) { + GST_DEBUG (0,"gstpipeline: delaying pad links for \"%s\" to \"%s\"", GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink)); g_signal_connect (G_OBJECT(src),"new_pad", G_CALLBACK (gst_autoplug_pads_autoplug_func), sink); diff --git a/gst/autoplug/spidertest.c b/gst/autoplug/spidertest.c index b52f6d0f41..c5c14df5a4 100644 --- a/gst/autoplug/spidertest.c +++ b/gst/autoplug/spidertest.c @@ -118,12 +118,12 @@ int main(int argc,char *argv[]) gst_bin_add(GST_BIN(bin), osssink); gst_bin_add(GST_BIN(bin), videosink); - /* connect objects */ - if (!(gst_element_connect(filesrc, decoder) && - gst_element_connect(decoder, osssink) && - gst_element_connect(decoder, videosink))) + /* link objects */ + if (!(gst_element_link(filesrc, decoder) && + gst_element_link(decoder, osssink) && + gst_element_link(decoder, videosink))) { - g_print ("the pipeline could not be connected\n"); + g_print ("the pipeline could not be linked\n"); exit (-4); } diff --git a/gst/elements/gstidentity.c b/gst/elements/gstidentity.c index 644ada8153..b11f383ac4 100644 --- a/gst/elements/gstidentity.c +++ b/gst/elements/gstidentity.c @@ -166,7 +166,7 @@ gst_identity_link (GstPad *pad, GstCaps *caps) if (GST_CAPS_IS_FIXED (caps)) return gst_pad_try_set_caps (otherpad, caps); else - return GST_PAD_CONNECT_DELAYED; + return GST_PAD_LINK_DELAYED; } static void diff --git a/gst/elements/gsttee.c b/gst/elements/gsttee.c index 3e7ebc7c3c..49fb205899 100644 --- a/gst/elements/gsttee.c +++ b/gst/elements/gsttee.c @@ -129,7 +129,7 @@ gst_tee_sinklink (GstPad *pad, GstCaps *caps) tee = GST_TEE (gst_pad_get_parent (pad)); if (!GST_CAPS_IS_FIXED (caps)) { - return GST_PAD_CONNECT_DELAYED; + return GST_PAD_LINK_DELAYED; } /* go through all the src pads */ @@ -146,7 +146,7 @@ gst_tee_sinklink (GstPad *pad, GstCaps *caps) return set_retval; } } - return GST_PAD_CONNECT_OK; + return GST_PAD_LINK_OK; } static void diff --git a/gst/gstcompat.h b/gst/gstcompat.h index 8532a595bf..3fb3851773 100644 --- a/gst/gstcompat.h +++ b/gst/gstcompat.h @@ -50,8 +50,23 @@ #define gst_pad_set_connect_function(a,b) \ gst_pad_set_link_function(a,b) +/* pad macros */ +#define GST_PAD_IS_CONNECTED(a) GST_PAD_IS_LINKED(a) + +/* pad enums */ +#define GST_PAD_CONNECT_REFUSED GST_PAD_LINK_REFUSED +#define GST_PAD_CONNECT_DELAYED GST_PAD_LINK_DELAYED +#define GST_PAD_CONNECT_OK GST_PAD_LINK_OK +#define GST_PAD_CONNECT_DONE GST_PAD_LINK_DONE +typedef GstPadConnectReturn GstPadLinkReturn; + +/* pad function types */ typedef GstPadConnectFunction GstPadLinkFunction; +/* probably not used */ +/* + * GST_RPAD_LINKFUNC + */ #endif /* not GST_DISABLE_DEPRECATED */ #endif /* __GSTCOMPAT_H__ */ diff --git a/gst/gstelement.c b/gst/gstelement.c index 6683b3f2ef..4e0041f338 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1768,7 +1768,7 @@ gst_element_get_random_pad (GstElement *element, GstPadDirection dir) GST_DEBUG_PAD_NAME (pad)); if (GST_PAD_DIRECTION (pad) == dir) { - if (GST_PAD_IS_CONNECTED (pad)) { + if (GST_PAD_IS_LINKED (pad)) { return pad; } else { @@ -2179,7 +2179,7 @@ gst_element_negotiate_pads (GstElement *element) /* if we have a link on this pad and it doesn't have caps * allready, try to negotiate */ - if (GST_PAD_IS_CONNECTED (srcpad) && !GST_PAD_CAPS (srcpad)) { + if (GST_PAD_IS_LINKED (srcpad) && !GST_PAD_CAPS (srcpad)) { GstRealPad *sinkpad; GstElementState otherstate; GstElement *parent; diff --git a/gst/gstpad.c b/gst/gstpad.c index fb114500a8..d16cff3e55 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -93,8 +93,8 @@ gst_pad_init (GstPad *pad) /* Pad signals and args */ enum { REAL_CAPS_NEGO_FAILED, - REAL_CONNECTED, - REAL_DISCONNECTED, + REAL_LINKED, + REAL_DISLINKED, /* FILL ME */ REAL_LAST_SIGNAL }; @@ -159,12 +159,12 @@ gst_real_pad_class_init (GstRealPadClass *klass) G_STRUCT_OFFSET (GstRealPadClass, caps_nego_failed), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); - gst_real_pad_signals[REAL_CONNECTED] = + gst_real_pad_signals[REAL_LINKED] = g_signal_new ("linked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, linked), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); - gst_real_pad_signals[REAL_DISCONNECTED] = + gst_real_pad_signals[REAL_DISLINKED] = g_signal_new ("unlinked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, unlinked), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, @@ -746,7 +746,7 @@ gst_pad_set_link_function (GstPad *pad, g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_REAL_PAD (pad)); - GST_RPAD_CONNECTFUNC (pad) = link; + GST_RPAD_LINKFUNC (pad) = link; GST_DEBUG (GST_CAT_PADS, "linkfunc for %s:%s set to %s", GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (link)); } @@ -859,9 +859,9 @@ gst_pad_unlink (GstPad *srcpad, /* fire off a signal to each of the pads telling them * that they've been unlinked */ - g_signal_emit (G_OBJECT (realsrc), gst_real_pad_signals[REAL_DISCONNECTED], + g_signal_emit (G_OBJECT (realsrc), gst_real_pad_signals[REAL_DISLINKED], 0, realsink); - g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_DISCONNECTED], + g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_DISLINKED], 0, realsrc); GST_INFO (GST_CAT_ELEMENT_PADS, "unlinked %s:%s and %s:%s", @@ -1052,9 +1052,9 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) /* fire off a signal to each of the pads telling them * that they've been linked */ - g_signal_emit (G_OBJECT (realsrc), gst_real_pad_signals[REAL_CONNECTED], + g_signal_emit (G_OBJECT (realsrc), gst_real_pad_signals[REAL_LINKED], 0, realsink); - g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_CONNECTED], + g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_LINKED], 0, realsrc); src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc)); @@ -1275,8 +1275,8 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) GstPadTemplate *template; GstElement *parent = GST_PAD_PARENT (pad); - g_return_val_if_fail (pad != NULL, GST_PAD_CONNECT_REFUSED); - g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_CONNECT_REFUSED); + g_return_val_if_fail (pad != NULL, GST_PAD_LINK_REFUSED); + g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_LINK_REFUSED); /* if this pad has a parent and the parent is not READY, delay the * negotiation */ @@ -1284,7 +1284,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) { GST_DEBUG (GST_CAT_CAPS, "parent %s of pad %s:%s is not READY", GST_ELEMENT_NAME (parent), GST_DEBUG_PAD_NAME (pad)); - return GST_PAD_CONNECT_DELAYED; + return GST_PAD_LINK_DELAYED; } GST_INFO (GST_CAT_CAPS, "trying to set caps %p on pad %s:%s", @@ -1312,7 +1312,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) gst_caps_debug (caps, "caps themselves (attemped to set)"); gst_caps_debug (allowed, "allowed caps that did not agree with caps"); - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; } /* caps checks out fine, we can unref the intersection now */ gst_caps_unref (intersection); @@ -1321,7 +1321,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) } /* we need to notify the link function */ - if (notify && GST_RPAD_CONNECTFUNC (pad)) { + if (notify && GST_RPAD_LINKFUNC (pad)) { GstPadConnectReturn res; gchar *debug_string; gboolean negotiating; @@ -1336,29 +1336,29 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) GST_FLAG_SET (pad, GST_PAD_NEGOTIATING); /* call the link function */ - res = GST_RPAD_CONNECTFUNC (pad) (GST_PAD (pad), caps); + res = GST_RPAD_LINKFUNC (pad) (GST_PAD (pad), caps); /* unset again after negotiating only if we set it */ if (!negotiating) GST_FLAG_UNSET (pad, GST_PAD_NEGOTIATING); switch (res) { - case GST_PAD_CONNECT_REFUSED: + case GST_PAD_LINK_REFUSED: debug_string = "REFUSED"; break; - case GST_PAD_CONNECT_OK: + case GST_PAD_LINK_OK: debug_string = "OK"; break; - case GST_PAD_CONNECT_DONE: + case GST_PAD_LINK_DONE: debug_string = "DONE"; break; - case GST_PAD_CONNECT_DELAYED: + case GST_PAD_LINK_DELAYED: debug_string = "DELAYED"; break; default: g_warning ("unknown return code from link function of pad %s:%s %d", GST_DEBUG_PAD_NAME (pad), res); - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; } GST_INFO (GST_CAT_CAPS, @@ -1367,14 +1367,14 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) /* done means the link function called another caps negotiate function * on this pad that succeeded, we dont need to continue */ - if (res == GST_PAD_CONNECT_DONE) { + if (res == GST_PAD_LINK_DONE) { GST_INFO (GST_CAT_CAPS, "pad %s:%s is done", GST_DEBUG_PAD_NAME (pad)); - return GST_PAD_CONNECT_DONE; + return GST_PAD_LINK_DONE; } - if (res == GST_PAD_CONNECT_REFUSED) { + if (res == GST_PAD_LINK_REFUSED) { GST_INFO (GST_CAT_CAPS, "pad %s:%s doesn't accept caps", GST_DEBUG_PAD_NAME (pad)); - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; } } /* we can only set caps on the pad if they are fixed */ @@ -1395,7 +1395,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) "caps are not fixed on pad %s:%s, not setting them yet", GST_DEBUG_PAD_NAME (pad)); } - return GST_PAD_CONNECT_OK; + return GST_PAD_LINK_OK; } /** @@ -1430,7 +1430,7 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps) g_warning ("trying to set non fixed caps on pad %s:%s, not allowed", GST_DEBUG_PAD_NAME (realpad)); gst_caps_debug (caps, "unfixed caps"); - return GST_PAD_CONNECT_DELAYED; + return GST_PAD_LINK_DELAYED; } /* if we have a peer try to set the caps, notifying the peerpad @@ -1605,15 +1605,15 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad) GstPadConnectReturn res; res = gst_pad_try_set_caps_func (realsrc, intersection, TRUE); - if (res == GST_PAD_CONNECT_REFUSED) + if (res == GST_PAD_LINK_REFUSED) return FALSE; - if (res == GST_PAD_CONNECT_DONE) + if (res == GST_PAD_LINK_DONE) return TRUE; res = gst_pad_try_set_caps_func (realsink, intersection, TRUE); - if (res == GST_PAD_CONNECT_REFUSED) + if (res == GST_PAD_LINK_REFUSED) return FALSE; - if (res == GST_PAD_CONNECT_DONE) + if (res == GST_PAD_LINK_DONE) return TRUE; } return TRUE; @@ -1706,11 +1706,11 @@ gst_pad_proxy_link (GstPad *pad, GstCaps *caps) GST_DEBUG_PAD_NAME (realpad)); if (peer && gst_pad_try_set_caps_func (peer, caps, TRUE) < 0) - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; if (gst_pad_try_set_caps_func (realpad, caps, FALSE) < 0) - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; - return GST_PAD_CONNECT_OK; + return GST_PAD_LINK_OK; } /** @@ -2651,7 +2651,7 @@ gst_pad_event_default_dispatch (GstPad *pad, GstElement *element, /* for all pads in the opposite direction that are linked */ if (GST_PAD_DIRECTION (eventpad) != GST_PAD_DIRECTION (pad) - && GST_PAD_IS_CONNECTED (eventpad)) { + && GST_PAD_IS_LINKED (eventpad)) { if (GST_PAD_DIRECTION (eventpad) == GST_PAD_SRC) { /* increase the refcount */ gst_event_ref (event); diff --git a/gst/gstpad.h b/gst/gstpad.h index 05b929d5d9..5a058a8f5b 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -112,10 +112,10 @@ typedef struct _GstGhostPadClass GstGhostPadClass; typedef enum { - GST_PAD_CONNECT_REFUSED = -1, - GST_PAD_CONNECT_DELAYED = 0, - GST_PAD_CONNECT_OK = 1, - GST_PAD_CONNECT_DONE = 2 + GST_PAD_LINK_REFUSED = -1, + GST_PAD_LINK_DELAYED = 0, + GST_PAD_LINK_OK = 1, + GST_PAD_LINK_DONE = 2 } GstPadConnectReturn; /* convenience functions */ @@ -262,7 +262,7 @@ struct _GstGhostPadClass { #define GST_RPAD_QUERYTYPEFUNC(pad) (((GstRealPad *)(pad))->querytypefunc) #define GST_RPAD_EVENTMASKFUNC(pad) (((GstRealPad *)(pad))->eventmaskfunc) -#define GST_RPAD_CONNECTFUNC(pad) (((GstRealPad *)(pad))->linkfunc) +#define GST_RPAD_LINKFUNC(pad) (((GstRealPad *)(pad))->linkfunc) #define GST_RPAD_GETCAPSFUNC(pad) (((GstRealPad *)(pad))->getcapsfunc) #define GST_RPAD_BUFFERPOOLFUNC(pad) (((GstRealPad *)(pad))->bufferpoolfunc) @@ -276,9 +276,9 @@ struct _GstGhostPadClass { #define GST_PAD_PEER(pad) GST_PAD_CAST(GST_RPAD_PEER(GST_PAD_REALIZE(pad))) /* Some check functions (unused?) */ -#define GST_PAD_IS_CONNECTED(pad) (GST_PAD_PEER(pad) != NULL) +#define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL) #define GST_PAD_IS_ACTIVE(pad) (!GST_FLAG_IS_SET(GST_PAD_REALIZE(pad), GST_PAD_DISABLED)) -#define GST_PAD_IS_USABLE(pad) (GST_PAD_IS_CONNECTED (pad) && \ +#define GST_PAD_IS_USABLE(pad) (GST_PAD_IS_LINKED (pad) && \ GST_PAD_IS_ACTIVE(pad) && GST_PAD_IS_ACTIVE(GST_PAD_PEER (pad))) #define GST_PAD_CAN_PULL(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->gethandler != NULL) #define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC) diff --git a/gst/gstparse.c b/gst/gstparse.c index e099ef4c80..2b9138bdb7 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -73,7 +73,7 @@ dynamic_link (GstElement * element, GstPad * newpad, gpointer data) /* try to find a target pad if we don't know it yet */ if (!dc->target_pad) { - if (!GST_PAD_IS_CONNECTED (newpad)) { + if (!GST_PAD_IS_LINKED (newpad)) { dc->target_pad = gst_element_get_compatible_pad (dc->target_element, newpad); warn = FALSE; } @@ -81,7 +81,7 @@ dynamic_link (GstElement * element, GstPad * newpad, gpointer data) return; } } - if (!GST_PAD_IS_CONNECTED (dc->target_pad) && !GST_PAD_IS_CONNECTED (newpad)) { + if (!GST_PAD_IS_LINKED (dc->target_pad) && !GST_PAD_IS_LINKED (newpad)) { gst_element_set_state (dc->pipeline, GST_STATE_PAUSED); if (!gst_pad_link (newpad, dc->target_pad) && warn) { g_warning ("could not link %s:%s to %s:%s", GST_DEBUG_PAD_NAME (newpad), @@ -378,42 +378,42 @@ next: could_not_get_pad_a: g_set_error (error, GST_PARSE_ERROR, - GST_PARSE_ERROR_CONNECT, + GST_PARSE_ERROR_LINK, "Could not get a pad %s from element %s", (gchar*)a->data, GST_OBJECT_NAME (src)); return FALSE; could_not_get_pad_b: g_set_error (error, GST_PARSE_ERROR, - GST_PARSE_ERROR_CONNECT, + GST_PARSE_ERROR_LINK, "Could not get a pad %s from element %s", (gchar*)b->data, GST_OBJECT_NAME (sink)); return FALSE; could_not_get_compatible_to_a: g_set_error (error, GST_PARSE_ERROR, - GST_PARSE_ERROR_CONNECT, + GST_PARSE_ERROR_LINK, "Could not find a compatible pad in element %s to for %s:%s", GST_OBJECT_NAME (sink), GST_OBJECT_NAME (src), (gchar*)a->data); return FALSE; could_not_get_compatible_to_b: g_set_error (error, GST_PARSE_ERROR, - GST_PARSE_ERROR_CONNECT, + GST_PARSE_ERROR_LINK, "Could not find a compatible pad in element %s to for %s:%s", GST_OBJECT_NAME (src), GST_OBJECT_NAME (sink), (gchar*)b->data); return FALSE; both_templates_have_sometimes_presence: g_set_error (error, GST_PARSE_ERROR, - GST_PARSE_ERROR_CONNECT, + GST_PARSE_ERROR_LINK, "Both %s:%s and %s:%s have GST_PAD_SOMETIMES presence, operation not supported", GST_OBJECT_NAME (src), pt1->name_template, GST_OBJECT_NAME (sink), pt2->name_template); return FALSE; could_not_link_pads: g_set_error (error, GST_PARSE_ERROR, - GST_PARSE_ERROR_CONNECT, + GST_PARSE_ERROR_LINK, "Could not link %s:%s to %s:%s", GST_DEBUG_PAD_NAME (p1), GST_DEBUG_PAD_NAME (p2)); @@ -421,7 +421,7 @@ could_not_link_pads: could_not_link_elements: g_set_error (error, GST_PARSE_ERROR, - GST_PARSE_ERROR_CONNECT, + GST_PARSE_ERROR_LINK, "Could not link element %s to %s", GST_OBJECT_NAME (src), GST_OBJECT_NAME (sink)); diff --git a/gst/gstparse.h b/gst/gstparse.h index 61a4e74ae9..a56f75c164 100644 --- a/gst/gstparse.h +++ b/gst/gstparse.h @@ -37,7 +37,7 @@ typedef enum GST_PARSE_ERROR_SYNTAX, GST_PARSE_ERROR_NO_SUCH_ELEMENT, GST_PARSE_ERROR_NO_SUCH_PROPERTY, - GST_PARSE_ERROR_CONNECT + GST_PARSE_ERROR_LINK } GstParseError; diff --git a/gst/gstqueue.c b/gst/gstqueue.c index 0f19f08dd8..73fe3796d7 100644 --- a/gst/gstqueue.c +++ b/gst/gstqueue.c @@ -644,7 +644,7 @@ gst_queue_change_state (GstElement *element) gst_queue_locked_flush (queue); } else if (new_state == GST_STATE_PLAYING) { - if (!GST_PAD_IS_CONNECTED (queue->sinkpad)) { + if (!GST_PAD_IS_LINKED (queue->sinkpad)) { GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not linked", GST_ELEMENT_NAME (queue)); /* FIXME can this be? */ if (queue->reader) diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index 644ada8153..b11f383ac4 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -166,7 +166,7 @@ gst_identity_link (GstPad *pad, GstCaps *caps) if (GST_CAPS_IS_FIXED (caps)) return gst_pad_try_set_caps (otherpad, caps); else - return GST_PAD_CONNECT_DELAYED; + return GST_PAD_LINK_DELAYED; } static void diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 0f19f08dd8..73fe3796d7 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -644,7 +644,7 @@ gst_queue_change_state (GstElement *element) gst_queue_locked_flush (queue); } else if (new_state == GST_STATE_PLAYING) { - if (!GST_PAD_IS_CONNECTED (queue->sinkpad)) { + if (!GST_PAD_IS_LINKED (queue->sinkpad)) { GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not linked", GST_ELEMENT_NAME (queue)); /* FIXME can this be? */ if (queue->reader) diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 3e7ebc7c3c..49fb205899 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -129,7 +129,7 @@ gst_tee_sinklink (GstPad *pad, GstCaps *caps) tee = GST_TEE (gst_pad_get_parent (pad)); if (!GST_CAPS_IS_FIXED (caps)) { - return GST_PAD_CONNECT_DELAYED; + return GST_PAD_LINK_DELAYED; } /* go through all the src pads */ @@ -146,7 +146,7 @@ gst_tee_sinklink (GstPad *pad, GstCaps *caps) return set_retval; } } - return GST_PAD_CONNECT_OK; + return GST_PAD_LINK_OK; } static void diff --git a/tests/lat.c b/tests/lat.c index 1931ff797b..bccfddfdb9 100644 --- a/tests/lat.c +++ b/tests/lat.c @@ -46,7 +46,7 @@ GstElement *identity_add(GstPipeline *pipeline, GstElement *first, int count) { g_return_val_if_fail(ident != NULL,NULL); g_object_set(G_OBJECT(ident),"silent",TRUE,NULL); gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(ident)); - gst_pad_connect(gst_element_get_pad(last,"src"), + gst_pad_link(gst_element_get_pad(last,"src"), gst_element_get_pad(ident,"sink")); last = ident; } @@ -101,7 +101,7 @@ GstPipeline *simple(int argc, int argi, char *argv[]) { last = identity_add(pipeline, src, idents); sink = fakesink(); gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(sink)); - gst_pad_connect(gst_element_get_pad(last,"src"), + gst_pad_link(gst_element_get_pad(last,"src"), gst_element_get_pad(sink,"sink")); return pipeline; @@ -135,7 +135,7 @@ GstPipeline *queue(int argc, int argi, char *argv[]) { src_q = gst_element_factory_make("queue","src_q"); g_return_val_if_fail(src_q != NULL,NULL); gst_bin_add(GST_BIN(src_thr),GST_ELEMENT(src_q)); - gst_pad_connect(gst_element_get_pad(src,"src"), + gst_pad_link(gst_element_get_pad(src,"src"), gst_element_get_pad(src_q,"sink")); gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src_thr)); @@ -145,7 +145,7 @@ GstPipeline *queue(int argc, int argi, char *argv[]) { sink_q = gst_element_factory_make("queue","sink_q"); g_return_val_if_fail(sink_q != NULL,NULL); gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(sink_q)); - gst_pad_connect(gst_element_get_pad(last,"src"), + gst_pad_link(gst_element_get_pad(last,"src"), gst_element_get_pad(sink_q,"sink")); sink_thr = GST_ELEMENT(gst_thread_new("sink_thread")); @@ -157,7 +157,7 @@ GstPipeline *queue(int argc, int argi, char *argv[]) { gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(sink_thr)); - gst_pad_connect(gst_element_get_pad(sink_q,"src"), + gst_pad_link(gst_element_get_pad(sink_q,"src"), gst_element_get_pad(sink,"sink")); return pipeline; diff --git a/tests/old/examples/cutter/cutter.c b/tests/old/examples/cutter/cutter.c index b19d90a5f5..c79350ca22 100644 --- a/tests/old/examples/cutter/cutter.c +++ b/tests/old/examples/cutter/cutter.c @@ -35,8 +35,8 @@ char buffer[255]; void cut_start (GstElement *element) { g_print ("\nDEBUG: main: cut start\n"); - /* we should pause the pipeline, disconnect cutter and disksink - * create a new disksink to a real file, reconnect, and set to play + /* we should pause the pipeline, unlink cutter and disksink + * create a new disksink to a real file, relink, and set to play */ g_print ("DEBUG: cut_start: main_bin pausing\n"); gst_element_set_state (main_bin, GST_STATE_PAUSED); @@ -71,8 +71,8 @@ void cut_start_signal (GstElement *element) void cut_stop (GstElement *element) { g_print ("\nDEBUG: main: cut stop\n"); - /* we should pause the pipeline, disconnect disksink, create a fake disksink, - * connect to pipeline, and set to play + /* we should pause the pipeline, unlink disksink, create a fake disksink, + * link to pipeline, and set to play */ g_print ("DEBUG: cut_stop: main_bin paused\n"); gst_element_set_state (main_bin, GST_STATE_PAUSED); @@ -154,22 +154,9 @@ int main (int argc, char *argv[]) gst_bin_add (GST_BIN (main_bin), audiosrc); gst_bin_add (GST_BIN (thread), queue); - gst_bin_add (GST_BIN (thread), cutter); - gst_bin_add (GST_BIN (thread), encoder); - gst_bin_add (GST_BIN (thread), disksink); - - /* connect adder and disksink */ - - gst_pad_connect (gst_element_get_pad (audiosrc, "src"), - gst_element_get_pad (queue, "sink")); - - gst_pad_connect (gst_element_get_pad (queue, "src"), - gst_element_get_pad (cutter, "sink")); - gst_pad_connect (gst_element_get_pad (cutter, "src"), - gst_element_get_pad (encoder, "sink")); - gst_pad_connect (gst_element_get_pad (encoder, "src"), - gst_element_get_pad (disksink, "sink")); + gst_bin_add_many (GST_BIN (thread), cutter, encoder, disksink, NULL); + gst_element_link_many (audiosrc, queue, cutter, encoder, disksink, NULL); gst_bin_add (GST_BIN (main_bin), thread); /* set signal handlers */ @@ -186,7 +173,7 @@ int main (int argc, char *argv[]) g_print ("setting thread to play\n"); gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING); */ - while (playing) + while (playing) { /* g_print ("> "); */ gst_bin_iterate (GST_BIN (main_bin)); diff --git a/tests/old/examples/queue/queue.c b/tests/old/examples/queue/queue.c index e68b278c56..5f3a9c0462 100644 --- a/tests/old/examples/queue/queue.c +++ b/tests/old/examples/queue/queue.c @@ -37,23 +37,12 @@ int main(int argc,char *argv[]) g_assert(osssink != NULL); /* add objects to the main pipeline */ - gst_bin_add(GST_BIN(bin), filesrc); - gst_bin_add(GST_BIN(bin), parse); - gst_bin_add(GST_BIN(bin), decode); - gst_bin_add(GST_BIN(bin), queue); + gst_bin_add_many (GST_BIN (bin), filesrc, parse, decode, queue, NULL); gst_bin_add(GST_BIN(thread), osssink); - gst_bin_add(GST_BIN(bin), thread); - - gst_pad_connect(gst_element_get_pad(filesrc,"src"), - gst_element_get_pad(parse,"sink")); - gst_pad_connect(gst_element_get_pad(parse,"src"), - gst_element_get_pad(decode,"sink")); - gst_pad_connect(gst_element_get_pad(decode,"src"), - gst_element_get_pad(queue,"sink")); - gst_pad_connect(gst_element_get_pad(queue,"src"), - gst_element_get_pad(osssink,"sink")); + + gst_element_link_many (filesrc, parse, decode, queue, osssink, NULL); /* start playing */ gst_element_set_state(GST_ELEMENT(bin), GST_STATE_PLAYING); diff --git a/tests/old/examples/queue3/queue3.c b/tests/old/examples/queue3/queue3.c index e2c1d38743..da92fcf7b3 100644 --- a/tests/old/examples/queue3/queue3.c +++ b/tests/old/examples/queue3/queue3.c @@ -4,14 +4,14 @@ gboolean playing; /* eos will be called when the src element has an end of stream */ -void eos(GstElement *element, gpointer data) +void eos(GstElement *element, gpointer data) { g_print("have eos, quitting\n"); playing = FALSE; } -int main(int argc,char *argv[]) +int main(int argc,char *argv[]) { GstElement *filesrc, *osssink, *queue, *parse, *decode; GstElement *bin; @@ -55,18 +55,8 @@ int main(int argc,char *argv[]) gst_bin_add(GST_BIN(thread), parse); gst_bin_add(GST_BIN(thread), decode); gst_bin_add(GST_BIN(thread), osssink); - - gst_pad_connect(gst_element_get_pad(filesrc,"src"), - gst_element_get_pad(queue,"sink")); - gst_pad_connect(gst_element_get_pad(queue,"src"), - gst_element_get_pad(parse,"sink")); - gst_pad_connect(gst_element_get_pad(parse,"src"), - gst_element_get_pad(decode,"sink")); - gst_pad_connect(gst_element_get_pad(decode,"src"), - gst_element_get_pad(osssink,"sink")); - - gst_bin_add(GST_BIN(bin), thread); + gst_element_link_many (filesrc, queue, parse, decode, osssink, NULL); /* make it ready */ gst_element_set_state(GST_ELEMENT(bin), GST_STATE_READY); diff --git a/tests/old/examples/queue4/queue4.c b/tests/old/examples/queue4/queue4.c index e2c4025f5b..193b12fa30 100644 --- a/tests/old/examples/queue4/queue4.c +++ b/tests/old/examples/queue4/queue4.c @@ -60,19 +60,8 @@ int main(int argc,char *argv[]) gst_bin_add(GST_BIN(thread), queue2); gst_bin_add(GST_BIN(thread2), osssink); - - gst_pad_connect(gst_element_get_pad(filesrc,"src"), - gst_element_get_pad(queue,"sink")); - gst_pad_connect(gst_element_get_pad(queue,"src"), - gst_element_get_pad(parse,"sink")); - gst_pad_connect(gst_element_get_pad(parse,"src"), - gst_element_get_pad(decode,"sink")); - gst_pad_connect(gst_element_get_pad(decode,"src"), - gst_element_get_pad(queue2,"sink")); - - gst_pad_connect(gst_element_get_pad(queue2,"src"), - gst_element_get_pad(osssink,"sink")); + gst_element_link_many (filesrc, queue, parse, decode, queue2, osssink, NULL); gst_bin_add(GST_BIN(bin), thread); gst_bin_add(GST_BIN(bin), thread2); diff --git a/tests/old/examples/typefind/typefind.c b/tests/old/examples/typefind/typefind.c index 0a66e26e61..1f5352411a 100644 --- a/tests/old/examples/typefind/typefind.c +++ b/tests/old/examples/typefind/typefind.c @@ -46,8 +46,7 @@ main(int argc, char *argv[]) g_signal_connect (G_OBJECT (typefind), "have_type", G_CALLBACK (type_found), NULL); - gst_pad_connect(gst_element_get_pad(filesrc,"src"), - gst_element_get_pad(typefind,"sink")); + gst_element_link (filesrc, typefind); /* start playing */ gst_element_set_state(GST_ELEMENT(bin), GST_STATE_PLAYING); diff --git a/tests/old/examples/xml/createxml.c b/tests/old/examples/xml/createxml.c index 137f494c14..568851368e 100644 --- a/tests/old/examples/xml/createxml.c +++ b/tests/old/examples/xml/createxml.c @@ -71,17 +71,8 @@ int main(int argc,char *argv[]) gst_bin_add (GST_BIN (thread), queue2); gst_bin_add (GST_BIN (thread2), osssink); - - gst_pad_connect (gst_element_get_pad (filesrc,"src"), - gst_element_get_pad (queue,"sink")); - gst_pad_connect (gst_element_get_pad (queue,"src"), - gst_element_get_pad (decode,"sink")); - gst_pad_connect (gst_element_get_pad (decode,"src"), - gst_element_get_pad (queue2,"sink")); - - gst_pad_connect (gst_element_get_pad (queue2,"src"), - gst_element_get_pad (osssink,"sink")); + gst_element_link_many (filesrc, queue, decode, queue2, osssink, NULL); gst_bin_add (GST_BIN (pipeline), thread); gst_bin_add (GST_BIN (pipeline), thread2); diff --git a/tests/old/testsuite/threads/threadc.c b/tests/old/testsuite/threads/threadc.c index c09f14942b..bcbb2705b2 100644 --- a/tests/old/testsuite/threads/threadc.c +++ b/tests/old/testsuite/threads/threadc.c @@ -28,10 +28,10 @@ construct_pipeline (GstElement *pipeline, gint identities) identity = gst_element_factory_make ("identity", NULL); g_assert (identity); gst_bin_add (GST_BIN (pipeline), identity); - gst_element_connect (from, identity); + gst_element_link (from, identity); from = identity; } - gst_element_connect (identity, sink); + gst_element_link (identity, sink); g_object_set (G_OBJECT (src), "num_buffers", 1, "sizetype", 3, NULL); } diff --git a/tests/old/testsuite/threads/threadd.c b/tests/old/testsuite/threads/threadd.c index c0902549f7..13147fa48f 100644 --- a/tests/old/testsuite/threads/threadd.c +++ b/tests/old/testsuite/threads/threadd.c @@ -29,10 +29,10 @@ construct_pipeline (GstElement *pipeline, gint identities) identity = gst_element_factory_make ("identity", NULL); g_assert (identity); gst_bin_add (GST_BIN (pipeline), identity); - gst_element_connect (from, identity); + gst_element_link (from, identity); from = identity; } - gst_element_connect (identity, sink); + gst_element_link (identity, sink); g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL); } diff --git a/tests/old/testsuite/threads/threade.c b/tests/old/testsuite/threads/threade.c index 1fc4af8a6d..79e6213213 100644 --- a/tests/old/testsuite/threads/threade.c +++ b/tests/old/testsuite/threads/threade.c @@ -29,10 +29,10 @@ construct_pipeline (GstElement *pipeline, gint identities) identity = gst_element_factory_make ("identity", NULL); g_assert (identity); gst_bin_add (GST_BIN (pipeline), identity); - gst_element_connect (from, identity); + gst_element_link (from, identity); from = identity; } - gst_element_connect (identity, sink); + gst_element_link (identity, sink); g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL); } diff --git a/tests/old/testsuite/threads/threadf.c b/tests/old/testsuite/threads/threadf.c index e182c82f4e..330be4e831 100644 --- a/tests/old/testsuite/threads/threadf.c +++ b/tests/old/testsuite/threads/threadf.c @@ -34,11 +34,11 @@ construct_pipeline (GstElement *pipeline, gint identities) identity = gst_element_factory_make ("identity", NULL); g_assert (identity); gst_bin_add (GST_BIN (pipeline), identity); - if (!(gst_element_connect (from, identity))) - g_print ("Warning: can't connect identity with previous element\n"); + if (!(gst_element_link (from, identity))) + g_print ("Warning: can't link identity with previous element\n"); from = identity; } - gst_element_connect (identity, sink); + gst_element_link (identity, sink); g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL); } diff --git a/tests/threadstate/threadstate1.c b/tests/threadstate/threadstate1.c index 5ab841f96c..1c3136c2e6 100644 --- a/tests/threadstate/threadstate1.c +++ b/tests/threadstate/threadstate1.c @@ -5,7 +5,7 @@ */ -int main(int argc,char *argv[]) +int main(int argc,char *argv[]) { GstElement *fakesrc, *fakesink; GstElement *thread; @@ -23,7 +23,7 @@ int main(int argc,char *argv[]) g_assert(fakesink != NULL); gst_bin_add_many (GST_BIN(thread), fakesrc, fakesink, NULL); - gst_element_connect (fakesrc, fakesink); + gst_element_link (fakesrc, fakesink); for (x = 0 ; x < 10 ; x++){ g_print("playing %d\n", x); diff --git a/tests/threadstate/threadstate3.c b/tests/threadstate/threadstate3.c index 5ba6adca39..475b3d28a2 100644 --- a/tests/threadstate/threadstate3.c +++ b/tests/threadstate/threadstate3.c @@ -4,7 +4,7 @@ * { { fakesrc ! fakesink } } */ -int main(int argc,char *argv[]) +int main(int argc,char *argv[]) { GstElement *fakesrc, *fakesink; GstElement *thread, *thread2; @@ -27,7 +27,7 @@ int main(int argc,char *argv[]) g_assert(fakesink != NULL); gst_bin_add_many (GST_BIN(thread2), fakesrc, fakesink, NULL); - gst_element_connect (fakesrc, fakesink); + gst_element_link (fakesrc, fakesink); for (x = 0 ; x < 10 ; x++){ g_print("playing %d\n", x); diff --git a/testsuite/threads/threadc.c b/testsuite/threads/threadc.c index c09f14942b..bcbb2705b2 100644 --- a/testsuite/threads/threadc.c +++ b/testsuite/threads/threadc.c @@ -28,10 +28,10 @@ construct_pipeline (GstElement *pipeline, gint identities) identity = gst_element_factory_make ("identity", NULL); g_assert (identity); gst_bin_add (GST_BIN (pipeline), identity); - gst_element_connect (from, identity); + gst_element_link (from, identity); from = identity; } - gst_element_connect (identity, sink); + gst_element_link (identity, sink); g_object_set (G_OBJECT (src), "num_buffers", 1, "sizetype", 3, NULL); } diff --git a/testsuite/threads/threadd.c b/testsuite/threads/threadd.c index c0902549f7..13147fa48f 100644 --- a/testsuite/threads/threadd.c +++ b/testsuite/threads/threadd.c @@ -29,10 +29,10 @@ construct_pipeline (GstElement *pipeline, gint identities) identity = gst_element_factory_make ("identity", NULL); g_assert (identity); gst_bin_add (GST_BIN (pipeline), identity); - gst_element_connect (from, identity); + gst_element_link (from, identity); from = identity; } - gst_element_connect (identity, sink); + gst_element_link (identity, sink); g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL); } diff --git a/testsuite/threads/threade.c b/testsuite/threads/threade.c index 1fc4af8a6d..79e6213213 100644 --- a/testsuite/threads/threade.c +++ b/testsuite/threads/threade.c @@ -29,10 +29,10 @@ construct_pipeline (GstElement *pipeline, gint identities) identity = gst_element_factory_make ("identity", NULL); g_assert (identity); gst_bin_add (GST_BIN (pipeline), identity); - gst_element_connect (from, identity); + gst_element_link (from, identity); from = identity; } - gst_element_connect (identity, sink); + gst_element_link (identity, sink); g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL); } diff --git a/testsuite/threads/threadf.c b/testsuite/threads/threadf.c index e182c82f4e..330be4e831 100644 --- a/testsuite/threads/threadf.c +++ b/testsuite/threads/threadf.c @@ -34,11 +34,11 @@ construct_pipeline (GstElement *pipeline, gint identities) identity = gst_element_factory_make ("identity", NULL); g_assert (identity); gst_bin_add (GST_BIN (pipeline), identity); - if (!(gst_element_connect (from, identity))) - g_print ("Warning: can't connect identity with previous element\n"); + if (!(gst_element_link (from, identity))) + g_print ("Warning: can't link identity with previous element\n"); from = identity; } - gst_element_connect (identity, sink); + gst_element_link (identity, sink); g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL); }