Blame gst-libs/gst/pbutils/install-plugins.h

Packit 971217
/* GStreamer base utils library plugin install support for applications
Packit 971217
 * Copyright (C) 2007 Tim-Philipp Müller <tim centricular net>
Packit 971217
 * Copyright (C) 2006 Ryan Lortie <desrt desrt ca>
Packit 971217
 *
Packit 971217
 * This library is free software; you can redistribute it and/or
Packit 971217
 * modify it under the terms of the GNU Library General Public
Packit 971217
 * License as published by the Free Software Foundation; either
Packit 971217
 * version 2 of the License, or (at your option) any later version.
Packit 971217
 *
Packit 971217
 * This library is distributed in the hope that it will be useful,
Packit 971217
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 971217
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 971217
 * Library General Public License for more details.
Packit 971217
 *
Packit 971217
 * You should have received a copy of the GNU Library General Public
Packit 971217
 * License along with this library; if not, write to the
Packit 971217
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 971217
 * Boston, MA 02110-1301, USA.
Packit 971217
 */
Packit 971217
Packit 971217
#ifndef __GST_PB_UTILS_INSTALL_PLUGINS_H__
Packit 971217
#define __GST_PB_UTILS_INSTALL_PLUGINS_H__
Packit 971217
Packit 971217
#include <gst/gst.h>
Packit 971217
#include <gst/pbutils/pbutils-prelude.h>
Packit 971217
Packit 971217
G_BEGIN_DECLS
Packit 971217
Packit 971217
/*
Packit 971217
 * functions for use by applications to initiate installation of missing plugins
Packit 971217
 */
Packit 971217
Packit 971217
/**
Packit 971217
 * GstInstallPluginsReturn:
Packit 971217
 * @GST_INSTALL_PLUGINS_SUCCESS: all of the requested plugins could be
Packit 971217
 *     installed
Packit 971217
 * @GST_INSTALL_PLUGINS_NOT_FOUND: no appropriate installation candidate for
Packit 971217
 *     any of the requested plugins could be found. Only return this if nothing
Packit 971217
 *     has been installed. Return #GST_INSTALL_PLUGINS_PARTIAL_SUCCESS if
Packit 971217
 *     some (but not all) of the requested plugins could be installed.
Packit 971217
 * @GST_INSTALL_PLUGINS_ERROR: an error occured during the installation. If
Packit 971217
 *     this happens, the  user has already seen an error message and another
Packit 971217
 *     one should not be displayed
Packit 971217
 * @GST_INSTALL_PLUGINS_CRASHED: the installer had an unclean exit code
Packit 971217
 *     (ie. death by signal)
Packit 971217
 * @GST_INSTALL_PLUGINS_PARTIAL_SUCCESS: some of the requested plugins could
Packit 971217
 *     be installed, but not all
Packit 971217
 * @GST_INSTALL_PLUGINS_USER_ABORT: the user has aborted the installation
Packit 971217
 * @GST_INSTALL_PLUGINS_INVALID: the helper returned an invalid status code
Packit 971217
 * @GST_INSTALL_PLUGINS_STARTED_OK: returned by gst_install_plugins_async() to
Packit 971217
 *     indicate that everything went fine so far and the provided callback
Packit 971217
 *     will be called with the result of the installation later
Packit 971217
 * @GST_INSTALL_PLUGINS_INTERNAL_FAILURE: some internal failure has
Packit 971217
 *     occured when trying to start the installer
Packit 971217
 * @GST_INSTALL_PLUGINS_HELPER_MISSING: the helper script to call the
Packit 971217
 *     actual installer is not installed
Packit 971217
 * @GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS: a previously-started plugin
Packit 971217
 *     installation is still in progress, try again later
Packit 971217
 *
Packit 971217
 * Result codes returned by gst_install_plugins_async() and
Packit 971217
 * gst_install_plugins_sync(), and also the result code passed to the
Packit 971217
 * #GstInstallPluginsResultFunc specified with gst_install_plugins_async().
Packit 971217
 *
Packit 971217
 * These codes indicate success or failure of starting an external installer
Packit 971217
 * program and to what extent the requested plugins could be installed.
Packit 971217
 */
