GStreamer Application Development Manual (0.8.5) | ||
---|---|---|
<<< Previous | More on factories | Next >>> |
GStreamer uses MIME types to identify the different types of data that can be handled by the elements. They are the high level mechanisms to make sure that everyone is talking about the right kind of data.
A MIME (Multipurpose Internet Mail Extension) type is a pair of strings that denote a certain type of data. Examples include:
audio/x-raw-int : raw audio samples
audio/mpeg : MPEG audio
video/mpeg : MPEG video
An element must associate a MIME type to its source and sink pads when it is loaded into the system. GStreamer knows about the different elements and what type of data they expect and emit. This allows for very dynamic and extensible element creation as we will see.
As we have seen in the previous chapter, MIME types are added to the Capability structure of a pad.
Figure 1 shows the MIME types associated with each pad from the "hello world" example.
We will see how you can create an element based on the MIME types of its source and sink pads. This way the end-user will have the ability to choose his/her favorite audio/mpeg decoder without you even having to care about it.
The typing of the source and sink pads also makes it possible to 'autoplug' a pipeline. We will have the ability to say: "construct a pipeline that does an audio/mpeg to audio/x-raw-int conversion".
![]() | The basic GStreamer library does not try to solve all of your autoplug problems. It leaves the hard decisions to the application programmer, where they belong. |
<<< Previous | Home | Next >>> |
More on factories | Up | GStreamer types |