diff --git a/ChangeLog b/ChangeLog index 156902c32d..edf16b17df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-01-09 Thomas Vander Stichele + + * first pass at changing _connect/_disconnect -> _link/_unlink + * gst/gstcompat.h: created + 2002-11-27 Thomas Vander Stichele * ChangeLog: added an entry diff --git a/docs/manual/advanced-threads.xml b/docs/manual/advanced-threads.xml index 4b8082afbc..500a106fe6 100644 --- a/docs/manual/advanced-threads.xml +++ b/docs/manual/advanced-threads.xml @@ -136,7 +136,7 @@ main (int argc, char *argv[]) /* add objects to the thread */ gst_bin_add_many (GST_BIN (thread), filesrc, decoder, audiosink, NULL); /* connect them in the logical order */ - gst_element_connect_many (filesrc, decoder, audiosink, NULL); + gst_element_link_many (filesrc, decoder, audiosink, NULL); /* start playing */ gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING); diff --git a/docs/manual/basics-bins.xml b/docs/manual/basics-bins.xml index 731d7cdc6e..9989f570d7 100644 --- a/docs/manual/basics-bins.xml +++ b/docs/manual/basics-bins.xml @@ -5,7 +5,7 @@ an GstElement itself, it can also be added to another bin. - Bins allow you to combine connected elements into one logical element. You do + Bins allow you to combine linked elements into one logical element. You do not deal with the individual elements anymore but with just one element, the bin. We will see that this is extremely powerful when you are going to construct complex pipelines since it allows you to break up the pipeline in smaller chunks. @@ -231,7 +231,7 @@ of the given element. - We can now, for example, connect the source pad of a filesrc element + We can now, for example, link the source pad of a filesrc element to the bin with: @@ -239,7 +239,7 @@ filesrc = gst_element_factory_create ("filesrc", "disk_reader"); - gst_element_connect_pads (filesrc, "src", bin, "sink"); + gst_element_link_pads (filesrc, "src", bin, "sink"); ... diff --git a/docs/manual/basics-helloworld.xml b/docs/manual/basics-helloworld.xml index 5cb9f2a43d..38c1fc3315 100644 --- a/docs/manual/basics-helloworld.xml +++ b/docs/manual/basics-helloworld.xml @@ -47,8 +47,8 @@ main (int argc, char *argv[]) /* add objects to the main pipeline */ gst_bin_add_many (GST_BIN (pipeline), filesrc, decoder, audiosink, NULL); - /* connect src to sink */ - gst_element_connect_many (filesrc, decoder, audiosink, NULL); + /* link src to sink */ + gst_element_link_many (filesrc, decoder, audiosink, NULL); /* start playing */ gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -166,11 +166,11 @@ main (int argc, char *argv[]) - We connect the different pads of the elements together like this: + We link the different pads of the elements together like this: - /* connect src to sink */ - gst_element_connect_many (filesrc, decoder, audiosink, NULL); + /* link src to sink */ + gst_element_link_many (filesrc, decoder, audiosink, NULL); diff --git a/docs/manual/basics-pads.xml b/docs/manual/basics-pads.xml index a53ac82dc4..43270bd177 100644 --- a/docs/manual/basics-pads.xml +++ b/docs/manual/basics-pads.xml @@ -2,7 +2,7 @@ GstPad As we have seen in the previous chapter (GstElement), the pads are the element's - connections with the outside world. + links with the outside world. The specific type of media that the element can handle will be exposed by the pads. @@ -81,7 +81,7 @@ static void -pad_connect_func (GstElement *parser, GstPad *pad, GstElement *pipeline) +pad_link_func (GstElement *parser, GstPad *pad, GstElement *pipeline) { g_print("***** a new pad %s was created\n", gst_pad_get_name(pad)); @@ -90,7 +90,7 @@ pad_connect_func (GstElement *parser, GstPad *pad, GstElement *pipeline) if (strncmp (gst_pad_get_name (pad), "private_stream_1.0", 18) == 0) { // set up an AC3 decoder pipeline ... - // connect pad to the AC3 decoder pipeline + // link pad to the AC3 decoder pipeline ... } gst_element_set_state (GST_ELEMENT (audio_thread), GST_STATE_READY); @@ -106,7 +106,7 @@ main(int argc, char *argv[]) ... mpeg2parser = gst_element_factory_make ("mpegdemux", "mpegdemux"); - g_signal_connect (G_OBJECT (mpeg2parser), "new_pad", pad_connect_func, pipeline); + g_signal_connect (G_OBJECT (mpeg2parser), "new_pad", pad_link_func, pipeline); ... // start the pipeline @@ -134,7 +134,7 @@ main(int argc, char *argv[]) The following piece of code can be used to get a pad from the tee element. After - the pad has been requested, it can be used to connect another element to it. + the pad has been requested, it can be used to link another element to it. ... @@ -152,7 +152,7 @@ main(int argc, char *argv[]) It is also possible to request a pad that is compatible with another - pad template. This is very useful if you want to connect an element + pad template. This is very useful if you want to link an element to a multiplexer element and you need to request a pad that is compatible. The gst_element_get_compatible_pad is used to request a compatible pad, as is shown in the next example. @@ -313,7 +313,7 @@ Pads: - Compatibility detection: when two pads are connected, GStreamer + Compatibility detection: when two pads are linked, GStreamer can verify if the two pads are talking about the same media types. diff --git a/docs/manual/bins.xml b/docs/manual/bins.xml index 731d7cdc6e..9989f570d7 100644 --- a/docs/manual/bins.xml +++ b/docs/manual/bins.xml @@ -5,7 +5,7 @@ an GstElement itself, it can also be added to another bin. - Bins allow you to combine connected elements into one logical element. You do + Bins allow you to combine linked elements into one logical element. You do not deal with the individual elements anymore but with just one element, the bin. We will see that this is extremely powerful when you are going to construct complex pipelines since it allows you to break up the pipeline in smaller chunks. @@ -231,7 +231,7 @@ of the given element. - We can now, for example, connect the source pad of a filesrc element + We can now, for example, link the source pad of a filesrc element to the bin with: @@ -239,7 +239,7 @@ filesrc = gst_element_factory_create ("filesrc", "disk_reader"); - gst_element_connect_pads (filesrc, "src", bin, "sink"); + gst_element_link_pads (filesrc, "src", bin, "sink"); ... diff --git a/docs/manual/connections.xml b/docs/manual/connections.xml index d579c932c0..33f83ce41f 100644 --- a/docs/manual/connections.xml +++ b/docs/manual/connections.xml @@ -1,20 +1,20 @@ - + Connecting elements - You can connect the different pads of elements together so that the elements + You can link the different pads of elements together so that the elements form a chain. -
- Visualisation of three connected elements + - By connecting these three elements, we have created a very simple + By linking these three elements, we have created a very simple chain. The effect of this will be that the output of the source element (element1) will be used as input for the filter element (element2). The filter element will do something with the data and send the result to @@ -28,9 +28,9 @@ - Making simple connections + Making simple links - You can connect two pads with: + You can link two pads with: GstPad *srcpad, *sinkpad; @@ -38,66 +38,66 @@ srcpad = gst_element_get_pad (element1, "src"); sinpad = gst_element_get_pad (element2, "sink"); - // connect them - gst_pad_connect (srcpad, sinkpad); + // link them + gst_pad_link (srcpad, sinkpad); .... - // and disconnect them - gst_pad_disconnect (srcpad, sinkpad); + // and unlink them + gst_pad_unlink (srcpad, sinkpad); - A convenient shortcut for the above code is done with the gst_element_connect_pads () + A convenient shortcut for the above code is done with the gst_element_link_pads () function: - // connect them - gst_element_connect_pads (element1, "src", element2, "sink"); + // link them + gst_element_link_pads (element1, "src", element2, "sink"); .... - // and disconnect them - gst_element_disconnect_pads (element1, "src", element2, "sink"); + // and unlink them + gst_element_unlink_pads (element1, "src", element2, "sink"); An even more convenient shortcut for single-source, single-sink elements is the - gst_element_connect () function: + gst_element_link () function: - // connect them - gst_element_connect (element1, element2); + // link them + gst_element_link (element1, element2); .... - // and disconnect them - gst_element_disconnect (element1, element2); + // and unlink them + gst_element_unlink (element1, element2); - If you have more than one element to connection, the gst_element_connect_many () function takes + If you have more than one element to link, the gst_element_link_many () function takes a NULL-terminated list of elements: - // connect them - gst_element_connect_many (element1, element2, element3, element4, NULL); + // link them + gst_element_link_many (element1, element2, element3, element4, NULL); .... - // and disconnect them - gst_element_disconnect_many (element1, element2, element3, element4, NULL); + // and unlink them + gst_element_unlink_many (element1, element2, element3, element4, NULL); - You can query if a pad is connected with GST_PAD_IS_CONNECTED (pad). + You can query if a pad is linked with GST_PAD_IS_CONNECTED (pad). - To query for the GstPad a pad is connected to, use + To query for the GstPad a pad is linked to, use gst_pad_get_peer (pad). - Making filtered connections + Making filtered links - You can also force a specific media type on the connection by using gst_pad_connect_filtered () - and gst_element_connect_filtered (). FIXME link to caps documentation. + You can also force a specific media type on the link by using gst_pad_link_filtered () + and gst_element_link_filtered (). FIXME link to caps documentation. diff --git a/docs/manual/dynamic.xml b/docs/manual/dynamic.xml index d7da62394f..86b8fc264c 100644 --- a/docs/manual/dynamic.xml +++ b/docs/manual/dynamic.xml @@ -49,7 +49,7 @@ new_pad_created (GstElement *parse, GstPad *pad, GstElement *pipeline) gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED); - /* connect to audio pad */ + /* link to audio pad */ if (strncmp (gst_pad_get_name (pad), "audio_", 6) == 0) { /* construct internal pipeline elements */ @@ -62,23 +62,23 @@ new_pad_created (GstElement *parse, GstPad *pad, GstElement *pipeline) audio_thread = gst_thread_new ("audio_thread"); g_return_if_fail (audio_thread != NULL); - /* construct queue and connect everything in the main pipeline */ + /* construct queue and link everything in the main pipeline */ audio_queue = gst_element_factory_make ("queue", "audio_queue"); g_return_if_fail (audio_queue != NULL); gst_bin_add_many (GST_BIN (audio_thread), audio_queue, decode_audio, play, NULL); - /* set up pad connections */ + /* set up pad links */ gst_element_add_ghost_pad (audio_thread, gst_element_get_pad (audio_queue, "sink"), "sink"); - gst_element_connect (audio_queue, decode_audio); - gst_element_connect (decode_audio, play); + gst_element_link (audio_queue, decode_audio); + gst_element_link (decode_audio, play); gst_bin_add (GST_BIN (pipeline), audio_thread); - gst_pad_connect (pad, gst_element_get_pad (audio_thread, "sink")); + gst_pad_link (pad, gst_element_get_pad (audio_thread, "sink")); /* set up thread state and kick things off */ g_print ("setting to READY state\n"); @@ -98,7 +98,7 @@ new_pad_created (GstElement *parse, GstPad *pad, GstElement *pipeline) show = gst_element_factory_make ("xvideosink", "show"); g_return_if_fail (show != NULL); - /* construct queue and connect everything in the main pipeline */ + /* construct queue and link everything in the main pipeline */ video_queue = gst_element_factory_make ("queue", "video_queue"); g_return_if_fail (video_queue != NULL); @@ -108,16 +108,16 @@ new_pad_created (GstElement *parse, GstPad *pad, GstElement *pipeline) gst_bin_add_many (GST_BIN (video_thread), video_queue, decode_video, color, show, NULL); - /* set up pad connections */ + /* set up pad links */ gst_element_add_ghost_pad (video_thread, gst_element_get_pad (video_queue, "sink"), "sink"); - gst_element_connect (video_queue, decode_video); - gst_element_connect_many (decode_video, color, show, NULL); + gst_element_link (video_queue, decode_video); + gst_element_link_many (decode_video, color, show, NULL); gst_bin_add (GST_BIN (pipeline), video_thread); - gst_pad_connect (pad, gst_element_get_pad (video_thread, "sink")); + gst_pad_link (pad, gst_element_get_pad (video_thread, "sink")); /* set up thread state and kick things off */ g_print ("setting to READY state\n"); @@ -154,7 +154,7 @@ main (int argc, char *argv[]) g_signal_connect (G_OBJECT (src), "eos", G_CALLBACK (eof), NULL); - gst_element_connect (src, demux); + gst_element_link (src, demux); gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); @@ -169,7 +169,7 @@ main (int argc, char *argv[]) We create two elements: a file source and an MPEG demuxer. There's nothing special about this piece of code except for - the signal 'new_pad' that we connected to the mpegdemux + the signal 'new_pad' that we linked to the mpegdemux element using: diff --git a/docs/manual/helloworld.xml b/docs/manual/helloworld.xml index 5cb9f2a43d..38c1fc3315 100644 --- a/docs/manual/helloworld.xml +++ b/docs/manual/helloworld.xml @@ -47,8 +47,8 @@ main (int argc, char *argv[]) /* add objects to the main pipeline */ gst_bin_add_many (GST_BIN (pipeline), filesrc, decoder, audiosink, NULL); - /* connect src to sink */ - gst_element_connect_many (filesrc, decoder, audiosink, NULL); + /* link src to sink */ + gst_element_link_many (filesrc, decoder, audiosink, NULL); /* start playing */ gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -166,11 +166,11 @@ main (int argc, char *argv[]) - We connect the different pads of the elements together like this: + We link the different pads of the elements together like this: - /* connect src to sink */ - gst_element_connect_many (filesrc, decoder, audiosink, NULL); + /* link src to sink */ + gst_element_link_many (filesrc, decoder, audiosink, NULL); diff --git a/docs/manual/helloworld2.xml b/docs/manual/helloworld2.xml index eb7e7b66d3..3ba2e490d3 100644 --- a/docs/manual/helloworld2.xml +++ b/docs/manual/helloworld2.xml @@ -44,8 +44,8 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin"); cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); - /* disconnect the typefind from the pipeline and remove it */ - gst_element_disconnect (cache, typefind); + /* unlink the typefind from the pipeline and remove it */ + gst_element_unlink (cache, typefind); gst_bin_remove (GST_BIN (autobin), typefind); /* and an audio sink */ @@ -68,7 +68,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) g_object_set (G_OBJECT (cache), "reset", TRUE, NULL); - gst_element_connect (cache, new_element); + gst_element_link (cache, new_element); gst_element_set_state (pipeline, GST_STATE_PLAYING); } @@ -90,10 +90,10 @@ gst_play_cache_empty (GstElement *element, GstElement *pipeline) cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); new_element = gst_bin_get_by_name (GST_BIN (autobin), "new_element"); - gst_element_disconnect (filesrc, cache); - gst_element_disconnect (cache, new_element); + gst_element_unlink (filesrc, cache); + gst_element_unlink (cache, new_element); gst_bin_remove (GST_BIN (autobin), cache); - gst_element_connect (filesrc, new_element); + gst_element_link (filesrc, new_element); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -137,12 +137,12 @@ main (int argc, char *argv[]) gst_bin_add (GST_BIN (autobin), cache); gst_bin_add (GST_BIN (autobin), typefind); - gst_element_connect (cache, typefind); + gst_element_link (cache, typefind); gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink"), "sink"); gst_bin_add (GST_BIN( pipeline), autobin); - gst_element_connect (filesrc, autobin); + gst_element_link (filesrc, autobin); /* start playing */ gst_element_set_state( GST_ELEMENT (pipeline), GST_STATE_PLAYING); @@ -187,15 +187,15 @@ main (int argc, char *argv[]) the pipeline: - /* disconnect the typefind from the pipeline and remove it */ - gst_element_disconnect (cache, "src", typefind, "sink"); + /* unlink the typefind from the pipeline and remove it */ + gst_element_unlink (cache, "src", typefind, "sink"); gst_bin_remove (GST_BIN (autobin), typefind); Our next step is to construct an element that can play the type we just detected. We are going to use the autoplugger to create an element that - connects the type to an osssink. We add the new element to our + links the type to an osssink. We add the new element to our autobin. @@ -230,7 +230,7 @@ main (int argc, char *argv[]) g_object_set (G_OBJECT (cache), "reset", TRUE, NULL); - gst_element_connect (cache, "src", new_element, "sink"); + gst_element_link (cache, "src", new_element, "sink"); Finally we set the pipeline back to the playing state. At this point the @@ -240,7 +240,7 @@ main (int argc, char *argv[]) The cache empty function simply removes the autoplugcache element from - the pipeline and reconnects the filesrc to the autoplugged element. + the pipeline and relinks the filesrc to the autoplugged element. diff --git a/docs/manual/highlevel-xml.xml b/docs/manual/highlevel-xml.xml index 145ba440a3..bcf9312873 100644 --- a/docs/manual/highlevel-xml.xml +++ b/docs/manual/highlevel-xml.xml @@ -78,15 +78,15 @@ main (int argc, char *argv[]) gst_bin_add (GST_BIN (thread2), osssink); - gst_pad_connect (gst_element_get_pad (filesrc,"src"), + gst_pad_link (gst_element_get_pad (filesrc,"src"), gst_element_get_pad (queue,"sink")); - gst_pad_connect (gst_element_get_pad (queue,"src"), + gst_pad_link (gst_element_get_pad (queue,"src"), gst_element_get_pad (decode,"sink")); - gst_pad_connect (gst_element_get_pad (decode,"src"), + gst_pad_link (gst_element_get_pad (decode,"src"), gst_element_get_pad (queue2,"sink")); - gst_pad_connect (gst_element_get_pad (queue2,"src"), + gst_pad_link (gst_element_get_pad (queue2,"src"), gst_element_get_pad (osssink,"sink")); gst_bin_add (GST_BIN (bin), thread); @@ -115,7 +115,7 @@ main (int argc, char *argv[]) The complete element hierarchy will be saved along with the inter element - pad connections and the element parameters. Future GStreamer + pad links and the element parameters. Future GStreamer versions will also allow you to store the signals in the XML file. @@ -189,7 +189,7 @@ main(int argc, char *argv[]) interfere with the core XML tags. - To insert a hook into the element saving procedure you can connect + To insert a hook into the element saving procedure you can link a signal to the GstElement using the following piece of code: diff --git a/docs/manual/pads.xml b/docs/manual/pads.xml index a53ac82dc4..43270bd177 100644 --- a/docs/manual/pads.xml +++ b/docs/manual/pads.xml @@ -2,7 +2,7 @@ GstPad As we have seen in the previous chapter (GstElement), the pads are the element's - connections with the outside world. + links with the outside world. The specific type of media that the element can handle will be exposed by the pads. @@ -81,7 +81,7 @@ static void -pad_connect_func (GstElement *parser, GstPad *pad, GstElement *pipeline) +pad_link_func (GstElement *parser, GstPad *pad, GstElement *pipeline) { g_print("***** a new pad %s was created\n", gst_pad_get_name(pad)); @@ -90,7 +90,7 @@ pad_connect_func (GstElement *parser, GstPad *pad, GstElement *pipeline) if (strncmp (gst_pad_get_name (pad), "private_stream_1.0", 18) == 0) { // set up an AC3 decoder pipeline ... - // connect pad to the AC3 decoder pipeline + // link pad to the AC3 decoder pipeline ... } gst_element_set_state (GST_ELEMENT (audio_thread), GST_STATE_READY); @@ -106,7 +106,7 @@ main(int argc, char *argv[]) ... mpeg2parser = gst_element_factory_make ("mpegdemux", "mpegdemux"); - g_signal_connect (G_OBJECT (mpeg2parser), "new_pad", pad_connect_func, pipeline); + g_signal_connect (G_OBJECT (mpeg2parser), "new_pad", pad_link_func, pipeline); ... // start the pipeline @@ -134,7 +134,7 @@ main(int argc, char *argv[]) The following piece of code can be used to get a pad from the tee element. After - the pad has been requested, it can be used to connect another element to it. + the pad has been requested, it can be used to link another element to it. ... @@ -152,7 +152,7 @@ main(int argc, char *argv[]) It is also possible to request a pad that is compatible with another - pad template. This is very useful if you want to connect an element + pad template. This is very useful if you want to link an element to a multiplexer element and you need to request a pad that is compatible. The gst_element_get_compatible_pad is used to request a compatible pad, as is shown in the next example. @@ -313,7 +313,7 @@ Pads: - Compatibility detection: when two pads are connected, GStreamer + Compatibility detection: when two pads are linked, GStreamer can verify if the two pads are talking about the same media types. diff --git a/docs/manual/queues.xml b/docs/manual/queues.xml index bbfcefcf1e..cc6a7bd92f 100644 --- a/docs/manual/queues.xml +++ b/docs/manual/queues.xml @@ -2,17 +2,17 @@ Queues A GstQueue is a filter element. - Queues can be used to connect two elements in such way that the data can + Queues can be used to link two elements in such way that the data can be buffered. A buffer that is sinked to a Queue will not automatically be pushed to the - next connected element but will be buffered. It will be pushed to the next + next linked element but will be buffered. It will be pushed to the next element as soon as a gst_pad_pull () is called on the queue's source pad. Queues are mostly used in conjunction with a GstThread to - provide an external connection for the thread elements. You could have one + provide an external link for the thread elements. You could have one thread feeding buffers into a GstQueue and another thread repeadedly calling gst_pad_pull () on the queue to feed its internal elements. @@ -105,8 +105,8 @@ main (int argc, char *argv[]) gst_bin_add_many (GST_BIN (bin), filesrc, queue, thread, NULL); - gst_element_connect (filesrc, queue); - gst_element_connect_many (queue, decode, audiosink, NULL); + gst_element_link (filesrc, queue); + gst_element_link_many (queue, decode, audiosink, NULL); /* start playing */ gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING); diff --git a/docs/manual/threads.xml b/docs/manual/threads.xml index 4b8082afbc..500a106fe6 100644 --- a/docs/manual/threads.xml +++ b/docs/manual/threads.xml @@ -136,7 +136,7 @@ main (int argc, char *argv[]) /* add objects to the thread */ gst_bin_add_many (GST_BIN (thread), filesrc, decoder, audiosink, NULL); /* connect them in the logical order */ - gst_element_connect_many (filesrc, decoder, audiosink, NULL); + gst_element_link_many (filesrc, decoder, audiosink, NULL); /* start playing */ gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING); diff --git a/docs/manual/typedetection.xml b/docs/manual/typedetection.xml index 642a5581d8..b163b4398e 100644 --- a/docs/manual/typedetection.xml +++ b/docs/manual/typedetection.xml @@ -88,8 +88,8 @@ 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_pad_link (gst_element_get_pad (filesrc, "src"), + gst_element_get_pad (typefind, "sink")); /* start playing */ gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING); diff --git a/docs/manual/xml.xml b/docs/manual/xml.xml index 145ba440a3..bcf9312873 100644 --- a/docs/manual/xml.xml +++ b/docs/manual/xml.xml @@ -78,15 +78,15 @@ main (int argc, char *argv[]) gst_bin_add (GST_BIN (thread2), osssink); - gst_pad_connect (gst_element_get_pad (filesrc,"src"), + gst_pad_link (gst_element_get_pad (filesrc,"src"), gst_element_get_pad (queue,"sink")); - gst_pad_connect (gst_element_get_pad (queue,"src"), + gst_pad_link (gst_element_get_pad (queue,"src"), gst_element_get_pad (decode,"sink")); - gst_pad_connect (gst_element_get_pad (decode,"src"), + gst_pad_link (gst_element_get_pad (decode,"src"), gst_element_get_pad (queue2,"sink")); - gst_pad_connect (gst_element_get_pad (queue2,"src"), + gst_pad_link (gst_element_get_pad (queue2,"src"), gst_element_get_pad (osssink,"sink")); gst_bin_add (GST_BIN (bin), thread); @@ -115,7 +115,7 @@ main (int argc, char *argv[]) The complete element hierarchy will be saved along with the inter element - pad connections and the element parameters. Future GStreamer + pad links and the element parameters. Future GStreamer versions will also allow you to store the signals in the XML file. @@ -189,7 +189,7 @@ main(int argc, char *argv[]) interfere with the core XML tags. - To insert a hook into the element saving procedure you can connect + To insert a hook into the element saving procedure you can link a signal to the GstElement using the following piece of code: diff --git a/examples/autoplug/autoplug.c b/examples/autoplug/autoplug.c index 56f25e8fce..c22507e8e1 100644 --- a/examples/autoplug/autoplug.c +++ b/examples/autoplug/autoplug.c @@ -18,8 +18,8 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin"); cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); - /* disconnect the typefind from the pipeline and remove it */ - gst_element_disconnect_pads (cache, "src", typefind, "sink"); + /* unlink the typefind from the pipeline and remove it */ + gst_element_unlink_pads (cache, "src", typefind, "sink"); gst_bin_remove (GST_BIN (autobin), typefind); /* and an audio sink */ @@ -34,7 +34,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) colorspace = gst_element_factory_make ("colorspace", "colorspace"); g_assert (colorspace != NULL); - gst_element_connect_pads (colorspace, "src", videoelement, "sink"); + gst_element_link_pads (colorspace, "src", videoelement, "sink"); gst_bin_add (GST_BIN (videosink), colorspace); gst_bin_add (GST_BIN (videosink), videoelement); @@ -61,7 +61,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) g_object_set (G_OBJECT (cache), "reset", TRUE, NULL); - gst_element_connect_pads (cache, "src", new_element, "sink"); + gst_element_link_pads (cache, "src", new_element, "sink"); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -87,9 +87,9 @@ gst_play_cache_empty (GstElement *element, GstElement *pipeline) cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); new_element = gst_bin_get_by_name (GST_BIN (autobin), "new_element"); - gst_element_disconnect_many (filesrc, cache, new_element, NULL); + gst_element_unlink_many (filesrc, cache, new_element, NULL); gst_bin_remove (GST_BIN (autobin), cache); - gst_element_connect_pads (filesrc, "src", new_element, "sink"); + gst_element_link_pads (filesrc, "src", new_element, "sink"); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -131,11 +131,11 @@ int main(int argc,char *argv[]) gst_bin_add (GST_BIN (autobin), cache); gst_bin_add (GST_BIN (autobin), typefind); - gst_element_connect_pads (cache, "src", typefind, "sink"); + gst_element_link_pads (cache, "src", typefind, "sink"); gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink"), "sink"); gst_bin_add (GST_BIN( pipeline), autobin); - gst_element_connect_pads (filesrc, "src", autobin, "sink"); + gst_element_link_pads (filesrc, "src", autobin, "sink"); /* start playing */ gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); diff --git a/examples/helloworld/helloworld.c b/examples/helloworld/helloworld.c index 7f056c9082..95197305de 100644 --- a/examples/helloworld/helloworld.c +++ b/examples/helloworld/helloworld.c @@ -34,8 +34,8 @@ int main (int argc, char *argv[]) /* add objects to the main pipeline */ gst_bin_add_many (GST_BIN (bin), filesrc, decoder, osssink, NULL); - /* connect the elements */ - gst_element_connect_many (filesrc, decoder, osssink, NULL); + /* link the elements */ + gst_element_link_many (filesrc, decoder, osssink, NULL); /* start playing */ gst_element_set_state (bin, GST_STATE_PLAYING); diff --git a/examples/helloworld2/helloworld2.c b/examples/helloworld2/helloworld2.c index 301f3c170d..53364d0240 100644 --- a/examples/helloworld2/helloworld2.c +++ b/examples/helloworld2/helloworld2.c @@ -18,8 +18,8 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin"); cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); - /* disconnect_pads the typefind from the pipeline and remove it */ - gst_element_disconnect_pads (cache, "src", typefind, "sink"); + /* unlink_pads the typefind from the pipeline and remove it */ + gst_element_unlink_pads (cache, "src", typefind, "sink"); gst_bin_remove (GST_BIN (autobin), typefind); /* and an audio sink */ @@ -45,7 +45,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) g_object_set (G_OBJECT (cache), "reset", TRUE, NULL); - gst_element_connect_pads (cache, "src", new_element, "sink"); + gst_element_link_pads (cache, "src", new_element, "sink"); gst_element_set_state (pipeline, GST_STATE_PLAYING); } @@ -67,10 +67,10 @@ gst_play_cache_empty (GstElement *element, GstElement *pipeline) cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); new_element = gst_bin_get_by_name (GST_BIN (autobin), "new_element"); - gst_element_disconnect_pads (filesrc, "src", cache, "sink"); - gst_element_disconnect_pads (cache, "src", new_element, "sink"); + gst_element_unlink_pads (filesrc, "src", cache, "sink"); + gst_element_unlink_pads (cache, "src", new_element, "sink"); gst_bin_remove (GST_BIN (autobin), cache); - gst_element_connect_pads (filesrc, "src", new_element, "sink"); + gst_element_link_pads (filesrc, "src", new_element, "sink"); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -114,11 +114,11 @@ main (int argc, char *argv[]) gst_bin_add (GST_BIN (autobin), cache); gst_bin_add (GST_BIN (autobin), typefind); - gst_element_connect_pads (cache, "src", typefind, "sink"); + gst_element_link_pads (cache, "src", typefind, "sink"); gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink"), "sink"); gst_bin_add (GST_BIN( pipeline), autobin); - gst_element_connect_pads (filesrc, "src", autobin, "sink"); + gst_element_link_pads (filesrc, "src", autobin, "sink"); /* start playing */ gst_element_set_state( GST_ELEMENT (pipeline), GST_STATE_PLAYING); diff --git a/examples/mixer/mixer.c b/examples/mixer/mixer.c index d6b9d6a38d..e786743ef1 100644 --- a/examples/mixer/mixer.c +++ b/examples/mixer/mixer.c @@ -55,7 +55,7 @@ gst_play_type_find (GstBin *bin, GstElement *element) typefind = gst_element_factory_make ("typefind", "typefind"); g_return_val_if_fail (typefind != NULL, FALSE); - gst_pad_connect (gst_element_get_pad (element, "src"), + gst_pad_link (gst_element_get_pad (element, "src"), gst_element_get_pad (typefind, "sink")); gst_bin_add (bin, typefind); gst_bin_add (GST_BIN (pipeline), GST_ELEMENT (bin)); @@ -69,7 +69,7 @@ gst_play_type_find (GstBin *bin, GstElement *element) caps = gst_pad_get_caps (gst_element_get_pad (element, "src")); - gst_pad_disconnect (gst_element_get_pad (element, "src"), + gst_pad_unlink (gst_element_get_pad (element, "src"), gst_element_get_pad (typefind, "sink")); gst_bin_remove (bin, typefind); gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin)); @@ -115,15 +115,15 @@ int main(int argc,char *argv[]) /* create main bin */ main_bin = gst_pipeline_new("bin"); - /* connect adder and output to bin */ + /* link adder and output to bin */ GST_INFO (0, "main: adding adder to bin"); gst_bin_add (GST_BIN(main_bin), adder); GST_INFO (0, "main: adding audiosink to bin"); gst_bin_add (GST_BIN(main_bin), audiosink); - /* connect adder and audiosink */ + /* link adder and audiosink */ - gst_pad_connect(gst_element_get_pad(adder,"src"), + gst_pad_link(gst_element_get_pad(adder,"src"), gst_element_get_pad(audiosink,"sink")); /* start looping */ @@ -138,12 +138,12 @@ int main(int argc,char *argv[]) if (i > 1) gst_element_set_state (main_bin, GST_STATE_PAUSED); gst_bin_add (GST_BIN(main_bin), channel_in->pipe); - /* request pads and connect to adder */ + /* request pads and link to adder */ GST_INFO (0, "requesting pad\n"); pad = gst_element_get_request_pad (adder, "sink%d"); printf ("\tGot new adder sink pad %s\n", gst_pad_get_name (pad)); sprintf (buffer, "channel%d", i); - gst_pad_connect (gst_element_get_pad (channel_in->pipe, buffer), pad); + gst_pad_link (gst_element_get_pad (channel_in->pipe, buffer), pad); /* register a volume envelope */ printf ("\tregistering volume envelope...\n"); @@ -276,7 +276,7 @@ create_input_channel (int id, char* location) /* add filesrc to the bin before autoplug */ gst_bin_add(GST_BIN(channel->pipe), channel->filesrc); - /* connect signal to eos of filesrc */ + /* link signal to eos of filesrc */ g_signal_connect (G_OBJECT(channel->filesrc),"eos", G_CALLBACK(eos),NULL); @@ -364,8 +364,8 @@ create_input_channel (int id, char* location) gst_bin_add (GST_BIN(channel->pipe), channel->volenv); gst_bin_add (GST_BIN (channel->pipe), new_element); - gst_element_connect_pads (channel->filesrc, "src", new_element, "sink"); - gst_element_connect_pads (new_element, "src_00", channel->volenv, "sink"); + gst_element_link_pads (channel->filesrc, "src", new_element, "sink"); + gst_element_link_pads (new_element, "src_00", channel->volenv, "sink"); /* add a ghost pad */ sprintf (buffer, "channel%d", id); diff --git a/examples/pingpong/pingpong.c b/examples/pingpong/pingpong.c index 9dbbc2f1d5..941b907d82 100644 --- a/examples/pingpong/pingpong.c +++ b/examples/pingpong/pingpong.c @@ -80,16 +80,16 @@ main (gint argc, gchar *argv[]) gst_bin_add (GST_BIN (pipeline), aggregator); gst_bin_add (GST_BIN (pipeline), sink); - gst_element_connect_pads (aggregator, "src", sink, "sink"); + gst_element_link_pads (aggregator, "src", sink, "sink"); bin1 = make_bin (1); pad1 = gst_element_get_request_pad (aggregator, "sink%d"); - gst_pad_connect (gst_element_get_pad (bin1, "src"), pad1); + gst_pad_link (gst_element_get_pad (bin1, "src"), pad1); gst_bin_add (GST_BIN (pipeline), bin1); bin2 = make_bin (2); pad2 = gst_element_get_request_pad (aggregator, "sink%d"); - gst_pad_connect (gst_element_get_pad (bin2, "src"), pad2); + gst_pad_link (gst_element_get_pad (bin2, "src"), pad2); gst_bin_add (GST_BIN (pipeline), bin2); gst_element_set_state (pipeline, GST_STATE_PLAYING); diff --git a/gst/Makefile.am b/gst/Makefile.am index 8592e8cb87..a6d6ae2e63 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -116,6 +116,7 @@ gst_headers = \ gstbufferpool-default.h \ gstcaps.h \ gstclock.h \ + gstcompat.h \ gstcpu.h \ gstdata.h \ gstelement.h \ diff --git a/gst/autoplug/autoplugtest.c b/gst/autoplug/autoplugtest.c index 4fba94728a..4fdd5dcdca 100644 --- a/gst/autoplug/autoplugtest.c +++ b/gst/autoplug/autoplugtest.c @@ -14,9 +14,9 @@ have_type (GstElement *element, GstCaps *caps, GstCaps **private_caps) gst_element_set_state (pipeline, GST_STATE_PAUSED); - /* disconnect the typefind from the pipeline and remove it, + /* unlink the typefind from the pipeline and remove it, * since we now know what the type is */ - gst_element_disconnect (cache, typefind); + gst_element_unlink (cache, typefind); gst_bin_remove (GST_BIN (autobin), typefind); gst_scheduler_show (GST_ELEMENT_SCHED (pipeline)); @@ -45,11 +45,11 @@ have_type (GstElement *element, GstCaps *caps, GstCaps **private_caps) sink = gst_element_factory_make ("osssink", "sink"); gst_bin_add (GST_BIN (autobin), decoder); gst_bin_add (GST_BIN (autobin), sink); - gst_element_connect (decoder, sink); + gst_element_link (decoder, sink); g_object_set (G_OBJECT (cache), "reset", TRUE, NULL); - gst_element_connect (cache, decoder); + gst_element_link (cache, decoder); gst_element_set_state (pipeline, GST_STATE_PLAYING); fprintf (stderr, "done with have_type signal, playing\n"); @@ -60,13 +60,13 @@ void cache_empty (GstElement *element, gpointer private) { gst_element_set_state (pipeline, GST_STATE_PAUSED); - gst_element_disconnect_pads (src,"src",cache,"sink"); + gst_element_unlink_pads (src,"src",cache,"sink"); gst_scheduler_show (GST_ELEMENT_SCHED(pipeline)); - gst_element_disconnect_pads (cache,"src",decoder,"sink"); + gst_element_unlink_pads (cache,"src",decoder,"sink"); gst_scheduler_show (GST_ELEMENT_SCHED(pipeline)); gst_bin_remove (GST_BIN(autobin), cache); gst_scheduler_show (GST_ELEMENT_SCHED(pipeline)); - gst_element_connect_pads (src,"src",decoder,"sink"); + gst_element_link_pads (src,"src",decoder,"sink"); gst_scheduler_show (GST_ELEMENT_SCHED(pipeline)); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -104,12 +104,12 @@ int main (int argc,char *argv[]) { G_CALLBACK (have_type), &caps); gst_bin_add (GST_BIN (autobin), cache); gst_bin_add (GST_BIN (autobin), typefind); - gst_element_connect (cache, typefind); + gst_element_link (cache, typefind); gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink") ,"sink"); gst_bin_add (GST_BIN (pipeline), autobin); - gst_element_connect (src, autobin); + gst_element_link (src, autobin); /* pipeline is now src ! autobin * with autobin: cache ! typefind diff --git a/gst/autoplug/gstspider.c b/gst/autoplug/gstspider.c index 135f0e82f4..3c59fa5d01 100644 --- a/gst/autoplug/gstspider.c +++ b/gst/autoplug/gstspider.c @@ -75,13 +75,13 @@ static GstPad* gst_spider_request_new_pad (GstElem static void gst_spider_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gst_spider_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -/* connection functions */ -static GstSpiderConnection * gst_spider_connection_new (GstSpiderIdentity *src); -static void gst_spider_connection_destroy (GstSpiderConnection *conn); -static void gst_spider_connection_reset (GstSpiderConnection *conn, GstElement *to); -static void gst_spider_connection_add (GstSpiderConnection *conn, GstElement *element); -static GstSpiderConnection * gst_spider_connection_find (GstSpiderIdentity *src); -static GstSpiderConnection * gst_spider_connection_get (GstSpiderIdentity *src); +/* link functions */ +static GstSpiderConnection * gst_spider_link_new (GstSpiderIdentity *src); +static void gst_spider_link_destroy (GstSpiderConnection *conn); +static void gst_spider_link_reset (GstSpiderConnection *conn, GstElement *to); +static void gst_spider_link_add (GstSpiderConnection *conn, GstElement *element); +static GstSpiderConnection * gst_spider_link_find (GstSpiderIdentity *src); +static GstSpiderConnection * gst_spider_link_get (GstSpiderIdentity *src); /* autoplugging functions */ static GstElement * gst_spider_find_element_to_plug (GstElement *src, GstElementFactory *fac, GstPadDirection dir); @@ -95,7 +95,7 @@ static gchar * gst_spider_unused_elementname (GstBin *bin, const gchar *start /* debugging stuff static void print_spider_contents (GstSpider *spider); -static void print_spider_connection (GstSpiderConnection *conn); */ +static void print_spider_link (GstSpiderConnection *conn); */ /* === variables === */ static GstElementClass * parent_class = NULL; @@ -165,7 +165,7 @@ gst_spider_init (GstSpider *spider) spider->factories = gst_autoplug_factories_filters_with_sink_caps ((GList *) gst_registry_pool_feature_list (GST_TYPE_ELEMENT_FACTORY)); - spider->connections = NULL; + spider->links = NULL; spider->sink_ident = gst_spider_identity_new_sink ("sink_ident"); gst_bin_add (GST_BIN (spider), GST_ELEMENT (spider->sink_ident)); @@ -210,7 +210,7 @@ gst_spider_request_new_pad (GstElement *element, GstPadTemplate *templ, const gc gst_bin_add (GST_BIN (element), GST_ELEMENT (identity)); returnpad = gst_element_add_ghost_pad (element, returnpad, padname); - gst_spider_connection_new (identity); + gst_spider_link_new (identity); GST_DEBUG (GST_CAT_ELEMENT_PADS, "successuflly created requested pad %s:%s", GST_DEBUG_PAD_NAME (returnpad)); return returnpad; @@ -303,9 +303,9 @@ gst_spider_connect_sometimes (GstElement *src, GstPad *pad, GstSpiderConnection gst_element_set_state ((GstElement *) spider, GST_STATE_PLAYING); } } -/* create a new connection from those two elements */ +/* create a new link from those two elements */ static GstSpiderConnection * -gst_spider_connection_new (GstSpiderIdentity *src) +gst_spider_link_new (GstSpiderIdentity *src) { GstSpider *spider = GST_SPIDER (GST_OBJECT_PARENT (src)); @@ -313,23 +313,23 @@ gst_spider_connection_new (GstSpiderIdentity *src) conn->src = src; conn->path = NULL; conn->current = (GstElement *) spider->sink_ident; - spider->connections = g_list_prepend (spider->connections, conn); + spider->links = g_list_prepend (spider->links, conn); return conn; } static void -gst_spider_connection_destroy (GstSpiderConnection *conn) +gst_spider_link_destroy (GstSpiderConnection *conn) { GstSpider *spider = GST_SPIDER (GST_OBJECT_PARENT (conn->src)); - /* reset connection to unplugged */ - gst_spider_connection_reset (conn, (GstElement *) spider->sink_ident); + /* reset link to unplugged */ + gst_spider_link_reset (conn, (GstElement *) spider->sink_ident); g_free (conn); } static void -gst_spider_connection_reset (GstSpiderConnection *conn, GstElement *to) +gst_spider_link_reset (GstSpiderConnection *conn, GstElement *to) { GstSpider *spider = GST_SPIDER (GST_OBJECT_PARENT (conn->src)); - GST_DEBUG (GST_CAT_AUTOPLUG, "resetting connection from %s to %s, currently at %s to %s", GST_ELEMENT_NAME (spider->sink_ident), + GST_DEBUG (GST_CAT_AUTOPLUG, "resetting link from %s to %s, currently at %s to %s", GST_ELEMENT_NAME (spider->sink_ident), GST_ELEMENT_NAME (conn->src), GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (to)); while ((conn->path != NULL) && ((GstElement *) conn->path->data != to)) { @@ -343,21 +343,21 @@ gst_spider_connection_reset (GstSpiderConnection *conn, GstElement *to) conn->current = to; } } -/* add an element to the connection */ +/* add an element to the link */ static void -gst_spider_connection_add (GstSpiderConnection *conn, GstElement *element) +gst_spider_link_add (GstSpiderConnection *conn, GstElement *element) { gst_object_ref ((GstObject *) element); gst_object_sink ((GstObject *) element); conn->path = g_list_prepend (conn->path, element); conn->current = element; } -/* find the connection from those two elements */ +/* find the link from those two elements */ static GstSpiderConnection * -gst_spider_connection_find (GstSpiderIdentity *src) +gst_spider_link_find (GstSpiderIdentity *src) { GstSpider *spider = (GstSpider *) GST_OBJECT_PARENT (src); - GList *list = spider->connections; + GList *list = spider->links; while (list) { @@ -369,18 +369,18 @@ gst_spider_connection_find (GstSpiderIdentity *src) } return NULL; } -/* get a new connection from those two elements +/* get a new link from those two elements * search first; if none is found, create a new one */ static GstSpiderConnection * -gst_spider_connection_get (GstSpiderIdentity *src) +gst_spider_link_get (GstSpiderIdentity *src) { GstSpiderConnection *ret; - if ((ret = gst_spider_connection_find (src)) != NULL) + if ((ret = gst_spider_link_find (src)) != NULL) { return ret; } - return gst_spider_connection_new (src); + return gst_spider_link_new (src); } void gst_spider_identity_plug (GstSpiderIdentity *ident) @@ -441,9 +441,9 @@ gst_spider_identity_plug (GstSpiderIdentity *ident) /* plug in the right direction */ if (dir == GST_PAD_SINK) { - conn = gst_spider_connection_get (peer); + conn = gst_spider_link_get (peer); } else { - conn = gst_spider_connection_get (ident); + conn = gst_spider_link_get (ident); } if ((GstElement *) spider->sink_ident == conn->current) { @@ -472,7 +472,7 @@ void gst_spider_identity_unplug (GstSpiderIdentity *ident) { GstSpider *spider = (GstSpider *) GST_OBJECT_PARENT (ident); - GList *list = spider->connections; + GList *list = spider->links; while (list) { @@ -481,8 +481,8 @@ gst_spider_identity_unplug (GstSpiderIdentity *ident) list = g_list_next (list); if (conn->src == ident) { - g_list_delete_link (spider->connections, cur); - gst_spider_connection_destroy (conn); + g_list_delete_link (spider->links, cur); + gst_spider_link_destroy (conn); } } ident->plugged = FALSE; @@ -500,7 +500,7 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) if ((GstElement *) conn->src == conn->current) return GST_PAD_CONNECT_DONE; - /* try to shorten the list at the end and not duplicate connection code */ + /* try to shorten the list at the end and not duplicate link code */ if (plugpath != NULL) { templist = g_list_last (plugpath); @@ -552,7 +552,7 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) return GST_PAD_CONNECT_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_connection_add (conn, element); + gst_spider_link_add (conn, element); if (plugpath != NULL) plugpath = g_list_delete_link (plugpath, plugpath); } @@ -560,7 +560,7 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath) /* ref all elements at the end */ while (endelements) { - gst_spider_connection_add (conn, endelements->data); + gst_spider_link_add (conn, endelements->data); endelements = g_list_delete_link (endelements, endelements); } @@ -589,7 +589,7 @@ gst_spider_find_element_to_plug (GstElement *src, GstElementFactory *fac, GstPad return NULL; } -/* try to establish the connection */ +/* try to establish the link */ static GstPadConnectReturn gst_spider_plug (GstSpiderConnection *conn) { @@ -601,7 +601,7 @@ gst_spider_plug (GstSpiderConnection *conn) g_warning ("FIXME: autoplugging only possible from GstSpiderIdentity conn->sink yet (yep, that's technical)\n"); return GST_PAD_CONNECT_REFUSED; } -/* try to establish the connection using this pad */ +/* try to establish the link using this pad */ static GstPadConnectReturn gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad) { @@ -639,7 +639,7 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad) 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; } - GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "found a connection that needs %d elements", g_list_length (plugpath)); + GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "found a link that needs %d elements", g_list_length (plugpath)); /* now remove non-needed elements from the beginning of the path * alter src to point to the new element where we need to start @@ -648,18 +648,18 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad) element = conn->current; while ((plugpath != NULL) && (element = gst_spider_find_element_to_plug (element, (GstElementFactory *) plugpath->data, GST_PAD_SRC))) { - gst_spider_connection_add (conn, element); + gst_spider_link_add (conn, element); plugpath = g_list_delete_link (plugpath, plugpath); } - GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "%d elements must be inserted to establish the connection", g_list_length (plugpath)); + GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "%d elements must be inserted to establish the link", g_list_length (plugpath)); /* create the elements and plug them */ result = gst_spider_create_and_plug (conn, plugpath); /* reset the "current" element */ if (result == GST_PAD_CONNECT_REFUSED) { - gst_spider_connection_reset (conn, startelement); + gst_spider_link_reset (conn, startelement); } return result; diff --git a/gst/autoplug/gstspider.h b/gst/autoplug/gstspider.h index b2251a9cc6..0e1bfa288f 100644 --- a/gst/autoplug/gstspider.h +++ b/gst/autoplug/gstspider.h @@ -33,14 +33,14 @@ extern GstElementDetails gst_spider_details; /* * Theory of operation: * When connecting a sink to a source, GstSpiderConnections are used to keep track - * of the current status of the connection. sink -> src is the path we intend to + * of the current status of the link. sink -> src is the path we intend to * plug. current is how far we've come. If current equals * - NULL, there is no possible path, - * - src, the connection is established. - * - sink, it wasn't tried to establish a connection. + * - src, the link is established. + * - sink, it wasn't tried to establish a link. * - something else, we have come that far while plugging. * signal_id is used to remember the signal_id when we are waiting for a "new_pad" - * callback during connection. + * callback during link. * When a path is established, the elements in the path (excluding sink and src) * are refcounted once for every path. * A GstSpider keeps a list of all GstSpiderConnections in it. @@ -74,7 +74,7 @@ struct _GstSpider { GstSpiderIdentity *sink_ident; GList * factories; /* factories to use for plugging */ - GList * connections; /* GStSpiderConnection list of all connections */ + GList * links; /* GStSpiderConnection list of all links */ }; struct _GstSpiderClass { @@ -84,7 +84,7 @@ struct _GstSpiderClass { /* default initialization stuff */ GType gst_spider_get_type (void); -/* private connection functions to be called by GstSpiderIdentity */ +/* private link functions to be called by GstSpiderIdentity */ void gst_spider_identity_plug (GstSpiderIdentity *ident); void gst_spider_identity_unplug (GstSpiderIdentity *ident); diff --git a/gst/autoplug/gstspideridentity.c b/gst/autoplug/gstspideridentity.c index 912d0604dd..adcb14cc9b 100644 --- a/gst/autoplug/gstspideridentity.c +++ b/gst/autoplug/gstspideridentity.c @@ -71,7 +71,7 @@ static void gst_spider_identity_init (GstSpiderIdentity *spider_identity); /* functions set in pads, elements and stuff */ static void gst_spider_identity_chain (GstPad *pad, GstBuffer *buf); static GstElementStateReturn gst_spider_identity_change_state (GstElement *element); -static GstPadConnectReturn gst_spider_identity_connect (GstPad *pad, GstCaps *caps); +static GstPadConnectReturn gst_spider_identity_link (GstPad *pad, GstCaps *caps); static GstCaps * gst_spider_identity_getcaps (GstPad *pad, GstCaps *caps); /* loop functions */ static void gst_spider_identity_dumb_loop (GstSpiderIdentity *ident); @@ -139,13 +139,13 @@ gst_spider_identity_init (GstSpiderIdentity *ident) /* sink */ ident->sink = gst_pad_new_from_template (GST_PAD_TEMPLATE_GET (spider_sink_factory), "sink"); gst_element_add_pad (GST_ELEMENT (ident), ident->sink); - gst_pad_set_connect_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_connect)); + gst_pad_set_link_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_link)); gst_pad_set_getcaps_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_getcaps)); gst_pad_set_bufferpool_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_get_bufferpool)); /* src */ ident->src = gst_pad_new_from_template (GST_PAD_TEMPLATE_GET (spider_src_factory), "src"); gst_element_add_pad (GST_ELEMENT (ident), ident->src); - gst_pad_set_connect_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_connect)); + gst_pad_set_link_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_link)); gst_pad_set_getcaps_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_getcaps)); gst_pad_set_event_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_handle_src_event)); @@ -169,11 +169,11 @@ gst_spider_identity_chain (GstPad *pad, GstBuffer *buf) if (GST_IS_EVENT (buf)) { /* start hack for current event stuff here */ - /* check for unconnected elements and send them the EOS event, too */ + /* check for unlinked elements and send them the EOS event, too */ if (GST_EVENT_TYPE (GST_EVENT (buf)) == GST_EVENT_EOS) { GstSpider *spider = (GstSpider *) GST_OBJECT_PARENT (ident); - GList *list = spider->connections; + GList *list = spider->links; while (list) { GstSpiderConnection *conn = (GstSpiderConnection *) list->data; @@ -220,9 +220,9 @@ gst_spider_identity_new_sink (gchar *name) return ret; } -/* shamelessly stolen from gstqueue.c to get proxy connections */ +/* shamelessly stolen from gstqueue.c to get proxy links */ static GstPadConnectReturn -gst_spider_identity_connect (GstPad *pad, GstCaps *caps) +gst_spider_identity_link (GstPad *pad, GstCaps *caps) { GstSpiderIdentity *spider_identity = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad)); GstPad *otherpad; @@ -233,7 +233,7 @@ gst_spider_identity_connect (GstPad *pad, GstCaps *caps) otherpad = spider_identity->src; if (otherpad != NULL) - return gst_pad_proxy_connect (otherpad, caps); + return gst_pad_proxy_link (otherpad, caps); return GST_PAD_CONNECT_OK; } @@ -274,7 +274,7 @@ gst_spider_identity_request_new_pad (GstElement *element, GstPadTemplate *templ GST_DEBUG(0, "element %s requests new sink pad", GST_ELEMENT_NAME(ident)); ident->sink = gst_pad_new ("sink", GST_PAD_SINK); gst_element_add_pad (GST_ELEMENT (ident), ident->sink); - gst_pad_set_connect_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_connect)); + gst_pad_set_link_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_link)); gst_pad_set_getcaps_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_getcaps)); gst_pad_set_bufferpool_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_get_bufferpool)); return ident->sink; @@ -284,7 +284,7 @@ gst_spider_identity_request_new_pad (GstElement *element, GstPadTemplate *templ GST_DEBUG(0, "element %s requests new src pad", GST_ELEMENT_NAME(ident)); ident->src = gst_pad_new ("src", GST_PAD_SRC); gst_element_add_pad (GST_ELEMENT (ident), ident->src); - gst_pad_set_connect_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_connect)); + gst_pad_set_link_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_link)); gst_pad_set_getcaps_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_getcaps)); gst_pad_set_event_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_handle_src_event)); return ident->src; @@ -384,7 +384,7 @@ gst_spider_identity_dumb_loop (GstSpiderIdentity *ident) gst_spider_identity_chain (ident->sink, buf); } -/* do nothing until we're connected - then disable yourself +/* do nothing until we're linked - then disable yourself */ static void gst_spider_identity_src_loop (GstSpiderIdentity *ident) diff --git a/gst/elements/gstidentity.c b/gst/elements/gstidentity.c index 0589362ff3..644ada8153 100644 --- a/gst/elements/gstidentity.c +++ b/gst/elements/gstidentity.c @@ -155,7 +155,7 @@ gst_identity_getcaps (GstPad *pad, GstCaps *caps) } static GstPadConnectReturn -gst_identity_connect (GstPad *pad, GstCaps *caps) +gst_identity_link (GstPad *pad, GstCaps *caps) { GstIdentity *identity; GstPad *otherpad; @@ -176,12 +176,12 @@ gst_identity_init (GstIdentity *identity) gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad); gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain)); gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool); - gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect); + gst_pad_set_link_function (identity->sinkpad, gst_identity_link); gst_pad_set_getcaps_function (identity->sinkpad, gst_identity_getcaps); identity->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad); - gst_pad_set_connect_function (identity->srcpad, gst_identity_connect); + gst_pad_set_link_function (identity->srcpad, gst_identity_link); gst_pad_set_getcaps_function (identity->srcpad, gst_identity_getcaps); identity->loop_based = FALSE; diff --git a/gst/elements/gsttee.c b/gst/elements/gsttee.c index 9361048040..3e7ebc7c3c 100644 --- a/gst/elements/gsttee.c +++ b/gst/elements/gsttee.c @@ -120,7 +120,7 @@ gst_tee_class_init (GstTeeClass *klass) } static GstPadConnectReturn -gst_tee_sinkconnect (GstPad *pad, GstCaps *caps) +gst_tee_sinklink (GstPad *pad, GstCaps *caps) { GstTee *tee; const GList *pads; @@ -155,7 +155,7 @@ gst_tee_init (GstTee *tee) tee->sinkpad = gst_pad_new ("sink", GST_PAD_SINK); gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad); gst_pad_set_chain_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_chain)); - gst_pad_set_connect_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_sinkconnect)); + gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_sinklink)); tee->silent = FALSE; tee->last_message = NULL; diff --git a/gst/gst.h b/gst/gst.h index 80e25a867c..6c3f8d303f 100644 --- a/gst/gst.h +++ b/gst/gst.h @@ -59,6 +59,9 @@ #include #include +/* API compatibility stuff */ +#include + G_BEGIN_DECLS /* initialize GST */ diff --git a/gst/gstbin.c b/gst/gstbin.c index da7793bae3..ad0c18e69a 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -267,9 +267,9 @@ gst_bin_set_element_sched (GstElement *element, GstScheduler *sched) /* otherwise, if it's just a regular old element */ else { GList *pads; - + gst_scheduler_add_element (sched, element); - + /* set the sched pointer in all the pads */ pads = element->pads; while (pads) { @@ -277,7 +277,7 @@ gst_bin_set_element_sched (GstElement *element, GstScheduler *sched) pad = GST_PAD (pads->data); pads = g_list_next (pads); - + /* we only operate on real pads */ if (!GST_IS_REAL_PAD (pad)) continue; @@ -285,12 +285,13 @@ gst_bin_set_element_sched (GstElement *element, GstScheduler *sched) /* if the peer element exists and is a candidate */ if (GST_PAD_PEER (pad)) { if (gst_pad_get_scheduler (GST_PAD_PEER (pad)) == sched) { - GST_INFO (GST_CAT_SCHEDULING, "peer is in same scheduler, telling scheduler"); - + GST_INFO (GST_CAT_SCHEDULING, + "peer is in same scheduler, telling scheduler"); + if (GST_PAD_IS_SRC (pad)) - gst_scheduler_pad_connect (sched, pad, GST_PAD_PEER (pad)); + gst_scheduler_pad_link (sched, pad, GST_PAD_PEER (pad)); else - gst_scheduler_pad_connect (sched, GST_PAD_PEER (pad), pad); + gst_scheduler_pad_link (sched, GST_PAD_PEER (pad), pad); } } } @@ -309,7 +310,7 @@ gst_bin_unset_element_sched (GstElement *element, GstScheduler *sched) GST_ELEMENT_NAME (element)); return; } - + GST_INFO (GST_CAT_SCHEDULING, "removing element \"%s\" from its sched %p", GST_ELEMENT_NAME (element), GST_ELEMENT_SCHED (element)); @@ -357,9 +358,9 @@ gst_bin_unset_element_sched (GstElement *element, GstScheduler *sched) GST_INFO (GST_CAT_SCHEDULING, "peer is in same scheduler, telling scheduler"); if (GST_PAD_IS_SRC (pad)) - gst_scheduler_pad_disconnect (sched, pad, GST_PAD_PEER (pad)); + gst_scheduler_pad_unlink (sched, pad, GST_PAD_PEER (pad)); else - gst_scheduler_pad_disconnect (sched, GST_PAD_PEER (pad), pad); + gst_scheduler_pad_unlink (sched, GST_PAD_PEER (pad), pad); } } } diff --git a/gst/gstcompat.h b/gst/gstcompat.h new file mode 100644 index 0000000000..8532a595bf --- /dev/null +++ b/gst/gstcompat.h @@ -0,0 +1,57 @@ +/* GStreamer + * Copyright (C) 1999,2000 Erik Walthinsen + * 2000 Wim Taymans + * + * gst.h: Main header for GStreamer, apps should include this + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +/* API compatibility stuff */ +#ifndef __GSTCOMPAT_H__ +#define __GSTCOMPAT_H__ + +#ifndef GST_DISABLE_DEPRECATED +/* 0.5.2 changes */ + +/* element functions */ +#define gst_element_connect(a,b) gst_element_link(a,b) +#define gst_element_connect_pads(a,b,c,d) \ + gst_element_link_pads(a,b,c,d) +#ifdef G_HAVE_ISO_VARARGS +#define gst_element_connect_many(a,...) gst_element_link_many(a,__VA_ARGS__) +#else +#define gst_element_connect_many(a,args...) \ + gst_element_link_many(a, ## args) +#endif +#define gst_element_connect_filtered(a,b,c) \ + gst_element_link_filtered(a,b,c) +#define gst_element_disconnect(a,b) gst_element_unlink(a,b) + +/* pad functions */ +#define gst_pad_connect(a,b) gst_pad_link(a,b) +#define gst_pad_connect_filtered(a,b,c) gst_pad_link_filtered(a,b,c) +#define gst_pad_disconnect(a,b) gst_pad_unlink(a,b) +#define gst_pad_proxy_connect(a,b) gst_pad_proxy_link(a,b) +#define gst_pad_set_connect_function(a,b) \ + gst_pad_set_link_function(a,b) + +typedef GstPadConnectFunction GstPadLinkFunction; + +#endif /* not GST_DISABLE_DEPRECATED */ + +#endif /* __GSTCOMPAT_H__ */ diff --git a/gst/gstelement.c b/gst/gstelement.c index a9dc0598af..6683b3f2ef 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -856,7 +856,7 @@ gst_element_release_locks (GstElement *element) * @element: a #GstElement to add the pad to. * @pad: the #GstPad to add to the element. * - * Add a pad (connection point) to the element, setting the parent of the + * Add a pad (link point) to the element, setting the parent of the * pad to the element (and thus adding a reference). */ void @@ -895,7 +895,7 @@ gst_element_add_pad (GstElement *element, GstPad *pad) * @element: a #GstElement to remove pad from. * @pad: the #GstPad to remove from the element. * - * Remove a pad (connection point) from the element. + * Remove a pad (link point) from the element. */ void gst_element_remove_pad (GstElement *element, GstPad *pad) @@ -907,7 +907,7 @@ gst_element_remove_pad (GstElement *element, GstPad *pad) g_return_if_fail (GST_PAD_PARENT (pad) == element); - /* check to see if the pad is still connected */ + /* check to see if the pad is still linked */ /* FIXME: what if someone calls _remove_pad instead of _remove_ghost_pad? */ if (GST_IS_REAL_PAD (pad)) { @@ -1226,14 +1226,14 @@ gst_element_get_pad_template (GstElement *element, const gchar *name) * @compattempl: the #GstPadTemplate to find a compatible template for. * * Generates a pad template for this element compatible with the given - * template (meaning it is able to connect with it). + * template (meaning it is able to link with it). * * Returns: the #GstPadTemplate of the element that is compatible with - * the given GstPadTemplate, or NULL if none was found. No unreferencing + * the given GstPadTemplate, or NULL if none was found. No unreferencing * is necessary. */ GstPadTemplate* -gst_element_get_compatible_pad_template (GstElement *element, +gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl) { GstPadTemplate *newtempl = NULL; @@ -1285,7 +1285,7 @@ gst_element_get_compatible_pad_template (GstElement *element, /** * gst_element_request_compatible_pad: * @element: a #GstElement to request a new pad from. - * @templ: the #GstPadTemplate to which the new pad should be able to connect. + * @templ: the #GstPadTemplate to which the new pad should be able to link. * * Requests a new pad from the element. The template will * be used to decide what type of pad to create. This function @@ -1318,43 +1318,43 @@ gst_element_request_compatible_pad (GstElement *element, GstPadTemplate *templ) * @pad: the #GstPad to find a compatible one for. * @filtercaps: the #GstCaps to use as a filter. * - * Looks for an unconnected pad to which the given pad can connect to. - * It is not guaranteed that connecting the pads will work, though + * Looks for an unlinked pad to which the given pad can link to. + * It is not guaranteed that linking the pads will work, though * it should work in most cases. * - * Returns: the #GstPad to which a connection can be made. + * Returns: the #GstPad to which a link can be made. */ -GstPad* -gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad, +GstPad* +gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad, GstCaps *filtercaps) { const GList *pads; GstPadTemplate *templ; GstCaps *templcaps; GstPad *foundpad = NULL; - + /* checks */ g_return_val_if_fail (element != NULL, NULL); g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); g_return_val_if_fail (pad != NULL, NULL); g_return_val_if_fail (GST_IS_PAD (pad), NULL); - + /* let's use the real pad */ pad = (GstPad *) GST_PAD_REALIZE (pad); g_return_val_if_fail (pad != NULL, NULL); g_return_val_if_fail (GST_RPAD_PEER (pad) == NULL, NULL); - - /* try to get an existing unconnected pad */ + + /* try to get an existing unlinked pad */ pads = gst_element_get_pad_list (element); while (pads) { GstPad *current = GST_PAD (pads->data); if ((GST_PAD_PEER (GST_PAD_REALIZE (current)) == NULL) && - gst_pad_can_connect_filtered (pad, current, filtercaps)) { + gst_pad_can_link_filtered (pad, current, filtercaps)) { return current; } pads = g_list_next (pads); } - + /* try to create a new one */ /* requesting is a little crazy, we need a template. Let's create one */ if (filtercaps != NULL) { @@ -1364,14 +1364,14 @@ gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad, } else { templcaps = gst_caps_copy (gst_pad_get_caps (pad)); } - + templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad), GST_RPAD_DIRECTION (pad), GST_PAD_ALWAYS, templcaps, NULL); foundpad = gst_element_request_compatible_pad (element, templ); gst_object_unref (GST_OBJECT (templ)); /* this will take care of the caps too */ - + /* FIXME: this is broken, but it's in here so autoplugging elements that don't - have caps on their source padtemplates (spider) can connect... */ + have caps on their source padtemplates (spider) can link... */ if (!foundpad && !filtercaps) { templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad), GST_RPAD_DIRECTION (pad), GST_PAD_ALWAYS, NULL, NULL); @@ -1387,11 +1387,11 @@ gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad, * @element: a #GstElement in which the pad should be found. * @pad: the #GstPad to find a compatible one for. * - * Looks for an unconnected pad to which the given pad can connect to. - * It is not guaranteed that connecting the pads will work, though + * Looks for an unlinked pad to which the given pad can link to. + * It is not guaranteed that linking the pads will work, though * it should work in most cases. * - * Returns: the #GstPad to which a connection can be made, or NULL if none + * Returns: the #GstPad to which a link can be made, or NULL if none * could be found. */ GstPad* @@ -1401,22 +1401,22 @@ gst_element_get_compatible_pad (GstElement *element, GstPad *pad) } /** - * gst_element_connect_filtered: + * gst_element_link_filtered: * @src: a #GstElement containing the source pad. * @dest: the #GstElement containing the destination pad. * @filtercaps: the #GstCaps to use as a filter. * * Connects the source to the destination element using the filtercaps. - * The connection must be from source to destination, the other + * The link must be from source to destination, the other * direction will not be tried. - * The functions looks for existing pads that aren't connected yet. + * The functions looks for existing pads that aren't linked yet. * It will use request pads if possible. But both pads will not be requested. - * If multiple connections are possible, only one is established. + * If multiple links are possible, only one is established. * - * Returns: TRUE if the elements could be connected. + * Returns: TRUE if the elements could be linked. */ gboolean -gst_element_connect_filtered (GstElement *src, GstElement *dest, +gst_element_link_filtered (GstElement *src, GstElement *dest, GstCaps *filtercaps) { const GList *srcpads, *destpads, *srctempls, *desttempls, *l; @@ -1429,7 +1429,7 @@ gst_element_connect_filtered (GstElement *src, GstElement *dest, g_return_val_if_fail (dest != NULL, FALSE); g_return_val_if_fail (GST_IS_ELEMENT (dest), FALSE); - GST_DEBUG (GST_CAT_ELEMENT_PADS, "trying to connect element %s to element %s", + GST_DEBUG (GST_CAT_ELEMENT_PADS, "trying to link element %s to element %s", GST_ELEMENT_NAME (src), GST_ELEMENT_NAME (dest)); srcpads = gst_element_get_pad_list (src); @@ -1447,8 +1447,8 @@ gst_element_connect_filtered (GstElement *src, GstElement *dest, (GST_PAD_PEER (srcpad) == NULL)) { destpad = gst_element_get_compatible_pad_filtered (dest, srcpad, filtercaps); - if (destpad && gst_pad_connect_filtered (srcpad, destpad, filtercaps)) { - GST_DEBUG (GST_CAT_ELEMENT_PADS, "connected pad %s:%s to pad %s:%s", + if (destpad && gst_pad_link_filtered (srcpad, destpad, filtercaps)) { + GST_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (destpad)); return TRUE; } @@ -1465,8 +1465,8 @@ gst_element_connect_filtered (GstElement *src, GstElement *dest, (GST_PAD_PEER (destpad) == NULL)) { srcpad = gst_element_get_compatible_pad_filtered (src, destpad, filtercaps); - if (srcpad && gst_pad_connect_filtered (srcpad, destpad, filtercaps)) { - GST_DEBUG (GST_CAT_ELEMENT_PADS, "connected pad %s:%s to pad %s:%s", + if (srcpad && gst_pad_link_filtered (srcpad, destpad, filtercaps)) { + GST_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (destpad)); return TRUE; } @@ -1494,9 +1494,9 @@ gst_element_connect_filtered (GstElement *src, GstElement *dest, srctempl->name_template); destpad = gst_element_get_request_pad (dest, desttempl->name_template); - if (gst_pad_connect_filtered (srcpad, destpad, filtercaps)) { + if (gst_pad_link_filtered (srcpad, destpad, filtercaps)) { GST_DEBUG (GST_CAT_ELEMENT_PADS, - "connected pad %s:%s to pad %s:%s", + "linked pad %s:%s to pad %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (destpad)); return TRUE; @@ -1510,23 +1510,23 @@ gst_element_connect_filtered (GstElement *src, GstElement *dest, } } - GST_DEBUG (GST_CAT_ELEMENT_PADS, "no connection possible from %s to %s", + GST_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s to %s", GST_ELEMENT_NAME (src), GST_ELEMENT_NAME (dest)); return FALSE; } /** - * gst_element_connect_many: - * @element_1: the first #GstElement in the connection chain. - * @element_2: the second #GstElement in the connection chain. - * @...: the NULL-terminated list of elements to connect in order. + * gst_element_link_many: + * @element_1: the first #GstElement in the link chain. + * @element_2: the second #GstElement in the link chain. + * @...: the NULL-terminated list of elements to link in order. * - * Chain together a series of elements. Uses #gst_element_connect. + * Chain together a series of elements. Uses #gst_element_link. * * Returns: TRUE on success, FALSE otherwise. */ gboolean -gst_element_connect_many (GstElement *element_1, GstElement *element_2, ...) +gst_element_link_many (GstElement *element_1, GstElement *element_2, ...) { va_list args; @@ -1537,7 +1537,7 @@ gst_element_connect_many (GstElement *element_1, GstElement *element_2, ...) va_start (args, element_2); while (element_2) { - if (!gst_element_connect (element_1, element_2)) + if (!gst_element_link (element_1, element_2)) return FALSE; element_1 = element_2; @@ -1550,27 +1550,27 @@ gst_element_connect_many (GstElement *element_1, GstElement *element_2, ...) } /** - * gst_element_connect: + * gst_element_link: * @src: a #GstElement containing the source pad. * @dest: the #GstElement containing the destination pad. * * Connects the source to the destination element. - * The connection must be from source to destination, the other + * The link must be from source to destination, the other * direction will not be tried. * The functions looks for existing pads and request pads that aren't - * connected yet. If multiple connections are possible, only one is + * linked yet. If multiple links are possible, only one is * established. * - * Returns: TRUE if the elements could be connected. + * Returns: TRUE if the elements could be linked. */ gboolean -gst_element_connect (GstElement *src, GstElement *dest) +gst_element_link (GstElement *src, GstElement *dest) { - return gst_element_connect_filtered (src, dest, NULL); + return gst_element_link_filtered (src, dest, NULL); } /** - * gst_element_connect_pads_filtered: + * gst_element_link_pads_filtered: * @src: a #GstElement containing the source pad. * @srcpadname: the name of the #GstPad in source element. * @dest: the #GstElement containing the destination pad. @@ -1580,12 +1580,12 @@ gst_element_connect (GstElement *src, GstElement *dest) * Connects the two named pads of the source and destination elements. * Side effect is that if one of the pads has no parent, it becomes a * child of the parent of the other element. If they have different - * parents, the connection fails. + * parents, the link fails. * - * Returns: TRUE if the pads could be connected. + * Returns: TRUE if the pads could be linked. */ gboolean -gst_element_connect_pads_filtered (GstElement *src, const gchar *srcpadname, +gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname, GstCaps *filtercaps) { @@ -1610,12 +1610,12 @@ gst_element_connect_pads_filtered (GstElement *src, const gchar *srcpadname, return FALSE; } - /* we're satisified they can be connected, let's do it */ - return gst_pad_connect_filtered (srcpad, destpad, filtercaps); + /* we're satisified they can be linked, let's do it */ + return gst_pad_link_filtered (srcpad, destpad, filtercaps); } /** - * gst_element_connect_pads: + * gst_element_link_pads: * @src: a #GstElement containing the source pad. * @srcpadname: the name of the #GstPad in the source element. * @dest: the #GstElement containing the destination pad. @@ -1624,28 +1624,28 @@ gst_element_connect_pads_filtered (GstElement *src, const gchar *srcpadname, * Connects the two named pads of the source and destination elements. * Side effect is that if one of the pads has no parent, it becomes a * child of the parent of the other element. If they have different - * parents, the connection fails. + * parents, the link fails. * - * Returns: TRUE if the pads could be connected. + * Returns: TRUE if the pads could be linked. */ gboolean -gst_element_connect_pads (GstElement *src, const gchar *srcpadname, +gst_element_link_pads (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname) { - return gst_element_connect_pads_filtered (src, srcpadname, dest, destpadname, NULL); + return gst_element_link_pads_filtered (src, srcpadname, dest, destpadname, NULL); } /** - * gst_element_disconnect_pads: + * gst_element_unlink_pads: * @src: a #GstElement containing the source pad. * @srcpadname: the name of the #GstPad in source element. * @dest: a #GstElement containing the destination pad. * @destpadname: the name of the #GstPad in destination element. * - * Disconnects the two named pads of the source and destination elements. + * Unlinks the two named pads of the source and destination elements. */ void -gst_element_disconnect_pads (GstElement *src, const gchar *srcpadname, +gst_element_unlink_pads (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname) { GstPad *srcpad,*destpad; @@ -1669,20 +1669,20 @@ gst_element_disconnect_pads (GstElement *src, const gchar *srcpadname, return; } - /* we're satisified they can be disconnected, let's do it */ - gst_pad_disconnect(srcpad,destpad); + /* we're satisified they can be unlinked, let's do it */ + gst_pad_unlink (srcpad,destpad); } /** - * gst_element_disconnect_many: - * @element_1: the first #GstElement in the connection chain. - * @element_2: the second #GstElement in the connection chain. - * @...: the NULL-terminated list of elements to disconnect in order. + * gst_element_unlink_many: + * @element_1: the first #GstElement in the link chain. + * @element_2: the second #GstElement in the link chain. + * @...: the NULL-terminated list of elements to unlink in order. * - * Disconnects a series of elements. Uses #gst_element_disconnect. + * Unlinks a series of elements. Uses #gst_element_unlink. */ void -gst_element_disconnect_many (GstElement *element_1, GstElement *element_2, ...) +gst_element_unlink_many (GstElement *element_1, GstElement *element_2, ...) { va_list args; @@ -1692,7 +1692,7 @@ gst_element_disconnect_many (GstElement *element_1, GstElement *element_2, ...) va_start (args, element_2); while (element_2) { - gst_element_disconnect (element_1, element_2); + gst_element_unlink (element_1, element_2); element_1 = element_2; element_2 = va_arg (args, GstElement*); @@ -1702,15 +1702,15 @@ gst_element_disconnect_many (GstElement *element_1, GstElement *element_2, ...) } /** - * gst_element_disconnect: - * @src: the source #GstElement to disconnect. - * @dest: the sink #GstElement to disconnect. + * gst_element_unlink: + * @src: the source #GstElement to unlink. + * @dest: the sink #GstElement to unlink. * - * Disconnects all source pads of the source element with all sink pads - * of the sink element to which they are connected. + * Unlinks all source pads of the source element with all sink pads + * of the sink element to which they are linked. */ void -gst_element_disconnect (GstElement *src, GstElement *dest) +gst_element_unlink (GstElement *src, GstElement *dest) { const GList *srcpads; GstPad *pad; @@ -1718,20 +1718,20 @@ gst_element_disconnect (GstElement *src, GstElement *dest) g_return_if_fail (GST_IS_ELEMENT (src)); g_return_if_fail (GST_IS_ELEMENT (dest)); - GST_DEBUG (GST_CAT_ELEMENT_PADS, "disconnecting \"%s\" and \"%s\"", + GST_DEBUG (GST_CAT_ELEMENT_PADS, "unlinking \"%s\" and \"%s\"", GST_ELEMENT_NAME (src), GST_ELEMENT_NAME (dest)); srcpads = gst_element_get_pad_list (src); while (srcpads) { pad = GST_PAD_CAST (srcpads->data); - + if (GST_IS_REAL_PAD (pad) && GST_PAD_DIRECTION (pad) == GST_PAD_SRC) { GstPad *peerpad = GST_PAD_PEER (pad); - if (peerpad && + if (peerpad && (GST_OBJECT_PARENT (GST_PAD_PEER (peerpad)) == (GstObject*) src)) { - gst_pad_disconnect (pad, peerpad); + gst_pad_unlink (pad, peerpad); } } @@ -1772,7 +1772,7 @@ gst_element_get_random_pad (GstElement *element, GstPadDirection dir) return pad; } else { - GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is not connected", + GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is not linked", GST_DEBUG_PAD_NAME (pad)); } } @@ -1793,7 +1793,7 @@ gst_element_get_random_pad (GstElement *element, GstPadDirection dir) * Get an array of event masks from the element. * If the element doesn't * implement an event masks function, the query will be forwarded - * to a random connected sink pad. + * to a random linked sink pad. * * Returns: An array of #GstEventMask elements. */ @@ -2177,7 +2177,7 @@ gst_element_negotiate_pads (GstElement *element) srcpad = GST_PAD_REALIZE (pad); - /* if we have a connection on this pad and it doesn't have caps + /* 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)) { GstRealPad *sinkpad; @@ -2373,12 +2373,12 @@ gst_element_dispose (GObject *object) GstElement *element = GST_ELEMENT (object); GList *pads; GstPad *pad; - + GST_DEBUG_ELEMENT (GST_CAT_REFCOUNTING, element, "dispose"); gst_element_set_state (element, GST_STATE_NULL); - /* first we break all our connections with the ouside */ + /* first we break all our links with the ouside */ if (element->pads) { GList *orig; orig = pads = g_list_copy (element->pads); @@ -2386,9 +2386,9 @@ gst_element_dispose (GObject *object) pad = GST_PAD (pads->data); if (GST_PAD_PEER (pad)) { - GST_DEBUG (GST_CAT_REFCOUNTING, "disconnecting pad '%s'", + GST_DEBUG (GST_CAT_REFCOUNTING, "unlinking pad '%s'", GST_OBJECT_NAME (GST_OBJECT (GST_PAD (GST_PAD_PEER (pad))))); - gst_pad_disconnect (pad, GST_PAD (GST_PAD_PEER (pad))); + gst_pad_unlink (pad, GST_PAD (GST_PAD_PEER (pad))); } gst_element_remove_pad (element, pad); @@ -2410,7 +2410,7 @@ gst_element_dispose (GObject *object) element->prop_value_queue = NULL; if (element->property_mutex) g_mutex_free (element->property_mutex); - + G_OBJECT_CLASS (parent_class)->dispose (object); } @@ -2537,7 +2537,7 @@ gst_element_restore_thyself (GstObject *object, xmlNodePtr self) children = self->xmlChildrenNode; while (children) { if (!strcmp (children->name, "pad")) { - gst_pad_load_and_connect (children, GST_OBJECT (element)); + gst_pad_load_and_link (children, GST_OBJECT (element)); } children = children->next; } diff --git a/gst/gstelement.h b/gst/gstelement.h index 0219061a07..cf828be661 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -290,19 +290,19 @@ GstPadTemplate* gst_element_get_pad_template (GstElement *element, const gchar GList* gst_element_get_pad_template_list (GstElement *element); GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl); -gboolean gst_element_connect (GstElement *src, GstElement *dest); -gboolean gst_element_connect_many (GstElement *element_1, GstElement *element_2, ...); -gboolean gst_element_connect_filtered (GstElement *src, GstElement *dest, +gboolean gst_element_link (GstElement *src, GstElement *dest); +gboolean gst_element_link_many (GstElement *element_1, GstElement *element_2, ...); +gboolean gst_element_link_filtered (GstElement *src, GstElement *dest, GstCaps *filtercaps); -void gst_element_disconnect (GstElement *src, GstElement *dest); -void gst_element_disconnect_many (GstElement *element_1, GstElement *element_2, ...); +void gst_element_unlink (GstElement *src, GstElement *dest); +void gst_element_unlink_many (GstElement *element_1, GstElement *element_2, ...); -gboolean gst_element_connect_pads (GstElement *src, const gchar *srcpadname, +gboolean gst_element_link_pads (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname); -gboolean gst_element_connect_pads_filtered (GstElement *src, const gchar *srcpadname, +gboolean gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname, GstCaps *filtercaps); -void gst_element_disconnect_pads (GstElement *src, const gchar *srcpadname, +void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname); const GstEventMask* gst_element_get_event_masks (GstElement *element); diff --git a/gst/gstpad.c b/gst/gstpad.c index d6583eedce..fb114500a8 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -2,7 +2,7 @@ * Copyright (C) 1999,2000 Erik Walthinsen * 2000 Wim Taymans * - * gstpad.c: Pads for connecting elements together + * gstpad.c: Pads for linking elements together * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -47,7 +47,7 @@ GType _gst_pad_type = 0; static void gst_pad_class_init (GstPadClass *klass); static void gst_pad_init (GstPad *pad); -static gboolean gst_pad_try_reconnect_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad, +static gboolean gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad, GstCaps *caps, gboolean clear); #ifndef GST_DISABLE_LOADSAVE @@ -160,13 +160,13 @@ gst_real_pad_class_init (GstRealPadClass *klass) gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); gst_real_pad_signals[REAL_CONNECTED] = - g_signal_new ("connected", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstRealPadClass, connected), NULL, NULL, + 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] = - g_signal_new ("disconnected", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstRealPadClass, disconnected), NULL, NULL, + 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, G_TYPE_POINTER); @@ -201,14 +201,14 @@ gst_real_pad_init (GstRealPad *pad) pad->ghostpads = NULL; pad->caps = NULL; - pad->connectfunc = NULL; + pad->linkfunc = NULL; pad->getcapsfunc = NULL; pad->convertfunc = gst_pad_convert_default; pad->eventfunc = gst_pad_event_default; pad->convertfunc = gst_pad_convert_default; pad->queryfunc = gst_pad_query_default; - pad->intconnfunc = gst_pad_get_internal_connections_default; + pad->intconnfunc = gst_pad_get_internal_links_default; pad->eventmaskfunc = gst_pad_get_event_masks_default; pad->formatsfunc = gst_pad_get_formats_default; @@ -695,21 +695,21 @@ gst_pad_get_query_types_default (GstPad *pad) } /** - * gst_pad_set_internal_connection_function: - * @pad: a #GstPad to set the internal connection function for. + * gst_pad_set_internal_link_function: + * @pad: a #GstPad to set the internal link function for. * @intconn: the #GstPadIntConnFunction to set. * - * Sets the given internal connection function for the pad. + * Sets the given internal link function for the pad. */ void -gst_pad_set_internal_connection_function (GstPad *pad, +gst_pad_set_internal_link_function (GstPad *pad, GstPadIntConnFunction intconn) { g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_INTCONNFUNC (pad) = intconn; - GST_DEBUG (GST_CAT_PADS, "internal connection for %s:%s set to %s", + GST_DEBUG (GST_CAT_PADS, "internal link for %s:%s set to %s", GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (intconn)); } @@ -732,23 +732,23 @@ gst_pad_set_formats_function (GstPad *pad, GstPadFormatsFunction formats) } /** - * gst_pad_set_connect_function: - * @pad: a #GstPad to set the connect function for. - * @connect: the #GstPadConnectFunction to set. + * gst_pad_set_link_function: + * @pad: a #GstPad to set the link function for. + * @link: the #GstPadConnectFunction to set. * - * Sets the given connect function for the pad. It will be called - * when the pad is connected or reconnected with caps. + * Sets the given link function for the pad. It will be called + * when the pad is linked or relinked with caps. */ void -gst_pad_set_connect_function (GstPad *pad, - GstPadConnectFunction connect) +gst_pad_set_link_function (GstPad *pad, + GstPadConnectFunction link) { g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_REAL_PAD (pad)); - GST_RPAD_CONNECTFUNC (pad) = connect; - GST_DEBUG (GST_CAT_PADS, "connectfunc for %s:%s set to %s", - GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (connect)); + GST_RPAD_CONNECTFUNC (pad) = link; + GST_DEBUG (GST_CAT_PADS, "linkfunc for %s:%s set to %s", + GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (link)); } /** @@ -791,14 +791,14 @@ gst_pad_set_bufferpool_function (GstPad *pad, } /** - * gst_pad_disconnect: - * @srcpad: the source #GstPad to disconnect. - * @sinkpad: the sink #GstPad to disconnect. + * gst_pad_unlink: + * @srcpad: the source #GstPad to unlink. + * @sinkpad: the sink #GstPad to unlink. * - * Disconnects the source pad from the sink pad. + * Unlinks the source pad from the sink pad. */ void -gst_pad_disconnect (GstPad *srcpad, +gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad) { GstRealPad *realsrc, *realsink; @@ -810,7 +810,7 @@ gst_pad_disconnect (GstPad *srcpad, g_return_if_fail (sinkpad != NULL); g_return_if_fail (GST_IS_PAD (sinkpad)); - GST_INFO (GST_CAT_ELEMENT_PADS, "disconnecting %s:%s(%p) and %s:%s(%p)", + GST_INFO (GST_CAT_ELEMENT_PADS, "unlinking %s:%s(%p) and %s:%s(%p)", GST_DEBUG_PAD_NAME (srcpad), srcpad, GST_DEBUG_PAD_NAME (sinkpad), sinkpad); @@ -832,7 +832,7 @@ gst_pad_disconnect (GstPad *srcpad, g_return_if_fail ((GST_RPAD_DIRECTION (realsrc) == GST_PAD_SRC) && (GST_RPAD_DIRECTION (realsink) == GST_PAD_SINK)); - /* get the schedulers before we disconnect */ + /* get the schedulers before we unlink */ src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc)); sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsink)); @@ -849,7 +849,7 @@ gst_pad_disconnect (GstPad *srcpad, /* now tell the scheduler */ if (src_sched && src_sched == sink_sched) { - gst_scheduler_pad_disconnect (src_sched, + gst_scheduler_pad_unlink (src_sched, GST_PAD_CAST (realsrc), GST_PAD_CAST (realsink)); } @@ -858,13 +858,13 @@ gst_pad_disconnect (GstPad *srcpad, gst_object_ref (GST_OBJECT (realsink)); /* fire off a signal to each of the pads telling them - * that they've been disconnected */ + * that they've been unlinked */ g_signal_emit (G_OBJECT (realsrc), gst_real_pad_signals[REAL_DISCONNECTED], 0, realsink); g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_DISCONNECTED], 0, realsrc); - GST_INFO (GST_CAT_ELEMENT_PADS, "disconnected %s:%s and %s:%s", + GST_INFO (GST_CAT_ELEMENT_PADS, "unlinked %s:%s and %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); gst_object_unref (GST_OBJECT (realsrc)); @@ -879,7 +879,7 @@ gst_pad_check_schedulers (GstRealPad *realsrc, GstRealPad *realsink) src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc)); sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsink)); - + if (src_sched && sink_sched) { if (GST_FLAG_IS_SET (GST_PAD_PARENT (realsrc), GST_ELEMENT_DECOUPLED)) num_decoupled++; @@ -894,18 +894,18 @@ gst_pad_check_schedulers (GstRealPad *realsrc, GstRealPad *realsink) } /** - * gst_pad_can_connect_filtered: - * @srcpad: the source #GstPad to connect. - * @sinkpad: the sink #GstPad to connect. + * gst_pad_can_link_filtered: + * @srcpad: the source #GstPad to link. + * @sinkpad: the sink #GstPad to link. * @filtercaps: the filter #GstCaps. * - * Checks if the source pad and the sink pad can be connected when constrained - * by the given filter caps. + * Checks if the source pad and the sink pad can be linked when constrained + * by the given filter caps. * - * Returns: TRUE if the pads can be connected, FALSE otherwise. + * Returns: TRUE if the pads can be linked, FALSE otherwise. */ gboolean -gst_pad_can_connect_filtered (GstPad *srcpad, GstPad *sinkpad, +gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) { GstRealPad *realsrc, *realsink; @@ -926,48 +926,48 @@ gst_pad_can_connect_filtered (GstPad *srcpad, GstPad *sinkpad, g_return_val_if_fail (GST_PAD_PARENT (realsink) != NULL, FALSE); if (!gst_pad_check_schedulers (realsrc, realsink)) { - g_warning ("connecting pads with different scheds requires " + g_warning ("linking pads with different scheds requires " "exactly one decoupled element (queue)"); return FALSE; } - + /* check if the directions are compatible */ if (!(((GST_RPAD_DIRECTION (realsrc) == GST_PAD_SINK) && (GST_RPAD_DIRECTION (realsink) == GST_PAD_SRC)) || ((GST_RPAD_DIRECTION (realsrc) == GST_PAD_SRC) && (GST_RPAD_DIRECTION (realsink) == GST_PAD_SINK)))) return FALSE; - + return TRUE; } /** - * gst_pad_can_connect: - * @srcpad: the source #GstPad to connect. - * @sinkpad: the sink #GstPad to connect. + * gst_pad_can_link: + * @srcpad: the source #GstPad to link. + * @sinkpad: the sink #GstPad to link. * - * Checks if the source pad and the sink pad can be connected. + * Checks if the source pad and the sink pad can be link. * - * Returns: TRUE if the pads can be connected, FALSE otherwise. + * Returns: TRUE if the pads can be linked, FALSE otherwise. */ gboolean -gst_pad_can_connect (GstPad *srcpad, GstPad *sinkpad) +gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad) { - return gst_pad_can_connect_filtered (srcpad, sinkpad, NULL); + return gst_pad_can_link_filtered (srcpad, sinkpad, NULL); } /** - * gst_pad_connect_filtered: - * @srcpad: the source #GstPad to connect. - * @sinkpad: the sink #GstPad to connect. + * gst_pad_link_filtered: + * @srcpad: the source #GstPad to link. + * @sinkpad: the sink #GstPad to link. * @filtercaps: the filter #GstCaps. * - * Connects the source pad and the sink pad can be connected, constrained - * by the given filter caps. + * Links the source pad and the sink pad, constrained + * by the given filter caps. * - * Returns: TRUE if the pads have been connected, FALSE otherwise. + * Returns: TRUE if the pads have been linked, FALSE otherwise. */ gboolean -gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) +gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) { GstRealPad *realsrc, *realsink; GstScheduler *src_sched, *sink_sched; @@ -978,7 +978,7 @@ gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) g_return_val_if_fail (sinkpad != NULL, FALSE); g_return_val_if_fail (GST_IS_PAD (sinkpad), FALSE); - GST_INFO (GST_CAT_PADS, "trying to connect %s:%s and %s:%s", + GST_INFO (GST_CAT_PADS, "trying to link %s:%s and %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); /* now we need to deal with the real/ghost stuff */ @@ -986,7 +986,7 @@ gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) realsink = GST_PAD_REALIZE (sinkpad); if ((GST_PAD (realsrc) != srcpad) || (GST_PAD (realsink) != sinkpad)) { - GST_INFO (GST_CAT_PADS, "*actually* connecting %s:%s and %s:%s", + GST_INFO (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s", GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink)); } if (GST_RPAD_PEER (realsrc) != NULL) { @@ -1011,7 +1011,7 @@ gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) } if (!gst_pad_check_schedulers (realsrc, realsink)) { - g_warning ("connecting pads with different scheds requires " + g_warning ("linking pads with different scheds requires " "exactly one decoupled element (such as queue)"); return FALSE; } @@ -1040,9 +1040,9 @@ gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) GST_RPAD_PEER (realsink) = realsrc; /* try to negotiate the pads, we don't need to clear the caps here */ - if (!gst_pad_try_reconnect_filtered_func (realsrc, realsink, + if (!gst_pad_try_relink_filtered_func (realsrc, realsink, filtercaps, FALSE)) { - GST_DEBUG (GST_CAT_CAPS, "reconnect_filtered_func failed, can't connect"); + GST_DEBUG (GST_CAT_CAPS, "relink_filtered_func failed, can't link"); GST_RPAD_PEER (realsrc) = NULL; GST_RPAD_PEER (realsink) = NULL; @@ -1051,7 +1051,7 @@ gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) } /* fire off a signal to each of the pads telling them - * that they've been connected */ + * that they've been linked */ g_signal_emit (G_OBJECT (realsrc), gst_real_pad_signals[REAL_CONNECTED], 0, realsink); g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_CONNECTED], @@ -1062,31 +1062,31 @@ gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) /* now tell the scheduler */ if (src_sched && src_sched == sink_sched) { - gst_scheduler_pad_connect (src_sched, + gst_scheduler_pad_link (src_sched, GST_PAD_CAST (realsrc), GST_PAD_CAST (realsink)); } - GST_INFO (GST_CAT_PADS, "connected %s:%s and %s:%s, successful", + GST_INFO (GST_CAT_PADS, "linked %s:%s and %s:%s, successful", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); gst_caps_debug (gst_pad_get_caps (GST_PAD_CAST (realsrc)), - "caps of newly connected src pad"); + "caps of newly linked src pad"); return TRUE; } /** - * gst_pad_connect: - * @srcpad: the source #GstPad to connect. - * @sinkpad: the sink #GstPad to connect. + * gst_pad_link: + * @srcpad: the source #GstPad to link. + * @sinkpad: the sink #GstPad to link. * * Connects the source pad to the sink pad. * - * Returns: TRUE if the pad could be connected, FALSE otherwise. + * Returns: TRUE if the pad could be linked, FALSE otherwise. */ gboolean -gst_pad_connect (GstPad *srcpad, GstPad *sinkpad) +gst_pad_link (GstPad *srcpad, GstPad *sinkpad) { - return gst_pad_connect_filtered (srcpad, sinkpad, NULL); + return gst_pad_link_filtered (srcpad, sinkpad, NULL); } /** @@ -1264,8 +1264,8 @@ gst_pad_get_ghost_pad_list (GstPad *pad) /* an internal caps negotiation helper function: * - * 1. optionally calls the pad connect function with the provided caps - * 2. deals with the result code of the connect function + * 1. optionally calls the pad link function with the provided caps + * 2. deals with the result code of the link function * 3. sets fixed caps on the pad. */ static GstPadConnectReturn @@ -1320,13 +1320,13 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) * padtemplate caps is the same as caps itself */ } - /* we need to notify the connect function */ + /* we need to notify the link function */ if (notify && GST_RPAD_CONNECTFUNC (pad)) { GstPadConnectReturn res; gchar *debug_string; gboolean negotiating; - GST_INFO (GST_CAT_CAPS, "calling connect function on pad %s:%s", + GST_INFO (GST_CAT_CAPS, "calling link function on pad %s:%s", GST_DEBUG_PAD_NAME (pad)); negotiating = GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING); @@ -1335,7 +1335,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) if (!negotiating) GST_FLAG_SET (pad, GST_PAD_NEGOTIATING); - /* call the connect function */ + /* call the link function */ res = GST_RPAD_CONNECTFUNC (pad) (GST_PAD (pad), caps); /* unset again after negotiating only if we set it */ @@ -1356,16 +1356,16 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) debug_string = "DELAYED"; break; default: - g_warning ("unknown return code from connect function of pad %s:%s %d", + g_warning ("unknown return code from link function of pad %s:%s %d", GST_DEBUG_PAD_NAME (pad), res); return GST_PAD_CONNECT_REFUSED; } GST_INFO (GST_CAT_CAPS, - "got reply %s (%d) from connect function on pad %s:%s", + "got reply %s (%d) from link function on pad %s:%s", debug_string, res, GST_DEBUG_PAD_NAME (pad)); - /* done means the connect function called another caps negotiate function + /* 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) { GST_INFO (GST_CAT_CAPS, "pad %s:%s is done", GST_DEBUG_PAD_NAME (pad)); @@ -1434,7 +1434,7 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps) } /* if we have a peer try to set the caps, notifying the peerpad - * if it has a connect function */ + * if it has a link function */ if (peer && ((set_retval = gst_pad_try_set_caps_func (peer, caps, TRUE)) <= 0)) { GST_INFO (GST_CAT_CAPS, "tried to set caps on peerpad %s:%s but couldn't, return value %d", @@ -1466,7 +1466,7 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps) * 6. starts the caps negotiation. */ static gboolean -gst_pad_try_reconnect_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad, +gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad, GstCaps *filtercaps, gboolean clear) { GstCaps *srccaps, *sinkcaps; @@ -1482,25 +1482,25 @@ gst_pad_try_reconnect_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad, /* optinally clear the caps */ if (clear) { GST_INFO (GST_CAT_PADS, - "start reconnect filtered %s:%s and %s:%s, clearing caps", + "start relink filtered %s:%s and %s:%s, clearing caps", GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink)); GST_PAD_CAPS (GST_PAD (realsrc)) = NULL; GST_PAD_CAPS (GST_PAD (realsink)) = NULL; } else { - GST_INFO (GST_CAT_PADS, "start reconnect filtered %s:%s and %s:%s", + GST_INFO (GST_CAT_PADS, "start relink filtered %s:%s and %s:%s", GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink)); } srccaps = gst_pad_get_caps (GST_PAD (realsrc)); GST_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s", GST_DEBUG_PAD_NAME (realsrc)); - gst_caps_debug (srccaps, "caps of src pad (pre-reconnect)"); + gst_caps_debug (srccaps, "caps of src pad (pre-relink)"); sinkcaps = gst_pad_get_caps (GST_PAD (realsink)); GST_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s", GST_DEBUG_PAD_NAME (realsink)); - gst_caps_debug (sinkcaps, "caps of sink pad (pre-reconnect)"); + gst_caps_debug (sinkcaps, "caps of sink pad (pre-relink)"); /* first take the intersection of the pad caps */ intersection = gst_caps_intersect (srccaps, sinkcaps); @@ -1528,7 +1528,7 @@ gst_pad_try_reconnect_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad, if (!filtered_intersection) { GST_INFO (GST_CAT_PADS, - "filtered connection between pads %s:%s and %s:%s is empty", + "filtered link between pads %s:%s and %s:%s is empty", GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink)); return FALSE; } @@ -1539,8 +1539,8 @@ gst_pad_try_reconnect_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad, GST_RPAD_APPFILTER (realsrc) = filtercaps; } } - GST_DEBUG (GST_CAT_CAPS, "setting filter for connection to:"); - gst_caps_debug (intersection, "filter for connection"); + GST_DEBUG (GST_CAT_CAPS, "setting filter for link to:"); + gst_caps_debug (intersection, "filter for link"); /* both the app filter and the filter, while stored on both peer pads, * are equal to the same thing on both */ @@ -1577,9 +1577,9 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad) filter = GST_RPAD_APPFILTER (realsrc); if (filter) { - GST_INFO (GST_CAT_PADS, "dumping filter for connection %s:%s-%s:%s", + GST_INFO (GST_CAT_PADS, "dumping filter for link %s:%s-%s:%s", GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink)); - gst_caps_debug (filter, "connection filter caps"); + gst_caps_debug (filter, "link filter caps"); } /* calculate the new caps here */ @@ -1620,18 +1620,18 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad) } /** - * gst_pad_try_reconnect_filtered: - * @srcpad: the source #GstPad to reconnect. - * @sinkpad: the sink #GstPad to reconnect. - * @filtercaps: the #GstPad to use as a filter in the reconnection. + * gst_pad_try_relink_filtered: + * @srcpad: the source #GstPad to relink. + * @sinkpad: the sink #GstPad to relink. + * @filtercaps: the #GstPad to use as a filter in the relink. * - * Tries to reconnect the given source and sink pad, constrained by the given + * Tries to relink the given source and sink pad, constrained by the given * capabilities. * * Returns: TRUE if the pads were succesfully renegotiated, FALSE otherwise. */ gboolean -gst_pad_try_reconnect_filtered (GstPad *srcpad, GstPad *sinkpad, +gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) { GstRealPad *realsrc, *realsink; @@ -1645,24 +1645,24 @@ gst_pad_try_reconnect_filtered (GstPad *srcpad, GstPad *sinkpad, g_return_val_if_fail (GST_RPAD_PEER (realsrc) != NULL, FALSE); g_return_val_if_fail (GST_RPAD_PEER (realsink) == realsrc, FALSE); - return gst_pad_try_reconnect_filtered_func (realsrc, realsink, + return gst_pad_try_relink_filtered_func (realsrc, realsink, filtercaps, TRUE); } /** - * gst_pad_reconnect_filtered: - * @srcpad: the source #GstPad to reconnect. - * @sinkpad: the sink #GstPad to reconnect. - * @filtercaps: the #GstPad to use as a filter in the reconnection. + * gst_pad_relink_filtered: + * @srcpad: the source #GstPad to relink. + * @sinkpad: the sink #GstPad to relink. + * @filtercaps: the #GstPad to use as a filter in the relink. * - * Reconnects the given source and sink pad, constrained by the given - * capabilities. If the reconnection fails, the pads are disconnected + * Relinks the given source and sink pad, constrained by the given + * capabilities. If the relink fails, the pads are unlinked * and FALSE is returned. * - * Returns: TRUE if the pads were succesfully reconnected, FALSE otherwise. + * Returns: TRUE if the pads were succesfully relinked, FALSE otherwise. */ gboolean -gst_pad_reconnect_filtered (GstPad *srcpad, GstPad *sinkpad, +gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) { GstRealPad *realsrc, *realsink; @@ -1676,25 +1676,25 @@ gst_pad_reconnect_filtered (GstPad *srcpad, GstPad *sinkpad, g_return_val_if_fail (GST_RPAD_PEER (realsrc) != NULL, FALSE); g_return_val_if_fail (GST_RPAD_PEER (realsink) == realsrc, FALSE); - if (! gst_pad_try_reconnect_filtered_func (realsrc, realsink, + if (! gst_pad_try_relink_filtered_func (realsrc, realsink, filtercaps, TRUE)) { - gst_pad_disconnect (srcpad, GST_PAD (GST_PAD_PEER (srcpad))); + gst_pad_unlink (srcpad, GST_PAD (GST_PAD_PEER (srcpad))); return FALSE; } return TRUE; } /** - * gst_pad_proxy_connect: + * gst_pad_proxy_link: * @pad: a #GstPad to proxy to. * @caps: the #GstCaps to use in proxying. * - * Proxies the connect function to the specified pad. + * Proxies the link function to the specified pad. * * Returns: TRUE if the peer pad accepted the caps, FALSE otherwise. */ GstPadConnectReturn -gst_pad_proxy_connect (GstPad *pad, GstCaps *caps) +gst_pad_proxy_link (GstPad *pad, GstCaps *caps) { GstRealPad *peer, *realpad; @@ -1702,7 +1702,7 @@ gst_pad_proxy_connect (GstPad *pad, GstCaps *caps) peer = GST_RPAD_PEER (realpad); - GST_INFO (GST_CAT_CAPS, "proxy connect to pad %s:%s", + GST_INFO (GST_CAT_CAPS, "proxy link to pad %s:%s", GST_DEBUG_PAD_NAME (realpad)); if (peer && gst_pad_try_set_caps_func (peer, caps, TRUE) < 0) @@ -1874,8 +1874,8 @@ gst_pad_get_allowed_caps (GstPad *pad) * gst_pad_recalc_allowed_caps: * @pad: a #GstPad to recalculate the capablities of. * - * Attempts to reconnect the pad to its peer through its filter, - * set with gst_pad_[re]connect_filtered. This function is useful when a + * Attempts to relink the pad to its peer through its filter, + * set with gst_pad_[re]link_filtered. This function is useful when a * plug-in has new capabilities on a pad and wants to notify the peer. * * Returns: TRUE on success, FALSE otherwise. @@ -1893,7 +1893,7 @@ gst_pad_recalc_allowed_caps (GstPad *pad) peer = GST_RPAD_PEER (pad); if (peer) - return gst_pad_try_reconnect_filtered (pad, GST_PAD (peer), + return gst_pad_try_relink_filtered (pad, GST_PAD (peer), GST_RPAD_APPFILTER (pad)); return TRUE; @@ -1942,8 +1942,8 @@ gst_real_pad_dispose (GObject *object) { GstPad *pad = GST_PAD (object); - /* No connected pad can ever be disposed. - * It has to have a parent to be connected + /* No linked pad can ever be disposed. + * It has to have a parent to be linked * and a parent would hold a reference */ g_assert (GST_PAD_PEER (pad) == NULL); @@ -1991,15 +1991,15 @@ gst_real_pad_dispose (GObject *object) #ifndef GST_DISABLE_LOADSAVE /* FIXME: why isn't this on a GstElement ? */ /** - * gst_pad_load_and_connect: + * gst_pad_load_and_link: * @self: an #xmlNodePtr to read the description from. * @parent: the #GstObject element that owns the pad. * - * Reads the pad definition from the XML node and connects the given pad + * Reads the pad definition from the XML node and links the given pad * in the element to a pad of an element up in the hierarchy. */ void -gst_pad_load_and_connect (xmlNodePtr self, GstObject *parent) +gst_pad_load_and_link (xmlNodePtr self, GstObject *parent) { xmlNodePtr field = self->xmlChildrenNode; GstPad *pad = NULL, *targetpad; @@ -2026,7 +2026,7 @@ gst_pad_load_and_connect (xmlNodePtr self, GstObject *parent) if (split[0] == NULL || split[1] == NULL) { GST_DEBUG (GST_CAT_XML, - "Could not parse peer '%s' for pad %s:%s, leaving unconnected", + "Could not parse peer '%s' for pad %s:%s, leaving unlinked", peer, GST_DEBUG_PAD_NAME (pad)); return; } @@ -2048,7 +2048,7 @@ gst_pad_load_and_connect (xmlNodePtr self, GstObject *parent) if (targetpad == NULL) goto cleanup; - gst_pad_connect (pad, targetpad); + gst_pad_link (pad, targetpad); cleanup: g_strfreev (split); @@ -2141,7 +2141,7 @@ gst_pad_push (GstPad *pad, GstBuffer *buf) peer = GST_RPAD_PEER (pad); if (!peer) { - g_warning ("push on pad %s:%s but it is unconnected", + g_warning ("push on pad %s:%s but it is unlinked", GST_DEBUG_PAD_NAME (pad)); } else { @@ -2200,7 +2200,7 @@ gst_pad_pull (GstPad *pad) if (!peer) { gst_element_error (GST_PAD_PARENT (pad), - "pull on pad %s:%s but it was unconnected", + "pull on pad %s:%s but it was unlinked", GST_ELEMENT_NAME (GST_PAD_PARENT (pad)), GST_PAD_NAME (pad), NULL); } @@ -2571,10 +2571,10 @@ gst_ghost_pad_new (const gchar *name, } /** - * gst_pad_get_internal_connections_default: - * @pad: the #GstPad to get the internal connections of. + * gst_pad_get_internal_links_default: + * @pad: the #GstPad to get the internal links of. * - * Gets a list of pads to which the given pad is connected to + * Gets a list of pads to which the given pad is linked to * inside of the parent element. * This is the default handler, and thus returns a list of all of the * pads inside the parent element with opposite direction. @@ -2583,7 +2583,7 @@ gst_ghost_pad_new (const gchar *name, * Returns: a newly allocated #GList of pads. */ GList* -gst_pad_get_internal_connections_default (GstPad *pad) +gst_pad_get_internal_links_default (GstPad *pad) { GList *res = NULL; GstElement *parent; @@ -2613,17 +2613,17 @@ gst_pad_get_internal_connections_default (GstPad *pad) } /** - * gst_pad_get_internal_connections: - * @pad: the #GstPad to get the internal connections of. + * gst_pad_get_internal_links: + * @pad: the #GstPad to get the internal links of. * - * Gets a list of pads to which the given pad is connected to + * Gets a list of pads to which the given pad is linked to * inside of the parent element. * The caller must free this list after use. * * Returns: a newly allocated #GList of pads. */ GList* -gst_pad_get_internal_connections (GstPad *pad) +gst_pad_get_internal_links (GstPad *pad) { GList *res = NULL; GstRealPad *rpad; @@ -2649,7 +2649,7 @@ gst_pad_event_default_dispatch (GstPad *pad, GstElement *element, GstPad *eventpad = GST_PAD (pads->data); pads = g_list_next (pads); - /* for all pads in the opposite direction that are connected */ + /* for all pads in the opposite direction that are linked */ if (GST_PAD_DIRECTION (eventpad) != GST_PAD_DIRECTION (pad) && GST_PAD_IS_CONNECTED (eventpad)) { if (GST_PAD_DIRECTION (eventpad) == GST_PAD_SRC) { @@ -2721,7 +2721,7 @@ gst_pad_event_default (GstPad *pad, GstEvent *event) * @data: gpointer user data passed to the dispatcher function. * * Invokes the given dispatcher function on all pads that are - * internally connected to the given pad. + * internally linked to the given pad. * The GstPadDispatcherFunction should return TRUE when no further pads * need to be processed. * @@ -2737,7 +2737,7 @@ gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, g_return_val_if_fail (GST_IS_PAD (pad), FALSE); g_return_val_if_fail (data, FALSE); - orig = int_pads = gst_pad_get_internal_connections (pad); + orig = int_pads = gst_pad_get_internal_links (pad); while (int_pads) { GstRealPad *int_rpad = GST_PAD_REALIZE (int_pads->data); @@ -2818,7 +2818,7 @@ gst_pad_convert_dispatcher (GstPad *pad, GstPadConvertData *data) * * Invokes the default converter on a pad. * This will forward the call to the pad obtained - * using the internal connection of + * using the internal link of * the element. * * Returns: TRUE if the conversion could be performed. diff --git a/gst/gstpad.h b/gst/gstpad.h index 03a8a79c81..05b929d5d9 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -188,7 +188,7 @@ struct _GstRealPad { GstPadDirection direction; - GstPadConnectFunction connectfunc; + GstPadConnectFunction linkfunc; GstRealPad *peer; gpointer sched_private; @@ -221,8 +221,8 @@ struct _GstRealPadClass { /* signal callbacks */ void (*caps_nego_failed) (GstPad *pad); - void (*connected) (GstPad *pad, GstPad *peer); - void (*disconnected) (GstPad *pad, GstPad *peer); + void (*linked) (GstPad *pad, GstPad *peer); + void (*unlinked) (GstPad *pad, GstPad *peer); }; struct _GstGhostPad { @@ -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))->connectfunc) +#define GST_RPAD_CONNECTFUNC(pad) (((GstRealPad *)(pad))->linkfunc) #define GST_RPAD_GETCAPSFUNC(pad) (((GstRealPad *)(pad))->getcapsfunc) #define GST_RPAD_BUFFERPOOLFUNC(pad) (((GstRealPad *)(pad))->bufferpoolfunc) @@ -418,14 +418,14 @@ void gst_pad_set_event_mask_function (GstPad *pad, GstPadEventMaskFunction ma const GstEventMask* gst_pad_get_event_masks (GstPad *pad); const GstEventMask* gst_pad_get_event_masks_default (GstPad *pad); -/* pad connections */ -void gst_pad_set_connect_function (GstPad *pad, GstPadConnectFunction connect); -gboolean gst_pad_can_connect (GstPad *srcpad, GstPad *sinkpad); -gboolean gst_pad_can_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); +/* pad links */ +void gst_pad_set_link_function (GstPad *pad, GstPadConnectFunction link); +gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad); +gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); -gboolean gst_pad_connect (GstPad *srcpad, GstPad *sinkpad); -gboolean gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); -void gst_pad_disconnect (GstPad *srcpad, GstPad *sinkpad); +gboolean gst_pad_link (GstPad *srcpad, GstPad *sinkpad); +gboolean gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); +void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad); GstPad* gst_pad_get_peer (GstPad *pad); @@ -436,10 +436,10 @@ GstPadConnectReturn gst_pad_try_set_caps (GstPad *pad, GstCaps *caps); gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad); void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps); -GstPadConnectReturn gst_pad_proxy_connect (GstPad *pad, GstCaps *caps); -gboolean gst_pad_reconnect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); +GstPadConnectReturn gst_pad_proxy_link (GstPad *pad, GstCaps *caps); +gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad); -gboolean gst_pad_try_reconnect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); +gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps); GstCaps* gst_pad_get_allowed_caps (GstPad *pad); gboolean gst_pad_recalc_allowed_caps (GstPad *pad); @@ -475,9 +475,9 @@ gboolean gst_pad_query (GstPad *pad, GstQueryType type, gboolean gst_pad_query_default (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value); -void gst_pad_set_internal_connection_function(GstPad *pad, GstPadIntConnFunction intconn); -GList* gst_pad_get_internal_connections (GstPad *pad); -GList* gst_pad_get_internal_connections_default (GstPad *pad); +void gst_pad_set_internal_link_function(GstPad *pad, GstPadIntConnFunction intconn); +GList* gst_pad_get_internal_links (GstPad *pad); +GList* gst_pad_get_internal_links_default (GstPad *pad); /* misc helper functions */ gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, @@ -489,7 +489,7 @@ gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch (gst_probe_dispatcher_remove_probe (&(GST_REAL_PAD (pad)-probedisp), probe)) #ifndef GST_DISABLE_LOADSAVE -void gst_pad_load_and_connect (xmlNodePtr self, GstObject *parent); +void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent); #endif diff --git a/gst/gstparse.c b/gst/gstparse.c index 01efa01a86..e099ef4c80 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -42,7 +42,7 @@ typedef struct GstElement *target_element; GstElement *pipeline; } -dynamic_connection_t; +dynamic_link_t; GQuark @@ -55,9 +55,9 @@ gst_parse_error_quark (void) } G_GNUC_UNUSED static void -dynamic_connect (GstElement * element, GstPad * newpad, gpointer data) +dynamic_link (GstElement * element, GstPad * newpad, gpointer data) { - dynamic_connection_t *dc = (dynamic_connection_t *) data; + dynamic_link_t *dc = (dynamic_link_t *) data; gboolean warn = TRUE; /* do we know the exact srcpadname? */ @@ -83,8 +83,8 @@ dynamic_connect (GstElement * element, GstPad * newpad, gpointer data) } if (!GST_PAD_IS_CONNECTED (dc->target_pad) && !GST_PAD_IS_CONNECTED (newpad)) { gst_element_set_state (dc->pipeline, GST_STATE_PAUSED); - if (!gst_pad_connect (newpad, dc->target_pad) && warn) { - g_warning ("could not connect %s:%s to %s:%s", GST_DEBUG_PAD_NAME (newpad), + if (!gst_pad_link (newpad, dc->target_pad) && warn) { + g_warning ("could not link %s:%s to %s:%s", GST_DEBUG_PAD_NAME (newpad), GST_DEBUG_PAD_NAME (dc->target_pad)); } gst_element_set_state (dc->pipeline, GST_STATE_PLAYING); @@ -219,19 +219,19 @@ find_element_by_index (graph_t *g, gint i) } static gboolean -make_connections (graph_t *g, GError **error) +make_links (graph_t *g, GError **error) { GList *l, *a, *b; - connection_t *c; - dynamic_connection_t *dc; + link_t *c; + dynamic_link_t *dc; GstElement *src, *sink; GstPad *p1, *p2; GstPadTemplate *pt1, *pt2; GstCaps *caps; - l = g->connections; + l = g->links; while (l) { - c = (connection_t*)l->data; + c = (link_t*)l->data; if (c->src_name) { if (!(src = gst_bin_get_by_name (GST_BIN (g->bin), c->src_name))) { g_set_error (error, @@ -265,7 +265,7 @@ make_connections (graph_t *g, GError **error) gst_caps_debug (caps, "foo"); /* g_print ("a: %p, b: %p\n", a, b); */ if (a && b) { - /* balanced multipad connection */ + /* balanced multipad link */ while (a && b) { p1 = gst_element_get_pad (src, (gchar*)a->data); p2 = gst_element_get_pad (sink, (gchar*)b->data); @@ -275,21 +275,21 @@ make_connections (graph_t *g, GError **error) if (!p1 && p2 && (pt1 = gst_element_get_pad_template (src, (gchar*)a->data)) && pt1->presence == GST_PAD_SOMETIMES) { - dc = g_new0 (dynamic_connection_t, 1); + dc = g_new0 (dynamic_link_t, 1); dc->srcpadname = (gchar*)a->data; dc->target_pad = p2; dc->target_element = sink; dc->pipeline = g->bin; - GST_DEBUG (GST_CAT_PIPELINE, "setting up dynamic connection %s:%s and %s:%s", + GST_DEBUG (GST_CAT_PIPELINE, "setting up dynamic link %s:%s and %s:%s", GST_OBJECT_NAME (GST_OBJECT (src)), (gchar*)a->data, GST_DEBUG_PAD_NAME (p2)); - g_signal_connect (G_OBJECT (src), "new_pad", G_CALLBACK (dynamic_connect), dc); + g_signal_connect (G_OBJECT (src), "new_pad", G_CALLBACK (dynamic_link), dc); } else if (!p1) { goto could_not_get_pad_a; - } else if (!gst_pad_connect_filtered (p1, p2, caps)) { - goto could_not_connect_pads; + } else if (!gst_pad_link_filtered (p1, p2, caps)) { + goto could_not_link_pads; } a = g_list_next (a); b = g_list_next (b); @@ -301,17 +301,17 @@ make_connections (graph_t *g, GError **error) /* sigh, a hack until i fix the gstelement api... */ if ((pt2 = gst_element_get_compatible_pad_template (sink, pt1))) { if ((p2 = gst_element_get_pad (sink, pt2->name_template))) { - dc = g_new0 (dynamic_connection_t, 1); + dc = g_new0 (dynamic_link_t, 1); dc->srcpadname = (gchar*)a->data; dc->target_pad = p2; dc->target_element = NULL; dc->pipeline = g->bin; - GST_DEBUG (GST_CAT_PIPELINE, "setting up dynamic connection %s:%s and %s:%s", + GST_DEBUG (GST_CAT_PIPELINE, "setting up dynamic link %s:%s and %s:%s", GST_OBJECT_NAME (GST_OBJECT (src)), (gchar*)a->data, GST_DEBUG_PAD_NAME (p2)); - g_signal_connect (G_OBJECT (src), "new_pad", G_CALLBACK (dynamic_connect), dc); + g_signal_connect (G_OBJECT (src), "new_pad", G_CALLBACK (dynamic_link), dc); goto next; } else { /* both pt1 and pt2 are sometimes templates. sheesh. */ @@ -320,17 +320,17 @@ make_connections (graph_t *g, GError **error) } else { /* if the target pad has no padtemplate we will figure out a target * pad later on */ - dc = g_new0 (dynamic_connection_t, 1); + dc = g_new0 (dynamic_link_t, 1); dc->srcpadname = (gchar*)a->data; dc->target_pad = NULL; dc->target_element = sink; dc->pipeline = g->bin; - GST_DEBUG (GST_CAT_PIPELINE, "setting up dynamic connection %s:%s, and some pad in %s", + GST_DEBUG (GST_CAT_PIPELINE, "setting up dynamic link %s:%s, and some pad in %s", GST_OBJECT_NAME (GST_OBJECT (src)), (gchar*)a->data, GST_OBJECT_NAME (sink)); - g_signal_connect (G_OBJECT (src), "new_pad", G_CALLBACK (dynamic_connect), dc); + g_signal_connect (G_OBJECT (src), "new_pad", G_CALLBACK (dynamic_link), dc); goto next; } } else { @@ -343,23 +343,23 @@ make_connections (graph_t *g, GError **error) goto could_not_get_pad_a; } - if (!gst_pad_connect_filtered (p1, p2, caps)) { - goto could_not_connect_pads; + if (!gst_pad_link_filtered (p1, p2, caps)) { + goto could_not_link_pads; } } else if (b) { - /* we don't support dynamic connections on this side yet, if ever */ + /* we don't support dynamic links on this side yet, if ever */ if (!(p2 = gst_element_get_pad (sink, (gchar*)b->data))) { goto could_not_get_pad_b; } if (!(p1 = gst_element_get_compatible_pad (src, p2))) { goto could_not_get_compatible_to_b; } - if (!gst_pad_connect_filtered (p1, p2, caps)) { - goto could_not_connect_pads; + if (!gst_pad_link_filtered (p1, p2, caps)) { + goto could_not_link_pads; } } else { - if (!gst_element_connect_filtered (src, sink, caps)) { - goto could_not_connect_elements; + if (!gst_element_link_filtered (src, sink, caps)) { + goto could_not_link_elements; } } next: @@ -368,7 +368,7 @@ next: l = g->bins; while (l) { - if (!make_connections ((graph_t*)l->data, error)) + if (!make_links ((graph_t*)l->data, error)) return FALSE; l = g_list_next (l); } @@ -410,19 +410,19 @@ both_templates_have_sometimes_presence: "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_connect_pads: +could_not_link_pads: g_set_error (error, GST_PARSE_ERROR, GST_PARSE_ERROR_CONNECT, - "Could not connect %s:%s to %s:%s", + "Could not link %s:%s to %s:%s", GST_DEBUG_PAD_NAME (p1), GST_DEBUG_PAD_NAME (p2)); return FALSE; -could_not_connect_elements: +could_not_link_elements: g_set_error (error, GST_PARSE_ERROR, GST_PARSE_ERROR_CONNECT, - "Could not connect element %s to %s", + "Could not link element %s to %s", GST_OBJECT_NAME (src), GST_OBJECT_NAME (sink)); return FALSE; @@ -437,7 +437,7 @@ pipeline_from_graph (graph_t *g, GError **error) if (!set_properties (g, error)) return NULL; - if (!make_connections (g, error)) + if (!make_links (g, error)) return NULL; return (GstBin*)g->bin; diff --git a/gst/gstqueue.c b/gst/gstqueue.c index 7b23eca159..0f19f08dd8 100644 --- a/gst/gstqueue.c +++ b/gst/gstqueue.c @@ -174,7 +174,7 @@ gst_queue_class_init (GstQueueClass *klass) } static GstPadConnectReturn -gst_queue_connect (GstPad *pad, GstCaps *caps) +gst_queue_link (GstPad *pad, GstCaps *caps) { GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad)); GstPad *otherpad; @@ -184,7 +184,7 @@ gst_queue_connect (GstPad *pad, GstCaps *caps) else otherpad = queue->srcpad; - return gst_pad_proxy_connect (otherpad, caps); + return gst_pad_proxy_link (otherpad, caps); } static GstCaps* @@ -212,13 +212,13 @@ gst_queue_init (GstQueue *queue) gst_pad_set_chain_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_chain)); gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad); gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_get_bufferpool)); - gst_pad_set_connect_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_connect)); + gst_pad_set_link_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_link)); gst_pad_set_getcaps_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps)); queue->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_pad_set_get_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_get)); gst_element_add_pad (GST_ELEMENT (queue), queue->srcpad); - gst_pad_set_connect_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_connect)); + gst_pad_set_link_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_link)); gst_pad_set_getcaps_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps)); gst_pad_set_event_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_handle_src_event)); @@ -645,7 +645,7 @@ gst_queue_change_state (GstElement *element) } else if (new_state == GST_STATE_PLAYING) { if (!GST_PAD_IS_CONNECTED (queue->sinkpad)) { - GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not connected", GST_ELEMENT_NAME (queue)); + GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not linked", GST_ELEMENT_NAME (queue)); /* FIXME can this be? */ if (queue->reader) g_cond_signal (queue->not_empty); diff --git a/gst/gstscheduler.c b/gst/gstscheduler.c index b1775c29da..245db62e09 100644 --- a/gst/gstscheduler.c +++ b/gst/gstscheduler.c @@ -116,15 +116,15 @@ gst_scheduler_reset (GstScheduler *sched) } /** - * gst_scheduler_pad_connect: + * gst_scheduler_pad_link: * @sched: the scheduler - * @srcpad: the srcpad to connect - * @sinkpad: the sinkpad to connect to + * @srcpad: the srcpad to link + * @sinkpad: the sinkpad to link to * - * Connect the srcpad to the given sinkpad. + * Links the srcpad to the given sinkpad. */ void -gst_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) +gst_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) { GstSchedulerClass *sclass; @@ -134,20 +134,20 @@ gst_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) sclass = GST_SCHEDULER_GET_CLASS (sched); - if (sclass->pad_connect) - sclass->pad_connect (sched, srcpad, sinkpad); + if (sclass->pad_link) + sclass->pad_link (sched, srcpad, sinkpad); } /** - * gst_scheduler_pad_disconnect: + * gst_scheduler_pad_unlink: * @sched: the scheduler - * @srcpad: the srcpad to disconnect - * @sinkpad: the sinkpad to disconnect from + * @srcpad: the srcpad to unlink + * @sinkpad: the sinkpad to unlink from * - * Disconnect the srcpad to the given sinkpad. + * Unlinks the srcpad from the given sinkpad. */ void -gst_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) +gst_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) { GstSchedulerClass *sclass; @@ -157,8 +157,8 @@ gst_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkp sclass = GST_SCHEDULER_GET_CLASS (sched); - if (sclass->pad_disconnect) - sclass->pad_disconnect (sched, srcpad, sinkpad); + if (sclass->pad_unlink) + sclass->pad_unlink (sched, srcpad, sinkpad); } /** diff --git a/gst/gstscheduler.h b/gst/gstscheduler.h index 99f4755a43..45713082a0 100644 --- a/gst/gstscheduler.h +++ b/gst/gstscheduler.h @@ -92,8 +92,8 @@ struct _GstSchedulerClass { void (*yield) (GstScheduler *sched, GstElement *element); gboolean (*interrupt) (GstScheduler *sched, GstElement *element); void (*error) (GstScheduler *sched, GstElement *element); - void (*pad_connect) (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); - void (*pad_disconnect) (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); + void (*pad_link) (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); + void (*pad_unlink) (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); void (*pad_select) (GstScheduler *sched, GList *padlist); GstClockReturn (*clock_wait) (GstScheduler *sched, GstElement *element, GstClockID id, GstClockTimeDiff *jitter); @@ -126,8 +126,8 @@ void gst_scheduler_unlock_element (GstScheduler *sched, GstElement *element); void gst_scheduler_yield (GstScheduler *sched, GstElement *element); gboolean gst_scheduler_interrupt (GstScheduler *sched, GstElement *element); void gst_scheduler_error (GstScheduler *sched, GstElement *element); -void gst_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); -void gst_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); +void gst_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); +void gst_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); GstPad* gst_scheduler_pad_select (GstScheduler *sched, GList *padlist); GstClockReturn gst_scheduler_clock_wait (GstScheduler *sched, GstElement *element, GstClockID id, GstClockTimeDiff *jitter); diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 05c6ad3b83..f99997b5fb 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -17,20 +17,20 @@ static int yyerror (const char *s); gchar *s; GValue *v; graph_t *g; - connection_t *c; + link_t *c; property_t *p; element_t *e; } %token IDENTIFIER -%token CONNECTION BCONNECTION FCONNECTION +%token LINK BLINK FLINK %token VALUE %type id %type graph bin %type element %type

