2004-12-15 17:32:49 +00:00
|
|
|
<chapter id="chapter-interfaces">
|
|
|
|
<title>Interfaces</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
In <xref linkend="section-elements-properties"/>, you have learned how
|
|
|
|
to use <classname>GObject</classname> properties as a simple way to do
|
|
|
|
interaction between applications and elements. This method suffices for
|
|
|
|
the simple'n'straight settings, but fails for anything more complicated
|
|
|
|
than a getter and setter. For the more complicated use cases, &GStreamer;
|
2010-07-12 12:39:00 +00:00
|
|
|
uses interfaces based on the GObject <ulink type="http"
|
|
|
|
url="http://library.gnome.org/devel/gobject/stable/gtype-non-instantiable-classed.html"><classname>GTypeInterface</classname></ulink>
|
|
|
|
type.
|
2004-12-15 17:32:49 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Most of the interfaces handled here will not contain any example code.
|
|
|
|
See the API references for details. Here, we will just describe the
|
|
|
|
scope and purpose of each interface.
|
|
|
|
</para>
|
|
|
|
|
2005-06-29 09:25:51 +00:00
|
|
|
<sect1 id="section-interfaces-uri">
|
|
|
|
<title>The URI interface</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
In all examples so far, we have only supported local files through the
|
|
|
|
<quote>filesrc</quote> element. &GStreamer;, obviously, supports many
|
|
|
|
more location sources. However, we don't want applications to need to
|
|
|
|
know any particular element implementation details, such as element
|
|
|
|
names for particular network source types and so on. Therefore, there
|
|
|
|
is a URI interface, which can be used to get the source element that
|
|
|
|
supports a particular URI type. There is no strict rule for URI naming,
|
|
|
|
but in general we follow naming conventions that others use, too. For
|
|
|
|
example, assuming you have the correct plugins installed, &GStreamer;
|
|
|
|
supports <quote>file:///<path>/<file></quote>,
|
|
|
|
<quote>http://<host>/<path>/<file></quote>,
|
|
|
|
<quote>mms://<host>/<path>/<file></quote>, and so on.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
In order to get the source or sink element supporting a particular URI,
|
|
|
|
use <function>gst_element_make_from_uri ()</function>, with the URI
|
|
|
|
type being either <classname>GST_URI_SRC</classname> for a source
|
|
|
|
element, or <classname>GST_URI_SINK</classname> for a sink element.
|
|
|
|
</para>
|
2009-11-25 15:39:44 +00:00
|
|
|
<para>
|
|
|
|
You can convert filenames to and from URIs using GLib's
|
|
|
|
<function>g_filename_to_uri ()</function> and
|
|
|
|
<function>g_uri_to_filename ()</function>.
|
|
|
|
</para>
|
2005-06-29 09:25:51 +00:00
|
|
|
</sect1>
|
|
|
|
|
2004-12-15 17:32:49 +00:00
|
|
|
<sect1 id="section-interfaces-colorbalance">
|
|
|
|
<title>The Color Balance interface</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The colorbalance interface is a way to control video-related properties
|
|
|
|
on an element, such as brightness, contrast and so on. It's sole
|
2010-07-12 12:39:00 +00:00
|
|
|
reason for existence is that, as far as its authors know, there's no
|
2004-12-15 17:32:49 +00:00
|
|
|
way to dynamically register properties using
|
|
|
|
<classname>GObject</classname>.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The colorbalance interface is implemented by several plugins, including
|
2012-09-25 12:40:20 +00:00
|
|
|
xvimagesink and the Video4linux2 elements.
|
2004-12-15 17:32:49 +00:00
|
|
|
</para>
|
|
|
|
</sect1>
|
|
|
|
|
2012-09-25 12:40:20 +00:00
|
|
|
<sect1 id="section-interfaces-videooverlay">
|
|
|
|
<title>The Video Overlay interface</title>
|
2004-12-15 17:32:49 +00:00
|
|
|
|
|
|
|
<para>
|
2012-09-25 12:40:20 +00:00
|
|
|
The Video Overlay interface was created to solve the problem of embedding
|
2004-12-15 17:32:49 +00:00
|
|
|
video streams in an application window. The application provides an
|
2012-09-25 12:40:20 +00:00
|
|
|
window handle to the element implementing this interface to draw on, and
|
|
|
|
the element will then use this window handle to draw on rather than creating
|
2004-12-15 17:32:49 +00:00
|
|
|
a new toplevel window. This is useful to embed video in video players.
|
|
|
|
</para>
|
|
|
|
<para>
|
2012-09-25 12:40:20 +00:00
|
|
|
This interface is implemented by, amongst others, the Video4linux2
|
|
|
|
elements and by ximagesink, xvimagesink and sdlvideosink.
|
2004-12-15 17:32:49 +00:00
|
|
|
</para>
|
|
|
|
</sect1>
|
|
|
|
</chapter>
|