Introduction to the Gstreamer System Architecture


In my last post I wrote some different things about VLC, which I wanted to use for streaming purposes. I had to investigate what library it used. Actually, there is one library called "LIVE 555 streaming media" which the cone, VLC, is using.
Really, it was very difficult for me to find information for getting started.

For this reason, it was proposed to me, to investigate a bit about another low-level library called Gstreamer and written in C, for streaming and playing multimedia, which is used in several applications.

The first impression was really good. There is a first manual in which you can learn the basic features of Gstreamer, how to initialize it, how to put it in different state, what is a pipeline, what is an element, and finally a OGG player, as a "Hello World" application to apply the concepts already learnt.

As a result of my investigation, I'm going to summarize what I've learnt in this Gstreamer Manual.

The main use of Gstreamer is to manage the video and audio stream to create, for example, a video player, or a streaming server.


An element is the most important class of objects in Gstreamer. Usually, a functionality is achieved by linking elements.

Normally, inside the elements, there are pads, which are inputs and outputs. The input pad is called "sink" and is from where data flows trough the element, for example, from a local file, or from another element. The output pad, is called "source".

Introduction to the Gstreamer System Architecture_第1张图片Here we can see an example of an elements with two pads. An input pad, and an output pad.

This is an element called filter, with input and output pads.



Besides elements, there is a kind of container called bin, which would be the parent of some elements. And then, there is a type of bin, calledpipeline.
This is a hierarchical structure for one important reason. A medium-sized project with gstreamer will contain a lot of elements, imagine that you want to put the "play" state. You should tell to each element. This method allows you to tell the command to the pipeline and it will advise all its elements.

There are also buses and message reporting functionalities which I'm not going to explain in this post because it will be too long.

Finally, as an exemple of the above explained, we have the first "hello world" application, which is an audio player of the Vorbis encoded content in an OGG file.

Introduction to the Gstreamer System Architecture_第2张图片

In the next posts I'm going to explain how it functions by putting snippets of code, and extending a little bit more the bus and message functionalities.

你可能感兴趣的:(Architecture)