property_value value -%type connection rconnection +%type link rlink %left '{' '}' '(' ')' %left '!' '=' @@ -57,21 +57,21 @@ element: id { static int i = 0; $$ = g_new0 (element_t, graph: /* empty */ { $$ = g_new0 (graph_t, 1); *((graph_t**) pgraph) = $$; } | graph element { GList *l; - $$ = $1; l = $$->connections_pending; + $$ = $1; l = $$->links_pending; $$->elements = g_list_append ($$->elements, $2); $$->current = $2; if (!$$->first) $$->first = $$->current; while (l) { - ((connection_t*) l->data)->sink_index = $$->current->index; + ((link_t*) l->data)->sink_index = $$->current->index; l = g_list_next (l); } - if ($$->connections_pending) { - g_list_free ($$->connections_pending); - $$->connections_pending = NULL; + if ($$->links_pending) { + g_list_free ($$->links_pending); + $$->links_pending = NULL; } } - | graph bin { GList *l; $$ = $1; l = $$->connections_pending; + | graph bin { GList *l; $$ = $1; l = $$->links_pending; *((graph_t**) pgraph) = $$; $$->bins = g_list_append ($$->bins, $2); $2->parent = $$; @@ -79,21 +79,21 @@ graph: /* empty */ { $$ = g_new0 (graph_t, 1); *((graph_t**) p if (!$$->first) $$->first = $$->current; while (l) { - ((connection_t*) l->data)->sink_index = $$->current->index; + ((link_t*) l->data)->sink_index = $$->current->index; l = g_list_next (l); } - if ($$->connections_pending) { - g_list_free ($$->connections_pending); - $$->connections_pending = NULL; + if ($$->links_pending) { + g_list_free ($$->links_pending); + $$->links_pending = NULL; } $$->current = $2->current; } - | graph connection { $$ = $1; - $$->connections = g_list_append ($$->connections, $2); + | graph link { $$ = $1; + $$->links = g_list_append ($$->links, $2); if ($$->current) $2->src_index = $$->current->index; if (!$2->sink_name) - $$->connections_pending = g_list_append ($$->connections_pending, $2); + $$->links_pending = g_list_append ($$->links_pending, $2); } | graph property_value { $$ = $1; if (!$$->current) { @@ -109,14 +109,14 @@ bin: '{' graph '}' { $$ = $2; $$->current_bin_type = "thread"; | id '.' '(' graph ')' { $$ = $4; $$->current_bin_type = $1; } ; -connection: CONNECTION - | rconnection +link: LINK + | rlink ; -rconnection: '!' { $$ = g_new0 (connection_t, 1); } - | BCONNECTION { $$ = $1; } - | FCONNECTION { $$ = $1; } - | id ',' rconnection ',' id +rlink: '!' { $$ = g_new0 (link_t, 1); } + | BLINK { $$ = $1; } + | FLINK { $$ = $1; } + | id ',' rlink ',' id { $$ = $3; $$->src_pads = g_list_prepend ($$->src_pads, $1); $$->sink_pads = g_list_append ($$->sink_pads, $5); diff --git a/gst/parse/parse.l b/gst/parse/parse.l index d6c7e89cf1..327bde1673 100644 --- a/gst/parse/parse.l +++ b/gst/parse/parse.l @@ -46,10 +46,10 @@ _caps_double {_string}{_assign}{_caps_type_double}[[:space:]]+{_double} _caps_boolean {_string}{_assign}"boolean"[[:space:]]+{_boolean} _caps_pair {_caps_string}|{_caps_int}|{_caps_double}|{_caps_boolean} _caps {_string}({_comma}{_caps_pair})* -_lconnection ({_identifier}\.)?{_identifier}! -_rconnection !({_identifier}\.)?{_identifier} -_bconnection ({_identifier}\.)?{_identifier}!({_identifier}\.)?{_identifier} -_fconnection ({_identifier}\.)?{_identifier}!{_caps}!({_identifier}\.)?{_identifier} +_llink ({_identifier}\.)?{_identifier}! +_rlink !({_identifier}\.)?{_identifier} +_blink ({_identifier}\.)?{_identifier}!({_identifier}\.)?{_identifier} +_flink ({_identifier}\.)?{_identifier}!{_caps}!({_identifier}\.)?{_identifier} %x value %option noyywrap @@ -101,10 +101,10 @@ _fconnection ({_identifier}\.)?{_identifier}!{_caps}!({_identifier}\.)?{_identif [[:space:]]+ { /* PRINT ("space: [%s]\n", yytext); */ } } -{_lconnection} { +{_llink} { gchar *d1, *q; - lvalp->c = g_new0 (connection_t, 1); - PRINT ("An connection: %s\n", yytext); + lvalp->c = g_new0 (link_t, 1); + PRINT ("An link: %s\n", yytext); q = strchr (yytext, '!'); d1 = strchr (yytext, '.'); if (d1) { @@ -114,13 +114,13 @@ _fconnection ({_identifier}\.)?{_identifier}!{_caps}!({_identifier}\.)?{_identif lvalp->c->src_pads = g_list_append (lvalp->c->src_pads, g_strndup (yytext, q - yytext)); } - return CONNECTION; + return LINK; } -{_rconnection} { +{_rlink} { gchar *d2; - lvalp->c = g_new0 (connection_t, 1); - PRINT ("An rconnection: %s\n", yytext); + lvalp->c = g_new0 (link_t, 1); + PRINT ("An rlink: %s\n", yytext); d2 = strchr (yytext, '.'); if (d2) { lvalp->c->sink_name = g_strndup (yytext + 1, d2 - yytext - 1); @@ -129,13 +129,13 @@ _fconnection ({_identifier}\.)?{_identifier}!{_caps}!({_identifier}\.)?{_identif lvalp->c->sink_pads = g_list_append (lvalp->c->sink_pads, g_strdup (yytext + 1)); } - return CONNECTION; + return LINK; } -{_bconnection} { +{_blink} { gchar *d1, *d2, *q; - lvalp->c = g_new0 (connection_t, 1); - PRINT ("A bconnection: %s\n", yytext); + lvalp->c = g_new0 (link_t, 1); + PRINT ("A blink: %s\n", yytext); q = strchr (yytext, '!'); d1 = strchr (yytext, '.'); d2 = strchr (q, '.'); @@ -153,16 +153,16 @@ _fconnection ({_identifier}\.)?{_identifier}!{_caps}!({_identifier}\.)?{_identif lvalp->c->sink_pads = g_list_append (lvalp->c->sink_pads, g_strdup (q + 1)); } - return BCONNECTION; + return BLINK; } -{_fconnection} { +{_flink} { gchar *d1, *d2, *q1, *q2, *a1, *m1; gchar *mime; GstProps *props; - lvalp->c = g_new0 (connection_t, 1); - PRINT ("An fconnection: %s\n", yytext); + lvalp->c = g_new0 (link_t, 1); + PRINT ("An flink: %s\n", yytext); q1 = strchr (yytext, '!'); d1 = strchr (yytext, '.'); q2 = strchr (q1+1, '!'); @@ -243,7 +243,7 @@ _fconnection ({_identifier}\.)?{_identifier}!{_caps}!({_identifier}\.)?{_identif } lvalp->c->caps = gst_caps_new ("parse_caps", mime, props); - return FCONNECTION; + return FLINK; } {_identifier} { diff --git a/gst/parse/types.h b/gst/parse/types.h index 68f80e8a67..d9e8183cb3 100644 --- a/gst/parse/types.h +++ b/gst/parse/types.h @@ -14,9 +14,9 @@ typedef struct { } property_t; typedef struct { - /* if the names are present, upon connection we'll search out the pads of the - proper name and use those. otherwise, we'll search for elements of src_index - and sink_index. */ + /* if the names are present, upon link we'll search out the pads of the + proper name and use those. otherwise, we'll search for elements of + src_index and sink_index. */ char *src_name; char *sink_name; int src_index; @@ -24,7 +24,7 @@ typedef struct { GList *src_pads; GList *sink_pads; GstCaps *caps; -} connection_t; +} link_t; typedef struct _graph_t graph_t; @@ -34,8 +34,8 @@ struct _graph_t { graph_t *parent; gchar *current_bin_type; GList *elements; - GList *connections; - GList *connections_pending; + GList *links; + GList *links_pending; GList *bins; GstElement *bin; }; diff --git a/gst/schedulers/gstbasicscheduler.c b/gst/schedulers/gstbasicscheduler.c index 50352d9c88..7111e5a954 100644 --- a/gst/schedulers/gstbasicscheduler.c +++ b/gst/schedulers/gstbasicscheduler.c @@ -119,8 +119,8 @@ static void gst_basic_scheduler_unlock_element (GstScheduler *sched, GstEleme static void gst_basic_scheduler_yield (GstScheduler *sched, GstElement *element); static gboolean gst_basic_scheduler_interrupt (GstScheduler *sched, GstElement *element); static void gst_basic_scheduler_error (GstScheduler *sched, GstElement *element); -static void gst_basic_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); -static void gst_basic_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); +static void gst_basic_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); +static void gst_basic_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); static GstPad* gst_basic_scheduler_pad_select (GstScheduler *sched, GList *padlist); static GstClockReturn gst_basic_scheduler_clock_wait (GstScheduler *sched, GstElement *element, GstClockID id, GstClockTimeDiff *jitter); @@ -209,8 +209,8 @@ gst_basic_scheduler_class_init (GstBasicSchedulerClass * klass) gstscheduler_class->yield = GST_DEBUG_FUNCPTR (gst_basic_scheduler_yield); gstscheduler_class->interrupt = GST_DEBUG_FUNCPTR (gst_basic_scheduler_interrupt); gstscheduler_class->error = GST_DEBUG_FUNCPTR (gst_basic_scheduler_error); - gstscheduler_class->pad_connect = GST_DEBUG_FUNCPTR (gst_basic_scheduler_pad_connect); - gstscheduler_class->pad_disconnect = GST_DEBUG_FUNCPTR (gst_basic_scheduler_pad_disconnect); + gstscheduler_class->pad_link = GST_DEBUG_FUNCPTR (gst_basic_scheduler_pad_link); + gstscheduler_class->pad_unlink = GST_DEBUG_FUNCPTR (gst_basic_scheduler_pad_unlink); gstscheduler_class->pad_select = GST_DEBUG_FUNCPTR (gst_basic_scheduler_pad_select); gstscheduler_class->clock_wait = GST_DEBUG_FUNCPTR (gst_basic_scheduler_clock_wait); gstscheduler_class->iterate = GST_DEBUG_FUNCPTR (gst_basic_scheduler_iterate); @@ -505,7 +505,7 @@ gst_basic_scheduler_gethandler_proxy (GstPad * pad) GST_DEBUG (GST_CAT_DATAFLOW, "new pad in mid-switch!"); pad = (GstPad *) GST_RPAD_PEER (peer); if (!pad) { - gst_element_error (parent, "pad unconnected"); + gst_element_error (parent, "pad unlinked"); } parent = GST_PAD_PARENT (pad); peer = GST_RPAD_PEER (pad); @@ -1156,7 +1156,7 @@ gst_basic_scheduler_error (GstScheduler *sched, GstElement *element) } static void -gst_basic_scheduler_pad_connect (GstScheduler * sched, GstPad *srcpad, GstPad *sinkpad) +gst_basic_scheduler_pad_link (GstScheduler * sched, GstPad *srcpad, GstPad *sinkpad) { GstElement *srcelement, *sinkelement; GstBasicScheduler *bsched = GST_BASIC_SCHEDULER (sched); @@ -1166,7 +1166,7 @@ gst_basic_scheduler_pad_connect (GstScheduler * sched, GstPad *srcpad, GstPad *s sinkelement = GST_PAD_PARENT (sinkpad); g_return_if_fail (sinkelement != NULL); - GST_INFO (GST_CAT_SCHEDULING, "have pad connected callback on %s:%s to %s:%s", + GST_INFO (GST_CAT_SCHEDULING, "have pad linked callback on %s:%s to %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); GST_DEBUG (GST_CAT_SCHEDULING, "srcpad sched is %p, sinkpad sched is %p", GST_ELEMENT_SCHED (srcelement), GST_ELEMENT_SCHED (sinkelement)); @@ -1179,13 +1179,13 @@ gst_basic_scheduler_pad_connect (GstScheduler * sched, GstPad *srcpad, GstPad *s } static void -gst_basic_scheduler_pad_disconnect (GstScheduler * sched, GstPad * srcpad, GstPad * sinkpad) +gst_basic_scheduler_pad_unlink (GstScheduler * sched, GstPad * srcpad, GstPad * sinkpad) { GstElement *element1, *element2; GstSchedulerChain *chain1, *chain2; GstBasicScheduler *bsched = GST_BASIC_SCHEDULER (sched); - GST_INFO (GST_CAT_SCHEDULING, "disconnecting pads %s:%s and %s:%s", + GST_INFO (GST_CAT_SCHEDULING, "unlinking pads %s:%s and %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); /* we need to have the parent elements of each pad */ diff --git a/gst/schedulers/gstoptimalscheduler.c b/gst/schedulers/gstoptimalscheduler.c index 6f8394d499..e197876cec 100644 --- a/gst/schedulers/gstoptimalscheduler.c +++ b/gst/schedulers/gstoptimalscheduler.c @@ -205,8 +205,8 @@ static void gst_opt_scheduler_unlock_element (GstScheduler *sched, GstElement static void gst_opt_scheduler_yield (GstScheduler *sched, GstElement *element); static gboolean gst_opt_scheduler_interrupt (GstScheduler *sched, GstElement *element); static void gst_opt_scheduler_error (GstScheduler *sched, GstElement *element); -static void gst_opt_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); -static void gst_opt_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); +static void gst_opt_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); +static void gst_opt_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); static GstPad* gst_opt_scheduler_pad_select (GstScheduler *sched, GList *padlist); static GstClockReturn gst_opt_scheduler_clock_wait (GstScheduler *sched, GstElement *element, GstClockID id, GstClockTimeDiff *jitter); @@ -279,8 +279,8 @@ gst_opt_scheduler_class_init (GstOptSchedulerClass *klass) gstscheduler_class->yield = GST_DEBUG_FUNCPTR (gst_opt_scheduler_yield); gstscheduler_class->interrupt = GST_DEBUG_FUNCPTR (gst_opt_scheduler_interrupt); gstscheduler_class->error = GST_DEBUG_FUNCPTR (gst_opt_scheduler_error); - gstscheduler_class->pad_connect = GST_DEBUG_FUNCPTR (gst_opt_scheduler_pad_connect); - gstscheduler_class->pad_disconnect = GST_DEBUG_FUNCPTR (gst_opt_scheduler_pad_disconnect); + gstscheduler_class->pad_link = GST_DEBUG_FUNCPTR (gst_opt_scheduler_pad_link); + gstscheduler_class->pad_unlink = GST_DEBUG_FUNCPTR (gst_opt_scheduler_pad_unlink); gstscheduler_class->pad_select = GST_DEBUG_FUNCPTR (gst_opt_scheduler_pad_select); gstscheduler_class->clock_wait = GST_DEBUG_FUNCPTR (gst_opt_scheduler_clock_wait); gstscheduler_class->iterate = GST_DEBUG_FUNCPTR (gst_opt_scheduler_iterate); @@ -821,7 +821,7 @@ unkown_group_schedule_function (int argc, char *argv[]) } /* this function is called when the first element of a chain-loop or a loop-loop - * connection performs a push to the loop element. We then schedule the + * link performs a push to the loop element. We then schedule the * group with the loop-based element until the bufpen is empty */ static void gst_opt_scheduler_loop_wrapper (GstPad *sinkpad, GstBuffer *buffer) @@ -991,7 +991,7 @@ gst_opt_scheduler_state_transition (GstScheduler *sched, GstElement *element, gi switch (transition) { case GST_STATE_PAUSED_TO_PLAYING: - /* an element withut a group has to be an unconnected src, sink + /* an element withut a group has to be an unlinked src, sink * filter element */ if (!group) res = GST_STATE_FAILURE; @@ -1155,7 +1155,7 @@ gst_opt_scheduler_add_element (GstScheduler *sched, GstElement *element) GST_ELEMENT_SCHED_CONTEXT (element) = ctx; /* loop based elements *always* end up in their own group. It can eventually - * be merged with another group when a connection is made */ + * be merged with another group when a link is made */ if (element->loopfunc) { GstOptSchedulerGroup *group; GstOptSchedulerChain *chain; @@ -1258,21 +1258,21 @@ gst_opt_scheduler_error (GstScheduler *sched, GstElement *element) osched->state = GST_OPT_SCHEDULER_STATE_ERROR; } -/* connect pads, merge groups and chains */ +/* link pads, merge groups and chains */ static void -gst_opt_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) +gst_opt_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) { GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); ConnectionType type = GST_OPT_INVALID; GstElement *element1, *element2; - GST_INFO (GST_CAT_SCHEDULING, "pad connect between \"%s:%s\" and \"%s:%s\"", + GST_INFO (GST_CAT_SCHEDULING, "pad link between \"%s:%s\" and \"%s:%s\"", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); element1 = GST_PAD_PARENT (srcpad); element2 = GST_PAD_PARENT (sinkpad); - /* first we need to figure out what type of connection we're dealing + /* first we need to figure out what type of link we're dealing * with */ if (element1->loopfunc && element2->loopfunc) type = GST_OPT_LOOP_TO_LOOP; @@ -1326,13 +1326,13 @@ gst_opt_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sink } } - /* for each connection type, perform specific actions */ + /* for each link type, perform specific actions */ switch (type) { case GST_OPT_GET_TO_CHAIN: { GstOptSchedulerGroup *group = NULL; - GST_INFO (GST_CAT_SCHEDULING, "get to chain based connection"); + GST_INFO (GST_CAT_SCHEDULING, "get to chain based link"); /* setup get/chain handlers */ GST_RPAD_GETHANDLER (srcpad) = GST_RPAD_GETFUNC (srcpad); @@ -1358,7 +1358,7 @@ gst_opt_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sink } case GST_OPT_LOOP_TO_CHAIN: case GST_OPT_CHAIN_TO_CHAIN: - GST_INFO (GST_CAT_SCHEDULING, "loop/chain to chain based connection"); + GST_INFO (GST_CAT_SCHEDULING, "loop/chain to chain based link"); if (GST_ELEMENT_IS_EVENT_AWARE (element2)) GST_RPAD_CHAINHANDLER (sinkpad) = GST_RPAD_CHAINFUNC (sinkpad); @@ -1372,7 +1372,7 @@ gst_opt_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sink group_elements (osched, element1, element2); break; case GST_OPT_GET_TO_LOOP: - GST_INFO (GST_CAT_SCHEDULING, "get to loop based connection"); + GST_INFO (GST_CAT_SCHEDULING, "get to loop based link"); GST_RPAD_GETHANDLER (srcpad) = GST_RPAD_GETFUNC (srcpad); @@ -1387,7 +1387,7 @@ gst_opt_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sink { GstOptSchedulerGroup *group1, *group2; - GST_INFO (GST_CAT_SCHEDULING, "chain/loop to loop based connection"); + GST_INFO (GST_CAT_SCHEDULING, "chain/loop to loop based link"); GST_RPAD_CHAINHANDLER (sinkpad) = gst_opt_scheduler_loop_wrapper; GST_RPAD_GETHANDLER (srcpad) = gst_opt_scheduler_get_wrapper; @@ -1398,7 +1398,7 @@ gst_opt_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sink g_assert (group2 != NULL); /* group2 is guaranteed to exist as it contains a loop-based element. - * group1 only exists if element1 is connected to some other element */ + * group1 only exists if element1 is linked to some other element */ if (!group1) { /* create a new group for element1 as it cannot be merged into another group * here. we create the group in the same chain as the loop-based element. */ @@ -1413,24 +1413,24 @@ gst_opt_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sink break; } case GST_OPT_INVALID: - g_error ("(internal error) invalid element connection, what are you doing?"); + g_error ("(internal error) invalid element link, what are you doing?"); break; } } /* - * checks if an element is still connected to some other element in the group. + * checks if an element is still linked to some other element in the group. * no checking is done on the brokenpad arg * */ static gboolean -element_has_connection_with_group (GstElement *element, GstOptSchedulerGroup *group, GstPad *brokenpad) +element_has_link_with_group (GstElement *element, GstOptSchedulerGroup *group, GstPad *brokenpad) { - gboolean connected = FALSE; + gboolean linked = FALSE; const GList *pads; - /* see if the element has no more connections to the peer group */ + /* see if the element has no more links to the peer group */ pads = gst_element_get_pad_list (element); - while (pads && !connected) { + while (pads && !linked) { GstPad *pad = GST_PAD_CAST (pads->data); pads = g_list_next (pads); @@ -1445,31 +1445,31 @@ element_has_connection_with_group (GstElement *element, GstOptSchedulerGroup *gr /* see in what group this element is */ parent = GST_PAD_PARENT (GST_PAD_PEER (pad)); - /* connections with decoupled elements are valid */ + /* links with decoupled elements are valid */ if (GST_ELEMENT_IS_DECOUPLED (parent)) { - connected = TRUE; + linked = TRUE; } else { /* for non-decoupled elements we need to check the group */ get_group (parent, &parentgroup); - /* if it's in the same group, we're still connected */ + /* if it's in the same group, we're still linked */ if (parentgroup == group) - connected = TRUE; + linked = TRUE; } } } - return connected; + return linked; } static void -gst_opt_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) +gst_opt_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) { //GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); GstElement *element1, *element2; GstOptSchedulerGroup *group1, *group2; - GST_INFO (GST_CAT_SCHEDULING, "pad disconnect between \"%s:%s\" and \"%s:%s\"", + GST_INFO (GST_CAT_SCHEDULING, "pad unlink between \"%s:%s\" and \"%s:%s\"", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); element1 = GST_PAD_PARENT (srcpad); @@ -1479,7 +1479,7 @@ gst_opt_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *s get_group (element2, &group2); /* if one the elements has no group (anymore) we don't really care - * about the connection */ + * about the link */ if (!group1 || !group2) { GST_INFO (GST_CAT_SCHEDULING, "one (or both) of the elements is not in a group, not interesting"); return; @@ -1490,11 +1490,11 @@ gst_opt_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *s GST_INFO (GST_CAT_SCHEDULING, "elements are in different groups"); /* FIXME, need to eventually break the chain */ - g_warning ("pad disconnect for different groups, implement me"); + g_warning ("pad unlink for different groups, implement me"); } /* hard part, groups are equal */ else { - gboolean still_connect1, still_connect2; + gboolean still_link1, still_link2; GstOptSchedulerGroup *group; /* since group1 == group2, it doesn't matter which group we take */ @@ -1502,22 +1502,22 @@ gst_opt_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *s GST_INFO (GST_CAT_SCHEDULING, "elements are in the same group %p", group); - /* check if the element is still connected to some other element in the group, - * we pass the pad that is broken up as an arg because a connection on that pad + /* check if the element is still linked to some other element in the group, + * we pass the pad that is broken up as an arg because a link on that pad * is not valid anymore */ - still_connect1 = element_has_connection_with_group (element1, group, srcpad); - still_connect2 = element_has_connection_with_group (element2, group, sinkpad); + still_link1 = element_has_link_with_group (element1, group, srcpad); + still_link2 = element_has_link_with_group (element2, group, sinkpad); - /* if there is still a connection, we don't need to break this group */ - if (still_connect1 && still_connect2) { - GST_INFO (GST_CAT_SCHEDULING, "elements still have connections with other elements in the group"); + /* if there is still a link, we don't need to break this group */ + if (still_link1 && still_link2) { + GST_INFO (GST_CAT_SCHEDULING, "elements still have links with other elements in the group"); /* FIXME, need to check for breaking up the group */ return; } /* now check which one of the elements we can remove from the group */ - if (!still_connect1) { + if (!still_link1) { GST_INFO (GST_CAT_SCHEDULING, "element1 is separated from the group"); /* see if the element was an entry point for the group */ if (group->entry == element1) { @@ -1527,7 +1527,7 @@ gst_opt_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *s } remove_from_group (group, element1); } - if (!still_connect2) { + if (!still_link2) { GST_INFO (GST_CAT_SCHEDULING, "element2 is separated from the group"); /* see if the element was an entry point for the group */ diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index 0589362ff3..644ada8153 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -155,7 +155,7 @@ gst_identity_getcaps (GstPad *pad, GstCaps *caps) } static GstPadConnectReturn -gst_identity_connect (GstPad *pad, GstCaps *caps) +gst_identity_link (GstPad *pad, GstCaps *caps) { GstIdentity *identity; GstPad *otherpad; @@ -176,12 +176,12 @@ gst_identity_init (GstIdentity *identity) gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad); gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain)); gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool); - gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect); + gst_pad_set_link_function (identity->sinkpad, gst_identity_link); gst_pad_set_getcaps_function (identity->sinkpad, gst_identity_getcaps); identity->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad); - gst_pad_set_connect_function (identity->srcpad, gst_identity_connect); + gst_pad_set_link_function (identity->srcpad, gst_identity_link); gst_pad_set_getcaps_function (identity->srcpad, gst_identity_getcaps); identity->loop_based = FALSE; diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 7b23eca159..0f19f08dd8 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -174,7 +174,7 @@ gst_queue_class_init (GstQueueClass *klass) } static GstPadConnectReturn -gst_queue_connect (GstPad *pad, GstCaps *caps) +gst_queue_link (GstPad *pad, GstCaps *caps) { GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad)); GstPad *otherpad; @@ -184,7 +184,7 @@ gst_queue_connect (GstPad *pad, GstCaps *caps) else otherpad = queue->srcpad; - return gst_pad_proxy_connect (otherpad, caps); + return gst_pad_proxy_link (otherpad, caps); } static GstCaps* @@ -212,13 +212,13 @@ gst_queue_init (GstQueue *queue) gst_pad_set_chain_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_chain)); gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad); gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_get_bufferpool)); - gst_pad_set_connect_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_connect)); + gst_pad_set_link_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_link)); gst_pad_set_getcaps_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps)); queue->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_pad_set_get_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_get)); gst_element_add_pad (GST_ELEMENT (queue), queue->srcpad); - gst_pad_set_connect_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_connect)); + gst_pad_set_link_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_link)); gst_pad_set_getcaps_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps)); gst_pad_set_event_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_handle_src_event)); @@ -645,7 +645,7 @@ gst_queue_change_state (GstElement *element) } else if (new_state == GST_STATE_PLAYING) { if (!GST_PAD_IS_CONNECTED (queue->sinkpad)) { - GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not connected", GST_ELEMENT_NAME (queue)); + GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not linked", GST_ELEMENT_NAME (queue)); /* FIXME can this be? */ if (queue->reader) g_cond_signal (queue->not_empty); diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 9361048040..3e7ebc7c3c 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -120,7 +120,7 @@ gst_tee_class_init (GstTeeClass *klass) } static GstPadConnectReturn -gst_tee_sinkconnect (GstPad *pad, GstCaps *caps) +gst_tee_sinklink (GstPad *pad, GstCaps *caps) { GstTee *tee; const GList *pads; @@ -155,7 +155,7 @@ gst_tee_init (GstTee *tee) tee->sinkpad = gst_pad_new ("sink", GST_PAD_SINK); gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad); gst_pad_set_chain_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_chain)); - gst_pad_set_connect_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_sinkconnect)); + gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_sinklink)); tee->silent = FALSE; tee->last_message = NULL; diff --git a/tests/muxing/case1.c b/tests/muxing/case1.c index 74085fdc11..33149cafb6 100644 --- a/tests/muxing/case1.c +++ b/tests/muxing/case1.c @@ -46,16 +46,16 @@ main(int argc,char *argv[]) gst_bin_add_many (pipeline, src, tee, identity1, identity2, aggregator, sink, NULL); - gst_element_connect_pads (src, "src", tee, "sink"); - gst_pad_connect (gst_element_get_request_pad (tee, "src%d"), + gst_element_link_pads (src, "src", tee, "sink"); + gst_pad_link (gst_element_get_request_pad (tee, "src%d"), gst_element_get_pad (identity1, "sink")); - gst_pad_connect (gst_element_get_request_pad (tee, "src%d"), + gst_pad_link (gst_element_get_request_pad (tee, "src%d"), gst_element_get_pad (identity2, "sink")); - gst_pad_connect (gst_element_get_pad (identity1, "src"), + gst_pad_link (gst_element_get_pad (identity1, "src"), gst_element_get_request_pad (aggregator, "sink%d")); - gst_pad_connect (gst_element_get_pad (identity2, "src"), + gst_pad_link (gst_element_get_pad (identity2, "src"), gst_element_get_request_pad (aggregator, "sink%d")); - gst_element_connect_pads (aggregator, "src", sink, "sink"); + gst_element_link_pads (aggregator, "src", sink, "sink"); g_signal_connect (G_OBJECT (src), "eos", G_CALLBACK (eos_signal), NULL); diff --git a/tests/old/examples/autoplug/autoplug.c b/tests/old/examples/autoplug/autoplug.c index 56f25e8fce..c22507e8e1 100644 --- a/tests/old/examples/autoplug/autoplug.c +++ b/tests/old/examples/autoplug/autoplug.c @@ -18,8 +18,8 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin"); cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); - /* disconnect the typefind from the pipeline and remove it */ - gst_element_disconnect_pads (cache, "src", typefind, "sink"); + /* unlink the typefind from the pipeline and remove it */ + gst_element_unlink_pads (cache, "src", typefind, "sink"); gst_bin_remove (GST_BIN (autobin), typefind); /* and an audio sink */ @@ -34,7 +34,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) colorspace = gst_element_factory_make ("colorspace", "colorspace"); g_assert (colorspace != NULL); - gst_element_connect_pads (colorspace, "src", videoelement, "sink"); + gst_element_link_pads (colorspace, "src", videoelement, "sink"); gst_bin_add (GST_BIN (videosink), colorspace); gst_bin_add (GST_BIN (videosink), videoelement); @@ -61,7 +61,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) g_object_set (G_OBJECT (cache), "reset", TRUE, NULL); - gst_element_connect_pads (cache, "src", new_element, "sink"); + gst_element_link_pads (cache, "src", new_element, "sink"); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -87,9 +87,9 @@ gst_play_cache_empty (GstElement *element, GstElement *pipeline) cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); new_element = gst_bin_get_by_name (GST_BIN (autobin), "new_element"); - gst_element_disconnect_many (filesrc, cache, new_element, NULL); + gst_element_unlink_many (filesrc, cache, new_element, NULL); gst_bin_remove (GST_BIN (autobin), cache); - gst_element_connect_pads (filesrc, "src", new_element, "sink"); + gst_element_link_pads (filesrc, "src", new_element, "sink"); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -131,11 +131,11 @@ int main(int argc,char *argv[]) gst_bin_add (GST_BIN (autobin), cache); gst_bin_add (GST_BIN (autobin), typefind); - gst_element_connect_pads (cache, "src", typefind, "sink"); + gst_element_link_pads (cache, "src", typefind, "sink"); gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink"), "sink"); gst_bin_add (GST_BIN( pipeline), autobin); - gst_element_connect_pads (filesrc, "src", autobin, "sink"); + gst_element_link_pads (filesrc, "src", autobin, "sink"); /* start playing */ gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); diff --git a/tests/old/examples/helloworld/helloworld.c b/tests/old/examples/helloworld/helloworld.c index 7f056c9082..95197305de 100644 --- a/tests/old/examples/helloworld/helloworld.c +++ b/tests/old/examples/helloworld/helloworld.c @@ -34,8 +34,8 @@ int main (int argc, char *argv[]) /* add objects to the main pipeline */ gst_bin_add_many (GST_BIN (bin), filesrc, decoder, osssink, NULL); - /* connect the elements */ - gst_element_connect_many (filesrc, decoder, osssink, NULL); + /* link the elements */ + gst_element_link_many (filesrc, decoder, osssink, NULL); /* start playing */ gst_element_set_state (bin, GST_STATE_PLAYING); diff --git a/tests/old/examples/helloworld2/helloworld2.c b/tests/old/examples/helloworld2/helloworld2.c index 301f3c170d..53364d0240 100644 --- a/tests/old/examples/helloworld2/helloworld2.c +++ b/tests/old/examples/helloworld2/helloworld2.c @@ -18,8 +18,8 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin"); cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); - /* disconnect_pads the typefind from the pipeline and remove it */ - gst_element_disconnect_pads (cache, "src", typefind, "sink"); + /* unlink_pads the typefind from the pipeline and remove it */ + gst_element_unlink_pads (cache, "src", typefind, "sink"); gst_bin_remove (GST_BIN (autobin), typefind); /* and an audio sink */ @@ -45,7 +45,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline) g_object_set (G_OBJECT (cache), "reset", TRUE, NULL); - gst_element_connect_pads (cache, "src", new_element, "sink"); + gst_element_link_pads (cache, "src", new_element, "sink"); gst_element_set_state (pipeline, GST_STATE_PLAYING); } @@ -67,10 +67,10 @@ gst_play_cache_empty (GstElement *element, GstElement *pipeline) cache = gst_bin_get_by_name (GST_BIN (autobin), "cache"); new_element = gst_bin_get_by_name (GST_BIN (autobin), "new_element"); - gst_element_disconnect_pads (filesrc, "src", cache, "sink"); - gst_element_disconnect_pads (cache, "src", new_element, "sink"); + gst_element_unlink_pads (filesrc, "src", cache, "sink"); + gst_element_unlink_pads (cache, "src", new_element, "sink"); gst_bin_remove (GST_BIN (autobin), cache); - gst_element_connect_pads (filesrc, "src", new_element, "sink"); + gst_element_link_pads (filesrc, "src", new_element, "sink"); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -114,11 +114,11 @@ main (int argc, char *argv[]) gst_bin_add (GST_BIN (autobin), cache); gst_bin_add (GST_BIN (autobin), typefind); - gst_element_connect_pads (cache, "src", typefind, "sink"); + gst_element_link_pads (cache, "src", typefind, "sink"); gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink"), "sink"); gst_bin_add (GST_BIN( pipeline), autobin); - gst_element_connect_pads (filesrc, "src", autobin, "sink"); + gst_element_link_pads (filesrc, "src", autobin, "sink"); /* start playing */ gst_element_set_state( GST_ELEMENT (pipeline), GST_STATE_PLAYING); diff --git a/tests/old/examples/mixer/mixer.c b/tests/old/examples/mixer/mixer.c index d6b9d6a38d..e786743ef1 100644 --- a/tests/old/examples/mixer/mixer.c +++ b/tests/old/examples/mixer/mixer.c @@ -55,7 +55,7 @@ gst_play_type_find (GstBin *bin, GstElement *element) typefind = gst_element_factory_make ("typefind", "typefind"); g_return_val_if_fail (typefind != NULL, FALSE); - gst_pad_connect (gst_element_get_pad (element, "src"), + gst_pad_link (gst_element_get_pad (element, "src"), gst_element_get_pad (typefind, "sink")); gst_bin_add (bin, typefind); gst_bin_add (GST_BIN (pipeline), GST_ELEMENT (bin)); @@ -69,7 +69,7 @@ gst_play_type_find (GstBin *bin, GstElement *element) caps = gst_pad_get_caps (gst_element_get_pad (element, "src")); - gst_pad_disconnect (gst_element_get_pad (element, "src"), + gst_pad_unlink (gst_element_get_pad (element, "src"), gst_element_get_pad (typefind, "sink")); gst_bin_remove (bin, typefind); gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin)); @@ -115,15 +115,15 @@ int main(int argc,char *argv[]) /* create main bin */ main_bin = gst_pipeline_new("bin"); - /* connect adder and output to bin */ + /* link adder and output to bin */ GST_INFO (0, "main: adding adder to bin"); gst_bin_add (GST_BIN(main_bin), adder); GST_INFO (0, "main: adding audiosink to bin"); gst_bin_add (GST_BIN(main_bin), audiosink); - /* connect adder and audiosink */ + /* link adder and audiosink */ - gst_pad_connect(gst_element_get_pad(adder,"src"), + gst_pad_link(gst_element_get_pad(adder,"src"), gst_element_get_pad(audiosink,"sink")); /* start looping */ @@ -138,12 +138,12 @@ int main(int argc,char *argv[]) if (i > 1) gst_element_set_state (main_bin, GST_STATE_PAUSED); gst_bin_add (GST_BIN(main_bin), channel_in->pipe); - /* request pads and connect to adder */ + /* request pads and link to adder */ GST_INFO (0, "requesting pad\n"); pad = gst_element_get_request_pad (adder, "sink%d"); printf ("\tGot new adder sink pad %s\n", gst_pad_get_name (pad)); sprintf (buffer, "channel%d", i); - gst_pad_connect (gst_element_get_pad (channel_in->pipe, buffer), pad); + gst_pad_link (gst_element_get_pad (channel_in->pipe, buffer), pad); /* register a volume envelope */ printf ("\tregistering volume envelope...\n"); @@ -276,7 +276,7 @@ create_input_channel (int id, char* location) /* add filesrc to the bin before autoplug */ gst_bin_add(GST_BIN(channel->pipe), channel->filesrc); - /* connect signal to eos of filesrc */ + /* link signal to eos of filesrc */ g_signal_connect (G_OBJECT(channel->filesrc),"eos", G_CALLBACK(eos),NULL); @@ -364,8 +364,8 @@ create_input_channel (int id, char* location) gst_bin_add (GST_BIN(channel->pipe), channel->volenv); gst_bin_add (GST_BIN (channel->pipe), new_element); - gst_element_connect_pads (channel->filesrc, "src", new_element, "sink"); - gst_element_connect_pads (new_element, "src_00", channel->volenv, "sink"); + gst_element_link_pads (channel->filesrc, "src", new_element, "sink"); + gst_element_link_pads (new_element, "src_00", channel->volenv, "sink"); /* add a ghost pad */ sprintf (buffer, "channel%d", id); diff --git a/tests/old/examples/pingpong/pingpong.c b/tests/old/examples/pingpong/pingpong.c index 9dbbc2f1d5..941b907d82 100644 --- a/tests/old/examples/pingpong/pingpong.c +++ b/tests/old/examples/pingpong/pingpong.c @@ -80,16 +80,16 @@ main (gint argc, gchar *argv[]) gst_bin_add (GST_BIN (pipeline), aggregator); gst_bin_add (GST_BIN (pipeline), sink); - gst_element_connect_pads (aggregator, "src", sink, "sink"); + gst_element_link_pads (aggregator, "src", sink, "sink"); bin1 = make_bin (1); pad1 = gst_element_get_request_pad (aggregator, "sink%d"); - gst_pad_connect (gst_element_get_pad (bin1, "src"), pad1); + gst_pad_link (gst_element_get_pad (bin1, "src"), pad1); gst_bin_add (GST_BIN (pipeline), bin1); bin2 = make_bin (2); pad2 = gst_element_get_request_pad (aggregator, "sink%d"); - gst_pad_connect (gst_element_get_pad (bin2, "src"), pad2); + gst_pad_link (gst_element_get_pad (bin2, "src"), pad2); gst_bin_add (GST_BIN (pipeline), bin2); gst_element_set_state (pipeline, GST_STATE_PLAYING); diff --git a/tests/old/testsuite/elements/fake.c b/tests/old/testsuite/elements/fake.c index 35da5755ea..9fcba05beb 100644 --- a/tests/old/testsuite/elements/fake.c +++ b/tests/old/testsuite/elements/fake.c @@ -65,9 +65,9 @@ main (int argc, char *argv[]) retval = 1; } - gst_pad_connect (gst_element_get_pad (src, "src"), - gst_element_get_pad (sink, "sink")); - + gst_pad_link (gst_element_get_pad (src, "src"), + gst_element_get_pad (sink, "sink")); + /* set to play */ g_print ("Doing 1 iteration\n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); diff --git a/tests/sched/dynamic-pipeline.c b/tests/sched/dynamic-pipeline.c index d5d5604c21..de30ff17fd 100644 --- a/tests/sched/dynamic-pipeline.c +++ b/tests/sched/dynamic-pipeline.c @@ -28,7 +28,7 @@ int main (int argc, char *argv[]) /* make the first pipeline */ gst_bin_add (GST_BIN(pipe1), fakesrc); gst_bin_add (GST_BIN(pipe1), fakesink1); - gst_element_connect_pads (fakesrc, "src", fakesink1, "sink"); + gst_element_link_pads (fakesrc, "src", fakesink1, "sink"); /* initialize cothreads */ gst_element_set_state(pipe1, GST_STATE_PLAYING); @@ -36,7 +36,7 @@ int main (int argc, char *argv[]) gst_element_set_state(pipe1, GST_STATE_READY); /* destroy the fakesink, but keep fakesrc (its state is GST_STATE_READY) */ - gst_element_disconnect_pads (fakesrc, "src", fakesink1, "sink"); + gst_element_unlink_pads (fakesrc, "src", fakesink1, "sink"); gst_object_ref(GST_OBJECT(fakesrc)); gst_bin_remove(GST_BIN(pipe1), fakesrc); gst_bin_remove(GST_BIN(pipe1), fakesink1); @@ -48,7 +48,7 @@ int main (int argc, char *argv[]) /* don't change the new pipeline's state, it should change on the bin_add */ gst_bin_add (GST_BIN(pipe2), fakesrc); - gst_element_connect_pads (fakesrc, "src", fakesink2, "sink"); + gst_element_link_pads (fakesrc, "src", fakesink2, "sink"); /* show the pipeline state */ gst_xml_write_file (GST_ELEMENT (pipe2), stdout); diff --git a/tests/sched/sched-stress.c b/tests/sched/sched-stress.c index 4430ab473d..28cccc6b53 100644 --- a/tests/sched/sched-stress.c +++ b/tests/sched/sched-stress.c @@ -18,7 +18,7 @@ int main (int argc, char *argv[]) dec = gst_element_factory_make ("identity", "decoder"); sink = gst_element_factory_make ("fakesink", "sink"); gst_bin_add_many (GST_BIN (bin), src, dec, sink, NULL); - gst_element_connect_many (src, dec, sink, NULL); + gst_element_link_many (src, dec, sink, NULL); gst_element_set_state (bin, GST_STATE_PLAYING); for(j = 0; j < 30; j++) gst_bin_iterate(GST_BIN(bin)); diff --git a/tests/seeking/seeking1.c b/tests/seeking/seeking1.c index 60542c9694..20bac0bf15 100644 --- a/tests/seeking/seeking1.c +++ b/tests/seeking/seeking1.c @@ -44,7 +44,7 @@ main (gint argc, gchar *argv[]) gst_bin_add (GST_BIN (pipeline), fakesrc); gst_bin_add (GST_BIN (pipeline), fakesink); - gst_element_connect_pads (fakesrc, "src", fakesink, "sink"); + gst_element_link_pads (fakesrc, "src", fakesink, "sink"); gst_element_set_state (pipeline, GST_STATE_READY); diff --git a/tests/threadstate/threadstate2.c b/tests/threadstate/threadstate2.c index f1013d34c4..816bfcfb2c 100644 --- a/tests/threadstate/threadstate2.c +++ b/tests/threadstate/threadstate2.c @@ -5,18 +5,18 @@ */ /* 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) { - GstThread *thread = GST_THREAD(data); + GstThread *thread = GST_THREAD (data); g_print("have eos, quitting\n"); /* stop the bin */ - gst_element_set_state(GST_ELEMENT(thread), GST_STATE_NULL); + gst_element_set_state (GST_ELEMENT (thread), GST_STATE_NULL); gst_main_quit(); } -int main(int argc,char *argv[]) +int main(int argc,char *argv[]) { GstElement *filesrc, *osssink; GstElement *thread; @@ -26,42 +26,42 @@ int main(int argc,char *argv[]) gst_init(&argc,&argv); if (argc != 2) { - g_print("usage: %s \n", argv[0]); - exit(-1); + g_print ("usage: %s \n", argv[0]); + exit (-1); } /* create a new thread to hold the elements */ - thread = gst_thread_new("thread"); - g_assert(thread != NULL); + thread = gst_thread_new ("thread"); + g_assert (thread != NULL); /* create a disk reader */ - filesrc = gst_element_factory_make("filesrc", "disk_source"); - g_assert(filesrc != NULL); - g_object_set(G_OBJECT(filesrc),"location", argv[1],NULL); - g_signal_connect(G_OBJECT(filesrc),"eos", - G_CALLBACK(eos), thread); + filesrc = gst_element_factory_make ("filesrc", "disk_source"); + g_assert (filesrc != NULL); + g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL); + g_signal_connect (G_OBJECT (filesrc), "eos", + G_CALLBACK (eos), thread); /* and an audio sink */ - osssink = gst_element_factory_make("osssink", "play_audio"); - g_assert(osssink != NULL); + osssink = gst_element_factory_make ("osssink", "play_audio"); + g_assert (osssink != NULL); /* did i mention that this is an mp3 player? */ - mad = gst_element_factory_make("mad", "mp3_decoder"); - g_assert(mad != NULL); + mad = gst_element_factory_make ("mad", "mp3_decoder"); + g_assert (mad != NULL); - gst_bin_add_many (GST_BIN(thread), filesrc, mad, osssink, NULL); - gst_element_connect_many (filesrc, mad, osssink, NULL); + gst_bin_add_many (GST_BIN (thread), filesrc, mad, osssink, NULL); + gst_element_link_many (filesrc, mad, osssink, NULL); for (x = 0 ; x < 10 ; x++){ - g_print("playing %d\n", x); - gst_element_set_state(GST_ELEMENT(thread), GST_STATE_PLAYING); - sleep(2); + g_print ("playing %d\n", x); + gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING); + sleep (2); - g_print("pausing %d\n", x); - gst_element_set_state(GST_ELEMENT(thread), GST_STATE_PAUSED); - sleep(2); + g_print ("pausing %d\n", x); + gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PAUSED); + sleep (2); } - exit(0); + exit (0); } diff --git a/tests/threadstate/threadstate4.c b/tests/threadstate/threadstate4.c index 19cf55892b..0258d61d87 100644 --- a/tests/threadstate/threadstate4.c +++ b/tests/threadstate/threadstate4.c @@ -33,7 +33,7 @@ int main(int argc,char *argv[]) gst_bin_add(GST_BIN(thread2), fakesrc); gst_element_add_ghost_pad (thread2, gst_element_get_pad (fakesrc, "src"), "src"); - gst_element_connect_many (thread2, queue, fakesink, NULL); + gst_element_link_many (thread2, queue, fakesink, NULL); for (x = 0 ; x < 10 ; x++){ g_print("playing %d\n", x); diff --git a/tests/threadstate/threadstate5.c b/tests/threadstate/threadstate5.c index 1c1cbac4a5..1e96c7c7de 100644 --- a/tests/threadstate/threadstate5.c +++ b/tests/threadstate/threadstate5.c @@ -32,8 +32,8 @@ int main(int argc,char *argv[]) gst_bin_add_many (GST_BIN(thread2), queue, fakesink, NULL); gst_element_add_ghost_pad (thread2, gst_element_get_pad (queue, "sink"), "sink"); - gst_element_connect_many (queue, fakesink, NULL); - gst_element_connect_many (fakesrc, thread2, NULL); + gst_element_link_many (queue, fakesink, NULL); + gst_element_link_many (fakesrc, thread2, NULL); for (x = 0 ; x < 10 ; x++){ g_print("playing %d\n", x); diff --git a/testsuite/elements/fake.c b/testsuite/elements/fake.c index 35da5755ea..9fcba05beb 100644 --- a/testsuite/elements/fake.c +++ b/testsuite/elements/fake.c @@ -65,9 +65,9 @@ main (int argc, char *argv[]) retval = 1; } - gst_pad_connect (gst_element_get_pad (src, "src"), - gst_element_get_pad (sink, "sink")); - + gst_pad_link (gst_element_get_pad (src, "src"), + gst_element_get_pad (sink, "sink")); + /* set to play */ g_print ("Doing 1 iteration\n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 0be347f3bb..b9a785394d 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -644,7 +644,7 @@ print_element_info (GstElementFactory *factory) print_query_types (gst_pad_get_query_types (GST_PAD (realpad))); } - if (realpad->intconnfunc != gst_pad_get_internal_connections_default) + if (realpad->intconnfunc != gst_pad_get_internal_links_default) g_print (" Has custom intconnfunc(): %s\n", GST_DEBUG_FUNCPTR_NAME(realpad->intconnfunc));