1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>gstpbutilsinstallplugins</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-base-utils.html" title="Base Utils Library">
9 <link rel="prev" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html" title="gstpbutilsmissingplugins">
10 <link rel="next" href="gst-plugins-base-libs-gstdiscoverer.html" title="gstdiscoverer">
11 <meta name="generator" content="GTK-Doc V1.17 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-base-utils.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer Base Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gst-plugins-base-libs-gstdiscoverer.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gstpbutilsinstallplugins.synopsis" class="shortcut">Top</a>
26 <a href="#gst-plugins-base-libs-gstpbutilsinstallplugins.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="gst-plugins-base-libs-gstpbutilsinstallplugins"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="gst-plugins-base-libs-gstpbutilsinstallplugins.top_of_page"></a>gstpbutilsinstallplugins</span></h2>
34 <p>gstpbutilsinstallplugins — Missing plugin installation support for applications</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="gst-plugins-base-libs-gstpbutilsinstallplugins.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include <gst/pbutils/install-plugins.h>
43 enum <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn">GstInstallPluginsReturn</a>;
44 <span class="returnvalue">void</span> (<a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsResultFunc" title="GstInstallPluginsResultFunc ()">*GstInstallPluginsResultFunc</a>) (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn"><span class="type">GstInstallPluginsReturn</span></a> result</code></em>,
45 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
46 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn"><span class="returnvalue">GstInstallPluginsReturn</span></a> <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async" title="gst_install_plugins_async ()">gst_install_plugins_async</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **details</code></em>,
47 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> *ctx</code></em>,
48 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsResultFunc" title="GstInstallPluginsResultFunc ()"><span class="type">GstInstallPluginsResultFunc</span></a> func</code></em>,
49 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
50 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn"><span class="returnvalue">GstInstallPluginsReturn</span></a> <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-sync" title="gst_install_plugins_sync ()">gst_install_plugins_sync</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **details</code></em>,
51 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> *ctx</code></em>);
52 const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-return-get-name" title="gst_install_plugins_return_get_name ()">gst_install_plugins_return_get_name</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn"><span class="type">GstInstallPluginsReturn</span></a> ret</code></em>);
53 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-installation-in-progress" title="gst_install_plugins_installation_in_progress ()">gst_install_plugins_installation_in_progress</a>
54 (<em class="parameter"><code><span class="type">void</span></code></em>);
55 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-supported" title="gst_install_plugins_supported ()">gst_install_plugins_supported</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
57 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext">GstInstallPluginsContext</a>;
58 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="returnvalue">GstInstallPluginsContext</span></a> * <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-new" title="gst_install_plugins_context_new ()">gst_install_plugins_context_new</a>
59 (<em class="parameter"><code><span class="type">void</span></code></em>);
60 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-free" title="gst_install_plugins_context_free ()">gst_install_plugins_context_free</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> *ctx</code></em>);
61 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-set-xid" title="gst_install_plugins_context_set_xid ()">gst_install_plugins_context_set_xid</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> *ctx</code></em>,
62 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> xid</code></em>);
65 <div class="refsect1">
66 <a name="gst-plugins-base-libs-gstpbutilsinstallplugins.description"></a><h2>Description</h2>
69 <div class="refsect2">
70 <a name="idp23991312"></a><h3>Overview</h3>
72 Using this API, applications can request the installation of missing
73 GStreamer plugins. These may be missing decoders/demuxers or encoders/muxers
74 for a certain format, sources or sinks for a certain URI protocol
75 (e.g. 'http'), or certain elements known by their element factory name
79 Whether plugin installation is supported or not depends on the operating
80 system and/or distribution in question. The vendor of the operating system
81 needs to make sure the necessary hooks and mechanisms are in place for
82 plugin installation to work. See below for more detailed information.
85 From the application perspective, plugin installation is usually triggered
88 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
89 <li class="listitem"><p>
90 when the application itself has found that it wants or needs to install a
93 <li class="listitem"><p>
94 when the application has been notified by an element (such as playbin or
95 decodebin) that one or more plugins are missing <span class="emphasis"><em>and</em></span>
96 the application has decided that it wants to install one or more of those
103 The install functions in this section all take one or more 'detail strings'.
104 These detail strings contain information about the type of plugin that
105 needs to be installed (decoder, encoder, source, sink, or named element),
106 and some additional information such GStreamer version used and a
107 human-readable description of the component to install for user dialogs.
110 Applications should not concern themselves with the composition of the
111 string itself. They should regard the string as if it was a shared secret
112 between GStreamer and the plugin installer application.
115 Detail strings can be obtained using the function
116 <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-plugin-message-get-installer-detail" title="gst_missing_plugin_message_get_installer_detail ()"><code class="function">gst_missing_plugin_message_get_installer_detail()</code></a> on a missing-plugin
117 message. Such a message will either have been found by the application on
118 a pipeline's <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html"><span class="type">GstBus</span></a>, or the application will have created it itself using
119 <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-element-message-new" title="gst_missing_element_message_new ()"><code class="function">gst_missing_element_message_new()</code></a>, <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-decoder-message-new" title="gst_missing_decoder_message_new ()"><code class="function">gst_missing_decoder_message_new()</code></a>,
120 <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-encoder-message-new" title="gst_missing_encoder_message_new ()"><code class="function">gst_missing_encoder_message_new()</code></a>, <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-uri-sink-message-new" title="gst_missing_uri_sink_message_new ()"><code class="function">gst_missing_uri_sink_message_new()</code></a>, or
121 <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-uri-source-message-new" title="gst_missing_uri_source_message_new ()"><code class="function">gst_missing_uri_source_message_new()</code></a>.
124 For each GStreamer element/plugin/component that should be installed, the
125 application needs one of those 'installer detail' string mentioned in the
126 previous section. This string can be obtained, as already mentioned above,
127 from a missing-plugin message using the function
128 <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-plugin-message-get-installer-detail" title="gst_missing_plugin_message_get_installer_detail ()"><code class="function">gst_missing_plugin_message_get_installer_detail()</code></a>. The missing-plugin
129 message is either posted by another element and then found on the bus
130 by the application, or the application has created it itself as described
134 The application will then call <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async" title="gst_install_plugins_async ()"><code class="function">gst_install_plugins_async()</code></a>, passing a
135 NULL-terminated array of installer detail strings, and a function that
136 should be called when the installation of the plugins has finished
137 (successfully or not). Optionally, a <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> created
138 with <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-new" title="gst_install_plugins_context_new ()"><code class="function">gst_install_plugins_context_new()</code></a> may be passed as well. This way
139 additional optional arguments like the application window's XID can be
140 passed to the external installer application.
143 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async" title="gst_install_plugins_async ()"><code class="function">gst_install_plugins_async()</code></a> will return almost immediately, with the
144 return code indicating whether plugin installation was started or not.
145 If the necessary hooks for plugin installation are in place and an
146 external installer application has in fact been called, the passed in
147 function will be called with a result code as soon as the external installer
148 has finished. If the result code indicates that new plugins have been
149 installed, the application will want to call <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-Gst.html#gst-update-registry"><code class="function">gst_update_registry()</code></a> so the
150 run-time plugin registry is updated and the new plugins are made available
153 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
154 <h3 class="title">Note</h3>
155 A Gtk/GLib main loop must be running in order for the result function to
156 be called when the external installer has finished. If this is not the case,
157 make sure to regularly call
158 <pre class="programlisting">
159 g_main_context_iteration (NULL,FALSE);
166 <span class="emphasis"><em>1. Installer hook</em></span>
169 When GStreamer applications initiate plugin installation via
170 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async" title="gst_install_plugins_async ()"><code class="function">gst_install_plugins_async()</code></a> or <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-sync" title="gst_install_plugins_sync ()"><code class="function">gst_install_plugins_sync()</code></a>, a pre-defined
171 helper application will be called.
174 The exact path of the helper application to be called is set at compile
175 time, usually by the <code class="literal">./configure</code> script based on the
176 install prefix. For a normal package build into the <code class="literal">/usr</code>
177 prefix, this will usually default to
178 <code class="filename">/usr/libexec/gst-install-plugins-helper</code> or
179 <code class="filename">/usr/lib/gst-install-plugins-helper</code>.
182 Vendors/distros who want to support GStreamer plugin installation should
183 either provide such a helper script/application or use the
184 <code class="literal">./configure</code> option
185 <code class="literal">--with-install-plugins-helper=/path/to/installer</code> to
186 make GStreamer call an installer of their own directly.
189 It is strongly recommended that vendors provide a small helper application
190 as interlocutor to the real installer though, even more so if command line
191 argument munging is required to transform the command line arguments
192 passed by GStreamer to the helper application into arguments that are
193 understood by the real installer.
196 The helper application path defined at compile time can be overriden at
197 runtime by setting the <code class="envar">GST_INSTALL_PLUGINS_HELPER</code>
198 environment variable. This can be useful for testing/debugging purposes.
201 <span class="emphasis"><em>2. Arguments passed to the install helper</em></span>
204 GStreamer will pass the following arguments to the install helper (this is
205 in addition to the path of the executable itself, which is by convention
208 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
209 <li class="listitem"><p>
210 none to many optional arguments in the form of
211 <code class="literal">--foo-bar=val</code>. Example:
212 <code class="literal">--transient-for=XID</code> where XID is the X Window ID of
213 the main window of the calling application (so the installer can make
214 itself transient to that window). Unknown optional arguments should
215 be ignored by the installer.
217 <li class="listitem"><p>
218 one 'installer detail string' argument for each plugin to be installed;
219 these strings will have a <code class="literal">gstreamer</code> prefix; the
220 exact format of the detail string is explained below
226 <span class="emphasis"><em>3. Detail string describing the missing plugin</em></span>
229 The string is in UTF-8 encoding and is made up of several fields, separated
230 by '|' characters (but neither the first nor the last character is a '|').
233 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
234 <li class="listitem">
236 plugin system identifier, ie. "gstreamer"
239 This identifier determines the format of the rest of the detail string.
240 Automatic plugin installers should not process detail strings with
241 unknown identifiers. This allows other plugin-based libraries to use
242 the same mechanism for their automatic plugin installation needs, or
243 for the format to be changed should it turn out to be insufficient.
246 <li class="listitem">
248 plugin system version, e.g. "0.10"
251 This is required so that when there is a GStreamer-0.12 or GStreamer-1.0
252 at some point in future, the different major versions can still co-exist
253 and use the same plugin install mechanism in the same way.
256 <li class="listitem">
258 application identifier, e.g. "totem"
261 This may also be in the form of "pid/12345" if the program name can't
262 be obtained for some reason.
265 <li class="listitem"><p>
266 human-readable localised description of the required component,
267 e.g. "Vorbis audio decoder"
269 <li class="listitem">
271 identifier string for the required component (see below for details about
272 how to map this to the package/plugin that needs installing), e.g.
274 <div class="itemizedlist"><ul class="itemizedlist" type="circle">
275 <li class="listitem"><p>
276 urisource-$(PROTOCOL_REQUIRED), e.g. urisource-http or urisource-mms
278 <li class="listitem"><p>
279 element-$(ELEMENT_REQUIRED), e.g. element-ffmpegcolorspace
281 <li class="listitem">
283 decoder-$(CAPS_REQUIRED), e.g. (do read below for more details!):
285 <div class="itemizedlist"><ul class="itemizedlist" type="square">
286 <li class="listitem"><p>decoder-audio/x-vorbis</p></li>
287 <li class="listitem"><p>decoder-application/ogg</p></li>
288 <li class="listitem"><p>decoder-audio/mpeg, mpegversion=(int)4</p></li>
289 <li class="listitem"><p>decoder-video/mpeg, systemstream=(boolean)true, mpegversion=(int)2</p></li>
294 <li class="listitem"><p>
295 encoder-$(CAPS_REQUIRED), e.g. encoder-audio/x-vorbis
301 <li class="listitem"><p>
302 optional further fields not yet specified
308 An entire ID string might then look like this, for example:
309 <code class="literal">
310 gstreamer|0.10|totem|Vorbis audio decoder|decoder-audio/x-vorbis
314 Plugin installers parsing this ID string should expect further fields also
315 separated by '|' symbols and either ignore them, warn the user, or error
316 out when encountering them.
319 Those unfamiliar with the GStreamer 'caps' system should note a few things
320 about the caps string used in the above decoder/encoder case:
322 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
323 <li class="listitem"><p>
324 the first part ("video/mpeg") of the caps string is a GStreamer media
325 type and <span class="emphasis"><em>not</em></span> a MIME type. Wherever possible, the
326 GStreamer media type will be the same as the corresponding MIME type,
329 <li class="listitem"><p>
330 a caps string may or may not have additional comma-separated fields
331 of various types (as seen in the examples above)
333 <li class="listitem">
335 the caps string of a 'required' component (as above) will always have
336 fields with fixed values, whereas an introspected string (see below)
337 may have fields with non-fixed values. Compare for example:
339 <div class="itemizedlist"><ul class="itemizedlist" type="circle">
340 <li class="listitem"><p>
341 <code class="literal">audio/mpeg, mpegversion=(int)4</code> vs.
342 <code class="literal">audio/mpeg, mpegversion=(int){2, 4}</code>
344 <li class="listitem"><p>
345 <code class="literal">video/mpeg, mpegversion=(int)2</code> vs.
346 <code class="literal">video/mpeg, systemstream=(boolean){ true, false}, mpegversion=(int)[1, 2]</code>
356 <span class="emphasis"><em>4. Exit codes the installer should return</em></span>
359 The installer should return one of the following exit codes when it exits:
361 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
362 <li class="listitem"><p>
363 0 if all of the requested plugins could be installed
364 (<a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-SUCCESS:CAPS"><span class="type">GST_INSTALL_PLUGINS_SUCCESS</span></a>)
366 <li class="listitem"><p>
367 1 if no appropriate installation candidate for any of the requested
368 plugins could be found. Only return this if nothing has been installed
369 (<a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-NOT-FOUND:CAPS"><span class="type">GST_INSTALL_PLUGINS_NOT_FOUND</span></a>)
371 <li class="listitem"><p>
372 2 if an error occured during the installation. The application will
373 assume that the user will already have seen an error message by the
374 installer in this case and will usually not show another one
375 (<a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-ERROR:CAPS"><span class="type">GST_INSTALL_PLUGINS_ERROR</span></a>)
377 <li class="listitem"><p>
378 3 if some of the requested plugins could be installed, but not all
379 (<a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-PARTIAL-SUCCESS:CAPS"><span class="type">GST_INSTALL_PLUGINS_PARTIAL_SUCCESS</span></a>)
381 <li class="listitem"><p>
382 4 if the user aborted the installation (<a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-USER-ABORT:CAPS"><span class="type">GST_INSTALL_PLUGINS_USER_ABORT</span></a>)
388 <span class="emphasis"><em>5. How to map the required detail string to packages</em></span>
391 It is up to the vendor to find mechanism to map required components from
392 the detail string to the actual packages/plugins to install. This could
393 be a hardcoded list of mappings, for example, or be part of the packaging
397 GStreamer plugin files can be introspected for this information. The
398 <code class="literal">gst-inspect</code> utility has a special command line option
399 that will output information similar to what is required. For example
400 <span class="command"><strong>
401 $ gst-inspect-0.10 --print-plugin-auto-install-info /path/to/libgstvorbis.so
403 should output something along the lines of
404 <code class="computeroutput">
405 decoder-audio/x-vorbis
410 encoder-audio/x-vorbis
412 Note that in the encoder and decoder case the introspected caps can be more
413 complex with additional fields, e.g.
414 <code class="literal">audio/mpeg,mpegversion=(int){2,4}</code>, so they will not
415 always exactly match the caps wanted by the application. It is up to the
416 installer to deal with this (either by doing proper caps intersection using
417 the GStreamer <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> API, or by only taking into account the media type).
420 Another potential source of problems are plugins such as ladspa or
421 libvisual where the list of elements depends on the installed
422 ladspa/libvisual plugins at the time. This is also up to the distribution
423 to handle (but usually not relevant for playback applications).
429 <div class="refsect1">
430 <a name="gst-plugins-base-libs-gstpbutilsinstallplugins.details"></a><h2>Details</h2>
431 <div class="refsect2">
432 <a name="GstInstallPluginsReturn"></a><h3>enum GstInstallPluginsReturn</h3>
433 <pre class="programlisting">typedef enum {
434 /* Return codes from the installer. Returned by gst_install_plugins_sync(),
435 * or passed as result code to your #GstInstallPluginsResultFunc */
436 GST_INSTALL_PLUGINS_SUCCESS = 0,
437 GST_INSTALL_PLUGINS_NOT_FOUND = 1,
438 GST_INSTALL_PLUGINS_ERROR = 2,
439 GST_INSTALL_PLUGINS_PARTIAL_SUCCESS = 3,
440 GST_INSTALL_PLUGINS_USER_ABORT = 4,
442 /* Returned by gst_install_plugins_sync(), or passed as result code to your
443 * #GstInstallPluginsResultFunc */
444 GST_INSTALL_PLUGINS_CRASHED = 100,
445 GST_INSTALL_PLUGINS_INVALID,
447 /* Return codes from starting the external helper, may be returned by both
448 * gst_install_plugins_sync() and gst_install_plugins_async(), but should
449 * never be seen by a #GstInstallPluginsResultFunc */
450 GST_INSTALL_PLUGINS_STARTED_OK = 200,
451 GST_INSTALL_PLUGINS_INTERNAL_FAILURE,
452 GST_INSTALL_PLUGINS_HELPER_MISSING,
453 GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS
454 } GstInstallPluginsReturn;
457 Result codes returned by <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async" title="gst_install_plugins_async ()"><code class="function">gst_install_plugins_async()</code></a> and
458 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-sync" title="gst_install_plugins_sync ()"><code class="function">gst_install_plugins_sync()</code></a>, and also the result code passed to the
459 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsResultFunc" title="GstInstallPluginsResultFunc ()"><span class="type">GstInstallPluginsResultFunc</span></a> specified with <code class="function">gst_install_plugin_async()</code>.
462 These codes indicate success or failure of starting an external installer
463 program and to what extent the requested plugins could be installed.
465 <div class="variablelist"><table border="0">
466 <col align="left" valign="top">
469 <td><p><a name="GST-INSTALL-PLUGINS-SUCCESS:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_SUCCESS</code></span></p></td>
470 <td>all of the requested plugins could be
475 <td><p><a name="GST-INSTALL-PLUGINS-NOT-FOUND:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_NOT_FOUND</code></span></p></td>
476 <td>no appropriate installation candidate for
477 any of the requested plugins could be found. Only return this if nothing
478 has been installed. Return <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-PARTIAL-SUCCESS:CAPS"><span class="type">GST_INSTALL_PLUGINS_PARTIAL_SUCCESS</span></a> if
479 some (but not all) of the requested plugins could be installed.
483 <td><p><a name="GST-INSTALL-PLUGINS-ERROR:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_ERROR</code></span></p></td>
484 <td>an error occured during the installation. If
485 this happens, the user has already seen an error message and another
486 one should not be displayed
490 <td><p><a name="GST-INSTALL-PLUGINS-PARTIAL-SUCCESS:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_PARTIAL_SUCCESS</code></span></p></td>
491 <td>some of the requested plugins could
492 be installed, but not all
496 <td><p><a name="GST-INSTALL-PLUGINS-USER-ABORT:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_USER_ABORT</code></span></p></td>
497 <td>the user has aborted the installation
501 <td><p><a name="GST-INSTALL-PLUGINS-CRASHED:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_CRASHED</code></span></p></td>
502 <td>the installer had an unclean exit code
503 (ie. death by signal)
507 <td><p><a name="GST-INSTALL-PLUGINS-INVALID:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_INVALID</code></span></p></td>
508 <td>the helper returned an invalid status code
512 <td><p><a name="GST-INSTALL-PLUGINS-STARTED-OK:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_STARTED_OK</code></span></p></td>
513 <td>returned by <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async" title="gst_install_plugins_async ()"><code class="function">gst_install_plugins_async()</code></a> to
514 indicate that everything went fine so far and the provided callback
515 will be called with the result of the installation later
519 <td><p><a name="GST-INSTALL-PLUGINS-INTERNAL-FAILURE:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_INTERNAL_FAILURE</code></span></p></td>
520 <td>some internal failure has
521 occured when trying to start the installer
525 <td><p><a name="GST-INSTALL-PLUGINS-HELPER-MISSING:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_HELPER_MISSING</code></span></p></td>
526 <td>the helper script to call the
527 actual installer is not installed
531 <td><p><a name="GST-INSTALL-PLUGINS-INSTALL-IN-PROGRESS:CAPS"></a><span class="term"><code class="literal">GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS</code></span></p></td>
532 <td>a previously-started plugin
533 installation is still in progress, try again later
538 <p class="since">Since 0.10.12</p>
541 <div class="refsect2">
542 <a name="GstInstallPluginsResultFunc"></a><h3>GstInstallPluginsResultFunc ()</h3>
543 <pre class="programlisting"><span class="returnvalue">void</span> (*GstInstallPluginsResultFunc) (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn"><span class="type">GstInstallPluginsReturn</span></a> result</code></em>,
544 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
546 The prototype of the callback function that will be called once the
547 external plugin installer program has returned. You only need to provide
548 a callback function if you are using the asynchronous interface.
550 <div class="variablelist"><table border="0">
551 <col align="left" valign="top">
554 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
555 <td>whether the installation of the requested plugins succeeded or not</td>
558 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
559 <td>the user data passed to <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async" title="gst_install_plugins_async ()"><code class="function">gst_install_plugins_async()</code></a>
564 <p class="since">Since 0.10.12</p>
567 <div class="refsect2">
568 <a name="gst-install-plugins-async"></a><h3>gst_install_plugins_async ()</h3>
569 <pre class="programlisting"><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn"><span class="returnvalue">GstInstallPluginsReturn</span></a> gst_install_plugins_async (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **details</code></em>,
570 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> *ctx</code></em>,
571 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsResultFunc" title="GstInstallPluginsResultFunc ()"><span class="type">GstInstallPluginsResultFunc</span></a> func</code></em>,
572 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
574 Requests plugin installation without blocking. Once the plugins have been
575 installed or installation has failed, <em class="parameter"><code>func</code></em> will be called with the result
576 of the installation and your provided <em class="parameter"><code>user_data</code></em> pointer.
579 This function requires a running GLib/Gtk main loop. If you are not
580 running a GLib/Gtk main loop, make sure to regularly call
581 g_main_context_iteration(NULL,FALSE).
584 The installer strings that make up <em class="parameter"><code>detail</code></em> are typically obtained by
585 calling <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-plugin-message-get-installer-detail" title="gst_missing_plugin_message_get_installer_detail ()"><code class="function">gst_missing_plugin_message_get_installer_detail()</code></a> on missing-plugin
586 messages that have been caught on a pipeline's bus or created by the
587 application via the provided API, such as <a class="link" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-element-message-new" title="gst_missing_element_message_new ()"><code class="function">gst_missing_element_message_new()</code></a>.
590 It is possible to request the installation of multiple missing plugins in
591 one go (as might be required if there is a demuxer for a certain format
592 installed but no suitable video decoder and no suitable audio decoder).
594 <div class="variablelist"><table border="0">
595 <col align="left" valign="top">
598 <td><p><span class="term"><em class="parameter"><code>details</code></em> :</span></p></td>
599 <td>NULL-terminated array of installer string details (see below)</td>
602 <td><p><span class="term"><em class="parameter"><code>ctx</code></em> :</span></p></td>
603 <td>a <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>, or NULL</td>
606 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
607 <td>the function to call when the installer program returns. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
611 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
612 <td>the user data to pass to <em class="parameter"><code>func</code></em> when called, or NULL. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
616 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
617 <td>result code whether an external installer could be started</td>
621 <p class="since">Since 0.10.12</p>
624 <div class="refsect2">
625 <a name="gst-install-plugins-sync"></a><h3>gst_install_plugins_sync ()</h3>
626 <pre class="programlisting"><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn"><span class="returnvalue">GstInstallPluginsReturn</span></a> gst_install_plugins_sync (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **details</code></em>,
627 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> *ctx</code></em>);</pre>
629 Requests plugin installation and block until the plugins have been
630 installed or installation has failed.
633 This function should almost never be used, it only exists for cases where
634 a non-GLib main loop is running and the user wants to run it in a separate
635 thread and marshal the result back asynchronously into the main thread
636 using the other non-GLib main loop. You should almost always use
637 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async" title="gst_install_plugins_async ()"><code class="function">gst_install_plugins_async()</code></a> instead of this function.
639 <div class="variablelist"><table border="0">
640 <col align="left" valign="top">
643 <td><p><span class="term"><em class="parameter"><code>details</code></em> :</span></p></td>
644 <td>NULL-terminated array of installer string details</td>
647 <td><p><span class="term"><em class="parameter"><code>ctx</code></em> :</span></p></td>
648 <td>a <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>, or NULL</td>
651 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
652 <td>the result of the installation.</td>
656 <p class="since">Since 0.10.12</p>
659 <div class="refsect2">
660 <a name="gst-install-plugins-return-get-name"></a><h3>gst_install_plugins_return_get_name ()</h3>
661 <pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gst_install_plugins_return_get_name (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn" title="enum GstInstallPluginsReturn"><span class="type">GstInstallPluginsReturn</span></a> ret</code></em>);</pre>
663 Convenience function to return the descriptive string associated
664 with a status code. This function returns English strings and
665 should not be used for user messages. It is here only to assist
668 <div class="variablelist"><table border="0">
669 <col align="left" valign="top">
672 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
673 <td>the return status code</td>
676 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
677 <td>a descriptive string for the status code in <em class="parameter"><code>ret</code></em>
682 <p class="since">Since 0.10.12</p>
685 <div class="refsect2">
686 <a name="gst-install-plugins-installation-in-progress"></a><h3>gst_install_plugins_installation_in_progress ()</h3>
687 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_install_plugins_installation_in_progress
688 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
690 Checks whether plugin installation (initiated by this application only)
691 is currently in progress.
693 <div class="variablelist"><table border="0">
694 <col align="left" valign="top">
696 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
697 <td>TRUE if plugin installation is in progress, otherwise FALSE</td>
700 <p class="since">Since 0.10.12</p>
703 <div class="refsect2">
704 <a name="gst-install-plugins-supported"></a><h3>gst_install_plugins_supported ()</h3>
705 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_install_plugins_supported (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
707 Checks whether plugin installation is likely to be supported by the
708 current environment. This currently only checks whether the helper script
709 that is to be provided by the distribution or operating system vendor
712 <div class="variablelist"><table border="0">
713 <col align="left" valign="top">
715 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
716 <td>TRUE if plugin installation is likely to be supported.</td>
719 <p class="since">Since 0.10.15</p>
722 <div class="refsect2">
723 <a name="GstInstallPluginsContext"></a><h3>GstInstallPluginsContext</h3>
724 <pre class="programlisting">typedef struct _GstInstallPluginsContext GstInstallPluginsContext;</pre>
726 Opaque context structure for the plugin installation. Use the provided
727 API to set details on it.
729 <p class="since">Since 0.10.12</p>
732 <div class="refsect2">
733 <a name="gst-install-plugins-context-new"></a><h3>gst_install_plugins_context_new ()</h3>
734 <pre class="programlisting"><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="returnvalue">GstInstallPluginsContext</span></a> * gst_install_plugins_context_new
735 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
737 Creates a new <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>.
739 <div class="variablelist"><table border="0">
740 <col align="left" valign="top">
742 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
743 <td>a new <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>. Free with
744 <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-free" title="gst_install_plugins_context_free ()"><code class="function">gst_install_plugins_context_free()</code></a> when no longer needed</td>
747 <p class="since">Since 0.10.12</p>
750 <div class="refsect2">
751 <a name="gst-install-plugins-context-free"></a><h3>gst_install_plugins_context_free ()</h3>
752 <pre class="programlisting"><span class="returnvalue">void</span> gst_install_plugins_context_free (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> *ctx</code></em>);</pre>
754 Frees a <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>.
756 <div class="variablelist"><table border="0">
757 <col align="left" valign="top">
759 <td><p><span class="term"><em class="parameter"><code>ctx</code></em> :</span></p></td>
760 <td>a <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>
764 <p class="since">Since 0.10.12</p>
767 <div class="refsect2">
768 <a name="gst-install-plugins-context-set-xid"></a><h3>gst_install_plugins_context_set_xid ()</h3>
769 <pre class="programlisting"><span class="returnvalue">void</span> gst_install_plugins_context_set_xid (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> *ctx</code></em>,
770 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> xid</code></em>);</pre>
772 This function is for X11-based applications (such as most Gtk/Qt
773 applications on linux/unix) only. You can use it to tell the external
774 installer the XID of your main application window. That way the installer
775 can make its own window transient to your application window during the
779 If set, the XID will be passed to the installer via a --transient-for=XID
783 Gtk+/Gnome application should be able to obtain the XID of the top-level
786 <pre class="programlisting">
787 ##include <gtk/gtk.h>
788 ##ifdef GDK_WINDOWING_X11
789 ##include <gdk/gdkx.h>
792 ##ifdef GDK_WINDOWING_X11
793 xid = GDK_WINDOW_XWINDOW (GTK_WIDGET (application_window)->window);
799 <div class="variablelist"><table border="0">
800 <col align="left" valign="top">
803 <td><p><span class="term"><em class="parameter"><code>ctx</code></em> :</span></p></td>
804 <td>a <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>
808 <td><p><span class="term"><em class="parameter"><code>xid</code></em> :</span></p></td>
809 <td>the XWindow ID (XID) of the top-level application</td>
813 <p class="since">Since 0.10.12</p>
819 Generated by GTK-Doc V1.17</div>