Commit 5d02075d authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

Merge remote-tracking branch 'origin/master' into 0.11

Conflicts:
	bindings/python/Makefile.am
	bindings/python/ges-types.defs
	bindings/python/ges.defs
	bindings/python/ges.override
	bindings/python/gesmodule.c
	bindings/python/testsuite/test_textoverlay.py
parents 1da4d714 e121368e
......@@ -193,6 +193,14 @@ AC_SUBST(GLIB_PREFIX)
AC_SUBST(GST_PREFIX)
AC_SUBST(GSTPB_PREFIX)
dnl pitivi formatter needs libxml
PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML="yes", HAVE_LIBXML="no")
if test "x$HAVE_LIBXML" != "xyes"; then
AC_ERROR([libxml2 is required])
fi
AC_SUBST(XML_LIBS)
AC_SUBST(XML_CFLAGS)
dnl GTK is optional and only used in examples
HAVE_GTK=no
HAVE_GTK_X11=no
......
......@@ -88,6 +88,7 @@ platform as well as Windows. It is released under the GNU Library General Public
<title>Serialization Classes</title>
<xi:include href="xml/ges-formatter.xml"/>
<xi:include href="xml/ges-keyfile-formatter.xml"/>
<xi:include href="xml/ges-pitivi-formatter.xml"/>
</chapter>
<chapter id="ges-hierarchy">
......
......@@ -4,6 +4,11 @@
<FILE>ges-common</FILE>
<TITLE>Initialization</TITLE>
ges_init
ges_version
GES_VERSION_MAJOR
GES_VERSION_MICRO
GES_VERSION_MINOR
GES_VERSION_NANO
<SUBSECTION Standard>
GES_PADDING
</SECTION>
......@@ -51,6 +56,8 @@ ges_track_add_object
ges_track_remove_object
ges_track_set_caps
ges_track_get_caps
ges_track_enable_update
ges_track_get_objects
<SUBSECTION Standard>
GESTrackClass
GESTrackPrivate
......@@ -236,11 +243,13 @@ ges_timeline_new
ges_timeline_new_audio_video
ges_timeline_new_from_uri
ges_timeline_add_layer
ges_timeline_append_layer
ges_timeline_remove_layer
ges_timeline_add_track
ges_timeline_remove_track
ges_timeline_load_from_uri
ges_timeline_save_to_uri
ges_timeline_enable_update
<SUBSECTION usage>
ges_timeline_get_tracks
ges_timeline_get_layers
......@@ -269,6 +278,8 @@ ges_timeline_layer_remove_object
ges_timeline_layer_set_priority
ges_timeline_layer_get_priority
ges_timeline_layer_get_objects
ges_timeline_layer_get_auto_transition
ges_timeline_layer_set_auto_transition
<SUBSECTION Standard>
GESTimelineLayerPrivate
ges_timeline_layer_set_timeline
......@@ -298,7 +309,11 @@ ges_timeline_object_find_track_object
ges_timeline_object_add_track_object
ges_timeline_object_get_top_effects
ges_timeline_object_get_top_effect_position
ges_timeline_object_move_to_layer
ges_timeline_object_set_top_effect_priority
ges_timeline_object_set_supported_formats
ges_timeline_object_get_supported_formats
ges_timeline_object_split
<SUBSECTION Standard>
GES_TIMELINE_OBJECT_DURATION
GES_TIMELINE_OBJECT_INPOINT
......@@ -308,10 +323,13 @@ GES_TIMELINE_OBJECT_HEIGHT
ges_timeline_object_create_track_objects
ges_timeline_object_create_track_object
ges_timeline_object_fill_track_object
ges_timeline_object_is_moving_from_layer
ges_timeline_object_release_track_object
ges_timeline_object_get_track_objects
ges_timeline_object_set_layer
ges_timeline_object_set_moving_from_layer
ges_timeline_object_set_priority
ges_timeline_object_lock_track_objects
GESTimelineObjectPrivate
GES_IS_TIMELINE_OBJECT
GES_IS_TIMELINE_OBJECT_CLASS
......@@ -331,6 +349,10 @@ ges_timeline_pipeline_new
ges_timeline_pipeline_add_timeline
ges_timeline_pipeline_set_mode
ges_timeline_pipeline_set_render_settings
ges_timeline_pipeline_preview_get_audio_sink
ges_timeline_pipeline_preview_get_video_sink
ges_timeline_pipeline_preview_set_audio_sink
ges_timeline_pipeline_preview_set_video_sink
ges_timeline_pipeline_get_thumbnail_buffer
ges_timeline_pipeline_get_thumbnail_rgb24
ges_timeline_pipeline_save_thumbnail
......@@ -732,12 +754,15 @@ GESFormatter
GESFormatterClass
GESFormatterLoadFromURIMethod
GESFormatterSaveToURIMethod
GESFormatterSourceMovedMethod
GESFormatterLoadedMethod
ges_default_formatter_new
ges_formatter_load_from_uri
ges_formatter_save_to_uri
ges_formatter_new_for_uri
ges_formatter_can_load_uri
ges_formatter_can_save_uri
ges_formatter_update_source_uri
<SUBSECTION Standard>
ges_formatter_get_type
GES_FORMATTER
......@@ -775,6 +800,26 @@ GES_TYPE_KEYFILE_FORMATTER
ges_keyfile_formatter_get_type
</SECTION>
<SECTION>
<FILE>ges-pitivi-formatter</FILE>
<TITLE>GESPitiviFormatter</TITLE>
GESPitiviFormatter
ges_pitivi_formatter_new
ges_pitivi_formatter_set_sources
ges_pitivi_formatter_get_sources
<SUBSECTION Standard>
GESPitiviFormatterClass
GESPitiviFormatterPrivate
GES_TYPE_PITIVI_FORMATTER
GES_IS_PITIVI_FORMATTER
GES_IS_PITIVI_FORMATTER_CLASS
GES_PITIVI_FORMATTER
GES_PITIVI_FORMATTER_CLASS
GES_PITIVI_FORMATTER_GET_CLASS
GES_TYPE_PITIVIFORMATTER
ges_pitivi_formatter_get_type
</SECTION>
<SECTION>
<FILE>ges-track-effect</FILE>
<TITLE>GESTrackEffect</TITLE>
......
......@@ -46,6 +46,7 @@ libges_@GST_MAJORMINOR@_la_SOURCES = \
ges-screenshot.c \
ges-formatter.c \
ges-keyfile-formatter.c \
ges-pitivi-formatter.c \
ges-utils.c
libges_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/ges/
......@@ -89,13 +90,14 @@ libges_@GST_MAJORMINOR@include_HEADERS = \
ges-screenshot.h \
ges-formatter.h \
ges-keyfile-formatter.h \
ges-pitivi-formatter.h \
ges-utils.h
noinst_HEADERS = \
ges-internal.h
libges_@GST_MAJORMINOR@_la_CFLAGS = -I$(top_srcdir) $(GST_PBUTILS_CFLAGS) $(GST_VIDEO_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libges_@GST_MAJORMINOR@_la_LIBADD = $(GST_PBUTILS_LIBS) $(GST_VIDEO_LIBS) $(GST_CONTROLLER_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS)
libges_@GST_MAJORMINOR@_la_CFLAGS = -I$(top_srcdir) $(GST_PBUTILS_CFLAGS) $(GST_VIDEO_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(XML_CFLAGS)
libges_@GST_MAJORMINOR@_la_LIBADD = $(GST_PBUTILS_LIBS) $(GST_VIDEO_LIBS) $(GST_CONTROLLER_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(XML_LIBS)
libges_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) -export-symbols-regex \^_*\(ges_\|GES_\).*
DISTCLEANFILE = $(CLEANFILES)
......
......@@ -38,13 +38,19 @@
*
* Support for saving or loading new formats can be added by creating a subclass of
* #GESFormatter and implement the various vmethods of #GESFormatterClass.
*
* Note that subclasses should call project_loaded wen they are done loading
* a project.
**/
#include <gst/gst.h>
#include <stdlib.h>
#include "gesmarshal.h"
#include "ges-formatter.h"
#include "ges-keyfile-formatter.h"
#include "ges-internal.h"
#include "ges.h"
G_DEFINE_ABSTRACT_TYPE (GESFormatter, ges_formatter, G_TYPE_OBJECT);
......@@ -52,6 +58,10 @@ struct _GESFormatterPrivate
{
gchar *data;
gsize length;
/* Make sure not to emit several times "moved-source" when the user already
* provided the new source URI. */
GHashTable *uri_newuri_table;
};
static void ges_formatter_dispose (GObject * object);
......@@ -61,6 +71,20 @@ static gboolean save_to_uri (GESFormatter * formatter, GESTimeline *
timeline, const gchar * uri);
static gboolean default_can_load_uri (const gchar * uri);
static gboolean default_can_save_uri (const gchar * uri);
static void discovery_error_cb (GESTimeline * timeline,
GESTimelineFileSource * tfs, GError * error, GESFormatter * formatter);
static gboolean project_loaded (GESFormatter * formatter,
GESTimeline * timeline);
enum
{
SOURCE_MOVED_SIGNAL,
LOADED_SIGNAL,
LAST_SIGNAL
};
static guint ges_formatter_signals[LAST_SIGNAL] = { 0 };
static void
ges_formatter_class_init (GESFormatterClass * klass)
......@@ -69,12 +93,35 @@ ges_formatter_class_init (GESFormatterClass * klass)
g_type_class_add_private (klass, sizeof (GESFormatterPrivate));
/**
* GESFormatter::source-moved:
* @formatter: the #GESFormatter
* @source: The #GESTimelineFileSource that has an invalid URI. When this happens,
* you can call #ges_formatter_update_source_uri with the new URI of the source so
* the project can be loaded properly.
*/
ges_formatter_signals[SOURCE_MOVED_SIGNAL] =
g_signal_new ("source-moved", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, ges_marshal_VOID__OBJECT, G_TYPE_NONE,
1, GES_TYPE_TIMELINE_FILE_SOURCE);
/**
* GESFormatter::loaded:
* @formatter: the #GESFormatter that is done loading a project.
*/
ges_formatter_signals[LOADED_SIGNAL] =
g_signal_new ("loaded", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, ges_marshal_VOID__OBJECT, G_TYPE_NONE,
1, GES_TYPE_TIMELINE);
object_class->dispose = ges_formatter_dispose;
klass->can_load_uri = default_can_load_uri;
klass->can_save_uri = default_can_save_uri;
klass->load_from_uri = load_from_uri;
klass->save_to_uri = save_to_uri;
klass->update_source_uri = NULL;
klass->project_loaded = project_loaded;
}
static void
......@@ -82,6 +129,9 @@ ges_formatter_init (GESFormatter * object)
{
object->priv = G_TYPE_INSTANCE_GET_PRIVATE (object,
GES_TYPE_FORMATTER, GESFormatterPrivate);
object->priv->uri_newuri_table = g_hash_table_new_full (g_str_hash,
g_str_equal, g_free, g_free);
}
static void
......@@ -92,6 +142,7 @@ ges_formatter_dispose (GObject * object)
if (priv->data) {
g_free (priv->data);
}
g_hash_table_destroy (priv->uri_newuri_table);
}
/**
......@@ -144,7 +195,7 @@ default_can_save_uri (const gchar * uri)
/**
* ges_formatter_can_load_uri:
* @uri: a #gchar * pointing to the URI
*
*
* Checks if there is a #GESFormatter available which can load a #GESTimeline
* from the given URI.
*
......@@ -177,7 +228,7 @@ ges_formatter_can_load_uri (const gchar * uri)
/**
* ges_formatter_can_save_uri:
* @uri: a #gchar * pointing to a URI
*
*
* Returns TRUE if there is a #GESFormatter available which can save a
* #GESTimeline to the given URI.
*
......@@ -188,7 +239,7 @@ gboolean
ges_formatter_can_save_uri (const gchar * uri)
{
if (!(gst_uri_is_valid (uri))) {
GST_ERROR ("Invalid uri!");
GST_ERROR ("%s invalid uri!", uri);
return FALSE;
}
......@@ -237,7 +288,7 @@ ges_formatter_set_data (GESFormatter * formatter, void *data, gsize length)
*
* Lets you get the data @formatter used for loading.
*
* Returns: a pointer to the data.
* Returns: (transfer none): a pointer to the data.
*/
void *
ges_formatter_get_data (GESFormatter * formatter, gsize * length)
......@@ -334,7 +385,7 @@ ges_formatter_save (GESFormatter * formatter, GESTimeline * timeline)
* @formatter: a #GESFormatter
* @timeline: a #GESTimeline
* @uri: a #gchar * pointing to a URI
*
*
* Load data from the given URI into timeline.
*
* Returns: TRUE if the timeline data was successfully loaded from the URI,
......@@ -347,6 +398,11 @@ ges_formatter_load_from_uri (GESFormatter * formatter, GESTimeline * timeline,
{
GESFormatterClass *klass = GES_FORMATTER_GET_CLASS (formatter);
g_return_val_if_fail (GES_IS_FORMATTER (formatter), FALSE);
g_return_val_if_fail (GES_IS_TIMELINE (timeline), FALSE);
g_signal_connect (timeline, "discovery-error",
G_CALLBACK (discovery_error_cb), formatter);
if (klass->load_from_uri)
return klass->load_from_uri (formatter, timeline, uri);
......@@ -451,3 +507,56 @@ save_to_uri (GESFormatter * formatter, GESTimeline * timeline,
return ret;
}
gboolean
ges_formatter_update_source_uri (GESFormatter * formatter,
GESTimelineFileSource * source, gchar * new_uri)
{
GESFormatterClass *klass = GES_FORMATTER_GET_CLASS (formatter);
if (klass->update_source_uri) {
const gchar *uri = ges_timeline_filesource_get_uri (source);
gchar *cached_uri =
g_hash_table_lookup (formatter->priv->uri_newuri_table, uri);
if (!cached_uri) {
g_hash_table_insert (formatter->priv->uri_newuri_table, g_strdup (uri),
g_strdup (new_uri));
GST_DEBUG ("Adding %s to the new uri cache", new_uri);
}
return klass->update_source_uri (formatter, source, new_uri);
}
GST_ERROR ("not implemented!");
return FALSE;
}
static void
discovery_error_cb (GESTimeline * timeline,
GESTimelineFileSource * tfs, GError * error, GESFormatter * formatter)
{
if (error->domain == GST_RESOURCE_ERROR &&
error->code == GST_RESOURCE_ERROR_NOT_FOUND) {
const gchar *uri = ges_timeline_filesource_get_uri (tfs);
gchar *new_uri =
g_hash_table_lookup (formatter->priv->uri_newuri_table, uri);
if (new_uri) {
ges_formatter_update_source_uri (formatter, tfs, new_uri);
GST_DEBUG ("%s found in the cache, new uri: %s", uri, new_uri);
} else
g_signal_emit (formatter, ges_formatter_signals[SOURCE_MOVED_SIGNAL], 0,
tfs);
}
}
static gboolean
project_loaded (GESFormatter * formatter, GESTimeline * timeline)
{
g_signal_emit (formatter, ges_formatter_signals[LOADED_SIGNAL], 0, timeline);
return TRUE;
}
......@@ -100,6 +100,34 @@ typedef gboolean (*GESFormatterSaveMethod) (GESFormatter * formatter,
typedef gboolean (*GESFormatterLoadMethod) (GESFormatter * formatter,
GESTimeline * timeline);
/**
* GESFormatterSourceMovedMethod:
* @formatter: a #GESFormatter
* @tfs: a #GESTimelineFileSource
* @new_uri: the new URI of @tfs
*
* Virtual method for changing the URI of a #GESTimelineFileSource that has been
* moved between the saving and the loading of the timeline.
*
* This virtual method is not 100% necessary to be implemented as it is an
* extra feature.
*
* Returns: %TRUE if the source URI could be modified properly, %FALSE otherwize.
*/
typedef gboolean (*GESFormatterSourceMovedMethod) (GESFormatter *formatter,
GESTimelineFileSource *tfs, gchar *new_uri);
/**
* GESFormatterLoadedMethod
* @formatter: The #GESFormatter that is done loading
* @timeline: The #GESTimeline that has finnished to load
*
* This method should be called by sublcasses when they are done
* loading @timeline
*/
typedef gboolean (*GESFormatterLoadedMethod) (GESFormatter *formatter,
GESTimeline *timeline);
/**
* GESFormatterClass:
* @parent_class: the parent class structure
......@@ -107,6 +135,9 @@ typedef gboolean (*GESFormatterLoadMethod) (GESFormatter * formatter,
* @can_save_uri: Whether the URI can be saved
* @load_from_uri: class method to deserialize data from a URI
* @save_to_uri: class method to serialize data to a URI
* @update_source_uri: virtual method to specify that a source has moved, and thus its URI
* must be set to its new location (specified by the user)
* @project_loaded: Must be called by subclasses when done loading a project
*
* GES Formatter class. Override the vmethods to implement the formatter functionnality.
*/
......@@ -118,6 +149,8 @@ struct _GESFormatterClass {
GESFormatterCanSaveURIMethod can_save_uri;
GESFormatterLoadFromURIMethod load_from_uri;
GESFormatterSaveToURIMethod save_to_uri;
GESFormatterSourceMovedMethod update_source_uri;
GESFormatterLoadedMethod project_loaded;
/*< private >*/
/* FIXME : formatter name */
......@@ -148,6 +181,10 @@ gboolean ges_formatter_save_to_uri (GESFormatter * formatter,
GESTimeline *timeline,
const gchar *uri);
gboolean
ges_formatter_update_source_uri (GESFormatter * formatter,
GESTimelineFileSource * source, gchar * new_uri);
/* Non-standard methods. WILL BE DEPRECATED */
gboolean ges_formatter_load (GESFormatter * formatter,
GESTimeline * timeline);
......
This diff is collapsed.
#ifndef _GES_PITIVI_FORMATTER
#define _GES_PITIVI_FORMATTER
#define GES_TYPE_PITIVI_FORMATTER ges_pitivi_formatter_get_type()
#define GES_PITIVI_FORMATTER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_PITIVI_FORMATTER, GESPitiviFormatter))
#define GES_PITIVI_FORMATTER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_PITIVI_FORMATTER, GESPitiviFormatterClass))
#define GES_IS_PITIVI_FORMATTER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_PITIVI_FORMATTER))
#define GES_IS_PITIVI_FORMATTER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_PITIVI_FORMATTER))
#define GES_PITIVI_FORMATTER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_PITIVI_FORMATTER, GESPitiviFormatterClass))
typedef struct _GESPitiviFormatterPrivate GESPitiviFormatterPrivate;
/**
* GESPitiviFormatter:
*
* Serializes a #GESTimeline to a file using
*/
struct _GESPitiviFormatter {
GESFormatter parent;
/*< private >*/
GESPitiviFormatterPrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
struct _GESPitiviFormatterClass {
/*< private >*/
GESFormatterClass parent_class;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
GType ges_pitivi_formatter_get_type (void);
GESPitiviFormatter *ges_pitivi_formatter_new (void);
gboolean ges_pitivi_formatter_set_sources (GESPitiviFormatter * formatter, GList * infos);
GList * ges_pitivi_formatter_get_sources(GESPitiviFormatter * formatter);
#endif /* _GES_PITIVI_FORMATTER */
......@@ -163,7 +163,7 @@ static void
gstl_recalculate (GESSimpleTimelineLayer * self)
{
GList *tmp;
GstClockTime pos = 0;
gint64 pos = 0;
gint priority = 0;
gint transition_priority = 0;
gint height;
......@@ -210,9 +210,11 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
} else if (GES_IS_TIMELINE_TRANSITION (obj)) {
pos -= dur;
if (pos < 0)
pos = 0;
GST_LOG ("%p obj: height: %d: trans_priority %d", obj, height,
transition_priority);
GST_LOG ("%p obj: height: %d: trans_priority %d Position: %d, "
"duration %d", obj, height, transition_priority, pos);
g_assert (transition_priority != -1);
......
......@@ -44,10 +44,6 @@ struct _GESTimelineFileSourcePrivate
gboolean is_image;
guint64 maxduration;
/* The formats supported by this filesource
* TODO : Could maybe be moved to a parent class */
GESTrackType supportedformats;
};
enum
......@@ -56,7 +52,6 @@ enum
PROP_URI,
PROP_MAX_DURATION,
PROP_MUTE,
PROP_SUPPORTED_FORMATS,
PROP_IS_IMAGE,
};
......@@ -64,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,
......@@ -81,9 +78,6 @@ ges_timeline_filesource_get_property (GObject * object, guint property_id,
case PROP_MAX_DURATION:
g_value_set_uint64 (value, priv->maxduration);
break;
case PROP_SUPPORTED_FORMATS:
g_value_set_flags (value, priv->supportedformats);
break;
case PROP_IS_IMAGE:
g_value_set_boolean (value, priv->is_image);
break;
......@@ -100,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));
......@@ -109,10 +103,6 @@ ges_timeline_filesource_set_property (GObject * object, guint property_id,
ges_timeline_filesource_set_max_duration (tfs,
g_value_get_uint64 (value));
break;
case PROP_SUPPORTED_FORMATS:
ges_timeline_filesource_set_supported_formats (tfs,
g_value_get_flags (value));
break;
case PROP_IS_IMAGE:
ges_timeline_filesource_set_is_image (tfs, g_value_get_boolean (value));
break;
......@@ -151,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:
......@@ -175,16 +165,6 @@ ges_timeline_filesource_class_init (GESTimelineFileSourceClass * klass)
g_param_spec_boolean ("mute", "Mute", "Mute audio track",
FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* GESTimelineFileSource:supported-formats:
*
* The formats supported by the filesource.
*/
g_object_class_install_property (object_class, PROP_SUPPORTED_FORMATS,
g_param_spec_flags ("supported-formats", "Supported formats",
"Formats supported by the file", GES_TYPE_TRACK_TYPE,
GES_TRACK_TYPE_UNKNOWN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* GESTimelineFileSource:is-image:
*
......@@ -255,6 +235,7 @@ ges_timeline_filesource_set_max_duration (GESTimelineFileSource * self,
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) {
......@@ -262,6 +243,15 @@ ges_timeline_filesource_set_max_duration (GESTimelineFileSource * self,
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);
}
}
/**
......@@ -276,7 +266,8 @@ void
ges_timeline_filesource_set_supported_formats (GESTimelineFileSource * self,
GESTrackType supportedformats)
{
self->priv->supportedformats = supportedformats;
ges_timeline_object_set_supported_formats (GES_TIMELINE_OBJECT (self),
supportedformats);
}