[gst-devel] new API for applications to check plugin requirements

Tim Müller t.i.m at zen.co.uk
Tue Oct 11 09:16:53 CEST 2005


Howdy,

I'd like to add the following four functions to the 0.9 API to make it
easier for applications to check plugin requirements at runtime/on
startup:


typedef struct _GstPluginVersion GstPluginVersion;
typedef struct _GstPluginRequirement GstPluginRequirement;

struct _GstPluginVersion {
  guint major : 8;
  guint minor : 8;
  guint micro : 8;
  guint nano  : 8;
};

struct _GstPluginRequirement {
  const gchar        *name;
  GstPluginVersion    version_required;
  GstPluginVersion    version_available;

  /*< private >*/
  gpointer _reserved [GST_PADDING];
};


gboolean
gst_registry_get_plugin_version (GstRegistry      * registry,
                                 const gchar      * plugin_name,
                                 GstPluginVersion * version);

gboolean
gst_registry_get_feature_version (GstRegistry      * registry,
                                  const gchar      * feature_name,
                                  GstPluginVersion * version);

gboolean
gst_registry_check_feature_requirements (GstRegistry * registry,
   GstPluginRequirement  * requirements,
   GstPluginRequirement ** outdated,
   GstPluginRequirement ** unavailable);

gboolean
gst_registry_check_plugin_requirements  (GstRegistry * registry,
    GstPluginRequirement  * requirements,
    GstPluginRequirement ** outdated,
    GstPluginRequirement ** unavailable);


The two _get_foo_version() functions are probably pretty much
self-explanatory.

The _check_foo_requirements() function should be passed an array of
GstPluginRequirements to check. If all requirements are fulfilled, these
functions will return TRUE. Otherwise they will return FALSE and
*outdated and *unavailable will be filled with arrays of the given
GstPluginRequirements that don't fulfil the requirements. This way
applications can easily construct dialogs with messages like "These
plugins are outdated: xyz  These plugins are not installed: abc"

Thoughts?
Should the out parameters rather be GLists?

If there are no objections, I'll commit this to gstregistry.[ch]
tomorrow (along with docs of course).

Cheers
 -Tim






More information about the gstreamer-devel mailing list