Update theme submodule
[platform/upstream/gstreamer.git] / tutorial-basic-platform-specific-elements.md
1 # Basic tutorial 16: Platform-specific elements
2
3 ## Goal
4
5 Even though GStreamer is a multiplatform framework, not all the elements
6 are available on all platforms. For example, the video sinks
7 depend heavily on the underlying windowing system, and a different one
8 needs to be selected depending on the platform. You normally do not need
9 to worry about this when using elements like `playbin` or
10 `autovideosink`, but, for those cases when you need to use one of the
11 sinks that are only available on specific platforms, this tutorial hints
12 you some of their peculiarities.
13
14 ## Cross Platform
15
16 ### `glimagesink`
17
18 This video sink is based on
19 [OpenGL](http://en.wikipedia.org/wiki/OpenGL) or [OpenGL ES](https://en.wikipedia.org/wiki/OpenGL_ES). It supports rescaling
20 and filtering of the scaled image to alleviate aliasing. It implements
21 the VideoOverlay interface, so the video window can be re-parented
22 (embedded inside other windows). This is the video sink recommended on
23 most platforms. In particular, on Android and iOS, it is the only
24 available video sink. It can be decomposed into
25 `glupload ! glcolorconvert ! glimagesinkelement` to insert further OpenGL
26 hardware accelerated processing into the pipeline.
27
28 ## Linux
29
30 ### `ximagesink`
31
32 A standard RGB only X-based video sink. It implements the VideoOverlay
33 interface, so the video window can be re-parented (embedded inside
34 other windows). It does not support scaling or color formats other
35 than RGB; it has to be performed by different means (using the
36 `videoscale` element, for example).
37
38 ### `xvimagesink`
39
40 An X-based video sink, using the [X Video
41 Extension](http://en.wikipedia.org/wiki/X_video_extension) (Xv). It
42 implements the VideoOverlay interface, so the video window can be
43 re-parented (embedded inside other windows). It can perform scaling
44 efficiently, on the GPU. It is only available if the hardware and
45 corresponding drivers support the Xv extension.
46
47 ### `alsasink`
48
49 This audio sink outputs to the sound card via
50 [ALSA](http://www.alsa-project.org/) (Advanced Linux Sound
51 Architecture). This sink is available on almost every Linux platform. It
52 is often seen as a “low level” interface to the sound card, and can be
53 complicated to configure (See the comment on
54 [](tutorial-playback-digital-audio-pass-through.md)).
55
56 ### `pulsesink`
57
58 This sink plays audio to a [PulseAudio](http://www.pulseaudio.org/)
59 server. It is a higher level abstraction of the sound card than ALSA,
60 and is therefore easier to use and offers more advanced features. It has
61 been known to be unstable on some older Linux distributions, though.
62
63 ## Mac OS X
64
65 ### `osxvideosink`
66
67 This is the  video sink available to GStreamer on Mac OS X. It is also
68 possible to draw using `glimagesink` using OpenGL.
69
70 ### `osxaudiosink`
71
72 This is the only audio sink available to GStreamer on Mac OS X.
73
74 ## Windows
75
76 ### `directdrawsink`
77
78 This is the oldest of the Windows video sinks, based on [Direct
79 Draw](http://en.wikipedia.org/wiki/DirectDraw). It requires DirectX 7,
80 so it is available on almost every current Windows platform. It supports
81 rescaling and filtering of the scaled image to alleviate aliasing.
82
83 ### `dshowvideosink`
84
85 This video sink is based on [Direct
86 Show](http://en.wikipedia.org/wiki/Direct_Show).  It can use different
87 rendering back-ends, like
88 [EVR](http://en.wikipedia.org/wiki/Enhanced_Video_Renderer),
89 [VMR9](http://en.wikipedia.org/wiki/Direct_Show#Video_rendering_filters)
90 or
91 [VMR7](http://en.wikipedia.org/wiki/Direct_Show#Video_rendering_filters),
92 EVR only being available on Windows Vista or more recent. It supports
93 rescaling and filtering of the scaled image to alleviate aliasing. It
94 implements the VideoOverlay interface, so the video window can be
95 re-parented (embedded inside other windows).
96
97 ### `d3dvideosink`
98
99 This video sink is based on
100 [Direct3D](http://en.wikipedia.org/wiki/Direct3D) and it’s the most
101 recent Windows video sink. It supports rescaling and filtering of the
102 scaled image to alleviate aliasing. It implements the VideoOverlay
103 interface, so the video window can be re-parented (embedded inside other
104 windows).
105
106 ### `directsoundsink`
107
108 This is the default audio sink for Windows, based on [Direct
109 Sound](http://en.wikipedia.org/wiki/DirectSound), which is available in
110 all Windows versions.
111
112 ### `dshowdecwrapper`
113
114 [Direct Show](http://en.wikipedia.org/wiki/Direct_Show) is a multimedia
115 framework similar to GStreamer. They are different enough, though, so
116 that their pipelines cannot be interconnected. However, through this
117 element, GStreamer can benefit from the decoding elements present in
118 Direct Show. `dshowdecwrapper` wraps multiple Direct Show decoders so
119 they can be embedded in a GStreamer pipeline. Use the `gst-inspect-1.0` tool
120 (see [](tutorial-basic-gstreamer-tools.md)) to see the
121 available decoders.
122
123 ## Android
124
125 ### `openslessink`
126
127 This is the only audio sink available to GStreamer on Android. It is
128 based on [OpenSL ES](http://en.wikipedia.org/wiki/OpenSL_ES).
129
130 ### `openslessrc`
131
132 This is the only audio source available to GStreamer on Android. It is
133 based on [OpenSL ES](http://en.wikipedia.org/wiki/OpenSL_ES).
134
135 ### `androidmedia`
136
137 [android.media.MediaCodec](http://developer.android.com/reference/android/media/MediaCodec.html)
138 is an Android specific API to access the codecs that are available on
139 the device, including hardware codecs. It is available since API level
140 16 (JellyBean) and GStreamer can use it via the androidmedia plugin
141 for audio and video decoding. On Android, attaching the hardware
142 decoder to the `glimagesink` element can produce a high performance
143 zero-copy decodebin pipeline.
144
145 ### `ahcsrc`
146
147 This video source can capture from the cameras on Android devices, it is part
148 of the androidmedia plugin and uses the [android.hardware.Camera API](https://developer.android.com/reference/android/hardware/Camera.html).
149
150 ## iOS
151
152 ### `osxaudiosink`
153
154 This is the only audio sink available to GStreamer on iOS.
155
156 ### `iosassetsrc`
157
158 Source element to read iOS assets, this is, documents stored in the
159 Library (like photos, music and videos). It can be instantiated
160 automatically by `playbin` when URIs use the
161 `assets-library://` scheme.
162
163 ### `iosavassetsrc`
164
165 Source element to read and decode iOS audiovisual assets, this is,
166 documents stored in the Library (like photos, music and videos). It can
167 be instantiated automatically by `playbin` when URIs use the
168 `ipod-library://` scheme. Decoding is performed by the system, so
169 dedicated hardware will be used if available.
170
171 ## Conclusion
172
173 This tutorial has shown a few specific details about some GStreamer
174 elements which are not available on all platforms. You do not have to
175 worry about them when using multiplatform elements like `playbin` or
176 `autovideosink`, but it is good to know their personal quirks if
177 instancing them manually.
178
179 It has been a pleasure having you here, and see you soon!