diff --git a/ges/ges-base-xml-formatter.c b/ges/ges-base-xml-formatter.c index a8565b596e..908e199681 100644 --- a/ges/ges-base-xml-formatter.c +++ b/ges/ges-base-xml-formatter.c @@ -1106,7 +1106,8 @@ ges_base_xml_formatter_add_control_binding (GESBaseXmlFormatter * self, void ges_base_xml_formatter_add_source (GESBaseXmlFormatter * self, - const gchar * track_id, GstStructure * children_properties) + const gchar * track_id, GstStructure * children_properties, + GstStructure * properties) { GESBaseXmlFormatterPrivate *priv = _GET_PRIV (self); GESTrackElement *element = NULL; @@ -1128,8 +1129,13 @@ ges_base_xml_formatter_add_source (GESBaseXmlFormatter * self, return; } - gst_structure_foreach (children_properties, - (GstStructureForeachFunc) _set_child_property, element); + if (properties) + gst_structure_foreach (properties, + (GstStructureForeachFunc) set_property_foreach, element); + + if (children_properties) + gst_structure_foreach (children_properties, + (GstStructureForeachFunc) _set_child_property, element); } void diff --git a/ges/ges-internal.h b/ges/ges-internal.h index 07fd873445..f14e63d31c 100644 --- a/ges/ges-internal.h +++ b/ges/ges-internal.h @@ -329,7 +329,8 @@ G_GNUC_INTERNAL void ges_base_xml_formatter_add_track_element (GESBaseXmlForma G_GNUC_INTERNAL void ges_base_xml_formatter_add_source (GESBaseXmlFormatter *self, const gchar * track_id, - GstStructure *children_properties); + GstStructure *children_properties, + GstStructure *properties); G_GNUC_INTERNAL void ges_base_xml_formatter_add_group (GESBaseXmlFormatter *self, const gchar *name, diff --git a/ges/ges-layer.h b/ges/ges-layer.h index 7e7a8629d1..e2d6fa41d0 100644 --- a/ges/ges-layer.h +++ b/ges/ges-layer.h @@ -122,10 +122,10 @@ GList* ges_layer_get_clips (GESLayer * layer); GES_API GstClockTime ges_layer_get_duration (GESLayer *layer); GES_API -gboolean ges_layer_set_active_for_tracks(GESLayer *layer, gboolean active, - GList *tracks); +gboolean ges_layer_set_active_for_tracks (GESLayer *layer, gboolean active, + GList *tracks); -GES_API gboolean ges_layer_get_active_for_track(GESLayer *layer, - GESTrack *track); +GES_API gboolean ges_layer_get_active_for_track (GESLayer *layer, + GESTrack *track); G_END_DECLS diff --git a/ges/ges-xml-formatter.c b/ges/ges-xml-formatter.c index 9cb844cff9..b44a176ef0 100644 --- a/ges/ges-xml-formatter.c +++ b/ges/ges-xml-formatter.c @@ -712,13 +712,14 @@ _parse_source (GMarkupParseContext * context, const gchar * element_name, const gchar ** attribute_names, const gchar ** attribute_values, GESXmlFormatter * self, GError ** error) { - GstStructure *children_props = NULL; - const gchar *track_id = NULL, *children_properties = NULL; + GstStructure *children_props = NULL, *props = NULL; + const gchar *track_id = NULL, *children_properties = NULL, *properties = NULL; if (!g_markup_collect_attributes (element_name, attribute_names, attribute_values, error, G_MARKUP_COLLECT_STRING, "track-id", &track_id, COLLECT_STR_OPT, "children-properties", &children_properties, + COLLECT_STR_OPT, "properties", &properties, G_MARKUP_COLLECT_INVALID)) { return; } @@ -729,12 +730,22 @@ _parse_source (GMarkupParseContext * context, const gchar * element_name, goto wrong_children_properties; } - ges_base_xml_formatter_add_source (GES_BASE_XML_FORMATTER (self), track_id, - children_props); + if (properties) { + props = gst_structure_from_string (properties, NULL); + if (props == NULL) + goto wrong_properties; + } + ges_base_xml_formatter_add_source (GES_BASE_XML_FORMATTER (self), track_id, + children_props, props); + +done: if (children_props) gst_structure_free (children_props); + if (props) + gst_structure_free (props); + return; wrong_children_properties: @@ -742,6 +753,13 @@ wrong_children_properties: G_MARKUP_ERROR_INVALID_CONTENT, "element '%s', children properties '%s', could no be deserialized", element_name, children_properties); + goto done; + +wrong_properties: + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "element '%s', properties '%s', could no be deserialized", + element_name, properties); + goto done; } static inline void