mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
internal: Add a element_end_compare
This commit is contained in:
parent
e72f5a6012
commit
7f1fbd2300
3 changed files with 37 additions and 9 deletions
|
@ -519,6 +519,13 @@ _ges_container_sort_children (GESContainer * container)
|
|||
(GCompareFunc) element_start_compare);
|
||||
}
|
||||
|
||||
void
|
||||
_ges_container_sort_children_by_end (GESContainer * container)
|
||||
{
|
||||
container->children = g_list_sort (container->children,
|
||||
(GCompareFunc) element_end_compare);
|
||||
}
|
||||
|
||||
void
|
||||
_ges_container_set_ignore_notifies (GESContainer * container,
|
||||
gboolean ignore_notifies)
|
||||
|
|
|
@ -224,13 +224,17 @@ G_GNUC_INTERNAL void _init_formatter_assets (void);
|
|||
|
||||
/* Utilities */
|
||||
G_GNUC_INTERNAL gint element_start_compare (GESTimelineElement * a,
|
||||
GESTimelineElement * b);
|
||||
GESTimelineElement * b);
|
||||
G_GNUC_INTERNAL gint element_end_compare (GESTimelineElement * a,
|
||||
GESTimelineElement * b);
|
||||
|
||||
/****************************************************
|
||||
* GESContainer *
|
||||
****************************************************/
|
||||
G_GNUC_INTERNAL void _ges_container_sort_children (GESContainer *container);
|
||||
G_GNUC_INTERNAL void _ges_container_set_ignore_notifies (GESContainer *container,
|
||||
gboolean ignore_notifies);
|
||||
G_GNUC_INTERNAL void _ges_container_sort_children (GESContainer *container);
|
||||
G_GNUC_INTERNAL void _ges_container_sort_children_by_end (GESContainer *container);
|
||||
G_GNUC_INTERNAL void _ges_container_set_ignore_notifies (GESContainer *container,
|
||||
gboolean ignore_notifies);
|
||||
|
||||
/****************************************************
|
||||
* GESClip *
|
||||
|
|
|
@ -73,10 +73,27 @@ element_start_compare (GESTimelineElement * a, GESTimelineElement * b)
|
|||
if (a->duration > b->duration)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
if (a->start < b->start)
|
||||
} else if (a->start < b->start)
|
||||
return -1;
|
||||
if (a->start > b->start)
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
gint
|
||||
element_end_compare (GESTimelineElement * a, GESTimelineElement * b)
|
||||
{
|
||||
if (GES_TIMELINE_ELEMENT_END (a) == GES_TIMELINE_ELEMENT_END (b)) {
|
||||
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;
|
||||
} else if (GES_TIMELINE_ELEMENT_END (a) < (GES_TIMELINE_ELEMENT_END (b)))
|
||||
return -1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue