<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>gstpbutilsinstallplugins</title> <meta name="generator" content="DocBook XSL Stylesheets V1.72.0"> <link rel="start" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual"> <link rel="up" href="gstreamer-base-utils.html" title="Base Utils Library"> <link rel="prev" href="gst-plugins-base-libs-gstpbutilsmissingplugins.html" title="gstpbutilsmissingplugins"> <link rel="next" href="gstreamer-video.html" title="Video Library"> <meta name="generator" content="GTK-Doc V1.8 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> <link rel="part" href="gstreamer-plugins-base.html" title="Part I. GStreamer Base Plugins Libraries"> <link rel="chapter" href="gstreamer-audio.html" title="Audio Library"> <link rel="chapter" href="gstreamer-cdda.html" title="CDDA Library"> <link rel="chapter" href="gstreamer-ffft.html" title="FFT Library"> <link rel="chapter" href="gstreamer-floatcast.html" title="FloatCast Library"> <link rel="chapter" href="gstreamer-interfaces.html" title="Interfaces Library"> <link rel="chapter" href="gstreamer-netbuffer.html" title="Network Buffer Library"> <link rel="chapter" href="gstreamer-riff.html" title="Riff Media Library"> <link rel="chapter" href="gstreamer-rtp.html" title="RTP Library"> <link rel="chapter" href="gstreamer-rtsp.html" title="RTSP Library"> <link rel="chapter" href="gstreamer-sdp.html" title="SDP Library"> <link rel="chapter" href="gstreamer-tag.html" title="Tag Support Library"> <link rel="chapter" href="gstreamer-base-utils.html" title="Base Utils Library"> <link rel="chapter" href="gstreamer-video.html" title="Video Library"> <link rel="part" href="gstreamer-libs-hierarchy.html" title="Part II. Object Hierarchy"> <link rel="index" href="api-index.html" title="Index"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> <tr valign="middle"> <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> <td><a accesskey="u" href="gstreamer-base-utils.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> <th width="100%" align="center">GStreamer Base Plugins 0.10 Library Reference Manual</th> <td><a accesskey="n" href="gstreamer-video.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> </tr> <tr><td colspan="5" class="shortcuts"><nobr><a href="#id2750714" class="shortcut">Top</a>  |  <a href="#id2750987" class="shortcut">Description</a></nobr></td></tr> </table> <div class="refentry" lang="en"> <a name="gst-plugins-base-libs-gstpbutilsinstallplugins"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2> <a name="id2750714"></a><span class="refentrytitle">gstpbutilsinstallplugins</span> </h2> <p>gstpbutilsinstallplugins — Missing plugin installation support for applications</p> </td> <td valign="top" align="right"></td> </tr></table></div> <div class="refsynopsisdiv"> <h2>Synopsis</h2> <pre class="synopsis"> #include <gst/pbutils/install-plugins.h> enum <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a>; void (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsResultFunc">*GstInstallPluginsResultFunc</a>) (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a> result, gpointer user_data); <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a> <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async">gst_install_plugins_async</a> (gchar **details, <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a> *ctx, <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsResultFunc">GstInstallPluginsResultFunc</a> func, gpointer user_data); <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a> <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-sync">gst_install_plugins_sync</a> (gchar **details, <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a> *ctx); const gchar* <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-return-get-name">gst_install_plugins_return_get_name</a> (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a> ret); gboolean <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-installation-in-progress">gst_install_plugins_installation_in_progress</a> (void); gboolean <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-supported">gst_install_plugins_supported</a> (void); <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a>; <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a>* <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-new">gst_install_plugins_context_new</a> (void); void <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-free">gst_install_plugins_context_free</a> (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a> *ctx); void <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-set-xid">gst_install_plugins_context_set_xid</a> (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a> *ctx, guint xid); </pre> </div> <div class="refsect1" lang="en"> <a name="id2750987"></a><h2>Description</h2> <p> </p> <div class="refsect2" lang="en"> <a name="id2751000"></a><h3>Overview</h3> <p> Using this API, applications can request the installation of missing GStreamer plugins. These may be missing decoders/demuxers or encoders/muxers for a certain format, sources or sinks for a certain URI protocol (e.g. 'http'), or certain elements known by their element factory name ('audioresample'). </p> <p> Whether plugin installation is supported or not depends on the operating system and/or distribution in question. The vendor of the operating system needs to make sure the necessary hooks and mechanisms are in place for plugin installation to work. See below for more detailed information. </p> <p> From the application perspective, plugin installation is usually triggered either </p> <div class="itemizedlist"><ul type="disc"> <li><p> when the application itself has found that it wants or needs to install a certain element </p></li> <li><p> when the application has been notified by an element (such as playbin or decodebin) that one or more plugins are missing <span class="emphasis"><em>and</em></span> the application has decided that it wants to install one or more of those missing plugins </p></li> </ul></div> <p> </p> <h3>Detail Strings</h3> <p> The install functions in this section all take one or more 'detail strings'. These detail strings contain information about the type of plugin that needs to be installed (decoder, encoder, source, sink, or named element), and some additional information such GStreamer version used and a human-readable description of the component to install for user dialogs. </p> <p> Applications should not concern themselves with the composition of the string itself. They should regard the string as if it was a shared secret between GStreamer and the plugin installer application. </p> <p> Detail strings can be obtained using the function <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-plugin-message-get-installer-detail"><code class="function">gst_missing_plugin_message_get_installer_detail()</code></a> on a missing-plugin message. Such a message will either have been found by the application on a pipeline's <span class="type">GstBus</span>, or the application will have created it itself using <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-element-message-new"><code class="function">gst_missing_element_message_new()</code></a>, <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-decoder-message-new"><code class="function">gst_missing_decoder_message_new()</code></a>, <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-encoder-message-new"><code class="function">gst_missing_encoder_message_new()</code></a>, <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-uri-sink-message-new"><code class="function">gst_missing_uri_sink_message_new()</code></a>, or <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-uri-source-message-new"><code class="function">gst_missing_uri_source_message_new()</code></a>. </p> <h3>Plugin Installation from the Application Perspective</h3> <p> For each GStreamer element/plugin/component that should be installed, the application needs one of those 'installer detail' string mentioned in the previous section. This string can be obtained, as already mentioned above, from a missing-plugin message using the function <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-plugin-message-get-installer-detail"><code class="function">gst_missing_plugin_message_get_installer_detail()</code></a>. The missing-plugin message is either posted by another element and then found on the bus by the application, or the application has created it itself as described above. </p> <p> The application will then call <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async"><code class="function">gst_install_plugins_async()</code></a>, passing a <span class="type">NULL-terminated</span> array of installer detail strings, and a function that should be called when the installation of the plugins has finished (successfully or not). Optionally, a <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> created with <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-new"><code class="function">gst_install_plugins_context_new()</code></a> may be passed as well. This way additional optional arguments like the application window's XID can be passed to the external installer application. </p> <p> <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async"><code class="function">gst_install_plugins_async()</code></a> will return almost immediately, with the return code indicating whether plugin installation was started or not. If the necessary hooks for plugin installation are in place and an external installer application has in fact been called, the passed in function will be called with a result code as soon as the external installer has finished. If the result code indicates that new plugins have been installed, the application will want to call <code class="function">gst_update_registry()</code> so the run-time plugin registry is updated and the new plugins are made available to the application. </p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Note</h3> A Gtk/GLib main loop must be running in order for the result function to be called when the external installer has finished. If this is not the case, make sure to regularly call <pre class="programlisting"> g_main_context_iteration (NULL,FALSE); </pre> from your code. </div> <p> </p> <h3>Plugin Installation from the Vendor/Distribution Perspective</h3> <p> <span class="emphasis"><em>1. Installer hook</em></span> </p> <p> When GStreamer applications initiate plugin installation via <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async"><code class="function">gst_install_plugins_async()</code></a> or <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-sync"><code class="function">gst_install_plugins_sync()</code></a>, a pre-defined helper application will be called. </p> <p> The exact path of the helper application to be called is set at compile time, usually by the <code class="literal">./configure</code> script based on the install prefix. For a normal package build into the <code class="literal">/usr</code> prefix, this will usually default to <code class="filename">/usr/libexec/gst-install-plugins-helper</code> or <code class="filename">/usr/lib/gst-install-plugins-helper</code>. </p> <p> Vendors/distros who want to support GStreamer plugin installation should either provide such a helper script/application or use the <code class="literal">./configure</code> option <code class="literal">--with-install-plugins-helper=/path/to/installer</code> to make GStreamer call an installer of their own directly. </p> <p> It is strongly recommended that vendors provide a small helper application as interlocutor to the real installer though, even more so if command line argument munging is required to transform the command line arguments passed by GStreamer to the helper application into arguments that are understood by the reeal installer. </p> <p> The helper application path defined at compile time can be overriden at runtime by setting the <code class="envar">GST_INSTALL_PLUGINS_HELPER</code> environment variable. This can be useful for testing/debugging purposes. </p> <p> <span class="emphasis"><em>2. Arguments passed to the install helper</em></span> </p> <p> GStreamer will pass the following arguments to the install helper (this is in addition to the path of the executable itself, which is by convention argv[0]): </p> <div class="itemizedlist"><ul type="disc"> <li><p> none to many optional arguments in the form of <code class="literal">--foo-bar=val</code>. Example: <code class="literal">--transient-for=XID</code> where XID is the X Window ID of the main window of the calling application (so the installer can make itself transient to that window). Unknown optional arguments should be ignored by the installer. </p></li> <li><p> one 'installer detail string' argument for each plugin to be installed; these strings will have a <code class="literal">gstreamer</code> prefix; the exact format of the detail string is explained below </p></li> </ul></div> <p> </p> <p> <span class="emphasis"><em>3. Detail string describing the missing plugin</em></span> </p> <p> The string is in UTF-8 encoding and is made up of several fields, separated by '|' characters (but neither the first nor the last character is a '|'). The fields are: </p> <div class="itemizedlist"><ul type="disc"> <li> <p> plugin system identifier, ie. "gstreamer" </p> <p> This identifier determines the format of the rest of the detail string. Automatic plugin installers should not process detail strings with unknown identifiers. This allows other plugin-based libraries to use the same mechanism for their automatic plugin installation needs, or for the format to be changed should it turn out to be insufficient. </p> </li> <li> <p> plugin system version, e.g. "0.10" </p> <p> This is required so that when there is a GStreamer-0.12 or GStreamer-1.0 at some point in future, the different major versions can still co-exist and use the same plugin install mechanism in the same way. </p> </li> <li> <p> application identifier, e.g. "totem" </p> <p> This may also be in the form of "pid/12345" if the program name can't be obtained for some reason. </p> </li> <li><p> human-readable localised description of the required component, e.g. "Vorbis audio decoder" </p></li> <li> <p> identifier string for the required component (see below for details about how to map this to the package/plugin that needs installing), e.g. </p> <div class="itemizedlist"><ul type="circle"> <li><p> urisource-$(PROTOCOL_REQUIRED), e.g. urisource-http or urisource-mms </p></li> <li><p> element-$(ELEMENT_REQUIRED), e.g. element-ffmpegcolorspace </p></li> <li> <p> decoder-$(CAPS_REQUIRED), e.g. (do read below for more details!): </p> <div class="itemizedlist"><ul type="square"> <li><p>decoder-audio/x-vorbis</p></li> <li><p>decoder-application/ogg</p></li> <li><p>decoder-audio/mpeg, mpegversion=(int)4</p></li> <li><p>decoder-video/mpeg, systemstream=(boolean)true, mpegversion=(int)2</p></li> </ul></div> <p> </p> </li> <li><p> encoder-$(CAPS_REQUIRED), e.g. encoder-audio/x-vorbis </p></li> </ul></div> <p> </p> </li> <li><p> optional further fields not yet specified </p></li> </ul></div> <p> </p> <p> An entire ID string might then look like this, for example: <code class="literal"> gstreamer|0.10|totem|Vorbis audio decoder|decoder-audio/x-vorbis </code> </p> <p> Plugin installers parsing this ID string should expect further fields also separated by '|' symbols and either ignore them, warn the user, or error out when encountering them. </p> <p> Those unfamiliar with the GStreamer 'caps' system should note a few things about the caps string used in the above decoder/encoder case: </p> <div class="itemizedlist"><ul type="disc"> <li><p> the first part ("video/mpeg") of the caps string is a GStreamer media type and <span class="emphasis"><em>not</em></span> a MIME type. Wherever possible, the GStreamer media type will be the same as the corresponding MIME type, but often it is not. </p></li> <li><p> a caps string may or may not have additional comma-separated fields of various types (as seen in the examples above) </p></li> <li> <p> the caps string of a 'required' component (as above) will always have fields with fixed values, whereas an introspected string (see below) may have fields with non-fixed values. Compare for example: </p> <div class="itemizedlist"><ul type="circle"> <li><p> <code class="literal">audio/mpeg, mpegversion=(int)4</code> vs. <code class="literal">audio/mpeg, mpegversion=(int){2, 4}</code> </p></li> <li><p> <code class="literal">video/mpeg, mpegversion=(int)2</code> vs. <code class="literal">video/mpeg, systemstream=(boolean){ true, false}, mpegversion=(int)[1, 2]</code> </p></li> </ul></div> <p> </p> </li> </ul></div> <p> </p> <p> <span class="emphasis"><em>4. Exit codes the installer should return</em></span> </p> <p> The installer should return one of the following exit codes when it exits: </p> <div class="itemizedlist"><ul type="disc"> <li><p> 0 if all of the requested plugins could be installed (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-SUCCESS:CAPS"><span class="type">GST_INSTALL_PLUGINS_SUCCESS</span></a>) </p></li> <li><p> 1 if no appropriate installation candidate for any of the requested plugins could be found. Only return this if nothing has been installed (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-NOT-FOUND:CAPS"><span class="type">GST_INSTALL_PLUGINS_NOT_FOUND</span></a>) </p></li> <li><p> 2 if an error occured during the installation. The application will assume that the user will already have seen an error message by the installer in this case and will usually not show another one (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-ERROR:CAPS"><span class="type">GST_INSTALL_PLUGINS_ERROR</span></a>) </p></li> <li><p> 3 if some of the requested plugins could be installed, but not all (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-PARTIAL-SUCCESS:CAPS"><span class="type">GST_INSTALL_PLUGINS_PARTIAL_SUCCESS</span></a>) </p></li> <li><p> 4 if the user aborted the installation (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-USER-ABORT:CAPS"><span class="type">GST_INSTALL_PLUGINS_USER_ABORT</span></a>) </p></li> </ul></div> <p> </p> <p> <span class="emphasis"><em>5. How to map the required detail string to packages</em></span> </p> <p> It is up to the vendor to find mechanism to map required components from the detail string to the actual packages/plugins to install. This could be a hardcoded list of mappings, for example, or be part of the packaging system metadata. </p> <p> GStreamer plugin files can be introspected for this information. The <code class="literal">gst-inspect</code> utility has a special command line option that will output information similar to what is required. For example <span><strong class="command"> $ gst-inspect-0.10 --print-plugin-auto-install-info /path/to/libgstvorbis.so </strong></span> should output something along the lines of <code class="computeroutput"> decoder-audio/x-vorbis element-vorbisdec element-vorbisenc element-vorbisparse element-vorbistag encoder-audio/x-vorbis </code> Note that in the encoder and decoder case the introspected caps can be more complex with additional fields, e.g. <code class="literal">audio/mpeg,mpegversion=(int){2,4}</code>, so they will not always exactly match the caps wanted by the application. It is up to the installer to deal with this (either by doing proper caps intersection using the GStreamer <span class="type">GstCaps</span> API, or by only taking into account the media type). </p> <p> Another potential source of problems are plugins such as ladspa or libvisual where the list of elements depends on the installed ladspa/libvisual plugins at the time. This is also up to the distribution to handle (but usually not relevant for playback applications). </p> </div> <p> </p> </div> <div class="refsect1" lang="en"> <a name="id2751828"></a><h2>Details</h2> <div class="refsect2" lang="en"> <a name="id2751838"></a><h3> <a name="GstInstallPluginsReturn"></a>enum GstInstallPluginsReturn</h3> <a class="indexterm" name="id2751854"></a><pre class="programlisting">typedef enum { /* Return codes from the installer. Returned by gst_install_plugins_sync(), * or passed as result code to your #GstInstallPluginsResultFunc */ GST_INSTALL_PLUGINS_SUCCESS = 0, GST_INSTALL_PLUGINS_NOT_FOUND = 1, GST_INSTALL_PLUGINS_ERROR = 2, GST_INSTALL_PLUGINS_PARTIAL_SUCCESS = 3, GST_INSTALL_PLUGINS_USER_ABORT = 4, /* Returned by gst_install_plugins_sync(), or passed as result code to your * #GstInstallPluginsResultFunc */ GST_INSTALL_PLUGINS_CRASHED = 100, GST_INSTALL_PLUGINS_INVALID, /* Return codes from starting the external helper, may be returned by both * gst_install_plugins_sync() and gst_install_plugins_async(), but should * never be seen by a #GstInstallPluginsResultFunc */ GST_INSTALL_PLUGINS_STARTED_OK = 200, GST_INSTALL_PLUGINS_INTERNAL_FAILURE, GST_INSTALL_PLUGINS_HELPER_MISSING, GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS } GstInstallPluginsReturn; </pre> <p> Result codes returned by <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async"><code class="function">gst_install_plugins_async()</code></a> and <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-sync"><code class="function">gst_install_plugins_sync()</code></a>, and also the result code passed to the <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsResultFunc"><span class="type">GstInstallPluginsResultFunc</span></a> specified with <code class="function">gst_install_plugin_async()</code>. </p> <p> These codes indicate success or failure of starting an external installer program and to what extent the requested plugins could be installed.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-SUCCESS:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_SUCCESS</code></span></td> <td> all of the requested plugins could be installed </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-NOT-FOUND:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_NOT_FOUND</code></span></td> <td> no appropriate installation candidate for any of the requested plugins could be found. Only return this if nothing has been installed. Return <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GST-INSTALL-PLUGINS-PARTIAL-SUCCESS:CAPS"><span class="type">GST_INSTALL_PLUGINS_PARTIAL_SUCCESS</span></a> if some (but not all) of the requested plugins could be installed. </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-ERROR:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_ERROR</code></span></td> <td> an error occured during the installation. If this happens, the user has already seen an error message and another one should not be displayed </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-PARTIAL-SUCCESS:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_PARTIAL_SUCCESS</code></span></td> <td> some of the requested plugins could be installed, but not all </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-USER-ABORT:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_USER_ABORT</code></span></td> <td> the user has aborted the installation </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-CRASHED:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_CRASHED</code></span></td> <td> the installer had an unclean exit code (ie. death by signal) </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-INVALID:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_INVALID</code></span></td> <td> the helper returned an invalid status code </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-STARTED-OK:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_STARTED_OK</code></span></td> <td> returned by <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async"><code class="function">gst_install_plugins_async()</code></a> to indicate that everything went fine so far and the provided callback will be called with the result of the installation later </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-INTERNAL-FAILURE:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_INTERNAL_FAILURE</code></span></td> <td> some internal failure has occured when trying to start the installer </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-HELPER-MISSING:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_HELPER_MISSING</code></span></td> <td> the helper script to call the actual installer is not installed </td> </tr> <tr> <td><span class="term"><a name="GST-INSTALL-PLUGINS-INSTALL-IN-PROGRESS:CAPS"></a><code class="literal">GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS</code></span></td> <td> a previously-started plugin installation is still in progress, try again later </td> </tr> </tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2752370"></a><h3> <a name="GstInstallPluginsResultFunc"></a>GstInstallPluginsResultFunc ()</h3> <a class="indexterm" name="id2752387"></a><pre class="programlisting">void (*GstInstallPluginsResultFunc) (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a> result, gpointer user_data);</pre> <p> The prototype of the callback function that will be called once the external plugin installer program has returned. You only need to provide a callback function if you are using the asynchronous interface.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>result</code></em> :</span></td> <td> whether the installation of the requested plugins succeeded or not </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td> the user data passed to <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async"><code class="function">gst_install_plugins_async()</code></a> </td> </tr> </tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2752481"></a><h3> <a name="gst-install-plugins-async"></a>gst_install_plugins_async ()</h3> <a class="indexterm" name="id2752497"></a><pre class="programlisting"><a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a> gst_install_plugins_async (gchar **details, <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a> *ctx, <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsResultFunc">GstInstallPluginsResultFunc</a> func, gpointer user_data);</pre> <p> Requests plugin installation without blocking. Once the plugins have been installed or installation has failed, <em class="parameter"><code>func</code></em> will be called with the result of the installation and your provided <em class="parameter"><code>user_data</code></em> pointer. </p> <p> This function requires a running GLib/Gtk main loop. If you are not running a GLib/Gtk main loop, make sure to regularly call g_main_context_iteration(NULL,FALSE). </p> <p> The installer strings that make up <em class="parameter"><code>detail</code></em> are typically obtained by calling <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-plugin-message-get-installer-detail"><code class="function">gst_missing_plugin_message_get_installer_detail()</code></a> on missing-plugin messages that have been caught on a pipeline's bus or created by the application via the provided API, such as <a href="gst-plugins-base-libs-gstpbutilsmissingplugins.html#gst-missing-element-message-new"><code class="function">gst_missing_element_message_new()</code></a>. </p> <p> It is possible to request the installation of multiple missing plugins in one go (as might be required if there is a demuxer for a certain format installed but no suitable video decoder and no suitable audio decoder).</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>details</code></em> :</span></td> <td> NULL-terminated array of installer string details (see below) </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>ctx</code></em> :</span></td> <td> a <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>, or NULL </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>func</code></em> :</span></td> <td> the function to call when the installer program returns </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td> the user data to pass to <em class="parameter"><code>func</code></em> when called, or NULL </td> </tr> <tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> result code whether an external installer could be started </td> </tr> </tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2752713"></a><h3> <a name="gst-install-plugins-sync"></a>gst_install_plugins_sync ()</h3> <a class="indexterm" name="id2752728"></a><pre class="programlisting"><a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a> gst_install_plugins_sync (gchar **details, <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a> *ctx);</pre> <p> Requests plugin installation and block until the plugins have been installed or installation has failed. </p> <p> This function should almost never be used, it only exists for cases where a non-GLib main loop is running and the user wants to run it in a separate thread and marshal the result back asynchronously into the main thread using the other non-GLib main loop. You should almost always use <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-async"><code class="function">gst_install_plugins_async()</code></a> instead of this function.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>details</code></em> :</span></td> <td> NULL-terminated array of installer string details </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>ctx</code></em> :</span></td> <td> a <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>, or NULL </td> </tr> <tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> the result of the installation. </td> </tr> </tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2752849"></a><h3> <a name="gst-install-plugins-return-get-name"></a>gst_install_plugins_return_get_name ()</h3> <a class="indexterm" name="id2752866"></a><pre class="programlisting">const gchar* gst_install_plugins_return_get_name (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsReturn">GstInstallPluginsReturn</a> ret);</pre> <p> Convenience function to return the descriptive string associated with a status code. This function returns English strings and should not be used for user messages. It is here only to assist in debugging.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>ret</code></em> :</span></td> <td> the return status code </td> </tr> <tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> a descriptive string for the status code in <em class="parameter"><code>ret</code></em> </td> </tr> </tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2752944"></a><h3> <a name="gst-install-plugins-installation-in-progress"></a>gst_install_plugins_installation_in_progress ()</h3> <a class="indexterm" name="id2752961"></a><pre class="programlisting">gboolean gst_install_plugins_installation_in_progress (void);</pre> <p> Checks whether plugin installation (initiated by this application only) is currently in progress.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody><tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> TRUE if plugin installation is in progress, otherwise FALSE </td> </tr></tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2753012"></a><h3> <a name="gst-install-plugins-supported"></a>gst_install_plugins_supported ()</h3> <a class="indexterm" name="id2753028"></a><pre class="programlisting">gboolean gst_install_plugins_supported (void);</pre> <p> Checks whether plugin installation is likely to be supported by the current environment. This currently only checks whether the helper script that is to be provided by the distribution or operating system vendor exists.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody><tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> TRUE if plugin installation is likely to be supported. </td> </tr></tbody> </table></div> <p class="since">Since 0.10.15 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2753079"></a><h3> <a name="GstInstallPluginsContext"></a>GstInstallPluginsContext</h3> <a class="indexterm" name="id2753094"></a><pre class="programlisting">typedef struct _GstInstallPluginsContext GstInstallPluginsContext;</pre> <p> Opaque context structure for the plugin installation. Use the provided API to set details on it.</p> <p> </p> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2753122"></a><h3> <a name="gst-install-plugins-context-new"></a>gst_install_plugins_context_new ()</h3> <a class="indexterm" name="id2753138"></a><pre class="programlisting"><a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a>* gst_install_plugins_context_new (void);</pre> <p> Creates a new <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody><tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> a new <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>. Free with <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#gst-install-plugins-context-free"><code class="function">gst_install_plugins_context_free()</code></a> when no longer needed </td> </tr></tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2753215"></a><h3> <a name="gst-install-plugins-context-free"></a>gst_install_plugins_context_free ()</h3> <a class="indexterm" name="id2753231"></a><pre class="programlisting">void gst_install_plugins_context_free (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a> *ctx);</pre> <p> Frees a <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a>.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody><tr> <td><span class="term"><em class="parameter"><code>ctx</code></em> :</span></td> <td> a <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> </td> </tr></tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2753306"></a><h3> <a name="gst-install-plugins-context-set-xid"></a>gst_install_plugins_context_set_xid ()</h3> <a class="indexterm" name="id2753322"></a><pre class="programlisting">void gst_install_plugins_context_set_xid (<a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext">GstInstallPluginsContext</a> *ctx, guint xid);</pre> <p> This function is for X11-based applications (such as most Gtk/Qt applications on linux/unix) only. You can use it to tell the external the XID of your main application window, so the installer can make its own window transient to your application windonw during the installation. </p> <p> If set, the XID will be passed to the installer via a --transient-for=XID command line option. </p> <p> Gtk+/Gnome application should be able to obtain the XID of the top-level window like this: </p> <pre class="programlisting"> ##include <gtk/gtk.h> ##ifdef GDK_WINDOWING_X11 ##include <gdk/gdkx.h> ##endif ... ##ifdef GDK_WINDOWING_X11 xid = GDK_WINDOW_XWINDOW (GTK_WIDGET (application_window)->window); ##endif ... </pre> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>ctx</code></em> :</span></td> <td> a <a href="gst-plugins-base-libs-gstpbutilsinstallplugins.html#GstInstallPluginsContext"><span class="type">GstInstallPluginsContext</span></a> </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>xid</code></em> :</span></td> <td> the XWindow ID (XID) of the top-level application </td> </tr> </tbody> </table></div> <p class="since">Since 0.10.12 </p> </div> </div> </div> </body> </html>