Interfaces
Previously, in the chapter , we have
introduced the concept of GObject properties of controlling an element's
behaviour. This is a very powerful, but has two big disadvantage: firstly,
it is too generic, and secondly, it isn't dynamic.
The first disadvantage has to do with customizability of the end-user
interface that will be built to control the element. Some properties are
more important than others. Some integer properties are better shown in a
spin-button widget, whereas others would be better represented by a slider
widget. Such things are not possible because the UI has no actual meaning
in the application. A UI widget that stands for a bitrate property is the
same as an UI widget that stands for the size of a video, as long as both
are of the same GParamSpec type. Another problem,
related to the one about parameter important, is that things like parameter
grouping, function grouping or anything to make parameters coherent, is not
really possible.
The second argument against parameters are that they are not dynamic. In
many cases, the allowed values for a property are not fixed, but depend
on things that can only be detected at run-time. The names of inputs for
a TV card in a video4linux source element, for example, can only be
retrieved from the kernel driver when we've opened the device; this only
happens when the element goes into the READY state. This means that we
cannot create an enum property type to show this to the user.
The solution to those problems is to create very specialized types of
controls for certain often-used controls. We use the concept of interfaces
to achieve this. The basis of this all is the glib
GTypeInterface type. For each case where we think
it's useful, we've created interfaces which can be implemented by elements
at their own will. We've also created a small extension to
GTypeInterface (which is static itself, too) which
allows us to query for interface availability based on runtime properties.
This extension is called GstImplementsInterface.
How to Implement Interfaces
WRITEME
Mixer Interface
WRITEME
Tuner Interface
WRITEME
Color Balance Interface
WRITEME
Property Probe Interface
WRITEME
Profile Interface
WRITEME
X Overlay Interface
WRITEME
Navigation Interface
WRITEME
Tagging Interface
WRITEME