mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-27 14:31:01 +00:00
Added first attempt at plugin versioning.
Original commit message from CVS: Added first attempt at plugin versioning.
This commit is contained in:
parent
31427072e3
commit
72e5e1342c
9 changed files with 18 additions and 10 deletions
|
@ -342,7 +342,7 @@ plugin_init (GModule *module)
|
|||
GstElementFactory *factory;
|
||||
|
||||
/* First we try to create a new Plugin structure. */
|
||||
plugin = gst_plugin_new("example");
|
||||
plugin = gst_plugin_new("example", GST_VERSION_MAJOR, GST_VERSION_MINOR);
|
||||
/* If we get a NULL back, chances are we're already loaded. */
|
||||
g_return_val_if_fail(plugin != NULL, NULL);
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ plugin_init (GModule *module)
|
|||
GstPlugin *plugin;
|
||||
GstAutoplugFactory *factory;
|
||||
|
||||
plugin = gst_plugin_new("gststaticautoplug");
|
||||
plugin = gst_plugin_new("gststaticautoplug", GST_VERSION_MAJOR, GST_VERSION_MINOR);
|
||||
g_return_val_if_fail(plugin != NULL,NULL);
|
||||
|
||||
gst_plugin_set_longname (plugin, "A static autoplugger");
|
||||
|
|
|
@ -86,7 +86,7 @@ plugin_init (GModule *module)
|
|||
GstPlugin *plugin;
|
||||
GstAutoplugFactory *factory;
|
||||
|
||||
plugin = gst_plugin_new("gststaticautoplugrender");
|
||||
plugin = gst_plugin_new("gststaticautoplugrender", GST_VERSION_MAJOR, GST_VERSION_MINOR);
|
||||
g_return_val_if_fail(plugin != NULL,NULL);
|
||||
|
||||
gst_plugin_set_longname (plugin, "A static autoplugger");
|
||||
|
|
|
@ -73,7 +73,7 @@ GstPlugin *plugin_init (GModule *module)
|
|||
GstElementFactory *factory;
|
||||
gint i = 0;
|
||||
|
||||
plugin = gst_plugin_new("gstelements");
|
||||
plugin = gst_plugin_new("gstelements", GST_VERSION_MAJOR, GST_VERSION_MINOR);
|
||||
g_return_val_if_fail(plugin != NULL,NULL);
|
||||
|
||||
gst_plugin_set_longname (plugin, "Standard GST Elements");
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "gst_private.h"
|
||||
#include "gstplugin.h"
|
||||
#include "gstversion.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
|
@ -392,16 +393,23 @@ gst_plugin_load_absolute (const gchar *name)
|
|||
/**
|
||||
* gst_plugin_new:
|
||||
* @name: name of new plugin
|
||||
* @major: major version number of core that plugin is compatible with
|
||||
* @minor: minor version number of core that plugin is compatible with
|
||||
*
|
||||
* Create a new plugin with given name.
|
||||
*
|
||||
* Returns: new plugin
|
||||
* Returns: new plugin, or NULL if plugin couldn't be created, due to
|
||||
* incompatible version number, or name already being allocated)
|
||||
*/
|
||||
GstPlugin*
|
||||
gst_plugin_new (const gchar *name)
|
||||
gst_plugin_new (const gchar *name, gint major, gint minor)
|
||||
{
|
||||
GstPlugin *plugin;
|
||||
|
||||
// return NULL if the major and minor version numbers are not compatible
|
||||
// with ours.
|
||||
if (major != GST_VERSION_MAJOR || minor != GST_VERSION_MINOR) return NULL;
|
||||
|
||||
// return NULL if the plugin is allready loaded
|
||||
plugin = gst_plugin_find (name);
|
||||
if (plugin) return NULL;
|
||||
|
|
|
@ -62,7 +62,7 @@ typedef GstPlugin* (*GstPluginInitFunc) (GModule *module);
|
|||
|
||||
void _gst_plugin_initialize (void);
|
||||
|
||||
GstPlugin* gst_plugin_new (const gchar *name);
|
||||
GstPlugin* gst_plugin_new (const gchar *name, gint major, gint minor);
|
||||
|
||||
void gst_plugin_add_path (const gchar *path);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ plugin_init (GModule *module)
|
|||
GstPlugin *plugin;
|
||||
gint i = 0;
|
||||
|
||||
plugin = gst_plugin_new ("gsttypes");
|
||||
plugin = gst_plugin_new ("gsttypes", GST_VERSION_MAJOR, GST_VERSION_MINOR);
|
||||
g_return_val_if_fail (plugin != NULL,NULL);
|
||||
|
||||
while (_factories[i].mime) {
|
||||
|
|
|
@ -73,7 +73,7 @@ GstPlugin *plugin_init (GModule *module)
|
|||
GstElementFactory *factory;
|
||||
gint i = 0;
|
||||
|
||||
plugin = gst_plugin_new("gstelements");
|
||||
plugin = gst_plugin_new("gstelements", GST_VERSION_MAJOR, GST_VERSION_MINOR);
|
||||
g_return_val_if_fail(plugin != NULL,NULL);
|
||||
|
||||
gst_plugin_set_longname (plugin, "Standard GST Elements");
|
||||
|
|
|
@ -342,7 +342,7 @@ plugin_init (GModule *module)
|
|||
GstElementFactory *factory;
|
||||
|
||||
/* First we try to create a new Plugin structure. */
|
||||
plugin = gst_plugin_new("example");
|
||||
plugin = gst_plugin_new("example", GST_VERSION_MAJOR, GST_VERSION_MINOR);
|
||||
/* If we get a NULL back, chances are we're already loaded. */
|
||||
g_return_val_if_fail(plugin != NULL, NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue