mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
save/load the elementfactory rank
Original commit message from CVS: save/load the elementfactory rank
This commit is contained in:
parent
5d902beab8
commit
c4cd6b8381
1 changed files with 12 additions and 0 deletions
|
@ -639,6 +639,11 @@ gst_xml_registry_parse_element_factory (GMarkupParseContext *context, const gcha
|
|||
else if (!strcmp(tag, "copyright")) {
|
||||
factory->details->copyright = g_strndup (text, text_len);
|
||||
}
|
||||
else if (!strcmp(tag, "rank")) {
|
||||
gint value;
|
||||
sscanf (text, "%d", &value);
|
||||
factory->rank = value;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -806,6 +811,7 @@ gst_xml_registry_start_element (GMarkupParseContext *context, const gchar *eleme
|
|||
factory->details_dynamic = TRUE;
|
||||
factory->details = g_new0(GstElementDetails, 1);
|
||||
factory->padtemplates = NULL;
|
||||
factory->rank = 0;
|
||||
xmlregistry->parser = gst_xml_registry_parse_element_factory;
|
||||
}
|
||||
else if (GST_IS_TYPE_FACTORY (feature))
|
||||
|
@ -1296,6 +1302,12 @@ gst_xml_registry_save_feature (GstXMLRegistry *xmlregistry, GstPluginFeature *fe
|
|||
PUT_ESCAPED ("author", factory->details->author);
|
||||
PUT_ESCAPED ("copyright", factory->details->copyright);
|
||||
|
||||
/* only write the rank if it is greater than zero */
|
||||
if (factory->rank > 0) {
|
||||
gint rank = factory->rank;
|
||||
CLASS (xmlregistry)->save_func (xmlregistry, "<rank>%d</rank>\n", rank);
|
||||
}
|
||||
|
||||
templates = factory->padtemplates;
|
||||
|
||||
while (templates) {
|
||||
|
|
Loading…
Reference in a new issue