tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / docs / libs / html / gst-plugins-base-libs-gstpbutilsinstallplugins.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
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.76.1">
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.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
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">
16 <tr valign="middle">
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>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gstpbutilsinstallplugins.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gst-plugins-base-libs-gstpbutilsinstallplugins.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
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>
32 <td valign="top">
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>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="gst-plugins-base-libs-gstpbutilsinstallplugins.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include &lt;gst/pbutils/install-plugins.h&gt;
42
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>);
56
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>);
63 </pre>
64 </div>
65 <div class="refsect1">
66 <a name="gst-plugins-base-libs-gstpbutilsinstallplugins.description"></a><h2>Description</h2>
67 <p>
68 </p>
69 <div class="refsect2">
70 <a name="idp25467280"></a><h3>Overview</h3>
71 <p>
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
76 ('audioresample').
77 </p>
78 <p>
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.
83 </p>
84 <p>
85 From the application perspective, plugin installation is usually triggered
86 either
87 </p>
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
91 certain element
92 </p></li>
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
97 missing plugins
98 </p></li>
99 </ul></div>
100 <p>
101 </p>
102 <p>
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.
108 </p>
109 <p>
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.
113 </p>
114 <p>
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>.
122 </p>
123 <p>
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
131 above.
132 </p>
133 <p>
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.
141 </p>
142 <p>
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
151 to the application.
152 </p>
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);
160 </pre>
161 from your code.
162 </div>
163 <p>
164 </p>
165 <p>
166 <span class="emphasis"><em>1. Installer hook</em></span>
167 </p>
168 <p>
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.
172 </p>
173 <p>
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>.
180 </p>
181 <p>
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.
187 </p>
188 <p>
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.
194 </p>
195 <p>
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.
199 </p>
200 <p>
201 <span class="emphasis"><em>2. Arguments passed to the install helper</em></span>
202 </p>
203 <p>
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
206 argv[0]):
207 </p>
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.
216  </p></li>
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
221  </p></li>
222 </ul></div>
223 <p>
224 </p>
225 <p>
226 <span class="emphasis"><em>3. Detail string describing the missing plugin</em></span>
227 </p>
228 <p>
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 '|').
231 The fields are:
232 </p>
233 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
234 <li class="listitem">
235 <p>
236    plugin system identifier, ie. "gstreamer"
237   </p>
238 <p>
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.
244   </p>
245 </li>
246 <li class="listitem">
247 <p>
248    plugin system version, e.g. "0.10"
249   </p>
250 <p>
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.
254   </p>
255 </li>
256 <li class="listitem">
257 <p>
258    application identifier, e.g. "totem"
259   </p>
260 <p>
261    This may also be in the form of "pid/12345" if the program name can't
262    be obtained for some reason.
263   </p>
264 </li>
265 <li class="listitem"><p>
266    human-readable localised description of the required component,
267    e.g. "Vorbis audio decoder"
268   </p></li>
269 <li class="listitem">
270 <p>
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.
273    </p>
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
277     </p></li>
278 <li class="listitem"><p>
279       element-$(ELEMENT_REQUIRED), e.g. element-ffmpegcolorspace
280     </p></li>
281 <li class="listitem">
282 <p>
283       decoder-$(CAPS_REQUIRED), e.g. (do read below for more details!):
284       </p>
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>
290 </ul></div>
291 <p>
292     </p>
293 </li>
294 <li class="listitem"><p>
295       encoder-$(CAPS_REQUIRED), e.g. encoder-audio/x-vorbis
296     </p></li>
297 </ul></div>
298 <p>
299   </p>
300 </li>
301 <li class="listitem"><p>
302     optional further fields not yet specified
303   </p></li>
304 </ul></div>
305 <p>
306 </p>
307 <p>
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
311 </code>
312 </p>
313 <p>
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.
317 </p>
318 <p>
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:
321   </p>
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,
327       but often it is not.
328     </p></li>
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)
332     </p></li>
333 <li class="listitem">
334 <p>
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:
338       </p>
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>
343         </p></li>
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>
347         </p></li>
348 </ul></div>
349 <p>
350     </p>
351 </li>
352 </ul></div>
353 <p>
354 </p>
355 <p>
356 <span class="emphasis"><em>4. Exit codes the installer should return</em></span>
357 </p>
358 <p>
359 The installer should return one of the following exit codes when it exits:
360 </p>
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>)
365   </p></li>
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>)
370   </p></li>
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>)
376   </p></li>
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>)
380   </p></li>
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>)
383   </p></li>
384 </ul></div>
385 <p>
386 </p>
387 <p>
388 <span class="emphasis"><em>5. How to map the required detail string to packages</em></span>
389 </p>
390 <p>
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
394 system metadata.
395 </p>
396 <p>
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
402 </strong></span>
403 should output something along the lines of
404 <code class="computeroutput">
405 decoder-audio/x-vorbis
406 element-vorbisdec
407 element-vorbisenc
408 element-vorbisparse
409 element-vorbistag
410 encoder-audio/x-vorbis
411 </code>
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).
418 </p>
419 <p>
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).
424 </p>
425 </div>
426 <p>
427 </p>
428 </div>
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,
441
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,
446
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;
455 </pre>
456 <p>
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 <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>.
460 </p>
461 <p>
462 These codes indicate success or failure of starting an external installer
463 program and to what extent the requested plugins could be installed.
464 </p>
465 <div class="variablelist"><table border="0">
466 <col align="left" valign="top">
467 <tbody>
468 <tr>
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
471     installed
472 </td>
473 </tr>
474 <tr>
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.
480 </td>
481 </tr>
482 <tr>
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
487 </td>
488 </tr>
489 <tr>
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
493 </td>
494 </tr>
495 <tr>
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
498 </td>
499 </tr>
500 <tr>
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)
504 </td>
505 </tr>
506 <tr>
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
509 </td>
510 </tr>
511 <tr>
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
516 </td>
517 </tr>
518 <tr>
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
522 </td>
523 </tr>
524 <tr>
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
528 </td>
529 </tr>
530 <tr>
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
534 </td>
535 </tr>
536 </tbody>
537 </table></div>
538 <p class="since">Since 0.10.12</p>
539 </div>
540 <hr>
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>
545 <p>
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.
549 </p>
550 <div class="variablelist"><table border="0">
551 <col align="left" valign="top">
552 <tbody>
553 <tr>
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>
556 </tr>
557 <tr>
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>
560 </td>
561 </tr>
562 </tbody>
563 </table></div>
564 <p class="since">Since 0.10.12</p>
565 </div>
566 <hr>
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>
573 <p>
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.
577 </p>
578 <p>
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).
582 </p>
583 <p>
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>.
588 </p>
589 <p>
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).
593 </p>
594 <div class="variablelist"><table border="0">
595 <col align="left" valign="top">
596 <tbody>
597 <tr>
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>
600 </tr>
601 <tr>
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>
604 </tr>
605 <tr>
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>
608 </td>
609 </tr>
610 <tr>
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>
613 </td>
614 </tr>
615 <tr>
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>
618 </tr>
619 </tbody>
620 </table></div>
621 <p class="since">Since 0.10.12</p>
622 </div>
623 <hr>
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>
628 <p>
629 Requests plugin installation and block until the plugins have been
630 installed or installation has failed.
631 </p>
632 <p>
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.
638 </p>
639 <div class="variablelist"><table border="0">
640 <col align="left" valign="top">
641 <tbody>
642 <tr>
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>
645 </tr>
646 <tr>
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>
649 </tr>
650 <tr>
651 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
652 <td>the result of the installation.</td>
653 </tr>
654 </tbody>
655 </table></div>
656 <p class="since">Since 0.10.12</p>
657 </div>
658 <hr>
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>
662 <p>
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
666 in debugging.
667 </p>
668 <div class="variablelist"><table border="0">
669 <col align="left" valign="top">
670 <tbody>
671 <tr>
672 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
673 <td>the return status code</td>
674 </tr>
675 <tr>
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>
678 </td>
679 </tr>
680 </tbody>
681 </table></div>
682 <p class="since">Since 0.10.12</p>
683 </div>
684 <hr>
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>
689 <p>
690 Checks whether plugin installation (initiated by this application only)
691 is currently in progress.
692 </p>
693 <div class="variablelist"><table border="0">
694 <col align="left" valign="top">
695 <tbody><tr>
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>
698 </tr></tbody>
699 </table></div>
700 <p class="since">Since 0.10.12</p>
701 </div>
702 <hr>
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>
706 <p>
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
710 exists.
711 </p>
712 <div class="variablelist"><table border="0">
713 <col align="left" valign="top">
714 <tbody><tr>
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>
717 </tr></tbody>
718 </table></div>
719 <p class="since">Since 0.10.15</p>
720 </div>
721 <hr>
722 <div class="refsect2">
723 <a name="GstInstallPluginsContext"></a><h3>GstInstallPluginsContext</h3>
724 <pre class="programlisting">typedef struct _GstInstallPluginsContext GstInstallPluginsContext;</pre>
725 <p>
726 Opaque context structure for the plugin installation. Use the provided
727 API to set details on it.
728 </p>
729 <p class="since">Since 0.10.12</p>
730 </div>
731 <hr>
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>
736 <p>
737 Creates a new <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>.
738 </p>
739 <div class="variablelist"><table border="0">
740 <col align="left" valign="top">
741 <tbody><tr>
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>
745 </tr></tbody>
746 </table></div>
747 <p class="since">Since 0.10.12</p>
748 </div>
749 <hr>
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>
753 <p>
754 Frees a <a class="link" href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext" title="GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>.
755 </p>
756 <div class="variablelist"><table border="0">
757 <col align="left" valign="top">
758 <tbody><tr>
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>
761 </td>
762 </tr></tbody>
763 </table></div>
764 <p class="since">Since 0.10.12</p>
765 </div>
766 <hr>
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>
771 <p>
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
776 installation.
777 </p>
778 <p>
779 If set, the XID will be passed to the installer via a --transient-for=XID
780 command line option.
781 </p>
782 <p>
783 Gtk+/Gnome application should be able to obtain the XID of the top-level
784 window like this:
785 </p>
786 <pre class="programlisting">
787 ##include &lt;gtk/gtk.h&gt;
788 ##ifdef GDK_WINDOWING_X11
789 ##include &lt;gdk/gdkx.h&gt;
790 ##endif
791 ...
792 ##ifdef GDK_WINDOWING_X11
793   xid = GDK_WINDOW_XWINDOW (GTK_WIDGET (application_window)-&gt;window);
794 ##endif
795 ...
796 </pre>
797 <p>
798 </p>
799 <div class="variablelist"><table border="0">
800 <col align="left" valign="top">
801 <tbody>
802 <tr>
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>
805 </td>
806 </tr>
807 <tr>
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>
810 </tr>
811 </tbody>
812 </table></div>
813 <p class="since">Since 0.10.12</p>
814 </div>
815 </div>
816 </div>
817 <div class="footer">
818 <hr>
819           Generated by GTK-Doc V1.18</div>
820 </body>
821 </html>