2016-12-05 21:12:24 +00:00
|
|
|
# Element Klass definition
|
|
|
|
|
|
|
|
## Purpose
|
|
|
|
|
|
|
|
Applications should be able to retrieve elements from the registry of
|
|
|
|
existing elements based on specific capabilities or features of the
|
|
|
|
element.
|
|
|
|
|
|
|
|
A playback application might want to retrieve all the elements that can
|
|
|
|
be used for visualisation, for example, or a video editor might want to
|
|
|
|
select all video effect filters.
|
|
|
|
|
|
|
|
The topic of defining the klass of elements should be based on use
|
|
|
|
cases.
|
|
|
|
|
|
|
|
A list of classes that are used in a installation can be generated
|
2017-03-20 18:15:08 +00:00
|
|
|
using:
|
|
|
|
|
|
|
|
```
|
|
|
|
gst-inspect-1.0 -a | grep -ho Klass.\* | cut -c8- | sort | uniq
|
|
|
|
```
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
## Proposal
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
The `GstElementDetails` contains a field named klass that is a pointer to
|
2016-12-05 21:12:24 +00:00
|
|
|
a string describing the element type.
|
|
|
|
|
|
|
|
In this document we describe the format and contents of the string.
|
|
|
|
Elements should adhere to this specification although that is not
|
|
|
|
enforced to allow for wild (application specific) customisation.
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
### String format
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
```
|
|
|
|
<keyword>['/'<keyword]*
|
|
|
|
```
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
The string consists of an ***unordered*** list of keywords separated with a '/'
|
|
|
|
character. While the / suggests a hierarchy, this is ***not*** the case.
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
### Keyword categories
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
#### Functional
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
Categories are base on ***intended usage*** of the element. Some elements
|
2016-12-05 21:12:24 +00:00
|
|
|
might have other side-effects (especially for filers/effects). The purpose
|
|
|
|
is to list enough keywords so that applications can do meaningful filtering,
|
2017-03-20 18:15:08 +00:00
|
|
|
not to completely describe the functionality that is expressed in caps.
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Source: produces data
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Sink: consumes data
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Filter: filters/transforms data, no modification on the data is
|
2016-12-05 21:12:24 +00:00
|
|
|
intended (although it might be unavoidable). The filter can
|
|
|
|
decide on input and output caps independently of the stream
|
|
|
|
contents (GstBaseTransform).
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Effect: applies an effect to some data, changes to data are
|
2016-12-05 21:12:24 +00:00
|
|
|
intended. Examples are colorbalance, volume. These elements can
|
|
|
|
also be implemented with GstBaseTransform.
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Demuxer: splits audio, video, … from a stream
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Muxer: interleave audio, video, … into one stream, this is like
|
2016-12-05 21:12:24 +00:00
|
|
|
mixing but without losing or degrading each separate input
|
|
|
|
stream. The reverse operation is possible with a Demuxer that
|
|
|
|
reproduces the exact same input streams.
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Decoder: decodes encoded data into a raw format, there is
|
2016-12-05 21:12:24 +00:00
|
|
|
typically no relation between input caps and output caps. The
|
|
|
|
output caps are defined in the stream data. This separates the
|
|
|
|
Decoder from the Filter and Effect.
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Encoder: encodes raw data into an encoded format.
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Mixer: combine audio, video, .. this is like muxing but with
|
2016-12-05 21:12:24 +00:00
|
|
|
applying some algorithm so that the individual streams are not
|
|
|
|
extractable anymore, there is therefore no reverse operation to
|
|
|
|
mixing. (audio mixer, video mixer, …)
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Converter: convert audio into video, text to audio, … The
|
2016-12-05 21:12:24 +00:00
|
|
|
converter typically works on raw types only. The source media
|
|
|
|
type is listed first.
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Analyzer: reports about the stream contents.
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Control: controls some aspect of a hardware device
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Extracter: extracts tags/headers from a stream
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Formatter: adds tags/headers to a stream
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Connector: allows for new connections in the pipeline. (tee, …)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
- …
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
#### Based on media type
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
Purpose is to make a selection for elements operating on the different
|
|
|
|
types of media. An audio application must be able to filter out the
|
|
|
|
elements operating on audio, for example.
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Audio: operates on audio data
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Video: operates on video data
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Image: operates on image data. Usually this media type can also
|
2016-12-05 21:12:24 +00:00
|
|
|
be used to make a video stream in which case it is added
|
|
|
|
together with the Video media type.
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Text: operates on text data
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Metadata: operates on metadata
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
- …
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
#### Extra features
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
The purpose is to further specialize the element, mostly for
|
|
|
|
application specific needs.
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Network: element is used in networked situations
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Protocol: implements some protocol (RTSP, HTTP, …)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Payloader: encapsulate as payload (RTP, RDT,.. )
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Depayloader: strip a payload (RTP, RDT,.. )
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- RTP: intended to be used in RTP applications
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Device: operates on some hardware device (disk, network, audio
|
2016-12-05 21:12:24 +00:00
|
|
|
card, video card, usb, …)
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Visualisation: intended to be used for audio visualisation
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Debug: intended usage is more for debugging purposes.
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
#### Categories found, but not yet in one of the above lists
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Bin: playbin, decodebin, bin, pipeline
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Codec: lots of decoders, encoder, demuxers should be removed?
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Generic: should be removed?
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- File: like network, should go to Extra?
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
- Editor: gnonlin, textoverlays
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
- DVD, GDP, LADSPA, Parser, Player, Subtitle, Testing, …
|
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
### Suggested order:
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
```
|
2016-12-05 21:12:24 +00:00
|
|
|
<functional>[/<media type>]*[/<extra...>]*
|
2017-03-20 18:15:08 +00:00
|
|
|
```
|
2016-12-05 21:12:24 +00:00
|
|
|
|
2017-03-20 18:15:08 +00:00
|
|
|
### Examples:
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
apedemux : Extracter/Metadata
|
|
|
|
audiotestsrc : Source/Audio
|
|
|
|
autoaudiosink : Sink/Audio/Device
|
|
|
|
cairotimeoverlay : Mixer/Video/Text
|
|
|
|
dvdec : Decoder/Video
|
|
|
|
dvdemux : Demuxer
|
|
|
|
goom : Converter/Audio/Video
|
|
|
|
id3demux : Extracter/Metadata
|
|
|
|
udpsrc : Source/Network/Protocol/Device
|
|
|
|
videomixer : Mixer/Video
|
|
|
|
videoconvert : Filter/Video (intended use to convert video with as little
|
|
|
|
visible change as possible)
|
|
|
|
vertigotv : Effect/Video (intended use is to change the video)
|
|
|
|
volume : Effect/Audio (intended use is to change the audio data)
|
|
|
|
vorbisdec : Decoder/Audio
|
|
|
|
vorbisenc : Encoder/Audio
|
|
|
|
oggmux : Muxer
|
|
|
|
adder : Mixer/Audio
|
|
|
|
videobox : Effect/Video
|
|
|
|
alsamixer : Control/Audio/Device
|
|
|
|
audioconvert : Filter/Audio
|
|
|
|
audioresample : Filter/Audio
|
|
|
|
xvimagesink : Sink/Video/Device
|
|
|
|
navseek : Filter/Debug
|
|
|
|
decodebin : Decoder/Demuxer
|
|
|
|
level : Filter/Analyzer/Audio
|
|
|
|
tee : Connector/Debug
|
|
|
|
|
|
|
|
### open issues:
|
|
|
|
|
|
|
|
- how to differentiate physical devices from logical ones?
|
|
|
|
autoaudiosink : Sink/Audio/Device alsasink : Sink/Audio/Device
|
|
|
|
|
|
|
|
## Use cases
|
|
|
|
|
|
|
|
- get a list of all elements implementing a video effect (pitivi):
|
|
|
|
|
|
|
|
klass.contains (Effect & Video)
|
|
|
|
|
|
|
|
- get list of muxers (pitivi):
|
|
|
|
|
|
|
|
klass.contains (Muxer)
|
|
|
|
|
|
|
|
- get list of video encoders (pitivi):
|
|
|
|
|
|
|
|
klass.contains (Encoder & video)
|
|
|
|
|
|
|
|
- Get a list of all audio/video visualisations (totem):
|
|
|
|
|
|
|
|
klass.contains (Visualisation)
|
|
|
|
|
|
|
|
- Get a list of all decoders/demuxer/metadata parsers/vis (playbin):
|
|
|
|
|
|
|
|
klass.contains (Visualisation | Demuxer | Decoder | (Extractor & Metadata))
|
|
|
|
|
|
|
|
- Get a list of elements that can capture from an audio device
|
|
|
|
(gst-properties):
|
|
|
|
|
|
|
|
klass.contains (Source & Audio & Device)
|
|
|
|
|
|
|
|
- filters out audiotestsrc, since it is not a device
|