mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 18:20:44 +00:00
code cleanups and further deprecation fixes
Original commit message from CVS: code cleanups and further deprecation fixes
This commit is contained in:
parent
5529bbc7dc
commit
f1af3cca60
43 changed files with 245 additions and 337 deletions
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -56,17 +56,7 @@ int main(int argc,char *argv[])
|
|||
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);
|
||||
|
|
|
@ -61,18 +61,7 @@ int main(int argc,char *argv[])
|
|||
|
||||
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);
|
||||
|
|
|
@ -72,16 +72,7 @@ int main(int argc,char *argv[])
|
|||
|
||||
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))) {
|
||||
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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -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;
|
||||
|
|
68
gst/gstpad.c
68
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);
|
||||
|
|
14
gst/gstpad.h
14
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)
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
10
tests/lat.c
10
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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -56,17 +56,7 @@ int main(int argc,char *argv[])
|
|||
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);
|
||||
|
|
|
@ -61,18 +61,7 @@ int main(int argc,char *argv[])
|
|||
|
||||
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);
|
||||
|
|
|
@ -72,16 +72,7 @@ int main(int argc,char *argv[])
|
|||
|
||||
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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue