You can link the different pads of elements together so that the elements form a chain.
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 the final sink element (element3).
Imagine the above graph as a simple MPEG audio decoder. The source element is a disk source, the filter element is the MPEG decoder and the sink element is your audiocard. We will use this simple graph to construct an MPEG player later in this manual.
You can link two pads with:
srcpad = element1.get_pad("src") sinpad = element2.get_pad("sink") # link them srcpad.link(sinkpad) .... # and unlink them srcpad.unlink(sinkpad)
A convenient shortcut for single-source, single-sink elements is the Gst::Element#link method:
# link them element1.link(element2) ... # and unlink them element1.unlink(element2)
# link them all element1 >> element2 >> element3
You can query if a pad is linked with Gst::Pad#linked?.