2016-06-04 06:55:52 +00:00
|
|
|
---
|
|
|
|
title: Interfaces
|
|
|
|
...
|
|
|
|
|
|
|
|
# Interfaces
|
|
|
|
|
2017-09-08 23:10:43 +00:00
|
|
|
[Using an element as a GObject][element-object] presents the use of `GObject`
|
|
|
|
properties as a simple way for applications and elements to interact. This
|
|
|
|
method suffices for simple getters and setters, but fails for anything more
|
|
|
|
complicated. For more complex use cases, GStreamer uses interfaces based on the
|
|
|
|
`GObject`
|
2021-07-14 15:00:56 +00:00
|
|
|
[`GTypeInterface`](http://library.gnome.org/devel/gobject/stable/gtype-non-instantiatable-classed.html)
|
2016-06-04 06:55:52 +00:00
|
|
|
type.
|
|
|
|
|
2017-09-08 23:10:43 +00:00
|
|
|
This text is meant to be introductory and does not include source code examples.
|
2019-03-25 10:54:43 +00:00
|
|
|
Please take a look at the API reference for additional details.
|
2016-06-04 06:55:52 +00:00
|
|
|
|
2016-11-14 16:50:57 +00:00
|
|
|
[element-object]: application-development/basics/elements.md#using-an-element-as-a-gobject
|
2016-11-14 16:29:47 +00:00
|
|
|
|
2017-09-08 00:35:41 +00:00
|
|
|
## The URI Handler interface
|
|
|
|
|
2017-09-08 23:10:43 +00:00
|
|
|
In our examples so far, we have only showed support for local files
|
2017-09-08 00:35:41 +00:00
|
|
|
using the “filesrc” element, but GStreamer supports many more location
|
|
|
|
sources.
|
|
|
|
|
|
|
|
GStreamer doesn't require applications to know any `URI` specifics, like
|
|
|
|
what element to use for a particular network source types. These details
|
|
|
|
are abstracted by the `GstURIHandler` interface.
|
|
|
|
|
|
|
|
There is no strict rule for `URI` naming, but in general, we follow
|
|
|
|
common-usage naming conventions. For example, assuming you have the
|
|
|
|
correct plugins installed, GStreamer supports:
|
2016-06-04 06:55:52 +00:00
|
|
|
|
2017-09-07 22:42:02 +00:00
|
|
|
```
|
|
|
|
file:///<path>/<file>
|
|
|
|
http://<host>/<path>/<file>
|
2021-10-20 00:03:26 +00:00
|
|
|
rtsp://<host>/<path>
|
2017-09-08 00:35:41 +00:00
|
|
|
dvb://<CHANNEL>
|
2017-09-07 22:42:02 +00:00
|
|
|
...
|
|
|
|
```
|
2017-09-08 00:35:41 +00:00
|
|
|
|
2016-06-04 06:55:52 +00:00
|
|
|
In order to get the source or sink element supporting a particular URI,
|
2017-09-08 00:35:41 +00:00
|
|
|
use `gst_element_make_from_uri ()` with `GST_URI_SRC` or `GST_URI_SINK`
|
|
|
|
as `GstURIType` depending in the direction you need.
|
2016-06-04 06:55:52 +00:00
|
|
|
|
|
|
|
You can convert filenames to and from URIs using GLib's
|
|
|
|
`g_filename_to_uri ()` and `g_uri_to_filename ()`.
|
|
|
|
|
2016-06-17 22:41:07 +00:00
|
|
|
## The Color Balance interface
|
2016-06-04 06:55:52 +00:00
|
|
|
|
2017-09-07 22:47:27 +00:00
|
|
|
The `GstColorBalance` interface is a way to control video-related properties
|
2019-03-25 10:54:43 +00:00
|
|
|
on an element, such as brightness, contrast and so on. Its sole reason
|
2016-06-04 06:55:52 +00:00
|
|
|
for existence is that, as far as its authors know, there's no way to
|
|
|
|
dynamically register properties using `GObject`.
|
|
|
|
|
|
|
|
The colorbalance interface is implemented by several plugins, including
|
2017-09-07 22:47:27 +00:00
|
|
|
`xvimagesink`, `glimagesink` and the `Video4linux2` elements.
|
2016-06-04 06:55:52 +00:00
|
|
|
|
2016-06-17 22:41:07 +00:00
|
|
|
## The Video Overlay interface
|
2016-06-04 06:55:52 +00:00
|
|
|
|
2017-09-07 22:47:27 +00:00
|
|
|
The `GstVideoOverlay` interface was created to solve the problem of
|
2016-06-04 06:55:52 +00:00
|
|
|
embedding video streams in an application window. The application
|
2017-09-07 22:42:02 +00:00
|
|
|
provides a window handle to an element implementing this interface,
|
|
|
|
and the element will then use this window handle to draw on
|
2016-06-04 06:55:52 +00:00
|
|
|
rather than creating a new toplevel window. This is useful to embed
|
|
|
|
video in video players.
|
|
|
|
|
2017-09-07 22:42:02 +00:00
|
|
|
This interface is implemented by, amongst others, the `Video4linux2`
|
2017-09-07 22:47:27 +00:00
|
|
|
elements and by `glimagesink`, `ximagesink`, `xvimagesink` and `sdlvideosink`.
|
2017-09-08 21:08:17 +00:00
|
|
|
|
|
|
|
## Other interfaces
|
|
|
|
|
|
|
|
There are quite a few other interfaces provided by GStreamer and implemented by
|
|
|
|
some of its elements. Among them:
|
|
|
|
|
|
|
|
* `GstChildProxy` For access to internal element's properties on multi-child elements
|
|
|
|
* `GstNavigation` For the sending and parsing of navigation events
|
|
|
|
* `GstPreset` For handling element presets
|
|
|
|
* `GstRTSPExtension` An RTSP Extension interface
|
|
|
|
* `GstStreamVolume` Interface to provide access and control stream volume levels
|
|
|
|
* `GstTagSetter` For handling media metadata
|
|
|
|
* `GstTagXmpWriter` For elements that provide XMP serialization
|
|
|
|
* `GstTocSetter` For setting and retrieval of TOC-like data
|
|
|
|
* `GstTuner` For elements providing RF tunning operations
|
|
|
|
* `GstVideoDirection` For video rotation and flipping controls
|
|
|
|
* `GstVideoOrientation` For video orientation controls
|
|
|
|
* `GstWaylandVideo` Wayland video interface
|
|
|
|
|