GStreamer Application Development Manual (0.8.1) | ||
---|---|---|
<<< Previous | Next >>> |
As we have seen in the chapter called Elements, the pads are the element's interface to the outside world.
The specific type of media that the element can handle will be exposed by the pads. The description of this media type is done with capabilities(see the Section called Capabilities of a pad)
Pads are either source or sink pads. The terminology is defined from the view of the element itself: elements accept data on their sink pads, and send data out on their source pads. Sink pads are drawn on the left, while source pads are drawn on the right of an element. In general, data flows from left to right in the graph.[1]
Some elements might not have all of their pads when the element is created. This can happen, for example, with an MPEG system demultiplexer. The demultiplexer will create its pads at runtime when it detects the different elementary streams in the MPEG system stream.
Running gst-inspect mpegdemux will show that the element has only one pad: a sink pad called 'sink'. The other pads are "dormant". You can see this in the pad template because there is an 'Exists: Sometimes' property. Depending on the type of MPEG file you play, the pads will be created. We will see that this is very important when you are going to create dynamic pipelines later on in this manual.
An element can also have request pads. These pads are not created automatically but are only created on demand. This is very useful for multiplexers, aggregators and tee elements.
The tee element, for example, has one input pad and a request padtemplate for the output pads. Whenever an element wants to get an output pad from the tee element, it has to request the pad.
[1] | In reality, there is no objection to data flowing from a source pad to the sink pad of an element upstream. Data will, however, always flow from a source pad of one element to the sink pad of another. |
<<< Previous | Home | Next >>> |
Types of elements | Up | Capabilities of a pad |