mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
ges: add track objects to the track before the track-object-added is emitted
NOTE: The caller of ges_timeline_object_create_track_object now needs to add it to the timeline_object after calling the function. Fix the testsuite to support that accordingly
This commit is contained in:
parent
ba37d07261
commit
32ce69684c
8 changed files with 32 additions and 10 deletions
|
@ -30,6 +30,7 @@ class TextOverlay(TestCase):
|
|||
ovrl.set_priority(2)
|
||||
ovrl.set_layer(lyr)
|
||||
tck_obj = ovrl.create_track_object(tck)
|
||||
ovrl.add_track_object(tck_obj)
|
||||
self.failIf (ovrl.release_track_object(tck_obj) != True)
|
||||
self.failIf (ovrl.add_track_object(tck_obj) != True)
|
||||
self.failIf (len(ovrl.get_track_objects()) != 1)
|
||||
|
|
|
@ -392,7 +392,6 @@ ges_timeline_object_create_track_object (GESTimelineObject * object,
|
|||
}
|
||||
|
||||
res = class->create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, res);
|
||||
return res;
|
||||
|
||||
}
|
||||
|
@ -434,13 +433,17 @@ ges_timeline_object_create_track_objects_func (GESTimelineObject * object,
|
|||
GESTrack * track)
|
||||
{
|
||||
GESTrackObject *result;
|
||||
gboolean ret;
|
||||
|
||||
result = ges_timeline_object_create_track_object (object, track);
|
||||
if (!result) {
|
||||
GST_WARNING ("couldn't create track object");
|
||||
return FALSE;
|
||||
}
|
||||
return ges_track_add_object (track, result);
|
||||
ges_track_object_set_timeline_object (result, object);
|
||||
ret = ges_track_add_object (track, result);
|
||||
ges_timeline_object_add_track_object (object, result);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -474,6 +477,7 @@ ges_timeline_object_add_track_object (GESTimelineObject * object, GESTrackObject
|
|||
return FALSE;
|
||||
|
||||
ges_track_object_set_timeline_object (trobj, object);
|
||||
|
||||
g_object_ref (trobj);
|
||||
|
||||
mapping = g_slice_new0 (ObjectMapping);
|
||||
|
|
|
@ -72,6 +72,7 @@ GST_START_TEST (test_test_source_properties)
|
|||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
|
@ -169,10 +170,12 @@ GST_START_TEST (test_test_source_in_layer)
|
|||
assert_equals_float (volume, 0);
|
||||
|
||||
|
||||
freq = ges_track_audio_test_source_get_freq (
|
||||
GES_TRACK_AUDIO_TEST_SOURCE (trobj));
|
||||
volume = ges_track_audio_test_source_get_volume (
|
||||
GES_TRACK_AUDIO_TEST_SOURCE (trobj));
|
||||
freq =
|
||||
ges_track_audio_test_source_get_freq (GES_TRACK_AUDIO_TEST_SOURCE
|
||||
(trobj));
|
||||
volume =
|
||||
ges_track_audio_test_source_get_volume (GES_TRACK_AUDIO_TEST_SOURCE
|
||||
(trobj));
|
||||
g_assert (freq == 440);
|
||||
g_assert (volume == 0);
|
||||
|
||||
|
@ -183,10 +186,12 @@ GST_START_TEST (test_test_source_in_layer)
|
|||
assert_equals_float (freq, 2000);
|
||||
assert_equals_float (volume, 0.5);
|
||||
|
||||
freq = ges_track_audio_test_source_get_freq (
|
||||
GES_TRACK_AUDIO_TEST_SOURCE (trobj));
|
||||
volume = ges_track_audio_test_source_get_volume (
|
||||
GES_TRACK_AUDIO_TEST_SOURCE (trobj));
|
||||
freq =
|
||||
ges_track_audio_test_source_get_freq (GES_TRACK_AUDIO_TEST_SOURCE
|
||||
(trobj));
|
||||
volume =
|
||||
ges_track_audio_test_source_get_volume (GES_TRACK_AUDIO_TEST_SOURCE
|
||||
(trobj));
|
||||
g_assert (freq == 2000);
|
||||
g_assert (volume == 0.5);
|
||||
|
||||
|
|
|
@ -55,6 +55,8 @@ GST_START_TEST (test_filesource_basic)
|
|||
trackobject =
|
||||
ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (source),
|
||||
track);
|
||||
ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT (source),
|
||||
trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
|
||||
/* The track holds a reference to the object
|
||||
|
@ -110,6 +112,7 @@ GST_START_TEST (test_filesource_properties)
|
|||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
|
@ -174,6 +177,7 @@ GST_START_TEST (test_filesource_images)
|
|||
|
||||
/* the returned track object should be an image source */
|
||||
trobj = ges_timeline_object_create_track_object (tlobj, v);
|
||||
ges_timeline_object_add_track_object (tlobj, trobj);
|
||||
fail_unless (GES_IS_TRACK_IMAGE_SOURCE (trobj));
|
||||
|
||||
/* The track holds a reference to the object
|
||||
|
@ -187,6 +191,7 @@ GST_START_TEST (test_filesource_images)
|
|||
* property is set true */
|
||||
|
||||
trobj = ges_timeline_object_create_track_object (tlobj, a);
|
||||
ges_timeline_object_add_track_object (tlobj, trobj);
|
||||
fail_unless (GES_IS_TRACK_AUDIO_TEST_SOURCE (trobj));
|
||||
|
||||
/* The track holds a reference to the object
|
||||
|
|
|
@ -71,6 +71,7 @@ GST_START_TEST (test_overlay_properties)
|
|||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ GST_START_TEST (test_object_properties)
|
|||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
|
@ -146,6 +147,7 @@ GST_START_TEST (test_object_properties_unlocked)
|
|||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ GST_START_TEST (test_title_source_properties)
|
|||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ GST_START_TEST (test_transition_basic)
|
|||
trackobject =
|
||||
ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (tr2),
|
||||
track);
|
||||
ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT (tr2), trackobject);
|
||||
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_video_transition_get_transition_type
|
||||
|
@ -103,6 +104,7 @@ GST_START_TEST (test_transition_properties)
|
|||
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||
|
||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
|
@ -157,6 +159,7 @@ GST_START_TEST (test_transition_properties)
|
|||
|
||||
GST_DEBUG ("creating track object");
|
||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||
ges_timeline_object_add_track_object (object, trackobject);
|
||||
fail_unless (trackobject != NULL);
|
||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||
|
||||
|
|
Loading…
Reference in a new issue