{
GESAudioTrack *ret;
GstCaps *caps = gst_caps_from_string (DEFAULT_CAPS);
+ GstCaps *restriction_caps = gst_caps_from_string (DEFAULT_RESTRICTION_CAPS);
ret = g_object_new (GES_TYPE_AUDIO_TRACK, "caps", caps,
"track-type", GES_TRACK_TYPE_AUDIO, NULL);
ges_track_set_create_element_for_gap_func (GES_TRACK (ret),
create_element_for_raw_audio_gap);
- ges_track_set_restriction_caps (GES_TRACK (ret),
- gst_caps_from_string (DEFAULT_RESTRICTION_CAPS));
+ ges_track_set_restriction_caps (GES_TRACK (ret), restriction_caps);
+
gst_caps_unref (caps);
+ gst_caps_unref (restriction_caps);
return ret;
}
g_free (xmlcontent);
if (file)
- gst_object_unref (file);
+ g_object_unref (file);
return parsecontext;
failed:
g_propagate_error (error, err);
+ if (file)
+ g_object_unref (file);
+
if (parsecontext) {
g_markup_parse_context_free (parsecontext);
parsecontext = NULL;
_loading_done_cb (GESFormatter * self)
{
_loading_done (self);
- g_object_unref (self);
+ gst_object_unref (self);
return FALSE;
}
GESBaseXmlFormatterPrivate *priv = _GET_PRIV (self);
if (priv->check_only) {
- if (caps)
- gst_caps_unref (caps);
-
return;
}
if (properties) {
gchar *restriction;
- GstCaps *caps;
+ GstCaps *restriction_caps;
gst_structure_get (properties, "restriction-caps", G_TYPE_STRING,
&restriction, NULL);
gst_structure_remove_fields (properties, "restriction-caps", "caps",
"message-forward", NULL);
if (g_strcmp0 (restriction, "NULL")) {
- caps = gst_caps_from_string (restriction);
- ges_track_set_restriction_caps (track, caps);
+ restriction_caps = gst_caps_from_string (restriction);
+ ges_track_set_restriction_caps (track, restriction_caps);
+ gst_caps_unref (restriction_caps);
}
gst_structure_foreach (properties,
(GstStructureForeachFunc) set_property_foreach, track);
+ g_free (restriction);
}
g_hash_table_insert (priv->tracks, g_strdup (id), gst_object_ref (track));
if (props)
gst_structure_free (props);
+ gst_caps_unref (caps);
+
return;
wrong_caps:
spec = pspecs[j];
if (spec->value_type == GST_TYPE_CAPS) {
GstCaps *caps;
+ gchar *caps_str;
g_object_get (object, spec->name, &caps, NULL);
- gst_structure_set (structure, spec->name, G_TYPE_STRING,
- gst_caps_to_string (caps), NULL);
+ caps_str = gst_caps_to_string (caps);
+ gst_structure_set (structure, spec->name, G_TYPE_STRING, caps_str, NULL);
+ g_free (caps_str);
} else if (_can_serialize_spec (spec)) {
_init_value_from_spec_for_serialization (&val, spec);
g_object_get_property (object, spec->name, &val);
GstStructure *structure;
GParamSpec **pspecs, *spec;
guint i, n_props;
+ gchar *struct_str;
pspecs = ges_track_element_list_children_properties (trackelement, &n_props);
}
g_free (pspecs);
+ struct_str = gst_structure_to_string (structure);
append_escaped (str,
- g_markup_printf_escaped (" children-properties='%s'",
- gst_structure_to_string (structure)));
-
+ g_markup_printf_escaped (" children-properties='%s'", struct_str));
gst_structure_free (structure);
+ g_free (struct_str);
}
/* TODO : Use this function for every track element with controllable properties */
gchar *properties, *metas;
guint track_id = 0;
gboolean serialize;
+ gchar *extractable_id;
g_object_get (trackelement, "serialize", &serialize, NULL);
if (!serialize) {
"in-point", "duration", "locked", "max-duration", "name", NULL);
metas =
ges_meta_container_metas_to_string (GES_META_CONTAINER (trackelement));
+ extractable_id = ges_extractable_get_id (GES_EXTRACTABLE (trackelement));
append_escaped (str,
g_markup_printf_escaped (" <effect asset-id='%s' clip-id='%u'"
" type-name='%s' track-type='%i' track-id='%i' properties='%s' metadatas='%s'",
- ges_extractable_get_id (GES_EXTRACTABLE (trackelement)), clip_id,
+ extractable_id, clip_id,
g_type_name (G_OBJECT_TYPE (trackelement)), tck->type, track_id,
properties, metas));
+ g_free (extractable_id);
g_free (properties);
g_free (metas);
GList *tmptrackelement;
GList *tracks;
gboolean serialize;
+ gchar *extractable_id;
clip = GES_CLIP (tmpclip->data);
properties = _serialize_properties (G_OBJECT (clip),
"supported-formats", "rate", "in-point", "start", "duration",
"max-duration", "priority", "vtype", "uri", NULL);
+ extractable_id = ges_extractable_get_id (GES_EXTRACTABLE (clip));
append_escaped (str,
g_markup_printf_escaped (" <clip id='%i' asset-id='%s'"
" type-name='%s' layer-priority='%i' track-types='%i' start='%"
G_GUINT64_FORMAT "' duration='%" G_GUINT64_FORMAT "' inpoint='%"
G_GUINT64_FORMAT "' rate='%d' properties='%s' >\n",
- priv->nbelements, ges_extractable_get_id (GES_EXTRACTABLE (clip)),
+ priv->nbelements, extractable_id,
g_type_name (G_OBJECT_TYPE (clip)), priority,
ges_clip_get_supported_formats (clip), _START (clip),
_DURATION (clip), _INPOINT (clip), 0, properties));
+ g_free (extractable_id);
g_free (properties);
g_hash_table_insert (self->priv->element_id, clip,