pitiviformatter: Handle project metadatas

This commit is contained in:
Thibault Saunier 2013-01-12 20:49:31 -03:00
parent 17b765bfb5
commit 7f81f16674

View file

@ -531,6 +531,30 @@ create_tracks (GESFormatter * self)
return TRUE;
}
static void
parse_metadatas (GESFormatter * self)
{
guint i, size;
xmlNodePtr node;
xmlAttr *cur_attr;
xmlNodeSetPtr nodes;
xmlXPathObjectPtr xpathObj;
GESMetaContainer *metacontainer = GES_META_CONTAINER (self->project);
xpathObj = xmlXPathEvalExpression ((const xmlChar *)
"/pitivi/metadata", GES_PITIVI_FORMATTER (self)->priv->xpathCtx);
nodes = xpathObj->nodesetval;
size = (nodes) ? nodes->nodeNr : 0;
for (i = 0; i < size; i++) {
node = nodes->nodeTab[i];
for (cur_attr = node->properties; cur_attr; cur_attr = cur_attr->next) {
ges_meta_container_set_string (metacontainer, (gchar *) cur_attr->name,
(gchar *) xmlGetProp (node, cur_attr->name));
}
}
}
static void
list_sources (GESFormatter * self)
{
@ -1023,6 +1047,9 @@ load_pitivi_file_from_uri (GESFormatter * self,
priv->xpathCtx = xmlXPathNewContext (doc);
if (self->project)
parse_metadatas (self);
if (!create_tracks (self)) {
GST_ERROR ("Couldn't create tracks");
return FALSE;