diff options
author | Thibault Saunier <thibault.saunier@collabora.com> | 2012-01-04 14:24:05 -0300 |
---|---|---|
committer | Thibault Saunier <thibault.saunier@collabora.com> | 2012-01-11 11:56:17 -0300 |
commit | 3ca5e7bcaa753d116169f3215cd4d8a99a1475f0 (patch) | |
tree | 107b1e89c7f77f4c402242a0e4fcf5ed25939377 | |
parent | ac6f8599fe95d6c662577621db5300af5fcf7bfe (diff) |
ges: Let user set TimelineObject URI while not containing any TrackObject
In the case of not properly set uri, we can keep using the same
TimelineFileSource changing its URI until its TrackObject could be created.
This is particularly usefull in the case of formatter trying to load filesource
when the file has been moved
-rw-r--r-- | ges/ges-timeline-file-source.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/ges/ges-timeline-file-source.c b/ges/ges-timeline-file-source.c index b706d32a..d2e2da99 100644 --- a/ges/ges-timeline-file-source.c +++ b/ges/ges-timeline-file-source.c @@ -59,6 +59,8 @@ enum static GESTrackObject * ges_timeline_filesource_create_track_object (GESTimelineObject * obj, GESTrack * track); +void +ges_timeline_filesource_set_uri (GESTimelineFileSource * self, gchar * uri); static void ges_timeline_filesource_get_property (GObject * object, guint property_id, @@ -92,7 +94,7 @@ ges_timeline_filesource_set_property (GObject * object, guint property_id, switch (property_id) { case PROP_URI: - tfs->priv->uri = g_value_dup_string (value); + ges_timeline_filesource_set_uri (tfs, g_value_dup_string (value)); break; case PROP_MUTE: ges_timeline_filesource_set_mute (tfs, g_value_get_boolean (value)); @@ -139,7 +141,7 @@ ges_timeline_filesource_class_init (GESTimelineFileSourceClass * klass) */ g_object_class_install_property (object_class, PROP_URI, g_param_spec_string ("uri", "URI", "uri of the resource", - NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); /** * GESTimelineFileSource:max-duration: @@ -407,3 +409,20 @@ ges_timeline_filesource_new (gchar * uri) return res; } + +void +ges_timeline_filesource_set_uri (GESTimelineFileSource * self, gchar * uri) +{ + GESTimelineObject *tlobj = GES_TIMELINE_OBJECT (self); + GList *tckobjs = ges_timeline_object_get_track_objects (tlobj); + + if (tckobjs) { + /* FIXME handle this case properly */ + GST_WARNING_OBJECT (tlobj, "Can not change uri when already" + "containing TrackObjects"); + + return; + } + + self->priv->uri = uri; +} |