mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
ges-clip: Remove the unlocked TrackElement APIs
Remove APIs: ges_track_element_set_locked ges_track_element_is_locked Those APIs where really not nice to use and were causing more issues than solving them. If 2 time related properties of TimelineElement must be different, then those element can *not* have the same parent. Plus, with the new ges_container_group () API, we will recreate 1 GESClip containing the proper GESTimelineElements if it is the thing to do.
This commit is contained in:
parent
6775097e66
commit
cdd00ed207
5 changed files with 39 additions and 143 deletions
|
@ -100,8 +100,6 @@ GES_TYPE_TRACK
|
||||||
GESTrackElement
|
GESTrackElement
|
||||||
GESTrackElementClass
|
GESTrackElementClass
|
||||||
ges_track_element_set_active
|
ges_track_element_set_active
|
||||||
ges_track_element_set_locked
|
|
||||||
ges_track_element_is_locked
|
|
||||||
ges_track_element_get_track
|
ges_track_element_get_track
|
||||||
ges_track_element_get_gnlobject
|
ges_track_element_get_gnlobject
|
||||||
ges_track_element_get_element
|
ges_track_element_get_element
|
||||||
|
|
|
@ -987,8 +987,7 @@ ges_clip_edit (GESClip * clip, GList * layers,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (tmp = GES_CONTAINER_CHILDREN (clip); tmp; tmp = g_list_next (tmp)) {
|
for (tmp = GES_CONTAINER_CHILDREN (clip); tmp; tmp = g_list_next (tmp)) {
|
||||||
if (ges_track_element_is_locked (tmp->data)
|
if (GES_IS_SOURCE (tmp->data)) {
|
||||||
&& GES_IS_SOURCE (tmp->data)) {
|
|
||||||
ret &= ges_track_element_edit (tmp->data, layers, mode, edge, position);
|
ret &= ges_track_element_edit (tmp->data, layers, mode, edge, position);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1155,7 +1154,6 @@ ges_clip_get_supported_formats (GESClip * clip)
|
||||||
gboolean
|
gboolean
|
||||||
_ripple (GESTimelineElement * element, GstClockTime start)
|
_ripple (GESTimelineElement * element, GstClockTime start)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
GESClip *clip = GES_CLIP (element);
|
GESClip *clip = GES_CLIP (element);
|
||||||
|
@ -1167,14 +1165,12 @@ _ripple (GESTimelineElement * element, GstClockTime start)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = g_list_next (tmp)) {
|
if (GES_CONTAINER_CHILDREN (element)) {
|
||||||
if (ges_track_element_is_locked (tmp->data)) {
|
GESTrackElement *track_element =
|
||||||
ret = timeline_ripple_object (timeline, GES_TRACK_ELEMENT (tmp->data),
|
GES_TRACK_ELEMENT (GES_CONTAINER_CHILDREN (element)->data);
|
||||||
NULL, GES_EDGE_NONE, start);
|
|
||||||
/* As we work only with locked objects, the changes will be reflected
|
ret = timeline_ripple_object (timeline, track_element, NULL, GES_EDGE_NONE,
|
||||||
* to others controlled TrackElements */
|
start);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1183,7 +1179,6 @@ _ripple (GESTimelineElement * element, GstClockTime start)
|
||||||
static gboolean
|
static gboolean
|
||||||
_ripple_end (GESTimelineElement * element, GstClockTime end)
|
_ripple_end (GESTimelineElement * element, GstClockTime end)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
GESClip *clip = GES_CLIP (element);
|
GESClip *clip = GES_CLIP (element);
|
||||||
|
@ -1195,14 +1190,12 @@ _ripple_end (GESTimelineElement * element, GstClockTime end)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = g_list_next (tmp)) {
|
if (GES_CONTAINER_CHILDREN (element)) {
|
||||||
if (ges_track_element_is_locked (tmp->data)) {
|
GESTrackElement *track_element =
|
||||||
ret = timeline_ripple_object (timeline, GES_TRACK_ELEMENT (tmp->data),
|
GES_TRACK_ELEMENT (GES_CONTAINER_CHILDREN (element)->data);
|
||||||
NULL, GES_EDGE_END, end);
|
|
||||||
/* As we work only with locked objects, the changes will be reflected
|
ret = timeline_ripple_object (timeline, track_element, NULL, GES_EDGE_END,
|
||||||
* to others controlled TrackElements */
|
end);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1211,7 +1204,6 @@ _ripple_end (GESTimelineElement * element, GstClockTime end)
|
||||||
gboolean
|
gboolean
|
||||||
_roll_start (GESTimelineElement * element, GstClockTime start)
|
_roll_start (GESTimelineElement * element, GstClockTime start)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
|
|
||||||
|
@ -1224,14 +1216,12 @@ _roll_start (GESTimelineElement * element, GstClockTime start)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = g_list_next (tmp)) {
|
if (GES_CONTAINER_CHILDREN (element)) {
|
||||||
if (ges_track_element_is_locked (tmp->data)) {
|
GESTrackElement *track_element =
|
||||||
ret = timeline_roll_object (timeline, GES_TRACK_ELEMENT (tmp->data),
|
GES_TRACK_ELEMENT (GES_CONTAINER_CHILDREN (element)->data);
|
||||||
NULL, GES_EDGE_START, start);
|
|
||||||
/* As we work only with locked objects, the changes will be reflected
|
ret = timeline_roll_object (timeline, track_element, NULL, GES_EDGE_START,
|
||||||
* to others controlled TrackElements */
|
start);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1240,7 +1230,6 @@ _roll_start (GESTimelineElement * element, GstClockTime start)
|
||||||
gboolean
|
gboolean
|
||||||
_roll_end (GESTimelineElement * element, GstClockTime end)
|
_roll_end (GESTimelineElement * element, GstClockTime end)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
|
|
||||||
|
@ -1253,14 +1242,12 @@ _roll_end (GESTimelineElement * element, GstClockTime end)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = g_list_next (tmp)) {
|
if (GES_CONTAINER_CHILDREN (element)) {
|
||||||
if (ges_track_element_is_locked (tmp->data)) {
|
GESTrackElement *track_element =
|
||||||
ret = timeline_roll_object (timeline, GES_TRACK_ELEMENT (tmp->data),
|
GES_TRACK_ELEMENT (GES_CONTAINER_CHILDREN (element)->data);
|
||||||
NULL, GES_EDGE_END, end);
|
|
||||||
/* As we work only with locked objects, the changes will be reflected
|
ret = timeline_roll_object (timeline, track_element,
|
||||||
* to others controlled TrackElements */
|
NULL, GES_EDGE_END, end);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1269,7 +1256,6 @@ _roll_end (GESTimelineElement * element, GstClockTime end)
|
||||||
gboolean
|
gboolean
|
||||||
_trim (GESTimelineElement * element, GstClockTime start)
|
_trim (GESTimelineElement * element, GstClockTime start)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
|
|
||||||
|
@ -1282,12 +1268,12 @@ _trim (GESTimelineElement * element, GstClockTime start)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = g_list_next (tmp)) {
|
if (GES_CONTAINER_CHILDREN (element)) {
|
||||||
if (ges_track_element_is_locked (tmp->data)) {
|
GESTrackElement *track_element =
|
||||||
ret = timeline_trim_object (timeline, GES_TRACK_ELEMENT (tmp->data),
|
GES_TRACK_ELEMENT (GES_CONTAINER_CHILDREN (element)->data);
|
||||||
NULL, GES_EDGE_START, start);
|
|
||||||
break;
|
ret = timeline_trim_object (timeline, track_element, NULL, GES_EDGE_START,
|
||||||
}
|
start);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -1408,18 +1408,12 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackElement * obj,
|
||||||
new_start = _START (trackelement) + offset;
|
new_start = _START (trackelement) + offset;
|
||||||
|
|
||||||
clip = add_moving_clip (mv_ctx, trackelement);
|
clip = add_moving_clip (mv_ctx, trackelement);
|
||||||
|
/* Make sure not to move 2 times the same Clip */
|
||||||
if (ges_track_element_is_locked (trackelement) == TRUE) {
|
if (g_list_find (moved_clips, clip) == NULL) {
|
||||||
|
|
||||||
/* Make sure not to move 2 times the same Clip */
|
|
||||||
if (g_list_find (moved_clips, clip) == NULL) {
|
|
||||||
_set_start0 (GES_TIMELINE_ELEMENT (trackelement), new_start);
|
|
||||||
moved_clips = g_list_prepend (moved_clips, clip);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
_set_start0 (GES_TIMELINE_ELEMENT (trackelement), new_start);
|
_set_start0 (GES_TIMELINE_ELEMENT (trackelement), new_start);
|
||||||
|
moved_clips = g_list_prepend (moved_clips, clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
g_list_free (moved_clips);
|
g_list_free (moved_clips);
|
||||||
_set_start0 (GES_TIMELINE_ELEMENT (obj), position);
|
_set_start0 (GES_TIMELINE_ELEMENT (obj), position);
|
||||||
|
@ -1444,18 +1438,12 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackElement * obj,
|
||||||
new_start = _START (trackelement) + offset;
|
new_start = _START (trackelement) + offset;
|
||||||
|
|
||||||
clip = add_moving_clip (mv_ctx, trackelement);
|
clip = add_moving_clip (mv_ctx, trackelement);
|
||||||
|
/* Make sure not to move 2 times the same Clip */
|
||||||
if (ges_track_element_is_locked (trackelement) == TRUE) {
|
if (g_list_find (moved_clips, clip) == NULL) {
|
||||||
|
|
||||||
/* Make sure not to move 2 times the same Clip */
|
|
||||||
if (g_list_find (moved_clips, clip) == NULL) {
|
|
||||||
_set_start0 (GES_TIMELINE_ELEMENT (trackelement), new_start);
|
|
||||||
moved_clips = g_list_prepend (moved_clips, clip);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
_set_start0 (GES_TIMELINE_ELEMENT (trackelement), new_start);
|
_set_start0 (GES_TIMELINE_ELEMENT (trackelement), new_start);
|
||||||
|
moved_clips = g_list_prepend (moved_clips, clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free (moved_clips);
|
g_list_free (moved_clips);
|
||||||
|
|
|
@ -63,7 +63,6 @@ struct _GESTrackElementPrivate
|
||||||
GESTrack *track;
|
GESTrack *track;
|
||||||
|
|
||||||
gboolean valid;
|
gboolean valid;
|
||||||
|
|
||||||
gboolean locked; /* If TRUE, then moves in sync with its controlling
|
gboolean locked; /* If TRUE, then moves in sync with its controlling
|
||||||
* GESClip */
|
* GESClip */
|
||||||
|
|
||||||
|
@ -75,7 +74,6 @@ enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_ACTIVE,
|
PROP_ACTIVE,
|
||||||
PROP_LOCKED,
|
|
||||||
PROP_TRACK_TYPE,
|
PROP_TRACK_TYPE,
|
||||||
PROP_TRACK,
|
PROP_TRACK,
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
|
@ -123,10 +121,6 @@ static gboolean _set_priority (GESTimelineElement * element, guint32 priority);
|
||||||
static void _deep_copy (GESTimelineElement * element,
|
static void _deep_copy (GESTimelineElement * element,
|
||||||
GESTimelineElement * copy);
|
GESTimelineElement * copy);
|
||||||
|
|
||||||
static inline void
|
|
||||||
ges_track_element_set_locked_internal (GESTrackElement * object,
|
|
||||||
gboolean locked);
|
|
||||||
|
|
||||||
static GParamSpec **default_list_children_properties (GESTrackElement * object,
|
static GParamSpec **default_list_children_properties (GESTrackElement * object,
|
||||||
guint * n_properties);
|
guint * n_properties);
|
||||||
|
|
||||||
|
@ -140,9 +134,6 @@ ges_track_element_get_property (GObject * object, guint property_id,
|
||||||
case PROP_ACTIVE:
|
case PROP_ACTIVE:
|
||||||
g_value_set_boolean (value, ges_track_element_is_active (track_element));
|
g_value_set_boolean (value, ges_track_element_is_active (track_element));
|
||||||
break;
|
break;
|
||||||
case PROP_LOCKED:
|
|
||||||
g_value_set_boolean (value, ges_track_element_is_locked (track_element));
|
|
||||||
break;
|
|
||||||
case PROP_TRACK_TYPE:
|
case PROP_TRACK_TYPE:
|
||||||
g_value_set_flags (value, track_element->priv->track_type);
|
g_value_set_flags (value, track_element->priv->track_type);
|
||||||
break;
|
break;
|
||||||
|
@ -164,10 +155,6 @@ ges_track_element_set_property (GObject * object, guint property_id,
|
||||||
case PROP_ACTIVE:
|
case PROP_ACTIVE:
|
||||||
ges_track_element_set_active (track_element, g_value_get_boolean (value));
|
ges_track_element_set_active (track_element, g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
case PROP_LOCKED:
|
|
||||||
ges_track_element_set_locked_internal (track_element,
|
|
||||||
g_value_get_boolean (value));
|
|
||||||
break;
|
|
||||||
case PROP_TRACK_TYPE:
|
case PROP_TRACK_TYPE:
|
||||||
track_element->priv->track_type = g_value_get_flags (value);
|
track_element->priv->track_type = g_value_get_flags (value);
|
||||||
break;
|
break;
|
||||||
|
@ -241,17 +228,6 @@ ges_track_element_class_init (GESTrackElementClass * klass)
|
||||||
g_object_class_install_property (object_class, PROP_ACTIVE,
|
g_object_class_install_property (object_class, PROP_ACTIVE,
|
||||||
properties[PROP_ACTIVE]);
|
properties[PROP_ACTIVE]);
|
||||||
|
|
||||||
/**
|
|
||||||
* GESTrackElement:locked:
|
|
||||||
*
|
|
||||||
* If %TRUE, then moves in sync with its controlling #GESClip
|
|
||||||
*/
|
|
||||||
properties[PROP_LOCKED] =
|
|
||||||
g_param_spec_boolean ("locked", "Locked",
|
|
||||||
"Moves in sync with its controling Clip", TRUE, G_PARAM_READWRITE);
|
|
||||||
g_object_class_install_property (object_class, PROP_LOCKED,
|
|
||||||
properties[PROP_LOCKED]);
|
|
||||||
|
|
||||||
properties[PROP_TRACK_TYPE] = g_param_spec_flags ("track-type", "Track Type",
|
properties[PROP_TRACK_TYPE] = g_param_spec_flags ("track-type", "Track Type",
|
||||||
"The track type of the object", GES_TYPE_TRACK_TYPE,
|
"The track type of the object", GES_TYPE_TRACK_TYPE,
|
||||||
GES_TRACK_TYPE_UNKNOWN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
|
GES_TRACK_TYPE_UNKNOWN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
|
||||||
|
@ -305,7 +281,6 @@ ges_track_element_init (GESTrackElement * self)
|
||||||
priv->pending_duration = GST_SECOND;
|
priv->pending_duration = GST_SECOND;
|
||||||
priv->pending_priority = 1;
|
priv->pending_priority = 1;
|
||||||
priv->pending_active = TRUE;
|
priv->pending_active = TRUE;
|
||||||
priv->locked = TRUE;
|
|
||||||
priv->properties_hashtable = NULL;
|
priv->properties_hashtable = NULL;
|
||||||
priv->bindings_hashtable = g_hash_table_new_full (g_str_hash, g_str_equal,
|
priv->bindings_hashtable = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||||
g_free, NULL);
|
g_free, NULL);
|
||||||
|
@ -814,52 +789,6 @@ ges_track_element_get_element (GESTrackElement * object)
|
||||||
return object->priv->element;
|
return object->priv->element;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
ges_track_element_set_locked_internal (GESTrackElement * object,
|
|
||||||
gboolean locked)
|
|
||||||
{
|
|
||||||
object->priv->locked = locked;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ges_track_element_set_locked:
|
|
||||||
* @object: a #GESTrackElement
|
|
||||||
* @locked: whether the object is lock to its parent
|
|
||||||
*
|
|
||||||
* Set the locking status of the @object in relationship to its controlling
|
|
||||||
* #GESClip. If @locked is %TRUE, then this object will move synchronously
|
|
||||||
* with its controlling #GESClip.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
ges_track_element_set_locked (GESTrackElement * object, gboolean locked)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GES_IS_TRACK_ELEMENT (object));
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (object, "%s object", locked ? "Locking" : "Unlocking");
|
|
||||||
|
|
||||||
ges_track_element_set_locked_internal (object, locked);
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (object), properties[PROP_LOCKED]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ges_track_element_is_locked:
|
|
||||||
* @object: a #GESTrackElement
|
|
||||||
*
|
|
||||||
* Let you know if object us locked or not (moving synchronously).
|
|
||||||
*
|
|
||||||
* Returns: %TRUE if the object is moving synchronously to its controlling
|
|
||||||
* #GESClip, else %FALSE.
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
ges_track_element_is_locked (GESTrackElement * object)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (GES_IS_TRACK_ELEMENT (object), FALSE);
|
|
||||||
|
|
||||||
return object->priv->locked;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ges_track_element_is_active:
|
* ges_track_element_is_active:
|
||||||
* @object: a #GESTrackElement
|
* @object: a #GESTrackElement
|
||||||
|
|
|
@ -126,11 +126,6 @@ GstElement * ges_track_element_get_gnlobject (GESTrackElement * object);
|
||||||
|
|
||||||
GstElement * ges_track_element_get_element (GESTrackElement * object);
|
GstElement * ges_track_element_get_element (GESTrackElement * object);
|
||||||
|
|
||||||
void ges_track_element_set_locked (GESTrackElement * object,
|
|
||||||
gboolean locked);
|
|
||||||
|
|
||||||
gboolean ges_track_element_is_locked (GESTrackElement * object);
|
|
||||||
|
|
||||||
gboolean ges_track_element_set_active (GESTrackElement * object,
|
gboolean ges_track_element_set_active (GESTrackElement * object,
|
||||||
gboolean active);
|
gboolean active);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue