I am confused by the concept of sink and source elements. Intuitively, I would expect a source to be something from which we take data, and a sink to be something where we put the results of our process. In Gstreamer tutorial 2, this seems to be right: https://gstreamer.freedesktop.org/documentation/tutorials/basic/images/figure-1.png But when I was reading tutorial 3, the definition seems to be the opposite: https://gstreamer.freedesktop.org/documentation/tutorials/basic/images/filter-element.png I am not sure why the filter element in the second image contains the sink element on the left and the src element on right, and not the opposite. I mean, I would expect the output to be sent into a sink not a source. Is it because we are looking at it from the "outside"? That is, the output of the filter is a source for us (and for the next element in the pipeline) even though, in non-gstreamer terminology, it could be seen as a sink internally for the filter. Is this correct?
Asked
Active
Viewed 714 times
1
-
1I also periodically get confused about this naming, and have to consult myself searching for the topic. Could be simply "in" and "out". – Dmitry Feb 25 '23 at 13:22
1 Answers
1
The second picture is not about elements in a pipeline, but pads on a single element. On the first one you look at a complete pipeline, but you have figured that one out already.
On the second one you look a single element and it's pads. The element has two pads. The one on the left is the sink pad, data goes in there and is consumed by the element. On the right side you have a source pad, the element will generate data and push it to that pad (so it is somehow a data source).
Treat is as a vocabulary. It sure can be argued about the naming, but this is what has been agreed upon.

Florian Zwoch
- 6,764
- 2
- 12
- 21
-
1Thanks! I have another question. Consider an element A and its subsequent element B in the pipeline ( A --> B). Does B read data from A's source or is A's source copied into B's sink? – user1315621 Dec 08 '21 at 23:23
-
Very good question. If you read on the documentation at some point you will find this part: https://gstreamer.freedesktop.org/documentation/additional/design/push-pull.html?gi-language=c – Florian Zwoch Dec 09 '21 at 08:42