1. Components (Elements)
Elements (Element) are the most important concepts in GStreamer.
You can transfer the data flow between the connected components (Elements) by creating a series of components (Elements) and connecting them together.
Each component (Elements) has a special function interface, and for some component (Elements) function interfaces They are used to read the file data and decode the file data.
Some component (Elements) function interfaces simply output the corresponding data to a specific device (for example, a sound card device).
You can connect several components (Elements) together to create a pipeline (pipeline) to accomplish a special task,
For example, media playback or recording. GStreamer has installed a number of useful components (Elements) by default,
By using these components (Elements) You can build an application with multiple functions.
Of course, if you need to, you can write a new component (Elements) yourself.
2. Cabinets (Bins) and pipes (pipelines)
A cabinet (Bins) is a container that can load components (element).
A pipe (pipelines) is a special subtype of a cabinet (Bins), and a pipe (pipelines) can manipulate all components contained within itself (element).
Since the cabinet (Bins) itself is a subset of elements (element), you can operate a cabinet (Bins) Just like the normal element (element),
This way you can reduce the complexity of your application. You can change the state of a cabinet (Bins) to change the state of all components (element) inside a cabinet (Bins).
The box cabinet (Bins) can send a bus message (messages) to its subset element (element), which includes the following: Error message (ERR messages),
Label message (tag messages), EOS message (EOS messages)).
The pipe (pipeline) is an advanced cabinet (Bins). When you set the pause or playback state of the pipe, the data flow will begin to flow,
and media data processing is also beginning to be processed. Once started, the pipeline will run in a separate thread until it is stopped or the data stream is finished.
3. Liner (Pads)
Liners (Pads) are used in GStreamer to link multiple components, allowing traffic to flow through such links.
A gasket (PADS) can be seen as a component (element) receptacle or port, and the link between elements (element) is dependent on the padding (Pads).
Liners (Pads) have the ability to handle special data: a gasket (PADS) can limit the flow type of traffic. The criteria for success of the link are:
Only when two pads (Pads) allow the data type to be passed is established.
The data type is set using a method called the caps negotiation. The data type is described as a gstcaps variable.
The following analogy may help you understand padding (Pads). A gasket (PADS) is much like a plug on a physical device.
For example a home theater system. A home theater system consists of an amplifier (amplifier), a DVD player, and a silent video projection.
We need to connect the DVD player to the amplifier (amplifier) because both devices have audio jacks;
We also need to connect the projector to the DVD player because both devices have a video processing socket.
But it is difficult to connect the projector to the amplifier (amplifier) because they are dealing with different sockets.
The GStreamer liner (Pads) acts the same as a socket in a home theater system.
For the most part, all traffic flows between the linked elements.
The data flows outside the element (element) through one or more source pads (Pads),
Element (element) accepts data through one or more sink liners (Pads).
The source element (element) and the sink element (element) have only one sink gasket (Pads) or source liner (Pads), respectively.
The data here represents the buffer (buffers) (The Gstbuffer object describes the data buffer (buffers) information) and the event (events)
(The Gstevent object describes the event (events) information for the data).
GStreamer Basic Concept Introduction (must read before development)