guint64 maxduration)
{
GESTimelineObject *object = GES_TIMELINE_OBJECT (self);
+ GList *tmp, *tckobjs;
self->priv->maxduration = maxduration;
if (object->duration == GST_CLOCK_TIME_NONE || object->duration == 0) {
g_object_set (self, "duration", self->priv->maxduration - object->inpoint,
NULL);
}
+
+ tckobjs = ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (self));
+ for (tmp = tckobjs; tmp; tmp = g_list_next (tmp)) {
+ g_object_set (tmp->data, "max-duration", maxduration, NULL);
+
+ /* We free the list in the same loop */
+ g_object_unref (tmp->data);
+ g_list_free_1 (tmp);
+ }
}
/**
g_object_set (tfs, "is_image", (gboolean) TRUE, NULL);
}
- else {
+ /* Continue the processing on tfs */
+ add_object_to_tracks (timeline, GES_TIMELINE_OBJECT (tfs));
+
+ if (!is_image) {
g_object_set (tfs, "max-duration",
gst_discoverer_info_get_duration (info), NULL);
}
struct _GESTrackFileSourcePrivate
{
- /* Dummy variable */
- void *nothing;
+ guint64 maxduration;
};
enum
{
PROP_0,
- PROP_URI
+ PROP_URI,
+ PROP_MAX_DURATION
};
static void
case PROP_URI:
g_value_set_string (value, tfs->uri);
break;
+ case PROP_MAX_DURATION:
+ g_value_set_uint64 (value, tfs->priv->maxduration);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
case PROP_URI:
tfs->uri = g_value_dup_string (value);
break;
+ case PROP_MAX_DURATION:
+ tfs->priv->maxduration = g_value_get_uint64 (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
object_class->set_property = ges_track_filesource_set_property;
object_class->dispose = ges_track_filesource_dispose;
+ /**
+ * GESTrackFileSource:max-duration:
+ *
+ * The maximum duration (in nanoseconds) of the file.
+ *
+ * If not set before adding the object to a layer, it will be discovered
+ * asynchronously. Connect to 'notify::max-duration' to be notified of it.
+ */
+ g_object_class_install_property (object_class, PROP_MAX_DURATION,
+ g_param_spec_uint64 ("max-duration", "Maximum duration",
+ "The duration of the file", 0, G_MAXUINT64, GST_CLOCK_TIME_NONE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
/**
* GESTrackFileSource:uri
*