Packit 971217
typedef enum {
Packit 971217
  /* Return codes from the installer. Returned by gst_install_plugins_sync(),
Packit 971217
   * or passed as result code to your #GstInstallPluginsResultFunc */
Packit 971217
  GST_INSTALL_PLUGINS_SUCCESS = 0,
Packit 971217
  GST_INSTALL_PLUGINS_NOT_FOUND = 1,
Packit 971217
  GST_INSTALL_PLUGINS_ERROR = 2,
Packit 971217
  GST_INSTALL_PLUGINS_PARTIAL_SUCCESS = 3,
Packit 971217
  GST_INSTALL_PLUGINS_USER_ABORT = 4,
Packit 971217
Packit 971217
  /* Returned by gst_install_plugins_sync(), or passed as result code to your
Packit 971217
   * #GstInstallPluginsResultFunc */
Packit 971217
  GST_INSTALL_PLUGINS_CRASHED = 100,
Packit 971217
  GST_INSTALL_PLUGINS_INVALID,
Packit 971217
Packit 971217
  /* Return codes from starting the external helper, may be returned by both
Packit 971217
   * gst_install_plugins_sync() and gst_install_plugins_async(), but should
Packit 971217
   * never be seen by a #GstInstallPluginsResultFunc */
Packit 971217
  GST_INSTALL_PLUGINS_STARTED_OK = 200,
Packit 971217
  GST_INSTALL_PLUGINS_INTERNAL_FAILURE,
Packit 971217
  GST_INSTALL_PLUGINS_HELPER_MISSING,
Packit 971217
  GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS
Packit 971217
} GstInstallPluginsReturn;
Packit 971217
Packit 971217
/**
Packit 971217
 * GstInstallPluginsContext:
Packit 971217
 *
Packit 971217
 * Opaque context structure for the plugin installation. Use the provided
Packit 971217
 * API to set details on it.
Packit 971217
 */
Packit 971217
Packit 971217
#define GST_TYPE_INSTALL_PLUGINS_CONTEXT	(gst_install_plugins_context_get_type())
Packit 971217
Packit 971217
typedef struct _GstInstallPluginsContext GstInstallPluginsContext;
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
GstInstallPluginsContext * gst_install_plugins_context_new (void);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
GstInstallPluginsContext * gst_install_plugins_context_copy (GstInstallPluginsContext * ctx);
Packit 971217
GST_PBUTILS_API
Packit 971217
void   gst_install_plugins_context_free    (GstInstallPluginsContext * ctx);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
void   gst_install_plugins_context_set_confirm_search (GstInstallPluginsContext * ctx,
Packit 971217
                                                       gboolean                   confirm_search);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
void   gst_install_plugins_context_set_desktop_id (GstInstallPluginsContext * ctx,
Packit 971217
                                                   const gchar              * desktop_id);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
void   gst_install_plugins_context_set_startup_notification_id (GstInstallPluginsContext * ctx,
Packit 971217
                                                                const gchar              * startup_id);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
void   gst_install_plugins_context_set_xid (GstInstallPluginsContext * ctx,
Packit 971217
                                            guint                      xid);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
GType  gst_install_plugins_context_get_type (void);
Packit 971217
Packit 971217
/**
Packit 971217
 * GstInstallPluginsResultFunc:
Packit 971217
 * @result: whether the installation of the requested plugins succeeded or not
Packit 971217
 * @user_data: the user data passed to gst_install_plugins_async()
Packit 971217
 *
Packit 971217
 * The prototype of the callback function that will be called once the
Packit 971217
 * external plugin installer program has returned. You only need to provide
Packit 971217
 * a callback function if you are using the asynchronous interface.
Packit 971217
 */
Packit 971217
typedef void (*GstInstallPluginsResultFunc) (GstInstallPluginsReturn  result,
Packit 971217
                                             gpointer                 user_data);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
GstInstallPluginsReturn  gst_install_plugins_async (const gchar * const * details,
Packit 971217
                                                    GstInstallPluginsContext  * ctx,
Packit 971217
                                                    GstInstallPluginsResultFunc func,
Packit 971217
                                                    gpointer                    user_data);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
GstInstallPluginsReturn  gst_install_plugins_sync  (const gchar * const       * details,
Packit 971217
                                                    GstInstallPluginsContext  * ctx);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
const gchar * gst_install_plugins_return_get_name (GstInstallPluginsReturn ret);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
gboolean      gst_install_plugins_installation_in_progress (void);
Packit 971217
Packit 971217
GST_PBUTILS_API
Packit 971217
gboolean      gst_install_plugins_supported (void);
Packit 971217
Packit 971217
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
Packit 971217
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstInstallPluginsContext, gst_install_plugins_context_free)
Packit 971217
#endif
Packit 971217
Packit 971217
G_END_DECLS
Packit 971217
Packit 971217
#endif /* __GST_PB_UTILS_INSTALL_PLUGINS_H__ */
Packit 971217