From: Thomas Vander Stichele Date: Sat, 3 Sep 2005 17:00:52 +0000 (+0000) Subject: add a source plugin description field, to represent the source module this plugin... X-Git-Tag: RELEASE-0_9_2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25169fe885f1e3828cb2dab7fd0f032e5620e128;p=platform%2Fupstream%2Fgstreamer.git add a source plugin description field, to represent the source module this plugin is a part of. By default GST_PLUGI... Original commit message from CVS: add a source plugin description field, to represent the source module this plugin is a part of. By default GST_PLUGIN_DEFINE will set it to PACKAGE, which is automake's idea of the name of the source project. --- diff --git a/ChangeLog b/ChangeLog index 33f01c6..90c0d07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,24 @@ 2005-09-03 Thomas Vander Stichele + * docs/gst/tmpl/gstplugin.sgml: + * gst/elements/gstelements.c: + * gst/gst.c: + * gst/gstplugin.c: (gst_plugin_register_func), + (gst_plugin_desc_copy), (gst_plugin_desc_free), + (gst_plugin_get_source): + * gst/gstplugin.h: + * gst/registries/gstlibxmlregistry.c: (load_plugin), + (gst_xml_registry_save_plugin): + * gst/registries/gstxmlregistry.c: (gst_xml_registry_parse_plugin), + (gst_xml_registry_save_plugin): + * tools/gst-inspect.c: (print_plugin_info): + add a "source" plugin description field, to represent the source + module this plugin is a part of. By default GST_PLUGIN_DEFINE + will set it to PACKAGE, which is automake's idea of the name of + the source project. + +2005-09-03 Thomas Vander Stichele + * Makefile.am: * autogen.sh: * configure.ac: diff --git a/docs/gst/tmpl/gstplugin.sgml b/docs/gst/tmpl/gstplugin.sgml index 17a0ae7..5f5f107 100644 --- a/docs/gst/tmpl/gstplugin.sgml +++ b/docs/gst/tmpl/gstplugin.sgml @@ -89,6 +89,7 @@ loaded will use this variable to initialize the plugin. @plugin_exit: @version: version of the plugin @license: effective license of plugin +@module: @package: package plugin belongs to @origin: URL to provider of plugin @_gst_reserved: diff --git a/gst/elements/gstelements.c b/gst/elements/gstelements.c index ba1d02d..9851688 100644 --- a/gst/elements/gstelements.c +++ b/gst/elements/gstelements.c @@ -77,4 +77,4 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "gstelements", "standard GStreamer elements", - plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN) + plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN); diff --git a/gst/gst.c b/gst/gst.c index bafb59d..a61c6e5 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -677,6 +677,7 @@ static GstPluginDesc plugin_desc = { NULL, VERSION, GST_LICENSE, + PACKAGE, GST_PACKAGE, GST_ORIGIN, diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 0cc06cb..2390e5c 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -190,7 +190,8 @@ gst_plugin_register_func (GstPlugin * plugin, GModule * module, return NULL; } - if (!desc->license || !desc->description || !desc->package || !desc->origin) { + if (!desc->license || !desc->description || !desc->source || + !desc->package || !desc->origin) { if (GST_CAT_DEFAULT) GST_INFO ("plugin \"%s\" has incorrect GstPluginDesc, not loading", plugin->filename); @@ -498,6 +499,8 @@ gst_plugin_desc_copy (GstPluginDesc * dest, const GstPluginDesc * src) dest->version = g_strdup (src->version); g_free (dest->license); dest->license = g_strdup (src->license); + g_free (dest->source); + dest->source = g_strdup (src->source); g_free (dest->package); dest->package = g_strdup (src->package); g_free (dest->origin); @@ -513,6 +516,7 @@ gst_plugin_desc_free (GstPluginDesc * desc) g_free (desc->description); g_free (desc->version); g_free (desc->license); + g_free (desc->source); g_free (desc->package); g_free (desc->origin); @@ -628,6 +632,22 @@ gst_plugin_get_license (GstPlugin * plugin) } /** + * gst_plugin_get_source: + * @plugin: plugin to get the source of + * + * get the source module the plugin belongs to. + * + * Returns: the source of the plugin + */ +G_CONST_RETURN gchar * +gst_plugin_get_source (GstPlugin * plugin) +{ + g_return_val_if_fail (plugin != NULL, NULL); + + return plugin->desc.source; +} + +/** * gst_plugin_get_package: * @plugin: plugin to get the package of * diff --git a/gst/gstplugin.h b/gst/gstplugin.h index cd87102..fe20d2c 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -58,10 +58,11 @@ struct _GstPluginDesc { gchar *name; /* unique name of plugin */ gchar *description; /* description of plugin */ GstPluginInitFunc plugin_init; /* pointer to plugin_init function */ - GstPluginExitFunc plugin_exit; /* pointer to exiting function */ + GstPluginExitFunc plugin_exit; /* pointer to plugin_exit function */ gchar *version; /* version of the plugin */ gchar *license; /* effective license of plugin */ - gchar *package; /* package plugin belongs to */ + gchar *source; /* source module plugin belongs to */ + gchar *package; /* shipped package plugin belongs to */ gchar *origin; /* URL to provider of plugin */ gpointer _gst_reserved[GST_PADDING]; @@ -90,6 +91,7 @@ GST_PLUGIN_EXPORT GstPluginDesc gst_plugin_desc = { \ NULL, \ version, \ license, \ + PACKAGE, \ package, \ origin, \ GST_PADDING_INIT \ @@ -108,6 +110,7 @@ _gst_plugin_static_init__ ##init (void) \ NULL, \ version, \ license, \ + PACKAGE, \ package, \ origin, \ GST_PADDING_INIT \ @@ -132,6 +135,7 @@ G_CONST_RETURN gchar* gst_plugin_get_description (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_filename (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_version (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_license (GstPlugin *plugin); +G_CONST_RETURN gchar* gst_plugin_get_source (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_package (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_origin (GstPlugin *plugin); GModule * gst_plugin_get_module (GstPlugin *plugin); diff --git a/gst/registries/gstlibxmlregistry.c b/gst/registries/gstlibxmlregistry.c index 1202f10..8ade175 100644 --- a/gst/registries/gstlibxmlregistry.c +++ b/gst/registries/gstlibxmlregistry.c @@ -838,6 +838,9 @@ load_plugin (xmlTextReaderPtr reader) } else if (g_str_equal (tag, "license")) { if (!read_string (reader, &plugin->desc.license)) break; + } else if (g_str_equal (tag, "source")) { + if (!read_string (reader, &plugin->desc.source)) + break; } else if (g_str_equal (tag, "package")) { if (!read_string (reader, &plugin->desc.package)) break; @@ -1134,6 +1137,7 @@ gst_xml_registry_save_plugin (GstXMLRegistry * xmlregistry, GstPlugin * plugin) PUT_ESCAPED ("filename", plugin->filename); PUT_ESCAPED ("version", plugin->desc.version); PUT_ESCAPED ("license", plugin->desc.license); + PUT_ESCAPED ("source", plugin->desc.source); PUT_ESCAPED ("package", plugin->desc.package); PUT_ESCAPED ("origin", plugin->desc.origin); diff --git a/gst/registries/gstxmlregistry.c b/gst/registries/gstxmlregistry.c index 2782889..f2f8cc7 100644 --- a/gst/registries/gstxmlregistry.c +++ b/gst/registries/gstxmlregistry.c @@ -741,6 +741,8 @@ gst_xml_registry_parse_plugin (GMarkupParseContext * context, const gchar * tag, plugin->desc.version = g_strndup (text, text_len); } else if (!strcmp (tag, "license")) { plugin->desc.license = g_strndup (text, text_len); + } else if (!strcmp (tag, "source")) { + plugin->desc.source = g_strndup (text, text_len); } else if (!strcmp (tag, "package")) { plugin->desc.package = g_strndup (text, text_len); } else if (!strcmp (tag, "origin")) { @@ -1270,6 +1272,7 @@ gst_xml_registry_save_plugin (GstXMLRegistry * xmlregistry, GstPlugin * plugin) PUT_ESCAPED ("filename", plugin->filename); PUT_ESCAPED ("version", plugin->desc.version); PUT_ESCAPED ("license", plugin->desc.license); + PUT_ESCAPED ("source", plugin->desc.source); PUT_ESCAPED ("package", plugin->desc.package); PUT_ESCAPED ("origin", plugin->desc.origin); diff --git a/plugins/elements/gstelements.c b/plugins/elements/gstelements.c index ba1d02d..9851688 100644 --- a/plugins/elements/gstelements.c +++ b/plugins/elements/gstelements.c @@ -77,4 +77,4 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "gstelements", "standard GStreamer elements", - plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN) + plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN); diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 1ca991f..09c4bb5 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -898,13 +898,15 @@ static void print_plugin_info (GstPlugin * plugin) { n_print ("Plugin Details:\n"); - n_print (" Name:\t\t%s\n", plugin->desc.name); - n_print (" Description:\t%s\n", plugin->desc.description); - n_print (" Filename:\t%s\n", plugin->filename ? plugin->filename : "(null)"); - n_print (" Version:\t%s\n", plugin->desc.version); - n_print (" License:\t%s\n", plugin->desc.license); - n_print (" Package:\t%s\n", plugin->desc.package); - n_print (" Origin URL:\t%s\n", plugin->desc.origin); + n_print (" Name:\t\t\t%s\n", plugin->desc.name); + n_print (" Description:\t\t%s\n", plugin->desc.description); + n_print (" Filename:\t\t%s\n", + plugin->filename ? plugin->filename : "(null)"); + n_print (" Version:\t\t%s\n", plugin->desc.version); + n_print (" License:\t\t%s\n", plugin->desc.license); + n_print (" Source module:\t%s\n", plugin->desc.source); + n_print (" Binary package:\t%s\n", plugin->desc.package); + n_print (" Origin URL:\t\t%s\n", plugin->desc.origin); n_print ("\n"); }