mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +00:00
ges: Deprecate GESTimelineElement::priority writability
GESLayer is now responsible for setting clips priorites. Also GESClip top effects priorities are now set by the ges_clip_set_top_effect_index method, the user should never call ges_timeline_element_set_priority as it will anyway be overriden by GES itself. Differential Revision: https://phabricator.freedesktop.org/D1280
This commit is contained in:
parent
f79c73789f
commit
3409719de5
5 changed files with 15 additions and 26 deletions
|
@ -366,6 +366,9 @@ ges_timeline_element_class_init (GESTimelineElementClass * klass)
|
|||
* GESTimelineElement:priority:
|
||||
*
|
||||
* The priority of the object.
|
||||
*
|
||||
* Setting GESTimelineElement priorities is deprecated
|
||||
* as all priority management is done by GES itself now.
|
||||
*/
|
||||
properties[PROP_PRIORITY] = g_param_spec_uint ("priority", "Priority",
|
||||
"The priority of the object", 0, G_MAXUINT, 0, G_PARAM_READWRITE);
|
||||
|
@ -881,6 +884,10 @@ ges_timeline_element_get_priority (GESTimelineElement * self)
|
|||
* @priority: the priority
|
||||
*
|
||||
* Sets the priority of the object within the containing layer
|
||||
*
|
||||
* Deprecated: All priority management is done by GES itself now.
|
||||
* To set #GESEffect priorities #ges_clip_set_top_effect_index should
|
||||
* be used.
|
||||
*/
|
||||
void
|
||||
ges_timeline_element_set_priority (GESTimelineElement * self, guint32 priority)
|
||||
|
|
|
@ -178,7 +178,7 @@ struct _GESTimelineElementClass
|
|||
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 (*set_priority) (GESTimelineElement * self, guint32 priority); /* set_priority is now protected */
|
||||
|
||||
gboolean (*ripple) (GESTimelineElement *self, guint64 start);
|
||||
gboolean (*ripple_end) (GESTimelineElement *self, guint64 end);
|
||||
|
|
|
@ -644,7 +644,7 @@ GST_START_TEST (test_effects_priorities)
|
|||
fail_unless_equals_int (MIN_NLE_PRIO + TRANSITIONS_HEIGHT + 2,
|
||||
_PRIORITY (effect2));
|
||||
|
||||
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
|
||||
fail_unless (ges_clip_set_top_effect_index (clip, GES_BASE_EFFECT (effect),
|
||||
2));
|
||||
fail_unless_equals_int (MIN_NLE_PRIO + TRANSITIONS_HEIGHT + 0,
|
||||
_PRIORITY (effect1));
|
||||
|
@ -653,7 +653,7 @@ GST_START_TEST (test_effects_priorities)
|
|||
fail_unless_equals_int (MIN_NLE_PRIO + TRANSITIONS_HEIGHT + 2,
|
||||
_PRIORITY (effect));
|
||||
|
||||
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
|
||||
fail_unless (ges_clip_set_top_effect_index (clip, GES_BASE_EFFECT (effect),
|
||||
0));
|
||||
fail_unless_equals_int (MIN_NLE_PRIO + TRANSITIONS_HEIGHT + 0,
|
||||
_PRIORITY (effect));
|
||||
|
@ -670,7 +670,7 @@ GST_START_TEST (test_effects_priorities)
|
|||
fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + TRANSITIONS_HEIGHT + 2,
|
||||
_PRIORITY (effect2));
|
||||
|
||||
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
|
||||
fail_unless (ges_clip_set_top_effect_index (clip, GES_BASE_EFFECT (effect),
|
||||
2));
|
||||
fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + TRANSITIONS_HEIGHT + 0,
|
||||
_PRIORITY (effect1));
|
||||
|
@ -679,7 +679,7 @@ GST_START_TEST (test_effects_priorities)
|
|||
fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + TRANSITIONS_HEIGHT + 2,
|
||||
_PRIORITY (effect));
|
||||
|
||||
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
|
||||
fail_unless (ges_clip_set_top_effect_index (clip, GES_BASE_EFFECT (effect),
|
||||
0));
|
||||
fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + TRANSITIONS_HEIGHT + 0,
|
||||
_PRIORITY (effect));
|
||||
|
|
|
@ -335,8 +335,6 @@ GST_START_TEST (test_priorities_clip)
|
|||
}
|
||||
g_list_free (effects);
|
||||
|
||||
ges_timeline_element_set_priority (GES_TIMELINE_ELEMENT (effect_clip), 2);
|
||||
assert_equals_int (_PRIORITY (effect_clip), 2);
|
||||
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4);
|
||||
effects = ges_clip_get_top_effects (GES_CLIP (effect_clip));
|
||||
effect_prio = 0;
|
||||
|
|
|
@ -150,14 +150,9 @@ GST_START_TEST (test_layer_priorities)
|
|||
fail_unless (clip2 != NULL);
|
||||
fail_unless (clip3 != NULL);
|
||||
|
||||
/* Set priorities on the objects */
|
||||
g_object_set (clip1, "priority", 0, "start", 0, "duration", 10, NULL);
|
||||
assert_equals_int (_PRIORITY (clip1), 0);
|
||||
g_object_set (clip2, "priority", 1, "start", 10, "duration", 10, NULL);
|
||||
assert_equals_int (_PRIORITY (clip2), 1);
|
||||
g_object_set (clip3, "priority", LAYER_HEIGHT + 1, "start", 20, "duration",
|
||||
10, NULL);
|
||||
assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT + 1);
|
||||
g_object_set (clip1, "start", 0, "duration", 10, NULL);
|
||||
g_object_set (clip2, "start", 10, "duration", 10, NULL);
|
||||
g_object_set (clip3, "start", 20, "duration", 10, NULL);
|
||||
|
||||
/* Add objects to the timeline */
|
||||
fail_unless (ges_layer_add_clip (layer1, clip1));
|
||||
|
@ -243,17 +238,6 @@ GST_START_TEST (test_layer_priorities)
|
|||
assert_equals_int (prio3,
|
||||
2 * LAYER_HEIGHT + 2 + MIN_NLE_PRIO + TRANSITIONS_HEIGHT);
|
||||
|
||||
/* And change TrackElement-s priorities and check that changes are not
|
||||
* refected on it containing Clip
|
||||
* FIXME : We should rework the way we handle the case were a trackobject
|
||||
* prio is set outside the layer it is in.
|
||||
* ges_timeline_element_set_priority (GES_TIMELINE_ELEMENT (trackelement3),
|
||||
* ges_timeline_commit (timeline);
|
||||
* LAYER_HEIGHT * 2);
|
||||
* g_object_get (nleobj3, "priority", &prio3, NULL);
|
||||
* assert_equals_int (prio3, 2 * LAYER_HEIGHT);
|
||||
* assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1); */
|
||||
|
||||
gst_object_unref (trackelement1);
|
||||
gst_object_unref (trackelement2);
|
||||
gst_object_unref (trackelement3);
|
||||
|
|
Loading…
Reference in a new issue