s/ffmpegcolorspace/videoconvert/ in a few places
[platform/upstream/gstreamer.git] / manual-interfaces.md
1 ---
2 title: Interfaces
3 ...
4
5 # Interfaces
6
7 In [Using an element as a
8 GObject](manual-elements.md#using-an-element-as-a-gobject), you have
9 learned how to use `GObject` properties as a simple way to do
10 interaction between applications and elements. This method suffices for
11 the simple'n'straight settings, but fails for anything more complicated
12 than a getter and setter. For the more complicated use cases, GStreamer
13 uses interfaces based on the GObject
14 [`GTypeInterface`](http://library.gnome.org/devel/gobject/stable/gtype-non-instantiable-classed.html)
15 type.
16
17 Most of the interfaces handled here will not contain any example code.
18 See the API references for details. Here, we will just describe the
19 scope and purpose of each interface.
20
21 ## The URI interface
22
23 In all examples so far, we have only supported local files through the
24 “filesrc” element. GStreamer, obviously, supports many more location
25 sources. However, we don't want applications to need to know any
26 particular element implementation details, such as element names for
27 particular network source types and so on. Therefore, there is a URI
28 interface, which can be used to get the source element that supports a
29 particular URI type. There is no strict rule for URI naming, but in
30 general we follow naming conventions that others use, too. For example,
31 assuming you have the correct plugins installed, GStreamer supports
32 “file:///\<path\>/\<file\>”, “http://\<host\>/\<path\>/\<file\>”,
33 “mms://\<host\>/\<path\>/\<file\>”, and so on.
34
35 In order to get the source or sink element supporting a particular URI,
36 use `gst_element_make_from_uri ()`, with the URI type being either
37 `GST_URI_SRC` for a source element, or `GST_URI_SINK` for a sink
38 element.
39
40 You can convert filenames to and from URIs using GLib's
41 `g_filename_to_uri ()` and `g_uri_to_filename ()`.
42
43 ## The Color Balance interface
44
45 The colorbalance interface is a way to control video-related properties
46 on an element, such as brightness, contrast and so on. It's sole reason
47 for existence is that, as far as its authors know, there's no way to
48 dynamically register properties using `GObject`.
49
50 The colorbalance interface is implemented by several plugins, including
51 xvimagesink and the Video4linux2 elements.
52
53 ## The Video Overlay interface
54
55 The Video Overlay interface was created to solve the problem of
56 embedding video streams in an application window. The application
57 provides an window handle to the element implementing this interface to
58 draw on, and the element will then use this window handle to draw on
59 rather than creating a new toplevel window. This is useful to embed
60 video in video players.
61
62 This interface is implemented by, amongst others, the Video4linux2
63 elements and by ximagesink, xvimagesink and sdlvideosink.
64