mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
Add a GESTimelineElement base class
+ Port GESTrackObject and GESTimelineObject to the new baseclass
This commit is contained in:
parent
edd45bba78
commit
f0359481c0
36 changed files with 1706 additions and 1827 deletions
|
@ -36,6 +36,7 @@ platform as well as Windows. It is released under the GNU Library General Public
|
|||
<title>Base Classes</title>
|
||||
<xi:include href="xml/ges-timeline.xml"/>
|
||||
<xi:include href="xml/ges-timeline-layer.xml"/>
|
||||
<xi:include href="xml/ges-timeline-element.xml"/>
|
||||
<xi:include href="xml/ges-timeline-object.xml"/>
|
||||
<xi:include href="xml/ges-timeline-source.xml"/>
|
||||
<xi:include href="xml/ges-timeline-operation.xml"/>
|
||||
|
|
|
@ -93,11 +93,7 @@ GES_TYPE_TRACK
|
|||
<TITLE>GESTrackObject</TITLE>
|
||||
GESTrackObject
|
||||
GESTrackObjectClass
|
||||
ges_track_object_set_duration
|
||||
ges_track_object_set_max_duration
|
||||
ges_track_object_set_inpoint
|
||||
ges_track_object_set_priority
|
||||
ges_track_object_set_start
|
||||
ges_track_object_set_active
|
||||
ges_track_object_set_locked
|
||||
ges_track_object_is_locked
|
||||
|
@ -105,11 +101,7 @@ ges_track_object_get_track
|
|||
ges_track_object_get_timeline_object
|
||||
ges_track_object_get_gnlobject
|
||||
ges_track_object_get_element
|
||||
ges_track_object_get_start
|
||||
ges_track_object_get_inpoint
|
||||
ges_track_object_get_duration
|
||||
ges_track_object_get_max_duration
|
||||
ges_track_object_get_priority
|
||||
ges_track_object_is_active
|
||||
ges_track_object_lookup_child
|
||||
ges_track_object_list_children_properties
|
||||
|
@ -124,9 +116,6 @@ ges_track_object_get_child_property_by_pspec
|
|||
ges_track_object_edit
|
||||
ges_track_object_copy
|
||||
<SUBSECTION Standard>
|
||||
GES_TRACK_OBJECT_DURATION
|
||||
GES_TRACK_OBJECT_INPOINT
|
||||
GES_TRACK_OBJECT_START
|
||||
GESTrackObjectPrivate
|
||||
ges_track_object_set_timeline_object
|
||||
ges_track_object_set_track
|
||||
|
@ -328,6 +317,36 @@ GES_TIMELINE_LAYER_GET_CLASS
|
|||
GES_TYPE_TIMELINE_LAYER
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>ges-timeline-element</FILE>
|
||||
<TITLE>GESTimelineElement</TITLE>
|
||||
GESTimelineElement
|
||||
GESTimelineElementClass
|
||||
ges_timeline_element_set_start
|
||||
ges_timeline_element_set_inpoint
|
||||
ges_timeline_element_set_duration
|
||||
ges_timeline_element_set_max_duration
|
||||
ges_timeline_element_set_priority
|
||||
ges_timeline_element_ripple
|
||||
ges_timeline_element_ripple_end
|
||||
ges_timeline_element_roll_start
|
||||
ges_timeline_element_roll_end
|
||||
ges_timeline_element_trim
|
||||
GES_TIMELINE_ELEMENT_START
|
||||
GES_TIMELINE_ELEMENT_INPOINT
|
||||
GES_TIMELINE_ELEMENT_DURATION
|
||||
GES_TIMELINE_ELEMENT_MAX_DURATION
|
||||
GES_TIMELINE_ELEMENT_PRIORITY
|
||||
<SUBSECTION Standard>
|
||||
GESTimelineElementPrivate
|
||||
ges_timeline_element_get_type
|
||||
GES_TYPE_TIMELINE_ELEMENT
|
||||
GES_TIMELINE_ELEMENT
|
||||
GES_TIMELINE_ELEMENT_CLASS
|
||||
GES_IS_TIMELINE_ELEMENT
|
||||
GES_IS_TIMELINE_ELEMENT_CLASS
|
||||
GES_TIMELINE_ELEMENT_GET_CLASS
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>ges-timeline-object</FILE>
|
||||
|
@ -337,9 +356,6 @@ GESTimelineObjectClass
|
|||
GESCreateTrackObjectFunc
|
||||
GESCreateTrackObjectsFunc
|
||||
GESFillTrackObjectFunc
|
||||
ges_timeline_object_set_inpoint
|
||||
ges_timeline_object_set_start
|
||||
ges_timeline_object_set_duration
|
||||
ges_timeline_object_get_layer
|
||||
ges_timeline_object_find_track_object
|
||||
ges_timeline_object_add_track_object
|
||||
|
@ -352,19 +368,10 @@ ges_timeline_object_set_supported_formats
|
|||
ges_timeline_object_get_supported_formats
|
||||
ges_timeline_object_split
|
||||
ges_timeline_object_edit
|
||||
ges_timeline_object_ripple
|
||||
ges_timeline_object_ripple_end
|
||||
ges_timeline_object_roll_start
|
||||
ges_timeline_object_roll_end
|
||||
ges_timeline_object_trim_start
|
||||
ges_timeline_object_get_max_duration
|
||||
ges_timeline_object_objects_set_locked
|
||||
ges_timeline_object_set_max_duration
|
||||
<SUBSECTION Standard>
|
||||
GES_TIMELINE_OBJECT_DURATION
|
||||
GES_TIMELINE_OBJECT_INPOINT
|
||||
GES_TIMELINE_OBJECT_PRIORITY
|
||||
GES_TIMELINE_OBJECT_START
|
||||
GES_TIMELINE_OBJECT_HEIGHT
|
||||
ges_timeline_object_create_track_objects
|
||||
ges_timeline_object_create_track_object
|
||||
|
@ -374,7 +381,6 @@ 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
|
||||
|
|
|
@ -56,6 +56,7 @@ libges_@GST_API_VERSION@_la_SOURCES = \
|
|||
ges-base-xml-formatter.c \
|
||||
ges-xml-formatter.c \
|
||||
ges-auto-transition.c \
|
||||
ges-timeline-element.c \
|
||||
ges-utils.c
|
||||
|
||||
libges_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/ges/
|
||||
|
@ -108,6 +109,7 @@ libges_@GST_API_VERSION@include_HEADERS = \
|
|||
ges-project.h \
|
||||
ges-base-xml-formatter.h \
|
||||
ges-xml-formatter.h \
|
||||
ges-timeline-element.h \
|
||||
ges-utils.h
|
||||
|
||||
noinst_HEADERS = \
|
||||
|
|
|
@ -41,19 +41,19 @@ neighbour_changed_cb (GESTimelineObject * obj, GParamSpec * arg G_GNUC_UNUSED,
|
|||
{
|
||||
gint64 new_duration;
|
||||
|
||||
if (self->next_source->priority / LAYER_HEIGHT !=
|
||||
self->previous_source->priority / LAYER_HEIGHT) {
|
||||
if (_PRIORITY (self->next_source) / LAYER_HEIGHT !=
|
||||
_PRIORITY (self->previous_source) / LAYER_HEIGHT) {
|
||||
GST_DEBUG_OBJECT (self, "Destroy changed layer");
|
||||
g_signal_emit (self, auto_transition_signals[DESTROY_ME], 0);
|
||||
return;
|
||||
}
|
||||
|
||||
new_duration =
|
||||
(self->previous_source->start + self->previous_source->duration) -
|
||||
self->next_source->start;
|
||||
(_START (self->previous_source) +
|
||||
_DURATION (self->previous_source)) - _START (self->next_source);
|
||||
|
||||
if (new_duration <= 0 || new_duration >= self->previous_source->duration ||
|
||||
new_duration >= self->next_source->duration) {
|
||||
if (new_duration <= 0 || new_duration >= _DURATION (self->previous_source)
|
||||
|| new_duration >= _DURATION (self->next_source)) {
|
||||
|
||||
GST_DEBUG_OBJECT (self, "Destroy %" G_GINT64_FORMAT " not a valid duration",
|
||||
new_duration);
|
||||
|
@ -61,9 +61,10 @@ neighbour_changed_cb (GESTimelineObject * obj, GParamSpec * arg G_GNUC_UNUSED,
|
|||
return;
|
||||
}
|
||||
|
||||
ges_timeline_object_set_start (self->timeline_transition,
|
||||
self->next_source->start);
|
||||
ges_timeline_object_set_duration (self->timeline_transition, new_duration);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (self->timeline_transition),
|
||||
_START (self->next_source));
|
||||
_set_duration0 (GES_TIMELINE_ELEMENT (self->timeline_transition),
|
||||
new_duration);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -72,8 +73,8 @@ _height_changed_cb (GESTimelineObject * obj, GParamSpec * arg G_GNUC_UNUSED,
|
|||
{
|
||||
/* FIXME This is really not smart and we should properly implement timelineobject
|
||||
* priority management at the TimelineLayer level */
|
||||
ges_timeline_object_set_priority (self->next_timeline_object,
|
||||
self->previous_timeline_object->priority +
|
||||
_set_priority0 (GES_TIMELINE_ELEMENT (self->next_timeline_object),
|
||||
_PRIORITY (self->previous_timeline_object) +
|
||||
self->previous_timeline_object->height);
|
||||
}
|
||||
|
||||
|
@ -172,8 +173,9 @@ ges_auto_transition_new (GESTrackObject * transition,
|
|||
" in layer nb %i, start: %" GST_TIME_FORMAT " duration: %"
|
||||
GST_TIME_FORMAT, transition, next_source, previous_source,
|
||||
ges_timeline_layer_get_priority (ges_timeline_object_get_layer
|
||||
(self->previous_timeline_object)), GST_TIME_ARGS (transition->start),
|
||||
GST_TIME_ARGS (transition->duration));
|
||||
(self->previous_timeline_object)),
|
||||
GST_TIME_ARGS (_START (transition)),
|
||||
GST_TIME_ARGS (_DURATION (transition)));
|
||||
|
||||
self->key = g_strdup_printf ("%p%p", self->previous_source,
|
||||
self->next_source);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "ges-timeline.h"
|
||||
#include "ges-track-object.h"
|
||||
#include "ges-timeline-element.h"
|
||||
|
||||
#include "ges-asset.h"
|
||||
#include "ges-base-xml-formatter.h"
|
||||
|
@ -35,6 +36,16 @@ GST_DEBUG_CATEGORY_EXTERN (_ges_debug);
|
|||
|
||||
#define LAYER_HEIGHT 1000
|
||||
|
||||
#define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
|
||||
#define _INPOINT(obj) GES_TIMELINE_ELEMENT_INPOINT (obj)
|
||||
#define _DURATION(obj) GES_TIMELINE_ELEMENT_DURATION (obj)
|
||||
#define _MAXDURATION(obj) GES_TIMELINE_ELEMENT_MAX_DURATION (obj)
|
||||
#define _PRIORITY(obj) GES_TIMELINE_ELEMENT_PRIORITY (obj)
|
||||
#define _set_start0 ges_timeline_element_set_start
|
||||
#define _set_inpoint0 ges_timeline_element_set_inpoint
|
||||
#define _set_duration0 ges_timeline_element_set_duration
|
||||
#define _set_priority0 ges_timeline_element_set_priority
|
||||
|
||||
G_GNUC_INTERNAL gboolean
|
||||
timeline_ripple_object (GESTimeline *timeline, GESTrackObject *obj,
|
||||
GList * layers, GESEdge edge,
|
||||
|
@ -212,9 +223,7 @@ G_GNUC_INTERNAL void _init_standard_transition_assets (void);
|
|||
G_GNUC_INTERNAL void _init_formatter_assets (void);
|
||||
|
||||
/* Utilities */
|
||||
G_GNUC_INTERNAL gint track_object_start_compare (GESTrackObject * a,
|
||||
GESTrackObject * b);
|
||||
G_GNUC_INTERNAL gint timeline_object_start_compare (GESTimelineObject * a,
|
||||
GESTimelineObject * b);
|
||||
G_GNUC_INTERNAL gint element_start_compare (GESTimelineElement * a,
|
||||
GESTimelineElement * b);
|
||||
|
||||
#endif /* __GES_INTERNAL_H__ */
|
||||
|
|
|
@ -184,19 +184,19 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
|
|||
GList *l_next;
|
||||
|
||||
obj = (GESTimelineObject *) tmp->data;
|
||||
dur = GES_TIMELINE_OBJECT_DURATION (obj);
|
||||
dur = _DURATION (obj);
|
||||
height = GES_TIMELINE_OBJECT_HEIGHT (obj);
|
||||
|
||||
if (GES_IS_TIMELINE_SOURCE (obj)) {
|
||||
|
||||
GST_LOG ("%p obj: height: %d: priority %d", obj, height, priority);
|
||||
|
||||
if (G_UNLIKELY (GES_TIMELINE_OBJECT_START (obj) != pos)) {
|
||||
ges_timeline_object_set_start (obj, pos);
|
||||
if (G_UNLIKELY (_START (obj) != pos)) {
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (obj), pos);
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (GES_TIMELINE_OBJECT_PRIORITY (obj) != priority)) {
|
||||
ges_timeline_object_set_priority (obj, priority);
|
||||
if (G_UNLIKELY (_PRIORITY (obj) != priority)) {
|
||||
_set_priority0 (GES_TIMELINE_ELEMENT (obj), priority);
|
||||
}
|
||||
|
||||
transition_priority = MAX (0, priority - 1);
|
||||
|
@ -217,12 +217,11 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
|
|||
|
||||
g_assert (transition_priority != -1);
|
||||
|
||||
if (G_UNLIKELY (GES_TIMELINE_OBJECT_START (obj) != pos))
|
||||
ges_timeline_object_set_start (obj, pos);
|
||||
if (G_UNLIKELY (_START (obj) != pos))
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (obj), pos);
|
||||
|
||||
if (G_UNLIKELY (GES_TIMELINE_OBJECT_PRIORITY (obj) !=
|
||||
transition_priority)) {
|
||||
ges_timeline_object_set_priority (obj, transition_priority);
|
||||
if (G_UNLIKELY (_PRIORITY (obj) != transition_priority)) {
|
||||
_set_priority0 (GES_TIMELINE_ELEMENT (obj), transition_priority);
|
||||
}
|
||||
|
||||
/* sanity checks */
|
||||
|
@ -233,20 +232,19 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
|
|||
valid = FALSE;
|
||||
}
|
||||
|
||||
if (prev_object && (GES_TIMELINE_OBJECT_DURATION (prev_object) < dur)) {
|
||||
if (prev_object && (_DURATION (prev_object) < dur)) {
|
||||
GST_ERROR ("transition duration exceeds that of previous neighbor!");
|
||||
valid = FALSE;
|
||||
}
|
||||
|
||||
if (l_next && (GES_TIMELINE_OBJECT_DURATION (l_next->data) < dur)) {
|
||||
if (l_next && (_DURATION (l_next->data) < dur)) {
|
||||
GST_ERROR ("transition duration exceeds that of next neighbor!");
|
||||
valid = FALSE;
|
||||
}
|
||||
|
||||
if (prev_transition) {
|
||||
guint64 start, end;
|
||||
end = (GES_TIMELINE_OBJECT_DURATION (prev_transition) +
|
||||
GES_TIMELINE_OBJECT_START (prev_transition));
|
||||
end = (_DURATION (prev_transition) + _START (prev_transition));
|
||||
|
||||
start = pos;
|
||||
|
||||
|
|
593
ges/ges-timeline-element.c
Normal file
593
ges/ges-timeline-element.c
Normal file
|
@ -0,0 +1,593 @@
|
|||
/* gst-editing-services
|
||||
* Copyright (C) <2013> Thibault Saunier <thibault.saunier@collabora.com>
|
||||
* <2013> Collabora Ltd.
|
||||
*
|
||||
* gst-editing-services is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* gst-editing-services is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ges-timeline-element.h"
|
||||
#include "ges-extractable.h"
|
||||
#include "ges-meta-container.h"
|
||||
|
||||
static void
|
||||
extractable_set_asset (GESExtractable * extractable, GESAsset * asset)
|
||||
{
|
||||
GES_TIMELINE_ELEMENT (extractable)->asset = asset;
|
||||
}
|
||||
|
||||
static void
|
||||
ges_extractable_interface_init (GESExtractableInterface * iface)
|
||||
{
|
||||
iface->set_asset = extractable_set_asset;
|
||||
}
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GESTimelineElement, ges_timeline_element,
|
||||
G_TYPE_INITIALLY_UNOWNED,
|
||||
G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE, ges_extractable_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (GES_TYPE_META_CONTAINER, NULL));
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_START,
|
||||
PROP_INPOINT,
|
||||
PROP_DURATION,
|
||||
PROP_MAX_DURATION,
|
||||
PROP_PRIORITY,
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
static GParamSpec *properties[PROP_LAST] = { NULL, };
|
||||
|
||||
struct _GESTimelineElementPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
};
|
||||
|
||||
static void
|
||||
_get_property (GObject * object, guint property_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GESTimelineElement *self = GES_TIMELINE_ELEMENT (object);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_START:
|
||||
g_value_set_uint64 (value, self->start);
|
||||
break;
|
||||
case PROP_INPOINT:
|
||||
g_value_set_uint64 (value, self->inpoint);
|
||||
break;
|
||||
case PROP_DURATION:
|
||||
g_value_set_uint64 (value, self->duration);
|
||||
break;
|
||||
case PROP_MAX_DURATION:
|
||||
g_value_set_uint64 (value, self->maxduration);
|
||||
break;
|
||||
case PROP_PRIORITY:
|
||||
g_value_set_uint (value, self->priority);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, property_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_set_property (GObject * object, guint property_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GESTimelineElement *self = GES_TIMELINE_ELEMENT (object);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_START:
|
||||
ges_timeline_element_set_start (self, g_value_get_uint64 (value));
|
||||
break;
|
||||
case PROP_INPOINT:
|
||||
ges_timeline_element_set_inpoint (self, g_value_get_uint64 (value));
|
||||
break;
|
||||
case PROP_DURATION:
|
||||
ges_timeline_element_set_duration (self, g_value_get_uint64 (value));
|
||||
break;
|
||||
case PROP_PRIORITY:
|
||||
ges_timeline_element_set_priority (self, g_value_get_uint (value));
|
||||
break;
|
||||
case PROP_MAX_DURATION:
|
||||
ges_timeline_element_set_max_duration (self, g_value_get_uint64 (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, property_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ges_timeline_element_init (GESTimelineElement * ges_timeline_element)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
ges_timeline_element_finalize (GObject * self)
|
||||
{
|
||||
G_OBJECT_CLASS (ges_timeline_element_parent_class)->finalize (self);
|
||||
}
|
||||
|
||||
static void
|
||||
ges_timeline_element_class_init (GESTimelineElementClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->get_property = _get_property;
|
||||
object_class->set_property = _set_property;
|
||||
|
||||
/**
|
||||
* GESTimelineElement:start:
|
||||
*
|
||||
* The position of the object in its container (in nanoseconds).
|
||||
*/
|
||||
properties[PROP_START] = g_param_spec_uint64 ("start", "Start",
|
||||
"The position in the container", 0, G_MAXUINT64, 0, G_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
* GESTimelineElement:in-point:
|
||||
*
|
||||
* The in-point at which this #GESTimelineElement will start outputting data
|
||||
* from its contents (in nanoseconds).
|
||||
*
|
||||
* Ex : an in-point of 5 seconds means that the first outputted buffer will
|
||||
* be the one located 5 seconds in the controlled resource.
|
||||
*/
|
||||
properties[PROP_INPOINT] =
|
||||
g_param_spec_uint64 ("in-point", "In-point", "The in-point", 0,
|
||||
G_MAXUINT64, 0, G_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
* GESTimelineElement:duration:
|
||||
*
|
||||
* The duration (in nanoseconds) which will be used in the container
|
||||
*/
|
||||
properties[PROP_DURATION] =
|
||||
g_param_spec_uint64 ("duration", "Duration", "The duration to use", 0,
|
||||
G_MAXUINT64, GST_CLOCK_TIME_NONE, G_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
* GESTimelineElement:max-duration:
|
||||
*
|
||||
* The maximum duration (in nanoseconds) of the #GESTimelineElement.
|
||||
*
|
||||
* Since: 0.10.XX
|
||||
*/
|
||||
properties[PROP_MAX_DURATION] =
|
||||
g_param_spec_uint64 ("max-duration", "Maximum duration",
|
||||
"The maximum duration of the object", 0, G_MAXUINT64, G_MAXUINT64,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
|
||||
|
||||
/**
|
||||
* GESTimelineElement:priority:
|
||||
*
|
||||
* The layer priority of the object.
|
||||
*/
|
||||
properties[PROP_PRIORITY] = g_param_spec_uint ("priority", "Priority",
|
||||
"The priority of the object", 0, G_MAXUINT, 0, G_PARAM_READWRITE);
|
||||
|
||||
g_object_class_install_properties (object_class, PROP_LAST, properties);
|
||||
|
||||
object_class->finalize = ges_timeline_element_finalize;
|
||||
|
||||
klass->set_start = NULL;
|
||||
klass->set_inpoint = NULL;
|
||||
klass->set_duration = NULL;
|
||||
klass->set_max_duration = NULL;
|
||||
klass->set_priority = NULL;
|
||||
|
||||
klass->ripple = NULL;
|
||||
klass->ripple_end = NULL;
|
||||
klass->roll_start = NULL;
|
||||
klass->roll_end = NULL;
|
||||
klass->trim = NULL;
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* API implementation *
|
||||
*********************************************/
|
||||
|
||||
/**
|
||||
* ges_timeline_element_set_start:
|
||||
* @self: a #GESTimelineElement
|
||||
* @start: the position in #GstClockTime
|
||||
*
|
||||
* Set the position of the object in its containing layer
|
||||
*
|
||||
* Note that if the timeline snap-distance property of the timeline containing
|
||||
* @self is set, @self will properly snap to its neighboors.
|
||||
*/
|
||||
void
|
||||
ges_timeline_element_set_start (GESTimelineElement * self, GstClockTime start)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_if_fail (GES_IS_TIMELINE_ELEMENT (self));
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
GST_DEBUG_OBJECT (self, "current start: %" GST_TIME_FORMAT,
|
||||
" new start: %" GST_TIME_FORMAT, GST_TIME_ARGS (start),
|
||||
GST_TIME_ARGS (GES_TIMELINE_ELEMENT_START (self)));
|
||||
|
||||
if (klass->set_start) {
|
||||
if (klass->set_start (self, start)) {
|
||||
self->start = start;
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_START]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GST_WARNING_OBJECT (self, "No set_start virtual method implementation"
|
||||
" on class %s. Can not set start %" GST_TIME_FORMAT,
|
||||
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (start));
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_set_inpoint:
|
||||
* @self: a #GESTimelineElement
|
||||
* @inpoint: the in-point in #GstClockTime
|
||||
*
|
||||
* Set the in-point, that is the moment at which the @self will start
|
||||
* outputting data from its contents.
|
||||
*/
|
||||
void
|
||||
ges_timeline_element_set_inpoint (GESTimelineElement * self,
|
||||
GstClockTime inpoint)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_if_fail (GES_IS_TIMELINE_ELEMENT (self));
|
||||
|
||||
GST_DEBUG_OBJECT (self, "current inpoint: %" GST_TIME_FORMAT,
|
||||
" new inpoint: %" GST_TIME_FORMAT, GST_TIME_ARGS (inpoint),
|
||||
GST_TIME_ARGS (GES_TIMELINE_ELEMENT_INPOINT (self)));
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
if (klass->set_inpoint) {
|
||||
if (klass->set_inpoint (self, inpoint)) {
|
||||
self->inpoint = inpoint;
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INPOINT]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GST_WARNING_OBJECT (self, "No set_inpoint virtual method implementation"
|
||||
" on class %s. Can not set inpoint %" GST_TIME_FORMAT,
|
||||
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (inpoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_set_max_duration:
|
||||
* @self: a #GESTimelineElement
|
||||
* @maxduration: the maximum duration in #GstClockTime
|
||||
*
|
||||
* Set the maximun duration of the object
|
||||
*/
|
||||
void
|
||||
ges_timeline_element_set_max_duration (GESTimelineElement * self,
|
||||
GstClockTime maxduration)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_if_fail (GES_IS_TIMELINE_ELEMENT (self));
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
GST_DEBUG_OBJECT (self, "current duration: %" GST_TIME_FORMAT,
|
||||
" new duration: %" GST_TIME_FORMAT, GST_TIME_ARGS (maxduration),
|
||||
GST_TIME_ARGS (GES_TIMELINE_ELEMENT_MAX_DURATION (self)));
|
||||
|
||||
if (klass->set_max_duration) {
|
||||
if (klass->set_max_duration (self, maxduration) == FALSE)
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
self->maxduration = maxduration;
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MAX_DURATION]);
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_set_duration:
|
||||
* @self: a #GESTimelineElement
|
||||
* @duration: the duration in #GstClockTime
|
||||
*
|
||||
* Set the duration of the object
|
||||
*
|
||||
* Note that if the timeline snap-distance property of the timeline containing
|
||||
* @self is set, @self will properly snap to its neighboors.
|
||||
*/
|
||||
void
|
||||
ges_timeline_element_set_duration (GESTimelineElement * self,
|
||||
GstClockTime duration)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_if_fail (GES_IS_TIMELINE_ELEMENT (self));
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
GST_DEBUG_OBJECT (self, "current duration: %" GST_TIME_FORMAT,
|
||||
" new duration: %" GST_TIME_FORMAT, GST_TIME_ARGS (duration),
|
||||
GST_TIME_ARGS (GES_TIMELINE_ELEMENT_DURATION (self)));
|
||||
|
||||
if (klass->set_duration) {
|
||||
if (klass->set_duration (self, duration)) {
|
||||
self->duration = duration;
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_DURATION]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GST_WARNING_OBJECT (self, "No set_duration virtual method implementation"
|
||||
" on class %s. Can not set duration %" GST_TIME_FORMAT,
|
||||
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (duration));
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_set_priority:
|
||||
* @self: a #GESTimelineElement
|
||||
* @priority: the priority
|
||||
*
|
||||
* Sets the priority of the object within the containing layer
|
||||
*/
|
||||
void
|
||||
ges_timeline_element_set_priority (GESTimelineElement * self, guint32 priority)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_if_fail (GES_IS_TIMELINE_ELEMENT (self));
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
if (klass->set_priority) {
|
||||
if (klass->set_priority (self, priority)) {
|
||||
self->priority = priority;
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PRIORITY]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
GST_WARNING_OBJECT (self, "No set_priority virtual method implementation"
|
||||
" on class %s. Can not set priority %d", G_OBJECT_CLASS_NAME (klass),
|
||||
priority);
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_ripple:
|
||||
* @self: The #GESTimelineElement to ripple.
|
||||
* @start: The new start of @self in ripple mode.
|
||||
*
|
||||
* Edits @self in ripple mode. It allows you to modify the
|
||||
* start of @self and move the following neighbours accordingly.
|
||||
* This will change the overall timeline duration.
|
||||
*
|
||||
* Returns: %TRUE if the self as been rippled properly, %FALSE if an error
|
||||
* occured
|
||||
*/
|
||||
gboolean
|
||||
ges_timeline_element_ripple (GESTimelineElement * self, GstClockTime start)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_val_if_fail (GES_IS_TIMELINE_ELEMENT (self), FALSE);
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
if (klass->ripple)
|
||||
return klass->ripple (self, start);
|
||||
|
||||
GST_WARNING_OBJECT (self, "No ripple virtual method implementation"
|
||||
" on class %s. Can not ripple to %" GST_TIME_FORMAT,
|
||||
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (start));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_ripple_end:
|
||||
* @self: The #GESTimelineElement to ripple.
|
||||
* @end: The new end (start + duration) of @self in ripple mode. It will
|
||||
* basically only change the duration of @self.
|
||||
*
|
||||
* Edits @self in ripple mode. It allows you to modify the
|
||||
* duration of a @self and move the following neighbours accordingly.
|
||||
* This will change the overall timeline duration.
|
||||
*
|
||||
* Returns: %TRUE if the self as been rippled properly, %FALSE if an error
|
||||
* occured
|
||||
*/
|
||||
gboolean
|
||||
ges_timeline_element_ripple_end (GESTimelineElement * self, GstClockTime end)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_val_if_fail (GES_IS_TIMELINE_ELEMENT (self), FALSE);
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
if (klass->ripple_end) {
|
||||
return klass->ripple_end (self, end);
|
||||
}
|
||||
|
||||
GST_WARNING_OBJECT (self, "No ripple virtual method implementation"
|
||||
" on class %s. Can not ripple end to %" GST_TIME_FORMAT,
|
||||
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (end));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_roll_start:
|
||||
* @self: The #GESTimelineElement to roll
|
||||
* @start: The new start of @self in roll mode, it will also adapat
|
||||
* the in-point of @self according
|
||||
*
|
||||
* Edits @self in roll mode. It allows you to modify the
|
||||
* start and inpoint of a @self and "resize" (basicly change the duration
|
||||
* in this case) of the previous neighbours accordingly.
|
||||
* This will not change the overall timeline duration.
|
||||
*
|
||||
* Returns: %TRUE if the self as been roll properly, %FALSE if an error
|
||||
* occured
|
||||
*/
|
||||
gboolean
|
||||
ges_timeline_element_roll_start (GESTimelineElement * self, GstClockTime start)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_val_if_fail (GES_IS_TIMELINE_ELEMENT (self), FALSE);
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
if (klass->roll_start) {
|
||||
return klass->roll_start (self, start);
|
||||
}
|
||||
|
||||
GST_WARNING_OBJECT (self, "No ripple virtual method implementation"
|
||||
" on class %s. Can not roll to %" GST_TIME_FORMAT,
|
||||
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (start));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_roll_end:
|
||||
* @self: The #GESTimelineElement to roll.
|
||||
* @end: The new end (start + duration) of @self in roll mode
|
||||
*
|
||||
* Edits @self in roll mode. It allows you to modify the
|
||||
* duration of a @self and trim (basicly change the start + inpoint
|
||||
* in this case) the following neighbours accordingly.
|
||||
* This will not change the overall timeline duration.
|
||||
*
|
||||
* Returns: %TRUE if the self as been rolled properly, %FALSE if an error
|
||||
* occured
|
||||
*/
|
||||
gboolean
|
||||
ges_timeline_element_roll_end (GESTimelineElement * self, GstClockTime end)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_val_if_fail (GES_IS_TIMELINE_ELEMENT (self), FALSE);
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
if (klass->roll_end)
|
||||
return klass->roll_end (self, end);
|
||||
|
||||
GST_WARNING_OBJECT (self, "No ripple virtual method implementation"
|
||||
" on class %s. Can not roll end to %" GST_TIME_FORMAT,
|
||||
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (end));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_trim:
|
||||
* @self: The #GESTimelineElement to trim.
|
||||
* @start: The new start of @self in trim mode, will adapt the inpoint
|
||||
* of @self accordingly
|
||||
*
|
||||
* Edits @self in trim mode. It allows you to modify the
|
||||
* inpoint and start of @self.
|
||||
* This will not change the overall timeline duration.
|
||||
*
|
||||
* Note that to trim the end of an self you can just set its duration. The same way
|
||||
* as this method, it will take into account the snapping-distance property of the
|
||||
* timeline in which @self is.
|
||||
*
|
||||
* Returns: %TRUE if the self as been trimmed properly, %FALSE if an error
|
||||
* occured
|
||||
*/
|
||||
gboolean
|
||||
ges_timeline_element_trim (GESTimelineElement * self, GstClockTime start)
|
||||
{
|
||||
GESTimelineElementClass *klass;
|
||||
|
||||
g_return_val_if_fail (GES_IS_TIMELINE_ELEMENT (self), FALSE);
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
if (klass->trim)
|
||||
return klass->trim (self, start);
|
||||
|
||||
GST_WARNING_OBJECT (self, "No ripple virtual method implementation"
|
||||
" on class %s. Can not trim to %" GST_TIME_FORMAT,
|
||||
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (start));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_element_copy:
|
||||
* @self: The #GESTimelineElement to copy
|
||||
* @deep: whether we want to create the elements @self contains or not
|
||||
*
|
||||
* Copies @self
|
||||
*
|
||||
* Returns: (transfer floating): The newly create #GESTimelineElement, copied from @self
|
||||
*/
|
||||
GESTimelineElement *
|
||||
ges_timeline_element_copy (GESTimelineElement * self, gboolean deep)
|
||||
{
|
||||
GParameter *params;
|
||||
GParamSpec **specs;
|
||||
GESTimelineElementClass *klass;
|
||||
guint n, n_specs, n_params;
|
||||
|
||||
GESTimelineElement *ret = NULL;
|
||||
|
||||
g_return_val_if_fail (GES_IS_TIMELINE_ELEMENT (self), FALSE);
|
||||
|
||||
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
|
||||
|
||||
specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (self), &n_specs);
|
||||
params = g_new0 (GParameter, n_specs);
|
||||
n_params = 0;
|
||||
|
||||
for (n = 0; n < n_specs; ++n) {
|
||||
if (g_strcmp0 (specs[n]->name, "parent") &&
|
||||
(specs[n]->flags & G_PARAM_READWRITE) == G_PARAM_READWRITE) {
|
||||
params[n_params].name = g_intern_string (specs[n]->name);
|
||||
g_value_init (¶ms[n_params].value, specs[n]->value_type);
|
||||
g_object_get_property (G_OBJECT (self), specs[n]->name,
|
||||
¶ms[n_params].value);
|
||||
++n_params;
|
||||
}
|
||||
}
|
||||
|
||||
ret = g_object_newv (G_OBJECT_TYPE (self), n_params, params);
|
||||
|
||||
g_free (specs);
|
||||
g_free (params);
|
||||
|
||||
|
||||
if (deep) {
|
||||
if (klass->deep_copy)
|
||||
klass->deep_copy (self, ret);
|
||||
else
|
||||
GST_WARNING_OBJECT (self, "No deep_copy virtual method implementation"
|
||||
" on class %s. Can not finish the copy", G_OBJECT_CLASS_NAME (klass));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
167
ges/ges-timeline-element.h
Normal file
167
ges/ges-timeline-element.h
Normal file
|
@ -0,0 +1,167 @@
|
|||
/*
|
||||
* gst-editing-services
|
||||
* Copyright (C) <2013> Thibault Saunier <thibault.saunier@collabora.com>
|
||||
* <2013> Collabora Ltd.
|
||||
*
|
||||
* gst-editing-services is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* gst-editing-services is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _GES_TIMELINE_ELEMENT_H_
|
||||
#define _GES_TIMELINE_ELEMENT_H_
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gst/gst.h>
|
||||
#include "ges-enums.h"
|
||||
#include "ges-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GES_TYPE_TIMELINE_ELEMENT (ges_timeline_element_get_type ())
|
||||
#define GES_TIMELINE_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TIMELINE_ELEMENT, GESTimelineElement))
|
||||
#define GES_TIMELINE_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TIMELINE_ELEMENT, GESTimelineElementClass))
|
||||
#define GES_IS_TIMELINE_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TIMELINE_ELEMENT))
|
||||
#define GES_IS_TIMELINE_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TIMELINE_ELEMENT))
|
||||
#define GES_TIMELINE_ELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_ELEMENT, GESTimelineElementClass))
|
||||
|
||||
typedef struct _GESTimelineElementPrivate GESTimelineElementPrivate;
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_ELEMENT_START:
|
||||
* @obj: a #GESTimelineElement
|
||||
*
|
||||
* The start position of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TIMELINE_ELEMENT_START(obj) (((GESTimelineElement*)obj)->start)
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_ELEMENT_INPOINT:
|
||||
* @obj: a #GESTimelineElement
|
||||
*
|
||||
* The in-point of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TIMELINE_ELEMENT_INPOINT(obj) (((GESTimelineElement*)obj)->inpoint)
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_ELEMENT_DURATION:
|
||||
* @obj: a #GESTimelineElement
|
||||
*
|
||||
* The duration of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TIMELINE_ELEMENT_DURATION(obj) (((GESTimelineElement*)obj)->duration)
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_ELEMENT_MAX_DURATION:
|
||||
* @obj: a #GESTimelineElement
|
||||
*
|
||||
* The maximun duration of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TIMELINE_ELEMENT_MAX_DURATION(obj) (((GESTimelineElement*)obj)->maxduration)
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_ELEMENT_PRIORITY:
|
||||
* @obj: a #GESTimelineElement
|
||||
*
|
||||
* The priority of the object.
|
||||
*/
|
||||
#define GES_TIMELINE_ELEMENT_PRIORITY(obj) (((GESTimelineElement*)obj)->priority)
|
||||
|
||||
|
||||
/**
|
||||
* GESTimelineElementClass:
|
||||
* @set_start: method to set the start of a #GESTimelineElement
|
||||
* @set_duration: method to set the duration of a #GESTimelineElement
|
||||
* @set_inpoint: method to set the inpoint of a #GESTimelineElement
|
||||
* @set_max_duration: method to set the maximun duration of a #GESTimelineElement
|
||||
* @set_priority: method to set the priority of a #GESTimelineElement
|
||||
* @ripple: method to ripple an object
|
||||
* @ripple_end: method to ripple an object on its #GES_EDGE_END edge
|
||||
* @roll_start: method to roll an object on its #GES_EDGE_START edge
|
||||
* @roll_end: method to roll an object on its #GES_EDGE_END edge
|
||||
* @trim: method to trim an object
|
||||
* @deep_copy: Copy the children properties of @self into @copy
|
||||
*
|
||||
* The GESTimelineElement base class. Subclasses should override at least
|
||||
* @set_start @set_inpoint @set_duration @ripple @ripple_end @roll_start
|
||||
* @roll_end and @trim
|
||||
*/
|
||||
struct _GESTimelineElementClass
|
||||
{
|
||||
GInitiallyUnownedClass parent_class;
|
||||
|
||||
gboolean (*set_start) (GESTimelineElement * self, GstClockTime start);
|
||||
gboolean (*set_inpoint) (GESTimelineElement * self, GstClockTime inpoint);
|
||||
gboolean (*set_duration) (GESTimelineElement * self, GstClockTime duration);
|
||||
gboolean (*set_max_duration) (GESTimelineElement * self, GstClockTime maxduration);
|
||||
gboolean (*set_priority) (GESTimelineElement * self, guint32 priority);
|
||||
|
||||
gboolean (*ripple) (GESTimelineElement *self, guint64 start);
|
||||
gboolean (*ripple_end) (GESTimelineElement *self, guint64 end);
|
||||
gboolean (*roll_start) (GESTimelineElement *self, guint64 start);
|
||||
gboolean (*roll_end) (GESTimelineElement *self, guint64 end);
|
||||
gboolean (*trim) (GESTimelineElement *self, guint64 start);
|
||||
void (*deep_copy) (GESTimelineElement *self, GESTimelineElement *copy);
|
||||
|
||||
/* Padding for API extension */
|
||||
gpointer _ges_reserved[GES_PADDING_LARGE];
|
||||
};
|
||||
|
||||
/**
|
||||
* GESTimelineElement:
|
||||
* @start: position (in time) of the object
|
||||
* @inpoint: Position in the media from which the object should be used
|
||||
* @duration: duration of the object to be used
|
||||
* @maxduration: The maximum duration the object can have
|
||||
* @priority: priority of the object in the layer (0:top priority)
|
||||
*
|
||||
* Those filed can be accessed from outside but in no case should
|
||||
* be changed from there. Subclasses can write them but should make
|
||||
* sure to properly call g_object_notify.
|
||||
*/
|
||||
struct _GESTimelineElement
|
||||
{
|
||||
GInitiallyUnowned parent_instance;
|
||||
|
||||
/*< protected >*/
|
||||
GESAsset *asset;
|
||||
GstClockTime start;
|
||||
GstClockTime inpoint;
|
||||
GstClockTime duration;
|
||||
GstClockTime maxduration;
|
||||
guint32 priority;
|
||||
|
||||
/*< private >*/
|
||||
GESTimelineElementPrivate *priv;
|
||||
|
||||
/* Padding for API extension */
|
||||
gpointer _ges_reserved[GES_PADDING_LARGE];
|
||||
};
|
||||
|
||||
GType ges_timeline_element_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void ges_timeline_element_set_start (GESTimelineElement *self, GstClockTime start);
|
||||
void ges_timeline_element_set_inpoint (GESTimelineElement *self, GstClockTime inpoint);
|
||||
void ges_timeline_element_set_duration (GESTimelineElement *self, GstClockTime duration);
|
||||
void ges_timeline_element_set_max_duration (GESTimelineElement *self, GstClockTime duration);
|
||||
void ges_timeline_element_set_priority (GESTimelineElement *self, guint32 priority);
|
||||
gboolean ges_timeline_element_ripple (GESTimelineElement *self, GstClockTime start);
|
||||
gboolean ges_timeline_element_ripple_end (GESTimelineElement *self, GstClockTime end);
|
||||
gboolean ges_timeline_element_roll_start (GESTimelineElement *self, GstClockTime start);
|
||||
gboolean ges_timeline_element_roll_end (GESTimelineElement *self, GstClockTime end);
|
||||
gboolean ges_timeline_element_trim (GESTimelineElement *self, GstClockTime start);
|
||||
GESTimelineElement * ges_timeline_element_copy (GESTimelineElement *self, gboolean deep);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GES_TIMELINE_ELEMENT_H_ */
|
||||
|
|
@ -38,6 +38,8 @@
|
|||
|
||||
static void ges_extractable_interface_init (GESExtractableInterface * iface);
|
||||
|
||||
#define parent_class ges_timeline_filesource_parent_class
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GESTimelineFileSource, ges_timeline_filesource,
|
||||
GES_TYPE_TIMELINE_SOURCE,
|
||||
G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE,
|
||||
|
@ -71,8 +73,9 @@ static GESTrackObject
|
|||
void ges_timeline_filesource_set_uri (GESTimelineFileSource * self,
|
||||
gchar * uri);
|
||||
|
||||
static void
|
||||
filesource_set_max_duration (GESTimelineObject * object, guint64 maxduration);
|
||||
gboolean
|
||||
filesource_set_max_duration (GESTimelineElement * element,
|
||||
GstClockTime maxduration);
|
||||
|
||||
static void
|
||||
ges_timeline_filesource_get_property (GObject * object, guint property_id,
|
||||
|
@ -132,7 +135,7 @@ ges_timeline_filesource_finalize (GObject * object)
|
|||
|
||||
if (priv->uri)
|
||||
g_free (priv->uri);
|
||||
G_OBJECT_CLASS (ges_timeline_filesource_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -140,6 +143,7 @@ ges_timeline_filesource_class_init (GESTimelineFileSourceClass * klass)
|
|||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
|
||||
GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GESTimelineFileSourcePrivate));
|
||||
|
||||
|
@ -185,11 +189,12 @@ ges_timeline_filesource_class_init (GESTimelineFileSourceClass * klass)
|
|||
GES_TYPE_TRACK_TYPE, GES_TRACK_TYPE_UNKNOWN,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
||||
|
||||
element_class->set_max_duration = filesource_set_max_duration;
|
||||
|
||||
timobj_class->create_track_objects =
|
||||
ges_timeline_filesource_create_track_objects;
|
||||
timobj_class->create_track_object =
|
||||
ges_timeline_filesource_create_track_object;
|
||||
timobj_class->set_max_duration = filesource_set_max_duration;
|
||||
timobj_class->need_fill_track = FALSE;
|
||||
|
||||
}
|
||||
|
@ -230,11 +235,11 @@ extractable_set_asset (GESExtractable * self, GESAsset * asset)
|
|||
GESAssetFileSource *filesource_asset = GES_ASSET_FILESOURCE (asset);
|
||||
GESTimelineObject *tlobj = GES_TIMELINE_OBJECT (self);
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (tlobj->duration) == FALSE)
|
||||
ges_timeline_object_set_duration (GES_TIMELINE_OBJECT (tfs),
|
||||
if (GST_CLOCK_TIME_IS_VALID (GES_TIMELINE_ELEMENT (tlobj)) == FALSE)
|
||||
_set_duration0 (GES_TIMELINE_ELEMENT (tfs),
|
||||
ges_asset_filesource_get_duration (filesource_asset));
|
||||
|
||||
ges_timeline_filesource_set_max_duration (tfs,
|
||||
ges_timeline_element_set_max_duration (GES_TIMELINE_ELEMENT (tfs),
|
||||
ges_asset_filesource_get_duration (filesource_asset));
|
||||
ges_timeline_filesource_set_is_image (tfs,
|
||||
ges_asset_filesource_is_image (filesource_asset));
|
||||
|
@ -247,7 +252,7 @@ extractable_set_asset (GESExtractable * self, GESAsset * asset)
|
|||
(GES_ASSET_TIMELINE_OBJECT (filesource_asset)));
|
||||
}
|
||||
|
||||
GES_TIMELINE_OBJECT (tfs)->asset = asset;
|
||||
GES_TIMELINE_ELEMENT (tfs)->asset = asset;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -267,7 +272,7 @@ ges_timeline_filesource_init (GESTimelineFileSource * self)
|
|||
GES_TYPE_TIMELINE_FILE_SOURCE, GESTimelineFileSourcePrivate);
|
||||
|
||||
/* Setting the duration to -1 by default. */
|
||||
GES_TIMELINE_OBJECT (self)->duration = GST_CLOCK_TIME_NONE;
|
||||
GES_TIMELINE_ELEMENT (self)->duration = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -301,39 +306,17 @@ ges_timeline_filesource_set_mute (GESTimelineFileSource * self, gboolean mute)
|
|||
g_list_free (trackobjects);
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_filesource_set_max_duration:
|
||||
* @self: the #GESTimelineFileSource to set the maximum duration on
|
||||
* @maxduration: the maximum duration of @self
|
||||
*
|
||||
* Sets the maximum duration (in nanoseconds) of the file.
|
||||
*
|
||||
*/
|
||||
void
|
||||
ges_timeline_filesource_set_max_duration (GESTimelineFileSource * self,
|
||||
guint64 maxduration)
|
||||
gboolean
|
||||
filesource_set_max_duration (GESTimelineElement * element,
|
||||
GstClockTime maxduration)
|
||||
{
|
||||
ges_timeline_object_set_max_duration (GES_TIMELINE_OBJECT (self),
|
||||
maxduration);
|
||||
}
|
||||
|
||||
void
|
||||
filesource_set_max_duration (GESTimelineObject * object, guint64 maxduration)
|
||||
{
|
||||
GList *tmp, *tckobjs;
|
||||
|
||||
if (object->duration == GST_CLOCK_TIME_NONE || object->duration == 0) {
|
||||
if (_DURATION (element) == GST_CLOCK_TIME_NONE || _DURATION (element) == 0)
|
||||
/* If we don't have a valid duration, use the max duration */
|
||||
g_object_set (object, "duration", maxduration - object->inpoint, NULL);
|
||||
}
|
||||
_set_duration0 (element, maxduration - _INPOINT (element));
|
||||
|
||||
tckobjs = ges_timeline_object_get_track_objects (object);
|
||||
for (tmp = tckobjs; tmp; tmp = g_list_next (tmp)) {
|
||||
ges_track_object_set_max_duration (GES_TRACK_OBJECT (tmp->data),
|
||||
maxduration);
|
||||
}
|
||||
|
||||
g_list_free_full (tckobjs, g_object_unref);
|
||||
return
|
||||
GES_TIMELINE_ELEMENT_CLASS (parent_class)->set_max_duration (element,
|
||||
maxduration);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -364,20 +347,6 @@ ges_timeline_filesource_is_muted (GESTimelineFileSource * self)
|
|||
return self->priv->mute;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_filesource_get_max_duration:
|
||||
* @self: the #GESTimelineFileSource
|
||||
*
|
||||
* Get the duration of the object.
|
||||
*
|
||||
* Returns: The duration of @self.
|
||||
*/
|
||||
guint64
|
||||
ges_timeline_filesource_get_max_duration (GESTimelineFileSource * self)
|
||||
{
|
||||
return ges_timeline_object_get_max_duration (GES_TIMELINE_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_filesource_is_image:
|
||||
* @self: the #GESTimelineFileSource
|
||||
|
@ -413,11 +382,11 @@ ges_timeline_filesource_create_track_objects (GESTimelineObject * obj,
|
|||
GList *res = NULL;
|
||||
const GList *tmp, *stream_assets;
|
||||
|
||||
g_return_val_if_fail (obj->asset, NULL);
|
||||
g_return_val_if_fail (GES_TIMELINE_ELEMENT (obj)->asset, NULL);
|
||||
|
||||
stream_assets =
|
||||
ges_asset_filesource_get_stream_assets (GES_ASSET_FILESOURCE
|
||||
(obj->asset));
|
||||
(GES_TIMELINE_ELEMENT (obj)->asset));
|
||||
for (tmp = stream_assets; tmp; tmp = tmp->next) {
|
||||
GESAssetTrackObject *asset = GES_ASSET_TRACK_OBJECT (tmp->data);
|
||||
|
||||
|
|
|
@ -74,16 +74,11 @@ GType ges_timeline_filesource_get_type (void);
|
|||
void
|
||||
ges_timeline_filesource_set_mute (GESTimelineFileSource * self, gboolean mute);
|
||||
|
||||
void
|
||||
ges_timeline_filesource_set_max_duration (GESTimelineFileSource * self,
|
||||
guint64 maxduration);
|
||||
|
||||
void
|
||||
ges_timeline_filesource_set_is_image (GESTimelineFileSource * self,
|
||||
gboolean is_image);
|
||||
|
||||
gboolean ges_timeline_filesource_is_muted (GESTimelineFileSource * self);
|
||||
guint64 ges_timeline_filesource_get_max_duration (GESTimelineFileSource * self);
|
||||
gboolean ges_timeline_filesource_is_image (GESTimelineFileSource * self);
|
||||
const gchar *ges_timeline_filesource_get_uri (GESTimelineFileSource * self);
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ static gboolean
|
|||
ges_timeline_layer_resync_priorities (GESTimelineLayer * layer)
|
||||
{
|
||||
GList *tmp;
|
||||
GESTimelineObject *obj;
|
||||
GESTimelineElement *obj;
|
||||
|
||||
GST_DEBUG ("Resync priorities of %p", layer);
|
||||
|
||||
|
@ -227,8 +227,8 @@ ges_timeline_layer_resync_priorities (GESTimelineLayer * layer)
|
|||
* do in the meantime. */
|
||||
|
||||
for (tmp = layer->priv->objects_start; tmp; tmp = tmp->next) {
|
||||
obj = GES_TIMELINE_OBJECT (tmp->data);
|
||||
ges_timeline_object_set_priority (obj, GES_TIMELINE_OBJECT_PRIORITY (obj));
|
||||
obj = GES_TIMELINE_ELEMENT (tmp->data);
|
||||
_set_priority0 (obj, _PRIORITY (obj));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -431,7 +431,7 @@ ges_timeline_layer_get_objects (GESTimelineLayer * layer)
|
|||
|
||||
return g_list_sort (g_list_copy_deep (layer->priv->objects_start,
|
||||
(GCopyFunc) gst_object_ref, NULL),
|
||||
(GCompareFunc) timeline_object_start_compare);
|
||||
(GCompareFunc) element_start_compare);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -533,26 +533,25 @@ ges_timeline_layer_add_object (GESTimelineLayer * layer,
|
|||
|
||||
/* Take a reference to the object and store it stored by start/priority */
|
||||
priv->objects_start = g_list_insert_sorted (priv->objects_start, object,
|
||||
(GCompareFunc) timeline_object_start_compare);
|
||||
(GCompareFunc) element_start_compare);
|
||||
|
||||
/* Inform the object it's now in this layer */
|
||||
ges_timeline_object_set_layer (object, layer);
|
||||
|
||||
GST_DEBUG ("current object priority : %d, layer min/max : %d/%d",
|
||||
GES_TIMELINE_OBJECT_PRIORITY (object),
|
||||
layer->min_gnl_priority, layer->max_gnl_priority);
|
||||
_PRIORITY (object), layer->min_gnl_priority, layer->max_gnl_priority);
|
||||
|
||||
/* Set the priority. */
|
||||
maxprio = layer->max_gnl_priority;
|
||||
minprio = layer->min_gnl_priority;
|
||||
prio = GES_TIMELINE_OBJECT_PRIORITY (object);
|
||||
prio = _PRIORITY (object);
|
||||
|
||||
if (minprio + prio > (maxprio)) {
|
||||
GST_WARNING_OBJECT (layer,
|
||||
"%p is out of the layer space, setting its priority to "
|
||||
"%d, setting it to the maximum priority of the layer: %d", object, prio,
|
||||
maxprio - minprio);
|
||||
ges_timeline_object_set_priority (object, LAYER_HEIGHT - 1);
|
||||
_set_priority0 (GES_TIMELINE_ELEMENT (object), LAYER_HEIGHT - 1);
|
||||
}
|
||||
|
||||
/* If the object has an acceptable priority, we just let it with its current
|
||||
|
@ -599,13 +598,13 @@ ges_timeline_layer_add_asset (GESTimelineLayer * layer,
|
|||
ges_track_type_name (track_types));
|
||||
|
||||
tlobj = GES_TIMELINE_OBJECT (ges_asset_extract (asset, NULL));
|
||||
ges_timeline_object_set_start (tlobj, start);
|
||||
ges_timeline_object_set_inpoint (tlobj, inpoint);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (tlobj), start);
|
||||
_set_inpoint0 (GES_TIMELINE_ELEMENT (tlobj), inpoint);
|
||||
if (track_types != GES_TRACK_TYPE_UNKNOWN)
|
||||
ges_timeline_object_set_supported_formats (tlobj, track_types);
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (duration)) {
|
||||
ges_timeline_object_set_duration (tlobj, duration);
|
||||
_set_duration0 (GES_TIMELINE_ELEMENT (tlobj), duration);
|
||||
}
|
||||
|
||||
if (!ges_timeline_layer_add_object (layer, tlobj)) {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include <glib-object.h>
|
||||
#include <gst/gst.h>
|
||||
#include <ges/ges-timeline-element.h>
|
||||
#include <ges/ges-types.h>
|
||||
#include <ges/ges-track.h>
|
||||
|
||||
|
@ -100,38 +101,6 @@ typedef GESTrackObject *(*GESCreateTrackObjectFunc) (GESTimelineObject * object,
|
|||
|
||||
typedef GList * (*GESCreateTrackObjectsFunc) (GESTimelineObject * object, GESTrackType type);
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_OBJECT_START:
|
||||
* @obj: a #GESTimelineObject
|
||||
*
|
||||
* The start position of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TIMELINE_OBJECT_START(obj) (((GESTimelineObject*)obj)->start)
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_OBJECT_INPOINT:
|
||||
* @obj: a #GESTimelineObject
|
||||
*
|
||||
* The in-point of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TIMELINE_OBJECT_INPOINT(obj) (((GESTimelineObject*)obj)->inpoint)
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_OBJECT_DURATION:
|
||||
* @obj: a #GESTimelineObject
|
||||
*
|
||||
* The duration position of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TIMELINE_OBJECT_DURATION(obj) (((GESTimelineObject*)obj)->duration)
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_OBJECT_PRIORITY:
|
||||
* @obj: a #GESTimelineObject
|
||||
*
|
||||
* The priority of the object.
|
||||
*/
|
||||
#define GES_TIMELINE_OBJECT_PRIORITY(obj) (((GESTimelineObject*)obj)->priority)
|
||||
|
||||
/**
|
||||
* GES_TIMELINE_OBJECT_HEIGHT:
|
||||
* @obj: a #GESTimelineObject
|
||||
|
@ -149,23 +118,16 @@ typedef GList * (*GESCreateTrackObjectsFunc) (GESTimelineObject * object, GESTra
|
|||
*/
|
||||
struct _GESTimelineObject
|
||||
{
|
||||
GInitiallyUnowned parent;
|
||||
GESTimelineElement parent;
|
||||
|
||||
/*< readonly >*/
|
||||
GList *trackobjects;
|
||||
|
||||
/* We don't add those properties to the priv struct for optimization purposes
|
||||
* start, inpoint, duration and fullduration are in nanoseconds */
|
||||
guint64 start; /* position (in time) of the object in the layer */
|
||||
guint64 inpoint; /* in-point */
|
||||
guint64 duration; /* duration of the object used in the layer */
|
||||
guint32 priority; /* priority of the object in the layer (0:top priority) */
|
||||
guint32 height; /* the span of priorities this object needs */
|
||||
guint64 fullduration; /* Full usable duration of the object (-1: no duration) */
|
||||
|
||||
/*< protected >*/
|
||||
GESAsset *asset;
|
||||
|
||||
/*< private >*/
|
||||
GESTimelineObjectPrivate *priv;
|
||||
|
||||
|
@ -187,15 +149,13 @@ struct _GESTimelineObject
|
|||
* operation when a #GESTrackObject is added. Since: 0.10.2
|
||||
* @track_object_released: Should be overridden by subclasses if they need to perform
|
||||
* action when a #GESTrackObject is released. Since: 0.10.2
|
||||
* @set_max_duration: Should be overridden by subclasses if they need to perform
|
||||
* action when a changing the maximum duration. Since: 0.10.XX
|
||||
*
|
||||
* Subclasses can override the @create_track_object and @fill_track_object methods.
|
||||
*/
|
||||
struct _GESTimelineObjectClass
|
||||
{
|
||||
/*< private > */
|
||||
GInitiallyUnownedClass parent_class;
|
||||
GESTimelineElementClass parent_class;
|
||||
|
||||
/*< public > */
|
||||
GESCreateTrackObjectFunc create_track_object;
|
||||
|
@ -210,8 +170,6 @@ struct _GESTimelineObjectClass
|
|||
GESTrackObject *tck_object);
|
||||
void (*track_object_released) (GESTimelineObject *object,
|
||||
GESTrackObject *tck_object);
|
||||
void (*set_max_duration ) (GESTimelineObject *object,
|
||||
guint64 maxduration);
|
||||
|
||||
/*< private >*/
|
||||
/* Padding for API extension */
|
||||
|
@ -221,19 +179,6 @@ struct _GESTimelineObjectClass
|
|||
GType ges_timeline_object_get_type (void);
|
||||
|
||||
/* Setters */
|
||||
void ges_timeline_object_set_start (GESTimelineObject *object,
|
||||
guint64 start);
|
||||
void ges_timeline_object_set_inpoint (GESTimelineObject *object,
|
||||
guint64 inpoint);
|
||||
void ges_timeline_object_set_duration (GESTimelineObject *object,
|
||||
guint64 duration);
|
||||
void ges_timeline_object_set_max_duration (GESTimelineObject *object,
|
||||
guint64 maxduration);
|
||||
void ges_timeline_object_set_priority (GESTimelineObject *object,
|
||||
guint priority);
|
||||
|
||||
guint64 ges_timeline_object_get_max_duration (GESTimelineObject *object);
|
||||
|
||||
void ges_timeline_object_set_layer (GESTimelineObject *object,
|
||||
GESTimelineLayer *layer);
|
||||
|
||||
|
@ -263,13 +208,10 @@ gboolean ges_timeline_object_set_top_effect_priority (GESTimelineObject *object,
|
|||
/* Editing */
|
||||
GESTimelineObject *ges_timeline_object_split (GESTimelineObject *object, guint64 position);
|
||||
void ges_timeline_object_objects_set_locked (GESTimelineObject *object, gboolean locked);
|
||||
gboolean ges_timeline_object_ripple (GESTimelineObject *object, guint64 start);
|
||||
gboolean ges_timeline_object_ripple_end (GESTimelineObject *object, guint64 end);
|
||||
gboolean ges_timeline_object_roll_start (GESTimelineObject *object, guint64 start);
|
||||
gboolean ges_timeline_object_roll_end (GESTimelineObject *object, guint64 end);
|
||||
gboolean ges_timeline_object_trim_start (GESTimelineObject *object, guint64 start);
|
||||
|
||||
gboolean ges_timeline_object_edit (GESTimelineObject *object, GList *layers,
|
||||
gint new_layer_priority, GESEditMode mode,
|
||||
GESEdge edge, guint64 position);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* _GES_TIMELINE_OBJECT */
|
||||
|
|
|
@ -174,7 +174,7 @@ ges_timeline_test_source_init (GESTimelineTestSource * self)
|
|||
|
||||
self->priv->freq = 0;
|
||||
self->priv->volume = 0;
|
||||
GES_TIMELINE_OBJECT (self)->duration = 0;
|
||||
GES_TIMELINE_ELEMENT (self)->duration = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -245,7 +245,7 @@ ges_timeline_text_overlay_init (GESTimelineTextOverlay * self)
|
|||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
GES_TYPE_TIMELINE_TEXT_OVERLAY, GESTimelineTextOverlayPrivate);
|
||||
|
||||
GES_TIMELINE_OBJECT (self)->duration = 0;
|
||||
GES_TIMELINE_ELEMENT (self)->duration = 0;
|
||||
/* Not 100% needed since gobject contents are memzero'd when created */
|
||||
self->priv->text = NULL;
|
||||
self->priv->font_desc = NULL;
|
||||
|
|
|
@ -290,7 +290,7 @@ ges_timeline_title_source_init (GESTimelineTitleSource * self)
|
|||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
GES_TYPE_TIMELINE_TITLE_SOURCE, GESTimelineTitleSourcePrivate);
|
||||
|
||||
GES_TIMELINE_OBJECT (self)->duration = 0;
|
||||
GES_TIMELINE_ELEMENT (self)->duration = 0;
|
||||
/* Not 100% required since a new gobject's content will always be memzero'd */
|
||||
self->priv->mute = FALSE;
|
||||
self->priv->text = NULL;
|
||||
|
|
|
@ -508,7 +508,7 @@ ges_timeline_init (GESTimeline * self)
|
|||
priv = self->priv;
|
||||
self->layers = NULL;
|
||||
self->tracks = NULL;
|
||||
priv->duration = 0;
|
||||
self->priv->duration = 0;
|
||||
priv->snapping_distance = 0;
|
||||
|
||||
/* Move context initialization */
|
||||
|
@ -598,7 +598,7 @@ static void
|
|||
sort_track_objects (GESTimeline * timeline, TrackObjIters * iters)
|
||||
{
|
||||
g_sequence_sort_changed (iters->iter_obj,
|
||||
(GCompareDataFunc) track_object_start_compare, NULL);
|
||||
(GCompareDataFunc) element_start_compare, NULL);
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@ -623,11 +623,11 @@ custom_find_track (TrackPrivate * tr_priv, GESTrack * track)
|
|||
static inline void
|
||||
sort_starts_ends_end (GESTimeline * timeline, TrackObjIters * iters)
|
||||
{
|
||||
GESTrackObject *obj = iters->tckobj;
|
||||
GESTimelineElement *obj = GES_TIMELINE_ELEMENT (iters->tckobj);
|
||||
GESTimelinePrivate *priv = timeline->priv;
|
||||
guint64 *end = g_hash_table_lookup (priv->by_end, obj);
|
||||
|
||||
*end = obj->start + obj->duration;
|
||||
*end = _START (obj) + _DURATION (obj);
|
||||
|
||||
g_sequence_sort_changed (iters->iter_end, (GCompareDataFunc) compare_uint64,
|
||||
NULL);
|
||||
|
@ -637,11 +637,11 @@ sort_starts_ends_end (GESTimeline * timeline, TrackObjIters * iters)
|
|||
static inline void
|
||||
sort_starts_ends_start (GESTimeline * timeline, TrackObjIters * iters)
|
||||
{
|
||||
GESTrackObject *obj = iters->tckobj;
|
||||
GESTimelineElement *obj = GES_TIMELINE_ELEMENT (iters->tckobj);
|
||||
GESTimelinePrivate *priv = timeline->priv;
|
||||
guint64 *start = g_hash_table_lookup (priv->by_start, obj);
|
||||
|
||||
*start = obj->start;
|
||||
*start = _START (obj);
|
||||
|
||||
g_sequence_sort_changed (iters->iter_start,
|
||||
(GCompareDataFunc) compare_uint64, NULL);
|
||||
|
@ -749,10 +749,10 @@ _create_auto_transition_from_transitions (GESTimeline * timeline,
|
|||
if (ges_track_object_get_track (maybe_transition) != track)
|
||||
continue;
|
||||
|
||||
if (maybe_transition->start > next->start)
|
||||
if (_START (maybe_transition) > _START (next))
|
||||
break;
|
||||
else if (maybe_transition->start != next->start ||
|
||||
maybe_transition->duration != transition_duration)
|
||||
else if (_START (maybe_transition) != _START (next) ||
|
||||
_DURATION (maybe_transition) != transition_duration)
|
||||
continue;
|
||||
else if (GES_IS_TRACK_TRANSITION (maybe_transition))
|
||||
/* Use that transition */
|
||||
|
@ -761,7 +761,7 @@ _create_auto_transition_from_transitions (GESTimeline * timeline,
|
|||
* object to use it */
|
||||
return create_transition (timeline, prev, next,
|
||||
ges_track_object_get_timeline_object (maybe_transition), layer,
|
||||
next->start, transition_duration);
|
||||
_START (next), transition_duration);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -798,7 +798,7 @@ _create_transitions_on_layer (GESTimeline * timeline, GESTimelineLayer * layer,
|
|||
start_or_end);
|
||||
|
||||
/* Only object that are in that layer and track */
|
||||
if ((next->priority / LAYER_HEIGHT) != layer_prio ||
|
||||
if ((_PRIORITY (next) / LAYER_HEIGHT) != layer_prio ||
|
||||
(track && track != ges_track_object_get_track (next)))
|
||||
continue;
|
||||
|
||||
|
@ -825,15 +825,15 @@ _create_transitions_on_layer (GESTimeline * timeline, GESTimelineLayer * layer,
|
|||
if (ctrack != ges_track_object_get_track (prev))
|
||||
continue;
|
||||
|
||||
transition_duration = (prev->start + prev->duration) - next->start;
|
||||
if (transition_duration > 0 && transition_duration < prev->duration &&
|
||||
transition_duration < next->duration) {
|
||||
transition_duration = (_START (prev) + _DURATION (prev)) - _START (next);
|
||||
if (transition_duration > 0 && transition_duration < _DURATION (prev) &&
|
||||
transition_duration < _DURATION (next)) {
|
||||
transition =
|
||||
get_auto_transition (timeline, layer, ctrack, prev, next,
|
||||
transition_duration);
|
||||
if (!transition)
|
||||
transition = create_transition (timeline, prev, next, NULL, layer,
|
||||
next->start, transition_duration);
|
||||
_START (next), transition_duration);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -859,7 +859,7 @@ create_transitions (GESTimeline * timeline, GESTrackObject * tck_obj)
|
|||
|
||||
track = ges_track_object_get_track (tck_obj);
|
||||
layer_node = g_list_find_custom (timeline->layers,
|
||||
GINT_TO_POINTER (tck_obj->priority / LAYER_HEIGHT),
|
||||
GINT_TO_POINTER (_PRIORITY (tck_obj) / LAYER_HEIGHT),
|
||||
(GCompareFunc) find_layer_by_prio);
|
||||
|
||||
_create_transitions_on_layer (timeline,
|
||||
|
@ -931,7 +931,7 @@ start_tracking_track_object (GESTimeline * timeline, GESTrackObject * tckobj)
|
|||
TrackObjIters *iters;
|
||||
GESTimelinePrivate *priv = timeline->priv;
|
||||
|
||||
guint layer_prio = tckobj->priority / LAYER_HEIGHT;
|
||||
guint layer_prio = _PRIORITY (tckobj) / LAYER_HEIGHT;
|
||||
GList *layer_node = g_list_find_custom (timeline->layers,
|
||||
GINT_TO_POINTER (layer_prio), (GCompareFunc) find_layer_by_prio);
|
||||
GESTimelineLayer *layer = layer_node ? layer_node->data : NULL;
|
||||
|
@ -956,7 +956,7 @@ start_tracking_track_object (GESTimeline * timeline, GESTrackObject * tckobj)
|
|||
} else {
|
||||
by_layer_sequence = g_hash_table_lookup (priv->by_layer, layer);
|
||||
iters->iter_by_layer = g_sequence_insert_sorted (by_layer_sequence, tckobj,
|
||||
(GCompareDataFunc) track_object_start_compare, NULL);
|
||||
(GCompareDataFunc) element_start_compare, NULL);
|
||||
iters->layer = layer;
|
||||
}
|
||||
|
||||
|
@ -964,8 +964,8 @@ start_tracking_track_object (GESTimeline * timeline, GESTrackObject * tckobj)
|
|||
/* Track only sources for timeline edition and snapping */
|
||||
pstart = g_malloc (sizeof (guint64));
|
||||
pend = g_malloc (sizeof (guint64));
|
||||
*pstart = tckobj->start;
|
||||
*pend = *pstart + tckobj->duration;
|
||||
*pstart = _START (tckobj);
|
||||
*pend = *pstart + _DURATION (tckobj);
|
||||
|
||||
iters->iter_start = g_sequence_insert_sorted (priv->starts_ends, pstart,
|
||||
(GCompareDataFunc) compare_uint64, NULL);
|
||||
|
@ -973,7 +973,7 @@ start_tracking_track_object (GESTimeline * timeline, GESTrackObject * tckobj)
|
|||
(GCompareDataFunc) compare_uint64, NULL);
|
||||
iters->iter_obj =
|
||||
g_sequence_insert_sorted (priv->tracksources, g_object_ref (tckobj),
|
||||
(GCompareDataFunc) track_object_start_compare, NULL);
|
||||
(GCompareDataFunc) element_start_compare, NULL);
|
||||
iters->tckobj = tckobj;
|
||||
|
||||
g_hash_table_insert (priv->by_start, tckobj, pstart);
|
||||
|
@ -1170,7 +1170,7 @@ ges_move_context_set_objects (GESTimeline * timeline, GESTrackObject * obj,
|
|||
case GES_EDGE_START:
|
||||
/* set it properly in the context of "trimming" */
|
||||
mv_ctx->max_trim_pos = 0;
|
||||
start = obj->start;
|
||||
start = _START (obj);
|
||||
|
||||
if (g_sequence_iter_is_begin (tckobj_iter))
|
||||
break;
|
||||
|
@ -1181,10 +1181,10 @@ ges_move_context_set_objects (GESTimeline * timeline, GESTrackObject * obj,
|
|||
iter = g_sequence_iter_prev (iter)) {
|
||||
|
||||
tmptckobj = GES_TRACK_OBJECT (g_sequence_get (iter));
|
||||
tmpend = tmptckobj->start + tmptckobj->duration;
|
||||
tmpend = _START (tmptckobj) + _DURATION (tmptckobj);
|
||||
|
||||
if (tmpend <= start) {
|
||||
mv_ctx->max_trim_pos = MAX (mv_ctx->max_trim_pos, tmptckobj->start);
|
||||
mv_ctx->max_trim_pos = MAX (mv_ctx->max_trim_pos, _START (tmptckobj));
|
||||
mv_ctx->moving_tckobjs =
|
||||
g_list_prepend (mv_ctx->moving_tckobjs, tmptckobj);
|
||||
}
|
||||
|
@ -1196,9 +1196,7 @@ ges_move_context_set_objects (GESTimeline * timeline, GESTrackObject * obj,
|
|||
|
||||
case GES_EDGE_END:
|
||||
case GES_EDGE_NONE: /* In this case only works for ripple */
|
||||
end = ges_track_object_get_start (obj) +
|
||||
ges_track_object_get_duration (obj);
|
||||
|
||||
end = _START (obj) + _DURATION (obj);
|
||||
mv_ctx->max_trim_pos = G_MAXUINT64;
|
||||
|
||||
/* Look for folowing objects */
|
||||
|
@ -1207,8 +1205,8 @@ ges_move_context_set_objects (GESTimeline * timeline, GESTrackObject * obj,
|
|||
iter = g_sequence_iter_next (iter)) {
|
||||
tmptckobj = GES_TRACK_OBJECT (g_sequence_get (iter));
|
||||
|
||||
if (tmptckobj->start >= end) {
|
||||
tmpend = tmptckobj->start + tmptckobj->duration;
|
||||
if (_START (tmptckobj) >= end) {
|
||||
tmpend = _START (tmptckobj) + _DURATION (tmptckobj);
|
||||
mv_ctx->max_trim_pos = MIN (mv_ctx->max_trim_pos, tmpend);
|
||||
mv_ctx->moving_tckobjs =
|
||||
g_list_prepend (mv_ctx->moving_tckobjs, tmptckobj);
|
||||
|
@ -1296,13 +1294,13 @@ ges_timeline_trim_object_simple (GESTimeline * timeline, GESTrackObject * obj,
|
|||
GST_DEBUG_OBJECT (obj, "Trimming to %" GST_TIME_FORMAT " %s snaping, edge %i",
|
||||
GST_TIME_ARGS (position), snapping ? "Is" : "Not", edge);
|
||||
|
||||
start = ges_track_object_get_start (obj);
|
||||
start = _START (obj);
|
||||
g_object_get (obj, "max-duration", &max_duration, NULL);
|
||||
|
||||
switch (edge) {
|
||||
case GES_EDGE_START:
|
||||
inpoint = obj->inpoint;
|
||||
duration = obj->duration;
|
||||
inpoint = _INPOINT (obj);
|
||||
duration = _DURATION (obj);
|
||||
|
||||
if (snapping) {
|
||||
cur = g_hash_table_lookup (timeline->priv->by_start, obj);
|
||||
|
@ -1323,14 +1321,14 @@ ges_timeline_trim_object_simple (GESTimeline * timeline, GESTrackObject * obj,
|
|||
real_dur = start + duration - nstart;
|
||||
/* FIXME: Why CLAMP (0, real_dur, max_duration) doesn't work? */
|
||||
duration = MAX (0, real_dur);
|
||||
duration = MIN (duration, max_duration - obj->inpoint);
|
||||
duration = MIN (duration, max_duration - _INPOINT (obj));
|
||||
|
||||
timeline->priv->needs_transitions_update = FALSE;
|
||||
ges_track_object_set_start (obj, nstart);
|
||||
ges_track_object_set_inpoint (obj, inpoint);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (obj), nstart);
|
||||
_set_inpoint0 (GES_TIMELINE_ELEMENT (obj), inpoint);
|
||||
timeline->priv->needs_transitions_update = TRUE;
|
||||
|
||||
ges_track_object_set_duration (obj, duration);
|
||||
_set_duration0 (GES_TIMELINE_ELEMENT (obj), duration);
|
||||
break;
|
||||
case GES_EDGE_END:
|
||||
{
|
||||
|
@ -1342,9 +1340,9 @@ ges_timeline_trim_object_simple (GESTimeline * timeline, GESTrackObject * obj,
|
|||
/* Calculate new values */
|
||||
real_dur = position - start;
|
||||
duration = MAX (0, real_dur);
|
||||
duration = MIN (duration, max_duration - obj->inpoint);
|
||||
duration = MIN (duration, max_duration - _INPOINT (obj));
|
||||
|
||||
ges_track_object_set_duration (obj, duration);
|
||||
_set_duration0 (GES_TIMELINE_ELEMENT (obj), duration);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -1383,11 +1381,11 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackObject * obj,
|
|||
if (snapped)
|
||||
position = *snapped;
|
||||
|
||||
offset = position - obj->start;
|
||||
offset = position - _START (obj);
|
||||
|
||||
for (tmp = mv_ctx->moving_tckobjs; tmp; tmp = tmp->next) {
|
||||
tckobj = GES_TRACK_OBJECT (tmp->data);
|
||||
new_start = tckobj->start + offset;
|
||||
new_start = _START (tckobj) + offset;
|
||||
|
||||
tlobj = add_moving_timeline_object (mv_ctx, tckobj);
|
||||
|
||||
|
@ -1395,16 +1393,16 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackObject * obj,
|
|||
|
||||
/* Make sure not to move 2 times the same TimelineObject */
|
||||
if (g_list_find (moved_tlobjs, tlobj) == NULL) {
|
||||
ges_track_object_set_start (tckobj, new_start);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (tckobj), new_start);
|
||||
moved_tlobjs = g_list_prepend (moved_tlobjs, tlobj);
|
||||
}
|
||||
|
||||
} else {
|
||||
ges_track_object_set_start (tckobj, new_start);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (tckobj), new_start);
|
||||
}
|
||||
}
|
||||
g_list_free (moved_tlobjs);
|
||||
ges_track_object_set_start (obj, position);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (obj), position);
|
||||
|
||||
break;
|
||||
case GES_EDGE_END:
|
||||
|
@ -1416,14 +1414,14 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackObject * obj,
|
|||
if (snapped)
|
||||
position = *snapped;
|
||||
|
||||
duration = obj->duration;
|
||||
duration = _DURATION (obj);
|
||||
|
||||
ges_track_object_set_duration (obj, position - obj->start);
|
||||
_set_duration0 (GES_TIMELINE_ELEMENT (obj), position - _START (obj));
|
||||
|
||||
offset = obj->duration - duration;
|
||||
offset = _DURATION (obj) - duration;
|
||||
for (tmp = mv_ctx->moving_tckobjs; tmp; tmp = tmp->next) {
|
||||
tckobj = GES_TRACK_OBJECT (tmp->data);
|
||||
new_start = tckobj->start + offset;
|
||||
new_start = _START (tckobj) + offset;
|
||||
|
||||
tlobj = add_moving_timeline_object (mv_ctx, tckobj);
|
||||
|
||||
|
@ -1431,12 +1429,12 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackObject * obj,
|
|||
|
||||
/* Make sure not to move 2 times the same TimelineObject */
|
||||
if (g_list_find (moved_tlobjs, tlobj) == NULL) {
|
||||
ges_track_object_set_start (tckobj, new_start);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (tckobj), new_start);
|
||||
moved_tlobjs = g_list_prepend (moved_tlobjs, tlobj);
|
||||
}
|
||||
|
||||
} else {
|
||||
ges_track_object_set_start (tckobj, new_start);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (tckobj), new_start);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1516,8 +1514,8 @@ timeline_roll_object (GESTimeline * timeline, GESTrackObject * obj,
|
|||
edge, layers))
|
||||
goto error;
|
||||
|
||||
start = ges_track_object_get_start (obj);
|
||||
duration = ges_track_object_get_duration (obj);
|
||||
start = _START (obj);
|
||||
duration = _DURATION (obj);
|
||||
end = start + duration;
|
||||
|
||||
timeline->priv->needs_transitions_update = FALSE;
|
||||
|
@ -1539,14 +1537,14 @@ timeline_roll_object (GESTimeline * timeline, GESTrackObject * obj,
|
|||
|
||||
/* In the case we reached max_duration we just make sure to roll
|
||||
* everything to the real new position */
|
||||
position = obj->start;
|
||||
position = _START (obj);
|
||||
|
||||
/* Send back changes to the neighbourhood */
|
||||
for (tmp = mv_ctx->moving_tckobjs; tmp; tmp = tmp->next) {
|
||||
GESTrackObject *tmptckobj = GES_TRACK_OBJECT (tmp->data);
|
||||
|
||||
tmpstart = ges_track_object_get_start (tmptckobj);
|
||||
tmpduration = ges_track_object_get_duration (tmptckobj);
|
||||
tmpstart = _START (tmptckobj);
|
||||
tmpduration = _DURATION (tmptckobj);
|
||||
tmpend = tmpstart + tmpduration;
|
||||
|
||||
/* Check that the object should be resized at this position
|
||||
|
@ -1564,7 +1562,7 @@ timeline_roll_object (GESTimeline * timeline, GESTrackObject * obj,
|
|||
if (position > mv_ctx->max_trim_pos || position < start)
|
||||
goto error;
|
||||
|
||||
end = obj->start + obj->duration;
|
||||
end = _START (obj) + _DURATION (obj);
|
||||
|
||||
cur = g_hash_table_lookup (timeline->priv->by_end, obj);
|
||||
snapped = ges_timeline_snap_position (timeline, obj, cur, position, TRUE);
|
||||
|
@ -1576,14 +1574,14 @@ timeline_roll_object (GESTimeline * timeline, GESTrackObject * obj,
|
|||
|
||||
/* In the case we reached max_duration we just make sure to roll
|
||||
* everything to the real new position */
|
||||
position = obj->start + obj->duration;
|
||||
position = _START (obj) + _DURATION (obj);
|
||||
|
||||
/* Send back changes to the neighbourhood */
|
||||
for (tmp = mv_ctx->moving_tckobjs; tmp; tmp = tmp->next) {
|
||||
GESTrackObject *tmptckobj = GES_TRACK_OBJECT (tmp->data);
|
||||
|
||||
tmpstart = ges_track_object_get_start (tmptckobj);
|
||||
tmpduration = ges_track_object_get_duration (tmptckobj);
|
||||
tmpstart = _START (tmptckobj);
|
||||
tmpduration = _DURATION (tmptckobj);
|
||||
tmpend = tmpstart + tmpduration;
|
||||
|
||||
/* Check that the object should be resized at this position
|
||||
|
@ -1635,7 +1633,7 @@ ges_timeline_move_object_simple (GESTimeline * timeline,
|
|||
{
|
||||
guint64 *snap_end, *snap_st, *cur, off1, off2, end;
|
||||
|
||||
end = position + object->duration;
|
||||
end = position + _DURATION (object);
|
||||
cur = g_hash_table_lookup (timeline->priv->by_end, object);
|
||||
|
||||
GST_DEBUG_OBJECT (timeline, "Moving to %" GST_TIME_FORMAT " (end %"
|
||||
|
@ -1665,7 +1663,7 @@ ges_timeline_move_object_simple (GESTimeline * timeline,
|
|||
ges_timeline_emit_snappig (timeline, object, NULL);
|
||||
|
||||
|
||||
ges_track_object_set_start (object, position);
|
||||
_set_start0 (GES_TIMELINE_ELEMENT (object), position);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1816,7 +1814,9 @@ add_object_to_tracks (GESTimeline * timeline, GESTimelineObject * object,
|
|||
continue;
|
||||
}
|
||||
|
||||
track_object_copy = ges_track_object_copy (track_object, TRUE);
|
||||
track_object_copy =
|
||||
GES_TRACK_OBJECT (ges_timeline_element_copy (GES_TIMELINE_ELEMENT
|
||||
(track_object), TRUE));
|
||||
|
||||
GST_LOG_OBJECT (timeline, "Trying to add %p to track %p",
|
||||
track_object_copy, tmp_track);
|
||||
|
@ -1920,7 +1920,7 @@ trackobj_start_changed_cb (GESTrackObject * child,
|
|||
|
||||
if (G_LIKELY (iters->iter_by_layer))
|
||||
g_sequence_sort_changed (iters->iter_by_layer,
|
||||
(GCompareDataFunc) track_object_start_compare, NULL);
|
||||
(GCompareDataFunc) element_start_compare, NULL);
|
||||
|
||||
if (GES_IS_TRACK_SOURCE (child)) {
|
||||
sort_track_objects (timeline, iters);
|
||||
|
@ -1946,7 +1946,7 @@ trackobj_priority_changed_cb (GESTrackObject * child,
|
|||
GESTimelinePrivate *priv = timeline->priv;
|
||||
|
||||
GList *layer_node = g_list_find_custom (timeline->layers,
|
||||
GINT_TO_POINTER (child->priority / LAYER_HEIGHT),
|
||||
GINT_TO_POINTER (_PRIORITY (child) / LAYER_HEIGHT),
|
||||
(GCompareFunc) find_layer_by_prio);
|
||||
GESTimelineLayer *layer = layer_node ? layer_node->data : NULL;
|
||||
TrackObjIters *iters = g_hash_table_lookup (priv->obj_iters,
|
||||
|
@ -1968,11 +1968,11 @@ trackobj_priority_changed_cb (GESTrackObject * child,
|
|||
g_sequence_remove (iters->iter_by_layer);
|
||||
iters->iter_by_layer =
|
||||
g_sequence_insert_sorted (by_layer_sequence, child,
|
||||
(GCompareDataFunc) track_object_start_compare, NULL);
|
||||
(GCompareDataFunc) element_start_compare, NULL);
|
||||
iters->layer = layer;
|
||||
} else {
|
||||
g_sequence_sort_changed (iters->iter_by_layer,
|
||||
(GCompareDataFunc) track_object_start_compare, NULL);
|
||||
(GCompareDataFunc) element_start_compare, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* #GESTrack.
|
||||
*
|
||||
* It contains the basic information as to the location of the object within
|
||||
* its container, like the start position, the in-point, the duration and the
|
||||
* its container, like the start position, the inpoint, the duration and the
|
||||
* priority.
|
||||
*/
|
||||
|
||||
|
@ -37,16 +37,8 @@
|
|||
#include "ges-meta-container.h"
|
||||
#include <gobject/gvaluecollector.h>
|
||||
|
||||
static void ges_extractable_interface_init (GESExtractableInterface * iface);
|
||||
static void ges_meta_container_interface_init
|
||||
(GESMetaContainerInterface * iface);
|
||||
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GESTrackObject, ges_track_object,
|
||||
G_TYPE_INITIALLY_UNOWNED,
|
||||
G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE, ges_extractable_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (GES_TYPE_META_CONTAINER,
|
||||
ges_meta_container_interface_init));
|
||||
G_DEFINE_ABSTRACT_TYPE (GESTrackObject, ges_track_object,
|
||||
GES_TYPE_TIMELINE_ELEMENT);
|
||||
|
||||
struct _GESTrackObjectPrivate
|
||||
{
|
||||
|
@ -72,8 +64,6 @@ struct _GESTrackObjectPrivate
|
|||
|
||||
gboolean valid;
|
||||
|
||||
guint64 maxduration;
|
||||
|
||||
gboolean locked; /* If TRUE, then moves in sync with its controlling
|
||||
* GESTimelineObject */
|
||||
};
|
||||
|
@ -81,13 +71,8 @@ struct _GESTrackObjectPrivate
|
|||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_START,
|
||||
PROP_INPOINT,
|
||||
PROP_DURATION,
|
||||
PROP_PRIORITY,
|
||||
PROP_ACTIVE,
|
||||
PROP_LOCKED,
|
||||
PROP_MAX_DURATION,
|
||||
PROP_TRACK_TYPE,
|
||||
PROP_TRACK,
|
||||
PROP_LAST
|
||||
|
@ -126,15 +111,15 @@ static void connect_signal (gpointer key, gpointer value, gpointer user_data);
|
|||
static void gst_element_prop_changed_cb (GstElement * element, GParamSpec * arg
|
||||
G_GNUC_UNUSED, GESTrackObject * obj);
|
||||
|
||||
static inline gboolean
|
||||
ges_track_object_set_start_internal (GESTrackObject * object, guint64 start);
|
||||
static inline gboolean
|
||||
ges_track_object_set_inpoint_internal (GESTrackObject * object,
|
||||
guint64 inpoint);
|
||||
static inline gboolean ges_track_object_set_duration_internal (GESTrackObject *
|
||||
object, guint64 duration);
|
||||
static inline gboolean ges_track_object_set_priority_internal (GESTrackObject *
|
||||
object, guint32 priority);
|
||||
static gboolean _set_start (GESTimelineElement * element, GstClockTime start);
|
||||
static gboolean _set_inpoint (GESTimelineElement * element,
|
||||
GstClockTime inpoint);
|
||||
static gboolean _set_duration (GESTimelineElement * element,
|
||||
GstClockTime duration);
|
||||
static gboolean _set_priority (GESTimelineElement * element, guint32 priority);
|
||||
static void _deep_copy (GESTimelineElement * element,
|
||||
GESTimelineElement * copy);
|
||||
|
||||
static inline void
|
||||
ges_track_object_set_locked_internal (GESTrackObject * object, gboolean locked);
|
||||
|
||||
|
@ -148,27 +133,12 @@ ges_track_object_get_property (GObject * object, guint property_id,
|
|||
GESTrackObject *tobj = GES_TRACK_OBJECT (object);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_START:
|
||||
g_value_set_uint64 (value, ges_track_object_get_start (tobj));
|
||||
break;
|
||||
case PROP_INPOINT:
|
||||
g_value_set_uint64 (value, ges_track_object_get_inpoint (tobj));
|
||||
break;
|
||||
case PROP_DURATION:
|
||||
g_value_set_uint64 (value, ges_track_object_get_duration (tobj));
|
||||
break;
|
||||
case PROP_PRIORITY:
|
||||
g_value_set_uint (value, ges_track_object_get_priority (tobj));
|
||||
break;
|
||||
case PROP_ACTIVE:
|
||||
g_value_set_boolean (value, ges_track_object_is_active (tobj));
|
||||
break;
|
||||
case PROP_LOCKED:
|
||||
g_value_set_boolean (value, ges_track_object_is_locked (tobj));
|
||||
break;
|
||||
case PROP_MAX_DURATION:
|
||||
g_value_set_uint64 (value, tobj->priv->maxduration);
|
||||
break;
|
||||
case PROP_TRACK_TYPE:
|
||||
g_value_set_flags (value, tobj->priv->track_type);
|
||||
break;
|
||||
|
@ -187,27 +157,12 @@ ges_track_object_set_property (GObject * object, guint property_id,
|
|||
GESTrackObject *tobj = GES_TRACK_OBJECT (object);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_START:
|
||||
ges_track_object_set_start_internal (tobj, g_value_get_uint64 (value));
|
||||
break;
|
||||
case PROP_INPOINT:
|
||||
ges_track_object_set_inpoint_internal (tobj, g_value_get_uint64 (value));
|
||||
break;
|
||||
case PROP_DURATION:
|
||||
ges_track_object_set_duration_internal (tobj, g_value_get_uint64 (value));
|
||||
break;
|
||||
case PROP_PRIORITY:
|
||||
ges_track_object_set_priority_internal (tobj, g_value_get_uint (value));
|
||||
break;
|
||||
case PROP_ACTIVE:
|
||||
ges_track_object_set_active (tobj, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_LOCKED:
|
||||
ges_track_object_set_locked_internal (tobj, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_MAX_DURATION:
|
||||
ges_track_object_set_max_duration (tobj, g_value_get_uint64 (value));
|
||||
break;
|
||||
case PROP_TRACK_TYPE:
|
||||
tobj->priv->track_type = g_value_get_flags (value);
|
||||
break;
|
||||
|
@ -256,6 +211,7 @@ static void
|
|||
ges_track_object_class_init (GESTrackObjectClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GESTrackObjectPrivate));
|
||||
|
||||
|
@ -264,59 +220,6 @@ ges_track_object_class_init (GESTrackObjectClass * klass)
|
|||
object_class->dispose = ges_track_object_dispose;
|
||||
object_class->finalize = ges_track_object_finalize;
|
||||
|
||||
/**
|
||||
* GESTrackObject:start:
|
||||
*
|
||||
* The position of the object in the container #GESTrack (in nanoseconds).
|
||||
*/
|
||||
properties[PROP_START] = g_param_spec_uint64 ("start", "Start",
|
||||
"The position in the container", 0, G_MAXUINT64, 0, G_PARAM_READWRITE);
|
||||
g_object_class_install_property (object_class, PROP_START,
|
||||
properties[PROP_START]);
|
||||
|
||||
/**
|
||||
* GESTrackObject:in-point:
|
||||
*
|
||||
* The in-point at which this #GESTrackObject will start outputting data
|
||||
* from its contents (in nanoseconds).
|
||||
*
|
||||
* Ex: an in-point of 5 seconds means that the first outputted buffer will
|
||||
* be the one located 5 seconds in the controlled resource.
|
||||
*/
|
||||
properties[PROP_INPOINT] =
|
||||
g_param_spec_uint64 ("in-point", "In-point", "The in-point", 0,
|
||||
G_MAXUINT64, 0, G_PARAM_READWRITE);
|
||||
g_object_class_install_property (object_class, PROP_INPOINT,
|
||||
properties[PROP_INPOINT]);
|
||||
|
||||
/**
|
||||
* GESTrackObject:duration:
|
||||
*
|
||||
* The duration (in nanoseconds) which will be used in the container #GESTrack
|
||||
* starting from 'in-point'.
|
||||
*
|
||||
*/
|
||||
properties[PROP_DURATION] =
|
||||
g_param_spec_uint64 ("duration", "Duration", "The duration to use", 0,
|
||||
G_MAXUINT64, GST_SECOND, G_PARAM_READWRITE);
|
||||
g_object_class_install_property (object_class, PROP_DURATION,
|
||||
properties[PROP_DURATION]);
|
||||
|
||||
/**
|
||||
* GESTrackObject:priority:
|
||||
*
|
||||
* The priority of the object within the containing #GESTrack.
|
||||
* If two objects intersect over the same region of time, the @priority
|
||||
* property is used to decide which one takes precedence.
|
||||
*
|
||||
* The highest priority (that supercedes everything) is 0, and then lowering
|
||||
* priorities go in increasing numerical value (with #G_MAXUINT64 being the
|
||||
* lowest priority).
|
||||
*/
|
||||
properties[PROP_PRIORITY] = g_param_spec_uint ("priority", "Priority",
|
||||
"The priority of the object", 0, G_MAXUINT, 0, G_PARAM_READWRITE);
|
||||
g_object_class_install_property (object_class, PROP_PRIORITY,
|
||||
properties[PROP_PRIORITY]);
|
||||
|
||||
/**
|
||||
* GESTrackObject:active:
|
||||
|
@ -342,21 +245,6 @@ ges_track_object_class_init (GESTrackObjectClass * klass)
|
|||
g_object_class_install_property (object_class, PROP_LOCKED,
|
||||
properties[PROP_LOCKED]);
|
||||
|
||||
/**
|
||||
* GESTrackObject:max-duration:
|
||||
*
|
||||
* The maximum duration (in nanoseconds) of the #GESTrackObject.
|
||||
*
|
||||
* Since: 0.10.XX
|
||||
*/
|
||||
properties[PROP_MAX_DURATION] =
|
||||
g_param_spec_uint64 ("max-duration", "Maximum duration",
|
||||
"The maximum duration of the object", 0, G_MAXUINT64, G_MAXUINT64,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
|
||||
|
||||
g_object_class_install_property (object_class, PROP_MAX_DURATION,
|
||||
properties[PROP_MAX_DURATION]);
|
||||
|
||||
properties[PROP_TRACK_TYPE] = g_param_spec_flags ("track-type", "Track Type",
|
||||
"The track type of the object", GES_TYPE_TRACK_TYPE,
|
||||
GES_TRACK_TYPE_UNKNOWN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
|
||||
|
@ -386,6 +274,12 @@ ges_track_object_class_init (GESTrackObjectClass * klass)
|
|||
G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_generic,
|
||||
G_TYPE_NONE, 2, GST_TYPE_ELEMENT, G_TYPE_PARAM);
|
||||
|
||||
element_class->set_start = _set_start;
|
||||
element_class->set_duration = _set_duration;
|
||||
element_class->set_inpoint = _set_inpoint;
|
||||
element_class->set_priority = _set_priority;
|
||||
element_class->deep_copy = _deep_copy;
|
||||
|
||||
klass->create_gnl_object = ges_track_object_create_gnl_object_func;
|
||||
/* There is no 'get_props_hashtable' default implementation */
|
||||
klass->get_props_hastable = NULL;
|
||||
|
@ -406,61 +300,38 @@ ges_track_object_init (GESTrackObject * self)
|
|||
priv->pending_active = TRUE;
|
||||
priv->locked = TRUE;
|
||||
priv->properties_hashtable = NULL;
|
||||
priv->maxduration = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
ges_extractable_interface_init (GESExtractableInterface * iface)
|
||||
static gboolean
|
||||
_set_start (GESTimelineElement * element, GstClockTime start)
|
||||
{
|
||||
}
|
||||
GESTrackObject *object = GES_TRACK_OBJECT (element);
|
||||
|
||||
static void
|
||||
ges_meta_container_interface_init (GESMetaContainerInterface * iface)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
ges_track_object_set_start_internal (GESTrackObject * object, guint64 start)
|
||||
{
|
||||
GST_DEBUG ("object:%p, start:%" GST_TIME_FORMAT,
|
||||
object, GST_TIME_ARGS (start));
|
||||
|
||||
if (object->priv->gnlobject != NULL) {
|
||||
if (G_UNLIKELY (start == object->start))
|
||||
if (G_UNLIKELY (start == _START (object)))
|
||||
return FALSE;
|
||||
|
||||
g_object_set (object->priv->gnlobject, "start", start, NULL);
|
||||
} else
|
||||
object->priv->pending_start = start;
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
/**
|
||||
* ges_track_object_set_start:
|
||||
* @object: a #GESTrackObject
|
||||
* @start: the start position (in #GstClockTime)
|
||||
*
|
||||
* Sets the position of the object in the container #GESTrack.
|
||||
*/
|
||||
void
|
||||
ges_track_object_set_start (GESTrackObject * object, guint64 start)
|
||||
{
|
||||
g_return_if_fail (GES_IS_TRACK_OBJECT (object));
|
||||
|
||||
if (ges_track_object_set_start_internal (object, start))
|
||||
g_object_notify_by_pspec (G_OBJECT (object), properties[PROP_START]);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
ges_track_object_set_inpoint_internal (GESTrackObject * object, guint64 inpoint)
|
||||
static gboolean
|
||||
_set_inpoint (GESTimelineElement * element, GstClockTime inpoint)
|
||||
{
|
||||
GESTrackObject *object = GES_TRACK_OBJECT (element);
|
||||
|
||||
GST_DEBUG ("object:%p, inpoint:%" GST_TIME_FORMAT,
|
||||
object, GST_TIME_ARGS (inpoint));
|
||||
|
||||
if (object->priv->gnlobject != NULL) {
|
||||
if (G_UNLIKELY (inpoint == object->inpoint))
|
||||
if (G_UNLIKELY (inpoint == _INPOINT (object)))
|
||||
|
||||
return FALSE;
|
||||
|
||||
g_object_set (object->priv->gnlobject, "media-start", inpoint, NULL);
|
||||
|
@ -470,37 +341,21 @@ ges_track_object_set_inpoint_internal (GESTrackObject * object, guint64 inpoint)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_set_inpoint:
|
||||
* @object: a #GESTrackObject
|
||||
* @inpoint: the in-point (in #GstClockTime)
|
||||
*
|
||||
* Set the offset within the contents of this #GESTrackObject
|
||||
*/
|
||||
void
|
||||
ges_track_object_set_inpoint (GESTrackObject * object, guint64 inpoint)
|
||||
{
|
||||
g_return_if_fail (GES_IS_TRACK_OBJECT (object));
|
||||
|
||||
if (ges_track_object_set_inpoint_internal (object, inpoint))
|
||||
g_object_notify_by_pspec (G_OBJECT (object), properties[PROP_INPOINT]);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
ges_track_object_set_duration_internal (GESTrackObject * object,
|
||||
guint64 duration)
|
||||
static gboolean
|
||||
_set_duration (GESTimelineElement * element, GstClockTime duration)
|
||||
{
|
||||
GESTrackObject *object = GES_TRACK_OBJECT (element);
|
||||
GESTrackObjectPrivate *priv = object->priv;
|
||||
|
||||
GST_DEBUG ("object:%p, duration:%" GST_TIME_FORMAT,
|
||||
object, GST_TIME_ARGS (duration));
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (priv->maxduration) &&
|
||||
duration > object->inpoint + priv->maxduration)
|
||||
duration = priv->maxduration - object->inpoint;
|
||||
if (GST_CLOCK_TIME_IS_VALID (_MAXDURATION (element)) &&
|
||||
duration > _INPOINT (object) + _MAXDURATION (element))
|
||||
duration = _MAXDURATION (element) - _INPOINT (object);
|
||||
|
||||
if (priv->gnlobject != NULL) {
|
||||
if (G_UNLIKELY (duration == object->duration))
|
||||
if (G_UNLIKELY (duration == _DURATION (object)))
|
||||
return FALSE;
|
||||
|
||||
g_object_set (priv->gnlobject, "duration", duration,
|
||||
|
@ -511,60 +366,24 @@ ges_track_object_set_duration_internal (GESTrackObject * object,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_set_duration:
|
||||
* @object: a #GESTrackObject
|
||||
* @duration: the duration (in #GstClockTime)
|
||||
*
|
||||
* Set the duration which will be used in the container #GESTrack
|
||||
* starting from the 'in-point'
|
||||
*/
|
||||
void
|
||||
ges_track_object_set_duration (GESTrackObject * object, guint64 duration)
|
||||
static gboolean
|
||||
_set_priority (GESTimelineElement * element, guint32 priority)
|
||||
{
|
||||
g_return_if_fail (GES_IS_TRACK_OBJECT (object));
|
||||
GESTrackObject *object = GES_TRACK_OBJECT (element);
|
||||
|
||||
if (ges_track_object_set_duration_internal (object, duration))
|
||||
g_object_notify_by_pspec (G_OBJECT (object), properties[PROP_DURATION]);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
ges_track_object_set_priority_internal (GESTrackObject * object,
|
||||
guint32 priority)
|
||||
{
|
||||
GST_DEBUG ("object:%p, priority:%" G_GUINT32_FORMAT, object, priority);
|
||||
|
||||
if (object->priv->gnlobject != NULL) {
|
||||
if (G_UNLIKELY (priority == object->priority))
|
||||
if (G_UNLIKELY (priority == _PRIORITY (object)))
|
||||
return FALSE;
|
||||
|
||||
g_object_set (object->priv->gnlobject, "priority", priority, NULL);
|
||||
} else
|
||||
object->priv->pending_priority = priority;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_set_priority:
|
||||
* @object: a #GESTrackObject
|
||||
* @priority: the priority
|
||||
*
|
||||
* Sets the priority of the object withing the containing #GESTrack.
|
||||
* If two objects intersect over the same region of time, the priority
|
||||
* property is used to decide which one takes precedence.
|
||||
*
|
||||
* The highest priority (that supercedes everything) is 0, and then
|
||||
* lowering priorities go in increasing numerical value (with G_MAXUINT32
|
||||
* being the lowest priority).
|
||||
*/
|
||||
void
|
||||
ges_track_object_set_priority (GESTrackObject * object, guint32 priority)
|
||||
{
|
||||
if (ges_track_object_set_priority_internal (object, priority))
|
||||
g_object_notify_by_pspec (G_OBJECT (object), properties[PROP_PRIORITY]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ges_track_object_set_active:
|
||||
* @object: a #GESTrackObject
|
||||
|
@ -617,19 +436,15 @@ gnlobject_start_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
|||
GESTrackObject * obj)
|
||||
{
|
||||
guint64 start;
|
||||
GESTrackObjectClass *klass;
|
||||
|
||||
klass = GES_TRACK_OBJECT_GET_CLASS (obj);
|
||||
|
||||
g_object_get (gnlobject, "start", &start, NULL);
|
||||
|
||||
GST_DEBUG ("gnlobject start : %" GST_TIME_FORMAT " current : %"
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (start), GST_TIME_ARGS (obj->start));
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (start), GST_TIME_ARGS (_START (obj)));
|
||||
|
||||
if (start != obj->start) {
|
||||
obj->start = start;
|
||||
if (klass->start_changed)
|
||||
klass->start_changed (obj, start);
|
||||
if (start != _START (obj)) {
|
||||
_START (obj) = start;
|
||||
g_object_notify (G_OBJECT (obj), "start");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -671,20 +486,16 @@ static void
|
|||
gnlobject_media_start_cb (GstElement * gnlobject,
|
||||
GParamSpec * arg G_GNUC_UNUSED, GESTrackObject * obj)
|
||||
{
|
||||
guint64 start;
|
||||
GESTrackObjectClass *klass;
|
||||
guint64 inpoint;
|
||||
|
||||
klass = GES_TRACK_OBJECT_GET_CLASS (obj);
|
||||
|
||||
g_object_get (gnlobject, "media-start", &start, NULL);
|
||||
g_object_get (gnlobject, "media-start", &inpoint, NULL);
|
||||
|
||||
GST_DEBUG ("gnlobject in-point : %" GST_TIME_FORMAT " current : %"
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (start), GST_TIME_ARGS (obj->inpoint));
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (inpoint), GST_TIME_ARGS (_INPOINT (obj)));
|
||||
|
||||
if (start != obj->inpoint) {
|
||||
obj->inpoint = start;
|
||||
if (klass->media_start_changed)
|
||||
klass->media_start_changed (obj, start);
|
||||
if (inpoint != _INPOINT (obj)) {
|
||||
_INPOINT (obj) = inpoint;
|
||||
g_object_notify (G_OBJECT (obj), "in-point");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -693,18 +504,14 @@ gnlobject_priority_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
|||
GESTrackObject * obj)
|
||||
{
|
||||
guint32 priority;
|
||||
GESTrackObjectClass *klass;
|
||||
|
||||
klass = GES_TRACK_OBJECT_GET_CLASS (obj);
|
||||
|
||||
g_object_get (gnlobject, "priority", &priority, NULL);
|
||||
|
||||
GST_DEBUG ("gnlobject priority : %d current : %d", priority, obj->priority);
|
||||
GST_DEBUG ("gnlobject priority : %d current : %d", priority, _PRIORITY (obj));
|
||||
|
||||
if (priority != obj->priority) {
|
||||
obj->priority = priority;
|
||||
if (klass->gnl_priority_changed)
|
||||
klass->gnl_priority_changed (obj, priority);
|
||||
if (priority != _PRIORITY (obj)) {
|
||||
_PRIORITY (obj) = priority;
|
||||
g_object_notify (G_OBJECT (obj), "priority");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -720,12 +527,14 @@ gnlobject_duration_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
|||
g_object_get (gnlobject, "duration", &duration, NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (gnlobject, "duration : %" GST_TIME_FORMAT " current : %"
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (duration), GST_TIME_ARGS (obj->duration));
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (duration),
|
||||
GST_TIME_ARGS (_DURATION (obj)));
|
||||
|
||||
if (duration != obj->duration) {
|
||||
obj->duration = duration;
|
||||
if (duration != _DURATION (obj)) {
|
||||
_DURATION (obj) = duration;
|
||||
if (klass->duration_changed)
|
||||
klass->duration_changed (obj, duration);
|
||||
g_object_notify (G_OBJECT (obj), "duration");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1075,93 +884,6 @@ ges_track_object_is_locked (GESTrackObject * object)
|
|||
return object->priv->locked;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_get_start:
|
||||
* @object: a #GESTrackObject
|
||||
*
|
||||
* Get the position of the object in the container #GESTrack.
|
||||
*
|
||||
* Returns: the start position (in #GstClockTime) or #GST_CLOCK_TIME_NONE
|
||||
* if something went wrong.
|
||||
*
|
||||
* Since: 0.10.2
|
||||
*/
|
||||
guint64
|
||||
ges_track_object_get_start (GESTrackObject * object)
|
||||
{
|
||||
g_return_val_if_fail (GES_IS_TRACK_OBJECT (object), GST_CLOCK_TIME_NONE);
|
||||
|
||||
if (G_UNLIKELY (object->priv->gnlobject == NULL))
|
||||
return object->priv->pending_start;
|
||||
else
|
||||
return object->start;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_get_inpoint:
|
||||
* @object: a #GESTrackObject
|
||||
*
|
||||
* Get the offset within the contents of this #GESTrackObject
|
||||
*
|
||||
* Returns: the in-point (in #GstClockTime) or #GST_CLOCK_TIME_NONE
|
||||
* if something went wrong.
|
||||
*
|
||||
* Since: 0.10.2
|
||||
*/
|
||||
guint64
|
||||
ges_track_object_get_inpoint (GESTrackObject * object)
|
||||
{
|
||||
g_return_val_if_fail (GES_IS_TRACK_OBJECT (object), GST_CLOCK_TIME_NONE);
|
||||
|
||||
if (G_UNLIKELY (object->priv->gnlobject == NULL))
|
||||
return object->priv->pending_inpoint;
|
||||
else
|
||||
return object->inpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_get_duration:
|
||||
* @object: a #GESTrackObject
|
||||
*
|
||||
* Get the duration which will be used in the container #GESTrack
|
||||
* starting from the 'in-point'
|
||||
*
|
||||
* Returns: the duration (in #GstClockTime) or #GST_CLOCK_TIME_NONE
|
||||
* if something went wrong.
|
||||
*
|
||||
* Since: 0.10.2
|
||||
*/
|
||||
guint64
|
||||
ges_track_object_get_duration (GESTrackObject * object)
|
||||
{
|
||||
g_return_val_if_fail (GES_IS_TRACK_OBJECT (object), GST_CLOCK_TIME_NONE);
|
||||
|
||||
if (G_UNLIKELY (object->priv->gnlobject == NULL))
|
||||
return object->priv->pending_duration;
|
||||
else
|
||||
return object->duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_get_priority:
|
||||
* @object: a #GESTrackObject
|
||||
*
|
||||
* Get the priority of the object withing the containing #GESTrack.
|
||||
*
|
||||
* Returns: the priority of @object or -1 if something went wrong
|
||||
*
|
||||
* Since: 0.10.2
|
||||
*/
|
||||
guint32
|
||||
ges_track_object_get_priority (GESTrackObject * object)
|
||||
{
|
||||
g_return_val_if_fail (GES_IS_TRACK_OBJECT (object), -1);
|
||||
|
||||
if (G_UNLIKELY (object->priv->gnlobject == NULL))
|
||||
return object->priv->pending_priority;
|
||||
else
|
||||
return object->priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_is_active:
|
||||
|
@ -1680,101 +1402,26 @@ prop_hash_not_set:
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_get_max_duration:
|
||||
* @object: The #GESTrackObject to retrieve max duration from
|
||||
*
|
||||
* Get the max duration of @object.
|
||||
*
|
||||
* Returns: The max duration of @object
|
||||
*
|
||||
* Since: 0.10.XX
|
||||
*/
|
||||
guint64
|
||||
ges_track_object_get_max_duration (GESTrackObject * object)
|
||||
{
|
||||
g_return_val_if_fail (GES_IS_TRACK_OBJECT (object), 0);
|
||||
|
||||
return object->priv->maxduration;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_set_max_duration:
|
||||
* @object: The #GESTrackObject to retrieve max duration from
|
||||
* @maxduration: The maximum duration of @object
|
||||
*
|
||||
* Returns: Set the max duration of @object
|
||||
*
|
||||
* Since: 0.10.XX
|
||||
*/
|
||||
void
|
||||
ges_track_object_set_max_duration (GESTrackObject * object, guint64 maxduration)
|
||||
_deep_copy (GESTimelineElement * element, GESTimelineElement * elementcopy)
|
||||
{
|
||||
g_return_if_fail (GES_IS_TRACK_OBJECT (object));
|
||||
|
||||
object->priv->maxduration = maxduration;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_copy:
|
||||
* @object: The #GESTrackObject to copy
|
||||
* @deep: whether we want to create the gnlobject and copy it properties
|
||||
*
|
||||
* Copies @object
|
||||
*
|
||||
* Returns: (transfer floating): The newly create #GESTrackObject, copied from @object
|
||||
*
|
||||
* Since: 0.10.XX
|
||||
*/
|
||||
GESTrackObject *
|
||||
ges_track_object_copy (GESTrackObject * object, gboolean deep)
|
||||
{
|
||||
GESTrackObject *ret = NULL;
|
||||
GParameter *params;
|
||||
GParamSpec **specs;
|
||||
guint n, n_specs, n_params;
|
||||
guint n, n_specs;
|
||||
GValue val = { 0 };
|
||||
GESTrackObject *copy = GES_TRACK_OBJECT (elementcopy);
|
||||
|
||||
g_return_val_if_fail (GES_IS_TRACK_OBJECT (object), NULL);
|
||||
|
||||
ensure_gnl_object (copy);
|
||||
specs =
|
||||
g_object_class_list_properties (G_OBJECT_GET_CLASS (object), &n_specs);
|
||||
params = g_new0 (GParameter, n_specs);
|
||||
n_params = 0;
|
||||
|
||||
for (n = 0; n < n_specs; ++n) {
|
||||
if (g_strcmp0 (specs[n]->name, "parent") &&
|
||||
(specs[n]->flags & G_PARAM_READWRITE) == G_PARAM_READWRITE) {
|
||||
params[n_params].name = g_intern_string (specs[n]->name);
|
||||
g_value_init (¶ms[n_params].value, specs[n]->value_type);
|
||||
g_object_get_property (G_OBJECT (object), specs[n]->name,
|
||||
¶ms[n_params].value);
|
||||
++n_params;
|
||||
}
|
||||
}
|
||||
|
||||
ret = g_object_newv (G_TYPE_FROM_INSTANCE (object), n_params, params);
|
||||
g_free (specs);
|
||||
g_free (params);
|
||||
specs = NULL;
|
||||
params = NULL;
|
||||
|
||||
if (deep == FALSE)
|
||||
return ret;
|
||||
|
||||
ensure_gnl_object (ret);
|
||||
specs = ges_track_object_list_children_properties (object, &n_specs);
|
||||
ges_track_object_list_children_properties (GES_TRACK_OBJECT (element),
|
||||
&n_specs);
|
||||
for (n = 0; n < n_specs; ++n) {
|
||||
g_value_init (&val, specs[n]->value_type);
|
||||
g_object_get_property (G_OBJECT (object), specs[n]->name, &val);
|
||||
ges_track_object_set_child_property_by_pspec (ret, specs[n], &val);
|
||||
g_object_get_property (G_OBJECT (element), specs[n]->name, &val);
|
||||
ges_track_object_set_child_property_by_pspec (copy, specs[n], &val);
|
||||
g_value_unset (&val);
|
||||
}
|
||||
|
||||
g_free (specs);
|
||||
g_free (params);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,30 +46,6 @@ G_BEGIN_DECLS
|
|||
#define GES_TRACK_OBJECT_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_OBJECT, GESTrackObjectClass))
|
||||
|
||||
/**
|
||||
* GES_TRACK_OBJECT_START:
|
||||
* @obj: a #GESTrackObject
|
||||
*
|
||||
* The start position of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TRACK_OBJECT_START(obj) (((GESTrackObject*)obj)->start)
|
||||
|
||||
/**
|
||||
* GES_TRACK_OBJECT_INPOINT:
|
||||
* @obj: a #GESTrackObject
|
||||
*
|
||||
* The in-point of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TRACK_OBJECT_INPOINT(obj) (((GESTrackObject*)obj)->inpoint)
|
||||
|
||||
/**
|
||||
* GES_TRACK_OBJECT_DURATION:
|
||||
* @obj: a #GESTrackObject
|
||||
*
|
||||
* The duration position of the object (in nanoseconds).
|
||||
*/
|
||||
#define GES_TRACK_OBJECT_DURATION(obj) (((GESTrackObject*)obj)->duration)
|
||||
|
||||
typedef struct _GESTrackObjectPrivate GESTrackObjectPrivate;
|
||||
|
||||
/**
|
||||
|
@ -78,13 +54,9 @@ typedef struct _GESTrackObjectPrivate GESTrackObjectPrivate;
|
|||
* The GESTrackObject base class.
|
||||
*/
|
||||
struct _GESTrackObject {
|
||||
GInitiallyUnowned parent;
|
||||
GESTimelineElement parent;
|
||||
|
||||
/*< private >*/
|
||||
guint64 start;
|
||||
guint64 inpoint;
|
||||
guint64 duration;
|
||||
guint32 priority;
|
||||
gboolean active;
|
||||
|
||||
GESTrackObjectPrivate *priv;
|
||||
|
@ -100,10 +72,7 @@ struct _GESTrackObject {
|
|||
* @gnlobject_factorytype: name of the GNonLin GStElementFactory type to use.
|
||||
* @create_gnl_object: method to create the GNonLin container object.
|
||||
* @create_element: method to return the GstElement to put in the gnlobject.
|
||||
* @start_changed: start property of gnlobject has changed
|
||||
* @media_start_changed: media-start property of gnlobject has changed
|
||||
* @duration_changed: duration property glnobject has changed
|
||||
* @gnl_priority_changed: duration property glnobject has changed
|
||||
* @active_changed: active property of gnlobject has changed
|
||||
* @get_props_hastable: method to list children properties that user could like
|
||||
* to configure. Since: 0.10.2
|
||||
|
@ -118,7 +87,7 @@ struct _GESTrackObject {
|
|||
*/
|
||||
struct _GESTrackObjectClass {
|
||||
/*< private >*/
|
||||
GInitiallyUnownedClass parent_class;
|
||||
GESTimelineElementClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* virtual methods for subclasses */
|
||||
|
@ -126,9 +95,6 @@ struct _GESTrackObjectClass {
|
|||
GstElement* (*create_gnl_object) (GESTrackObject * object);
|
||||
GstElement* (*create_element) (GESTrackObject * object);
|
||||
|
||||
void (*start_changed) (GESTrackObject *object, guint64 start);
|
||||
void (*media_start_changed) (GESTrackObject *object, guint64 media_start);
|
||||
void (*gnl_priority_changed) (GESTrackObject *object, guint priority);
|
||||
void (*duration_changed) (GESTrackObject *object, guint64 duration);
|
||||
void (*active_changed) (GESTrackObject *object, gboolean active);
|
||||
|
||||
|
@ -170,29 +136,9 @@ void ges_track_object_set_locked (GESTrackObject * object,
|
|||
|
||||
gboolean ges_track_object_is_locked (GESTrackObject * object);
|
||||
|
||||
void ges_track_object_set_start (GESTrackObject * object,
|
||||
guint64 start);
|
||||
|
||||
void ges_track_object_set_inpoint (GESTrackObject * object,
|
||||
guint64 inpoint);
|
||||
|
||||
void ges_track_object_set_duration (GESTrackObject * object,
|
||||
guint64 duration);
|
||||
|
||||
void ges_track_object_set_max_duration (GESTrackObject * object,
|
||||
guint64 maxduration);
|
||||
|
||||
void ges_track_object_set_priority (GESTrackObject * object,
|
||||
guint32 priority);
|
||||
|
||||
gboolean ges_track_object_set_active (GESTrackObject * object,
|
||||
gboolean active);
|
||||
|
||||
guint64 ges_track_object_get_start (GESTrackObject * object);
|
||||
guint64 ges_track_object_get_inpoint (GESTrackObject * object);
|
||||
guint64 ges_track_object_get_duration (GESTrackObject * object);
|
||||
guint64 ges_track_object_get_max_duration (GESTrackObject * object);
|
||||
guint32 ges_track_object_get_priority (GESTrackObject * object);
|
||||
gboolean ges_track_object_is_active (GESTrackObject * object);
|
||||
|
||||
GParamSpec **
|
||||
|
@ -232,9 +178,6 @@ void ges_track_object_set_child_properties (GESTrackObject * object,
|
|||
const gchar * first_property_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
GESTrackObject * ges_track_object_copy (GESTrackObject * object,
|
||||
gboolean deep);
|
||||
|
||||
gboolean ges_track_object_set_child_property (GESTrackObject *object,
|
||||
const gchar *property_name,
|
||||
GValue * value);
|
||||
|
|
|
@ -192,8 +192,8 @@ update_gaps (GESTrack * track)
|
|||
g_sequence_iter_is_end (it) == FALSE; it = g_sequence_iter_next (it)) {
|
||||
tckobj = g_sequence_get (it);
|
||||
|
||||
start = GES_TRACK_OBJECT_START (tckobj);
|
||||
end = start + GES_TRACK_OBJECT_DURATION (tckobj);
|
||||
start = _START (tckobj);
|
||||
end = start + _DURATION (tckobj);
|
||||
|
||||
if (start > duration) {
|
||||
/* 3- Fill gap */
|
||||
|
@ -206,7 +206,7 @@ update_gaps (GESTrack * track)
|
|||
duration = MAX (duration, end);
|
||||
}
|
||||
|
||||
/* 4- Add a gap at the end of the timeline if needed */
|
||||
/* 3- Add a gap at the end of the timeline if needed */
|
||||
if (priv->timeline) {
|
||||
g_object_get (priv->timeline, "duration", &timeline_duration, NULL);
|
||||
|
||||
|
@ -227,7 +227,7 @@ static inline void
|
|||
resort_and_fill_gaps (GESTrack * track)
|
||||
{
|
||||
g_sequence_sort (track->priv->tckobjs_by_start,
|
||||
(GCompareDataFunc) track_object_start_compare, NULL);
|
||||
(GCompareDataFunc) element_start_compare, NULL);
|
||||
|
||||
if (track->priv->updating == TRUE) {
|
||||
update_gaps (track);
|
||||
|
@ -749,7 +749,7 @@ ges_track_add_object (GESTrack * track, GESTrackObject * object)
|
|||
g_object_ref_sink (object);
|
||||
g_hash_table_insert (track->priv->tckobjs_iter, object,
|
||||
g_sequence_insert_sorted (track->priv->tckobjs_by_start, object,
|
||||
(GCompareDataFunc) track_object_start_compare, NULL));
|
||||
(GCompareDataFunc) element_start_compare, NULL));
|
||||
|
||||
g_signal_emit (track, ges_track_signals[TRACK_OBJECT_ADDED], 0,
|
||||
GES_TRACK_OBJECT (object));
|
||||
|
|
|
@ -41,6 +41,9 @@ typedef struct _GESTimelineClass GESTimelineClass;
|
|||
typedef struct _GESTimelineLayer GESTimelineLayer;
|
||||
typedef struct _GESTimelineLayerClass GESTimelineLayerClass;
|
||||
|
||||
typedef struct _GESTimelineElementClass GESTimelineElementClass;
|
||||
typedef struct _GESTimelineElement GESTimelineElement;
|
||||
|
||||
typedef struct _GESTimelineObject GESTimelineObject;
|
||||
typedef struct _GESTimelineObjectClass GESTimelineObjectClass;
|
||||
|
||||
|
|
|
@ -61,28 +61,7 @@ ges_timeline_new_audio_video (void)
|
|||
|
||||
/* Internal utilities */
|
||||
gint
|
||||
track_object_start_compare (GESTrackObject * a, GESTrackObject * b)
|
||||
{
|
||||
if (a->start == b->start) {
|
||||
if (a->priority < b->priority)
|
||||
return -1;
|
||||
if (a->priority > b->priority)
|
||||
return 1;
|
||||
if (a->duration < b->duration)
|
||||
return -1;
|
||||
if (a->duration > b->duration)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
if (a->start < b->start)
|
||||
return -1;
|
||||
if (a->start > b->start)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
gint
|
||||
timeline_object_start_compare (GESTimelineObject * a, GESTimelineObject * b)
|
||||
element_start_compare (GESTimelineElement * a, GESTimelineElement * b)
|
||||
{
|
||||
if (a->start == b->start) {
|
||||
if (a->priority < b->priority)
|
||||
|
|
|
@ -867,8 +867,8 @@ _save_layers (GString * str, GESTimeline * timeline)
|
|||
G_GUINT64_FORMAT "' rate='%d' properties='%s' >\n", nbtlobjs,
|
||||
ges_extractable_get_id (GES_EXTRACTABLE (tlobj)),
|
||||
g_type_name (G_OBJECT_TYPE (tlobj)), priority,
|
||||
ges_timeline_object_get_supported_formats (tlobj), tlobj->start,
|
||||
tlobj->duration, tlobj->inpoint, 0, properties);
|
||||
ges_timeline_object_get_supported_formats (tlobj), _START (tlobj),
|
||||
_DURATION (tlobj), _INPOINT (tlobj), 0, properties);
|
||||
g_free (properties);
|
||||
|
||||
for (tmpeffect = effects; tmpeffect; tmpeffect = tmpeffect->next)
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <ges/ges-timeline.h>
|
||||
#include <ges/ges-timeline-layer.h>
|
||||
#include <ges/ges-simple-timeline-layer.h>
|
||||
#include <ges/ges-timeline-element.h>
|
||||
#include <ges/ges-timeline-object.h>
|
||||
#include <ges/ges-timeline-pipeline.h>
|
||||
#include <ges/ges-timeline-source.h>
|
||||
|
|
|
@ -53,9 +53,9 @@ GST_START_TEST (test_test_source_properties)
|
|||
/* Set some properties */
|
||||
g_object_set (object, "start", (guint64) 42, "duration", (guint64) 51,
|
||||
"in-point", (guint64) 12, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 51);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 51);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -63,9 +63,9 @@ GST_START_TEST (test_test_source_properties)
|
|||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
|
||||
|
@ -74,12 +74,12 @@ GST_START_TEST (test_test_source_properties)
|
|||
/* Change more properties, see if they propagate */
|
||||
g_object_set (object, "start", (guint64) 420, "duration", (guint64) 510,
|
||||
"in-point", (guint64) 120, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 420);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 510);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 120);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 420);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 120);
|
||||
assert_equals_uint64 (_START (object), 420);
|
||||
assert_equals_uint64 (_DURATION (object), 510);
|
||||
assert_equals_uint64 (_INPOINT (object), 120);
|
||||
assert_equals_uint64 (_START (trackobject), 420);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 120);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
|
||||
|
@ -256,8 +256,8 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
|
||||
/* Set some properties */
|
||||
g_object_set (object, "start", (guint64) 0, "duration", (guint64) 5, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 0);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 5);
|
||||
assert_equals_uint64 (_START (object), 0);
|
||||
assert_equals_uint64 (_DURATION (object), 5);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -268,8 +268,8 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
fail_unless (gnlsrc != NULL);
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 0);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 5);
|
||||
assert_equals_uint64 (_START (trackobject), 0);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 5);
|
||||
|
||||
/* Check no gap were wrongly added */
|
||||
assert_equals_int (g_list_length (GST_BIN_CHILDREN (composition)), 1);
|
||||
|
@ -278,8 +278,8 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
fail_unless (object1 != NULL);
|
||||
|
||||
g_object_set (object1, "start", (guint64) 15, "duration", (guint64) 5, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object1), 15);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object1), 5);
|
||||
assert_equals_uint64 (_START (object1), 15);
|
||||
assert_equals_uint64 (_DURATION (object1), 5);
|
||||
|
||||
trackobject1 = ges_timeline_object_create_track_object (object1, track->type);
|
||||
ges_timeline_object_add_track_object (object1, trackobject1);
|
||||
|
@ -289,8 +289,8 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
fail_unless (gnlsrc1 != NULL);
|
||||
|
||||
/* Check that trackobject1 has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject1), 15);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject1), 5);
|
||||
assert_equals_uint64 (_START (trackobject1), 15);
|
||||
assert_equals_uint64 (_DURATION (trackobject1), 5);
|
||||
|
||||
/* Check the gap as properly been added */
|
||||
assert_equals_int (g_list_length (GST_BIN_CHILDREN (composition)), 3);
|
||||
|
@ -312,8 +312,8 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
ges_timeline_object_add_track_object (object2, trackobject2);
|
||||
fail_unless (ges_track_add_object (track, trackobject2));
|
||||
fail_unless (trackobject2 != NULL);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject2), 35);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject2), 5);
|
||||
assert_equals_uint64 (_START (trackobject2), 35);
|
||||
assert_equals_uint64 (_DURATION (trackobject2), 5);
|
||||
assert_equals_int (g_list_length (GST_BIN_CHILDREN (composition)), 5);
|
||||
|
||||
gst_object_unref (track);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "test-utils.h"
|
||||
#include <ges/ges.h>
|
||||
#include <gst/check/gstcheck.h>
|
||||
|
||||
|
@ -288,13 +289,11 @@ GST_START_TEST (test_priorities_tl_object)
|
|||
fail_unless (ges_timeline_object_set_top_effect_priority (GES_TIMELINE_OBJECT
|
||||
(tl_effect), GES_TRACK_EFFECT (tck_effect1), 0));
|
||||
|
||||
fail_unless (ges_track_object_get_priority (GES_TRACK_OBJECT (tck_effect)) ==
|
||||
3);
|
||||
fail_unless (_PRIORITY (tck_effect), 3);
|
||||
|
||||
fail_unless (ges_timeline_object_set_top_effect_priority (GES_TIMELINE_OBJECT
|
||||
(tl_effect), GES_TRACK_EFFECT (tck_effect1), 3));
|
||||
fail_unless (ges_track_object_get_priority (GES_TRACK_OBJECT (tck_effect)) ==
|
||||
2);
|
||||
fail_unless (_PRIORITY (tck_effect) == 2);
|
||||
|
||||
g_object_get (tl_effect, "height", &tl_object_height, NULL);
|
||||
fail_unless (tl_object_height == 4);
|
||||
|
|
|
@ -48,7 +48,7 @@ asset_created_cb (GObject * source, GAsyncResult * res, gpointer udata)
|
|||
asset, 0, 0, GST_CLOCK_TIME_NONE, 1, GES_TRACK_TYPE_UNKNOWN));
|
||||
fail_unless (GES_IS_TIMELINE_FILE_SOURCE (tlfs));
|
||||
fail_if (g_strcmp0 (ges_timeline_filesource_get_uri (tlfs), av_uri));
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tlfs), GST_SECOND);
|
||||
assert_equals_uint64 (_DURATION (tlfs), GST_SECOND);
|
||||
|
||||
fail_unless (ges_timeline_object_get_supported_formats
|
||||
(GES_TIMELINE_OBJECT (tlfs)) & GES_TRACK_TYPE_VIDEO);
|
||||
|
@ -130,9 +130,9 @@ GST_START_TEST (test_filesource_properties)
|
|||
g_object_set (object, "start", (guint64) 42, "duration", (guint64) 51,
|
||||
"in-point", (guint64) 12, "supported-formats", GES_TRACK_TYPE_AUDIO,
|
||||
NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 51);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 51);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -140,9 +140,9 @@ GST_START_TEST (test_filesource_properties)
|
|||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
|
||||
|
@ -151,12 +151,12 @@ GST_START_TEST (test_filesource_properties)
|
|||
/* Change more properties, see if they propagate */
|
||||
g_object_set (object, "start", (guint64) 420, "duration", (guint64) 510,
|
||||
"in-point", (guint64) 120, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 420);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 510);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 120);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 420);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 120);
|
||||
assert_equals_uint64 (_START (object), 420);
|
||||
assert_equals_uint64 (_DURATION (object), 510);
|
||||
assert_equals_uint64 (_INPOINT (object), 120);
|
||||
assert_equals_uint64 (_START (trackobject), 420);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 120);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -53,9 +53,9 @@ GST_START_TEST (test_overlay_properties)
|
|||
/* Set some properties */
|
||||
g_object_set (object, "start", (guint64) 42, "duration", (guint64) 51,
|
||||
"in-point", (guint64) 12, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 51);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 51);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -63,9 +63,9 @@ GST_START_TEST (test_overlay_properties)
|
|||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
|
||||
|
@ -74,12 +74,12 @@ GST_START_TEST (test_overlay_properties)
|
|||
/* Change more properties, see if they propagate */
|
||||
g_object_set (object, "start", (guint64) 420, "duration", (guint64) 510,
|
||||
"in-point", (guint64) 120, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 420);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 510);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 120);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 420);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 120);
|
||||
assert_equals_uint64 (_START (object), 420);
|
||||
assert_equals_uint64 (_DURATION (object), 510);
|
||||
assert_equals_uint64 (_INPOINT (object), 120);
|
||||
assert_equals_uint64 (_START (trackobject), 420);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 120);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "test-utils.h"
|
||||
#include <ges/ges.h>
|
||||
#include <gst/check/gstcheck.h>
|
||||
|
||||
|
@ -82,15 +83,15 @@ GST_START_TEST (test_gsl_add)
|
|||
source = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||
fail_unless (source != NULL);
|
||||
g_object_set (source, "duration", GST_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source), GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source), 42);
|
||||
fail_unless_equals_uint64 (_DURATION (source), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source), 42);
|
||||
|
||||
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
|
||||
(layer), GES_TIMELINE_OBJECT (source), -1));
|
||||
fail_unless (ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (source)) ==
|
||||
layer);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source), GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source), 0);
|
||||
fail_unless_equals_uint64 (_DURATION (source), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source), 0);
|
||||
|
||||
/* test nth */
|
||||
source2 =
|
||||
|
@ -157,47 +158,45 @@ GST_START_TEST (test_gsl_move_simple)
|
|||
/* Create two 1s sources */
|
||||
source1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||
g_object_set (source1, "duration", GST_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
|
||||
source2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||
g_object_set (source2, "duration", GST_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (source2), GST_SECOND);
|
||||
|
||||
/* Add source to any position */
|
||||
GST_DEBUG ("Adding the source to the timeline layer");
|
||||
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
|
||||
(layer), GES_TIMELINE_OBJECT (source1), -1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
|
||||
/* Add source2 to the end */
|
||||
GST_DEBUG ("Adding the source to the timeline layer");
|
||||
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
|
||||
(layer), GES_TIMELINE_OBJECT (source2), -1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_START (source2), GST_SECOND);
|
||||
|
||||
/* Move source2 before source 1 (newpos:0) */
|
||||
fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
|
||||
(layer), GES_TIMELINE_OBJECT (source2), 0));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
|
||||
fail_unless_equals_uint64 (_START (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source2), 0);
|
||||
fail_unless_equals_int (info.new, 0);
|
||||
fail_unless_equals_int (info.old, 1);
|
||||
|
||||
/* Move source2 after source 1 (newpos:0) */
|
||||
fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
|
||||
(layer), GES_TIMELINE_OBJECT (source2), 1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_START (source2), GST_SECOND);
|
||||
fail_unless_equals_int (info.new, 1);
|
||||
fail_unless_equals_int (info.old, 0);
|
||||
|
||||
/* Move source1 to end (newpos:-1) */
|
||||
fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
|
||||
(layer), GES_TIMELINE_OBJECT (source1), -1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
|
||||
fail_unless_equals_uint64 (_START (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source2), 0);
|
||||
/* position will be decremented, this is expected */
|
||||
fail_unless_equals_int (info.new, -1);
|
||||
fail_unless_equals_int (info.old, 0);
|
||||
|
@ -206,20 +205,20 @@ GST_START_TEST (test_gsl_move_simple)
|
|||
g_object_ref (source1);
|
||||
fail_unless (ges_timeline_layer_remove_object (layer,
|
||||
GES_TIMELINE_OBJECT (source1)));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
|
||||
fail_unless_equals_uint64 (_START (source2), 0);
|
||||
|
||||
g_object_set (source1, "start", (guint64) 42, NULL);
|
||||
|
||||
/* re-add source1... using the normal API, it should be added to the end */
|
||||
fail_unless (ges_timeline_layer_add_object (layer,
|
||||
GES_TIMELINE_OBJECT (source1)));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source2), 0);
|
||||
fail_unless_equals_uint64 (_START (source1), GST_SECOND);
|
||||
|
||||
/* remove source1 ... */
|
||||
fail_unless (ges_timeline_layer_remove_object (layer,
|
||||
GES_TIMELINE_OBJECT (source1)));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
|
||||
fail_unless_equals_uint64 (_START (source2), 0);
|
||||
/* ... and source2 */
|
||||
fail_unless (ges_timeline_layer_remove_object (layer,
|
||||
GES_TIMELINE_OBJECT (source2)));
|
||||
|
@ -273,8 +272,7 @@ GST_START_TEST (test_gsl_with_transitions)
|
|||
source1 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
|
||||
(gpointer) ELEMENT);
|
||||
g_object_set (source1, "duration", GST_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
|
||||
|
||||
/* make this source taller than the others, so we can check that
|
||||
* gstlrecalculate handles this properly */
|
||||
|
@ -283,20 +281,17 @@ GST_START_TEST (test_gsl_with_transitions)
|
|||
(gpointer) ELEMENT);
|
||||
g_object_set (source2, "duration", GST_SECOND, "start", (guint64) 42, NULL);
|
||||
GES_TIMELINE_OBJECT (source2)->height = 4;
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (source2), GST_SECOND);
|
||||
|
||||
source3 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
|
||||
(gpointer) ELEMENT);
|
||||
g_object_set (source3, "duration", GST_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source3),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (source3), GST_SECOND);
|
||||
|
||||
source4 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
|
||||
(gpointer) ELEMENT);
|
||||
g_object_set (source4, "duration", GST_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source4),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (source4), GST_SECOND);
|
||||
|
||||
/* create half-second transitions */
|
||||
|
||||
|
@ -307,31 +302,31 @@ GST_START_TEST (test_gsl_with_transitions)
|
|||
ges_timeline_standard_transition_new
|
||||
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
|
||||
g_object_set (tr1, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (tr1), HALF_SECOND);
|
||||
|
||||
tr2 =
|
||||
ges_timeline_standard_transition_new
|
||||
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
|
||||
g_object_set (tr2, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (tr2), HALF_SECOND);
|
||||
|
||||
tr3 =
|
||||
ges_timeline_standard_transition_new
|
||||
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
|
||||
g_object_set (tr3, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr3), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (tr3), HALF_SECOND);
|
||||
|
||||
tr4 =
|
||||
ges_timeline_standard_transition_new
|
||||
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
|
||||
g_object_set (tr4, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr4), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (tr4), HALF_SECOND);
|
||||
|
||||
tr5 =
|
||||
ges_timeline_standard_transition_new
|
||||
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
|
||||
g_object_set (tr5, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr5), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_DURATION (tr5), HALF_SECOND);
|
||||
|
||||
/* simple test scenario with several sources in layer */
|
||||
/* [0 0.5 1 1.5 2 2.5 3] */
|
||||
|
@ -354,38 +349,34 @@ GST_START_TEST (test_gsl_with_transitions)
|
|||
|
||||
fail_unless (ges_simple_timeline_layer_add_object (gstl,
|
||||
GES_TIMELINE_OBJECT (source1), -1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
|
||||
|
||||
GST_DEBUG ("Adding tr1");
|
||||
|
||||
fail_unless (ges_simple_timeline_layer_add_object (gstl,
|
||||
GES_TIMELINE_OBJECT (tr1), -1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (tr1), 1);
|
||||
|
||||
GST_DEBUG ("Adding source2");
|
||||
|
||||
fail_unless (ges_simple_timeline_layer_add_object (gstl,
|
||||
GES_TIMELINE_OBJECT (source2), -1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source2), 3);
|
||||
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (_DURATION (source2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source2), 3);
|
||||
|
||||
/* add the third source before the second transition */
|
||||
|
||||
|
@ -393,21 +384,18 @@ GST_START_TEST (test_gsl_with_transitions)
|
|||
|
||||
fail_unless (ges_simple_timeline_layer_add_object (gstl,
|
||||
GES_TIMELINE_OBJECT (source3), -1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source2), 3);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source3),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source3), SECOND (1.5));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source3), 7);
|
||||
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (_DURATION (source2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source2), 3);
|
||||
fail_unless_equals_uint64 (_DURATION (source3), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source3), SECOND (1.5));
|
||||
fail_unless_equals_uint64 (_PRIORITY (source3), 7);
|
||||
|
||||
/* now add the second transition */
|
||||
|
||||
|
@ -415,24 +403,21 @@ GST_START_TEST (test_gsl_with_transitions)
|
|||
|
||||
fail_unless (ges_simple_timeline_layer_add_object (gstl,
|
||||
GES_TIMELINE_OBJECT (tr2), 3));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source2), 3);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr2), 2);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source3),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source3), GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source3), 7);
|
||||
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (_DURATION (source2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source2), 3);
|
||||
fail_unless_equals_uint64 (_DURATION (tr2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_START (tr2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (tr2), 2);
|
||||
fail_unless_equals_uint64 (_DURATION (source3), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source3), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source3), 7);
|
||||
|
||||
/* fourth source */
|
||||
|
||||
|
@ -440,28 +425,24 @@ GST_START_TEST (test_gsl_with_transitions)
|
|||
|
||||
fail_unless (ges_simple_timeline_layer_add_object (gstl,
|
||||
GES_TIMELINE_OBJECT (source4), -1));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source2), 3);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr2), 2);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source3),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source3), GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source3), 7);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source4),
|
||||
GST_SECOND);
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source4), SECOND (2));
|
||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source4), 8);
|
||||
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source1), 0);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
|
||||
fail_unless_equals_uint64 (_DURATION (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_START (tr1), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (tr1), 1);
|
||||
fail_unless_equals_uint64 (_DURATION (source2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source2), 3);
|
||||
fail_unless_equals_uint64 (_DURATION (tr2), HALF_SECOND);
|
||||
fail_unless_equals_uint64 (_START (tr2), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (tr2), 2);
|
||||
fail_unless_equals_uint64 (_DURATION (source3), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source3), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_PRIORITY (source3), 7);
|
||||
fail_unless_equals_uint64 (_DURATION (source4), GST_SECOND);
|
||||
fail_unless_equals_uint64 (_START (source4), SECOND (2));
|
||||
fail_unless_equals_uint64 (_PRIORITY (source4), 8);
|
||||
|
||||
/* check that any insertion which might result in two adjacent transitions
|
||||
* will fail */
|
||||
|
|
|
@ -73,4 +73,9 @@ G_STMT_START { \
|
|||
g_type_name (type)); \
|
||||
} G_STMT_END;
|
||||
|
||||
#define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
|
||||
#define _DURATION(obj) GES_TIMELINE_ELEMENT_DURATION (obj)
|
||||
#define _INPOINT(obj) GES_TIMELINE_ELEMENT_INPOINT (obj)
|
||||
#define _PRIORITY(obj) GES_TIMELINE_ELEMENT_PRIORITY (obj)
|
||||
|
||||
#endif /* _GES_TEST_UTILS */
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "test-utils.h"
|
||||
#include <ges/ges.h>
|
||||
#include <gst/check/gstcheck.h>
|
||||
|
||||
|
@ -48,9 +49,9 @@ create_custom_tlobj (void)
|
|||
}
|
||||
|
||||
#define CHECK_OBJECT_PROPS(obj, start, inpoint, duration) {\
|
||||
assert_equals_uint64 (ges_track_object_get_start (obj), start);\
|
||||
assert_equals_uint64 (ges_track_object_get_inpoint (obj), inpoint);\
|
||||
assert_equals_uint64 (ges_track_object_get_duration (obj), duration);\
|
||||
assert_equals_uint64 (_START (obj), start);\
|
||||
assert_equals_uint64 (_INPOINT (obj), inpoint);\
|
||||
assert_equals_uint64 (_DURATION (obj), duration);\
|
||||
}
|
||||
|
||||
GST_START_TEST (test_basic_timeline_edition)
|
||||
|
@ -95,19 +96,19 @@ GST_START_TEST (test_basic_timeline_edition)
|
|||
fail_unless (tckobj != NULL);
|
||||
fail_unless (ges_timeline_object_add_track_object (obj, tckobj));
|
||||
fail_unless (ges_track_add_object (track, tckobj));
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj), 10);
|
||||
assert_equals_uint64 (_DURATION (tckobj), 10);
|
||||
|
||||
tckobj1 = ges_timeline_object_create_track_object (obj1, track->type);
|
||||
fail_unless (tckobj1 != NULL);
|
||||
fail_unless (ges_timeline_object_add_track_object (obj1, tckobj1));
|
||||
fail_unless (ges_track_add_object (track, tckobj1));
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj1), 10);
|
||||
assert_equals_uint64 (_DURATION (tckobj1), 10);
|
||||
|
||||
tckobj2 = ges_timeline_object_create_track_object (obj2, track->type);
|
||||
fail_unless (ges_timeline_object_add_track_object (obj2, tckobj2));
|
||||
fail_unless (tckobj2 != NULL);
|
||||
fail_unless (ges_track_add_object (track, tckobj2));
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj2), 60);
|
||||
assert_equals_uint64 (_DURATION (tckobj2), 60);
|
||||
|
||||
/**
|
||||
* Simple rippling obj to: 10
|
||||
|
@ -298,7 +299,7 @@ GST_START_TEST (test_snapping)
|
|||
fail_unless ((tckobjs = ges_timeline_object_get_track_objects (obj)) != NULL);
|
||||
fail_unless ((tckobj = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
|
||||
fail_unless (ges_track_object_get_track (tckobj) == track);
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj), 37);
|
||||
assert_equals_uint64 (_DURATION (tckobj), 37);
|
||||
g_list_free_full (tckobjs, g_object_unref);
|
||||
|
||||
/* We have 3 references to tckobj from:
|
||||
|
@ -313,7 +314,7 @@ GST_START_TEST (test_snapping)
|
|||
ges_timeline_object_get_track_objects (obj1)) != NULL);
|
||||
fail_unless ((tckobj1 = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
|
||||
fail_unless (ges_track_object_get_track (tckobj1) == track);
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj1), 15);
|
||||
assert_equals_uint64 (_DURATION (tckobj1), 15);
|
||||
g_list_free_full (tckobjs, g_object_unref);
|
||||
|
||||
/* Same ref logic */
|
||||
|
@ -325,7 +326,7 @@ GST_START_TEST (test_snapping)
|
|||
ges_timeline_object_get_track_objects (obj2)) != NULL);
|
||||
fail_unless ((tckobj2 = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
|
||||
fail_unless (ges_track_object_get_track (tckobj2) == track);
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj2), 60);
|
||||
assert_equals_uint64 (_DURATION (tckobj2), 60);
|
||||
g_list_free_full (tckobjs, g_object_unref);
|
||||
|
||||
/* Same ref logic */
|
||||
|
@ -356,7 +357,7 @@ GST_START_TEST (test_snapping)
|
|||
* time 20----------30
|
||||
*/
|
||||
g_object_set (timeline, "snapping-distance", (guint64) 0, NULL);
|
||||
ges_timeline_object_set_duration (obj1, 10);
|
||||
ges_timeline_element_set_duration (GES_TIMELINE_ELEMENT (obj1), 10);
|
||||
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
|
||||
CHECK_OBJECT_PROPS (tckobj2, 62, 0, 60);
|
||||
|
@ -372,8 +373,9 @@ GST_START_TEST (test_snapping)
|
|||
* time 20---------------------- 72 --------122
|
||||
*/
|
||||
/* Rolling involves only neighbour that are currently snapping */
|
||||
fail_unless (ges_timeline_object_roll_end (obj1, 62));
|
||||
fail_unless (ges_timeline_object_roll_end (obj1, 72) == TRUE);
|
||||
fail_unless (ges_timeline_element_roll_end (GES_TIMELINE_ELEMENT (obj1), 62));
|
||||
fail_unless (ges_timeline_element_roll_end (GES_TIMELINE_ELEMENT (obj1),
|
||||
72) == TRUE);
|
||||
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 52);
|
||||
CHECK_OBJECT_PROPS (tckobj2, 72, 10, 50);
|
||||
|
@ -387,7 +389,8 @@ GST_START_TEST (test_snapping)
|
|||
* time 25------------- 72 --------122
|
||||
*/
|
||||
g_object_set (timeline, "snapping-distance", (guint64) 4, NULL);
|
||||
fail_unless (ges_timeline_object_trim_start (obj1, 28) == TRUE);
|
||||
fail_unless (ges_timeline_element_trim (GES_TIMELINE_ELEMENT (obj1),
|
||||
28) == TRUE);
|
||||
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj1, 25, 5, 47);
|
||||
CHECK_OBJECT_PROPS (tckobj2, 72, 10, 50);
|
||||
|
@ -400,7 +403,8 @@ GST_START_TEST (test_snapping)
|
|||
* | obj1 || obj2 |
|
||||
* time 25-------- 62 --------122
|
||||
*/
|
||||
fail_unless (ges_timeline_object_roll_start (obj2, 59) == TRUE);
|
||||
fail_unless (ges_timeline_element_roll_start (GES_TIMELINE_ELEMENT (obj2),
|
||||
59) == TRUE);
|
||||
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj1, 25, 5, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj2, 62, 0, 60);
|
||||
|
@ -410,7 +414,8 @@ GST_START_TEST (test_snapping)
|
|||
* | obj || obj1 || obj2 |
|
||||
* time 25---------62-------- 99 --------170
|
||||
*/
|
||||
fail_unless (ges_timeline_object_ripple (obj1, 58) == TRUE);
|
||||
fail_unless (ges_timeline_element_ripple (GES_TIMELINE_ELEMENT (obj1),
|
||||
58) == TRUE);
|
||||
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj1, 62, 5, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj2, 99, 0, 60);
|
||||
|
@ -420,7 +425,7 @@ GST_START_TEST (test_snapping)
|
|||
* | obj || obj1 | | obj2 |
|
||||
* time 25---------62-------- 99 110--------170
|
||||
*/
|
||||
ges_timeline_object_set_start (obj2, 110);
|
||||
ges_timeline_element_set_start (GES_TIMELINE_ELEMENT (obj2), 110);
|
||||
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj1, 62, 5, 37);
|
||||
CHECK_OBJECT_PROPS (tckobj2, 110, 0, 60);
|
||||
|
@ -542,7 +547,7 @@ GST_START_TEST (test_timeline_edition_mode)
|
|||
fail_unless ((tckobjs = ges_timeline_object_get_track_objects (obj)) != NULL);
|
||||
fail_unless ((tckobj = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
|
||||
fail_unless (ges_track_object_get_track (tckobj) == track);
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj), 10);
|
||||
assert_equals_uint64 (_DURATION (tckobj), 10);
|
||||
g_list_free_full (tckobjs, g_object_unref);
|
||||
|
||||
/* Add a new layer and add objects to it */
|
||||
|
@ -555,7 +560,7 @@ GST_START_TEST (test_timeline_edition_mode)
|
|||
ges_timeline_object_get_track_objects (obj1)) != NULL);
|
||||
fail_unless ((tckobj1 = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
|
||||
fail_unless (ges_track_object_get_track (tckobj1) == track);
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj1), 10);
|
||||
assert_equals_uint64 (_DURATION (tckobj1), 10);
|
||||
g_list_free_full (tckobjs, g_object_unref);
|
||||
|
||||
fail_unless (ges_timeline_layer_add_object (layer1, obj2));
|
||||
|
@ -563,7 +568,7 @@ GST_START_TEST (test_timeline_edition_mode)
|
|||
ges_timeline_object_get_track_objects (obj2)) != NULL);
|
||||
fail_unless ((tckobj2 = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
|
||||
fail_unless (ges_track_object_get_track (tckobj2) == track);
|
||||
assert_equals_uint64 (ges_track_object_get_duration (tckobj2), 60);
|
||||
assert_equals_uint64 (_DURATION (tckobj2), 60);
|
||||
g_list_free_full (tckobjs, g_object_unref);
|
||||
|
||||
/**
|
||||
|
|
|
@ -58,9 +58,9 @@ GST_START_TEST (test_object_properties)
|
|||
/* Set some properties */
|
||||
g_object_set (object, "start", (guint64) 42, "duration", (guint64) 51,
|
||||
"in-point", (guint64) 12, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 51);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 51);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -68,9 +68,9 @@ GST_START_TEST (test_object_properties)
|
|||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
|
||||
|
@ -79,12 +79,12 @@ GST_START_TEST (test_object_properties)
|
|||
/* Change more properties, see if they propagate */
|
||||
g_object_set (object, "start", (guint64) 420, "duration", (guint64) 510,
|
||||
"in-point", (guint64) 120, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 420);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 510);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 120);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 420);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 120);
|
||||
assert_equals_uint64 (_START (object), 420);
|
||||
assert_equals_uint64 (_DURATION (object), 510);
|
||||
assert_equals_uint64 (_INPOINT (object), 120);
|
||||
assert_equals_uint64 (_START (trackobject), 420);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 120);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
|
||||
|
@ -94,8 +94,8 @@ GST_START_TEST (test_object_properties)
|
|||
/* This time, we move the trackobject to see if the changes move
|
||||
* along to the parent and the gnonlin object */
|
||||
g_object_set (trackobject, "start", (guint64) 400, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 400);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 400);
|
||||
assert_equals_uint64 (_START (object), 400);
|
||||
assert_equals_uint64 (_START (trackobject), 400);
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 400, 510, 120,
|
||||
510, 0, TRUE);
|
||||
|
||||
|
@ -126,9 +126,9 @@ GST_START_TEST (test_object_properties_unlocked)
|
|||
/* Set some properties */
|
||||
g_object_set (object, "start", (guint64) 42, "duration", (guint64) 51,
|
||||
"in-point", (guint64) 12, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 51);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 51);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -136,9 +136,9 @@ GST_START_TEST (test_object_properties_unlocked)
|
|||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
|
||||
|
@ -150,13 +150,13 @@ GST_START_TEST (test_object_properties_unlocked)
|
|||
/* Change more properties, they will be set on the GESTimelineObject */
|
||||
g_object_set (object, "start", (guint64) 420, "duration", (guint64) 510,
|
||||
"in-point", (guint64) 120, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 420);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 510);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 120);
|
||||
assert_equals_uint64 (_START (object), 420);
|
||||
assert_equals_uint64 (_DURATION (object), 510);
|
||||
assert_equals_uint64 (_INPOINT (object), 120);
|
||||
/* ... but not on the GESTrackObject since it was unlocked... */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
/* ... and neither on the GNonLin object */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
|
||||
51, 0, TRUE);
|
||||
|
@ -166,8 +166,8 @@ GST_START_TEST (test_object_properties_unlocked)
|
|||
/* This time, we move the trackobject to see if the changes move
|
||||
* along to the parent and the gnonlin object */
|
||||
g_object_set (trackobject, "start", (guint64) 400, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 420);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 400);
|
||||
assert_equals_uint64 (_START (object), 420);
|
||||
assert_equals_uint64 (_START (trackobject), 400);
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 400, 51, 12,
|
||||
51, 0, TRUE);
|
||||
|
||||
|
@ -200,9 +200,9 @@ GST_START_TEST (test_split_object)
|
|||
/* Set some properties */
|
||||
g_object_set (object, "start", (guint64) 42, "duration", (guint64) 50,
|
||||
"in-point", (guint64) 12, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 50);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 50);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -210,9 +210,9 @@ GST_START_TEST (test_split_object)
|
|||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 50);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 50);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 50, 12,
|
||||
|
@ -221,22 +221,22 @@ GST_START_TEST (test_split_object)
|
|||
splitobj = ges_timeline_object_split (object, 67);
|
||||
fail_unless (GES_IS_TIMELINE_OBJECT (splitobj));
|
||||
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 25);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 25);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (splitobj), 67);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (splitobj), 25);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (splitobj), 37);
|
||||
assert_equals_uint64 (_START (splitobj), 67);
|
||||
assert_equals_uint64 (_DURATION (splitobj), 25);
|
||||
assert_equals_uint64 (_INPOINT (splitobj), 37);
|
||||
|
||||
splittckobjs = ges_timeline_object_get_track_objects (splitobj);
|
||||
fail_unless_equals_int (g_list_length (splittckobjs), 1);
|
||||
|
||||
splittckobj = GES_TRACK_OBJECT (splittckobjs->data);
|
||||
fail_unless (GES_IS_TRACK_OBJECT (splittckobj));
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (splittckobj), 67);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (splittckobj), 25);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (splittckobj), 37);
|
||||
assert_equals_uint64 (_START (splittckobj), 67);
|
||||
assert_equals_uint64 (_DURATION (splittckobj), 25);
|
||||
assert_equals_uint64 (_INPOINT (splittckobj), 37);
|
||||
|
||||
fail_unless (splittckobj != trackobject);
|
||||
fail_unless (splitobj != object);
|
||||
|
|
|
@ -53,9 +53,9 @@ GST_START_TEST (test_title_source_properties)
|
|||
/* Set some properties */
|
||||
g_object_set (object, "start", (guint64) 42, "duration", (guint64) 51,
|
||||
"in-point", (guint64) 12, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 51);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 51);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -63,9 +63,9 @@ GST_START_TEST (test_title_source_properties)
|
|||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
|
||||
|
@ -74,12 +74,12 @@ GST_START_TEST (test_title_source_properties)
|
|||
/* Change more properties, see if they propagate */
|
||||
g_object_set (object, "start", (guint64) 420, "duration", (guint64) 510,
|
||||
"in-point", (guint64) 120, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 420);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 510);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 120);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 420);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 120);
|
||||
assert_equals_uint64 (_START (object), 420);
|
||||
assert_equals_uint64 (_DURATION (object), 510);
|
||||
assert_equals_uint64 (_INPOINT (object), 120);
|
||||
assert_equals_uint64 (_START (trackobject), 420);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 120);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
|
||||
|
|
|
@ -85,9 +85,9 @@ GST_START_TEST (test_transition_properties)
|
|||
g_object_set (object, "start", (guint64) 42, "duration", (guint64) 51,
|
||||
"in-point", (guint64) 12, NULL);
|
||||
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 42);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 51);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
assert_equals_uint64 (_START (object), 42);
|
||||
assert_equals_uint64 (_DURATION (object), 51);
|
||||
assert_equals_uint64 (_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track->type);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
|
@ -95,9 +95,9 @@ GST_START_TEST (test_transition_properties)
|
|||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
/* Check that trackobject has the same properties */
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 42);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 12);
|
||||
assert_equals_uint64 (_START (trackobject), 42);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 51);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 12);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
|
||||
|
@ -106,12 +106,12 @@ GST_START_TEST (test_transition_properties)
|
|||
/* Change more properties, see if they propagate */
|
||||
g_object_set (object, "start", (guint64) 420, "duration", (guint64) 510,
|
||||
"in-point", (guint64) 120, NULL);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_START (object), 420);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (object), 510);
|
||||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 120);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_START (trackobject), 420);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (GES_TRACK_OBJECT_INPOINT (trackobject), 120);
|
||||
assert_equals_uint64 (_START (object), 420);
|
||||
assert_equals_uint64 (_DURATION (object), 510);
|
||||
assert_equals_uint64 (_INPOINT (object), 120);
|
||||
assert_equals_uint64 (_START (trackobject), 420);
|
||||
assert_equals_uint64 (_DURATION (trackobject), 510);
|
||||
assert_equals_uint64 (_INPOINT (trackobject), 120);
|
||||
|
||||
/* And let's also check that it propagated correctly to GNonLin */
|
||||
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
|
||||
|
|
|
@ -271,15 +271,13 @@ filesource_notify_duration_cb (GESTimelineObject * object,
|
|||
GParamSpec * arg G_GNUC_UNUSED, App * app)
|
||||
{
|
||||
guint64 duration, max_inpoint;
|
||||
duration = GES_TIMELINE_OBJECT_DURATION (object);
|
||||
max_inpoint =
|
||||
ges_timeline_filesource_get_max_duration (GES_TIMELINE_FILE_SOURCE
|
||||
(object)) - duration;
|
||||
duration = GES_TIMELINE_ELEMENT_DURATION (object);
|
||||
max_inpoint = GES_TIMELINE_ELEMENT_MAX_DURATION (object) - duration;
|
||||
|
||||
gtk_range_set_value (GTK_RANGE (app->duration), duration);
|
||||
gtk_range_set_fill_level (GTK_RANGE (app->in_point), max_inpoint);
|
||||
|
||||
if (max_inpoint < GES_TIMELINE_OBJECT_INPOINT (object))
|
||||
if (max_inpoint < GES_TIMELINE_ELEMENT_INPOINT (object))
|
||||
g_object_set (object, "in-point", max_inpoint, NULL);
|
||||
|
||||
}
|
||||
|
@ -289,11 +287,9 @@ filesource_notify_max_duration_cb (GESTimelineObject * object,
|
|||
GParamSpec * arg G_GNUC_UNUSED, App * app)
|
||||
{
|
||||
gtk_range_set_range (GTK_RANGE (app->duration), 0, (gdouble)
|
||||
ges_timeline_filesource_get_max_duration (GES_TIMELINE_FILE_SOURCE
|
||||
(object)));
|
||||
GES_TIMELINE_ELEMENT_MAX_DURATION (object));
|
||||
gtk_range_set_range (GTK_RANGE (app->in_point), 0, (gdouble)
|
||||
ges_timeline_filesource_get_max_duration (GES_TIMELINE_FILE_SOURCE
|
||||
(object)));
|
||||
GES_TIMELINE_ELEMENT_MAX_DURATION (object));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -301,7 +297,7 @@ filesource_notify_in_point_cb (GESTimelineObject * object,
|
|||
GParamSpec * arg G_GNUC_UNUSED, App * app)
|
||||
{
|
||||
gtk_range_set_value (GTK_RANGE (app->in_point),
|
||||
GES_TIMELINE_OBJECT_INPOINT (object));
|
||||
GES_TIMELINE_ELEMENT_INPOINT (object));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -683,7 +679,7 @@ connect_to_object (GESTimelineObject * object, App * app)
|
|||
|
||||
app->ignore_input = TRUE;
|
||||
|
||||
duration = GES_TIMELINE_OBJECT_DURATION (object);
|
||||
duration = GES_TIMELINE_ELEMENT_DURATION (object);
|
||||
g_snprintf (buf, sizeof (buf), "%02u:%02u:%02u.%09u",
|
||||
GST_TIME_ARGS (duration));
|
||||
gtk_entry_set_text (app->seconds, buf);
|
||||
|
@ -1633,9 +1629,7 @@ duration_scale_change_value_cb (GtkRange * range, GtkScrollType unused,
|
|||
|
||||
for (i = app->selected_objects; i; i = i->next) {
|
||||
guint64 duration, maxduration;
|
||||
maxduration =
|
||||
ges_timeline_filesource_get_max_duration (GES_TIMELINE_FILE_SOURCE
|
||||
(i->data));
|
||||
maxduration = GES_TIMELINE_ELEMENT_MAX_DURATION (i->data);
|
||||
duration = (value < maxduration ? (value > 0 ? value : 0) : maxduration);
|
||||
g_object_set (G_OBJECT (i->data), "duration", (guint64) duration, NULL);
|
||||
}
|
||||
|
@ -1650,9 +1644,8 @@ in_point_scale_change_value_cb (GtkRange * range, GtkScrollType unused,
|
|||
|
||||
for (i = app->selected_objects; i; i = i->next) {
|
||||
guint64 in_point, maxduration;
|
||||
maxduration =
|
||||
ges_timeline_filesource_get_max_duration (GES_TIMELINE_FILE_SOURCE
|
||||
(i->data)) - GES_TIMELINE_OBJECT_DURATION (i->data);
|
||||
maxduration = GES_TIMELINE_ELEMENT_MAX_DURATION (i->data) -
|
||||
GES_TIMELINE_ELEMENT_DURATION (i->data);
|
||||
in_point = (value < maxduration ? (value > 0 ? value : 0) : maxduration);
|
||||
g_object_set (G_OBJECT (i->data), "in-point", (guint64) in_point, NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue