code cleanups and further deprecation fixes

Original commit message from CVS:
code cleanups and further deprecation fixes
parent 5529bbc7
......@@ -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
......
......@@ -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));
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
......@@ -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");
......
......@@ -2,7 +2,7 @@
* Copyright (C) 2002 Erik Walthinsen <omega@cse.ogi.edu>
* 2002 Wim Taymans <wtay@chello.be>
*
* 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 <in7y118@public.uni-hamburg.de>",
"(C) 2002",
......
......@@ -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*
......
......@@ -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))) {