mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
pitiviformatter: Handle project metadatas
This commit is contained in:
parent
17b765bfb5
commit
7f81f16674
1 changed files with 27 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue