mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +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_priority(2)
|
||||||
ovrl.set_layer(lyr)
|
ovrl.set_layer(lyr)
|
||||||
tck_obj = ovrl.create_track_object(tck)
|
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.release_track_object(tck_obj) != True)
|
||||||
self.failIf (ovrl.add_track_object(tck_obj) != True)
|
self.failIf (ovrl.add_track_object(tck_obj) != True)
|
||||||
self.failIf (len(ovrl.get_track_objects()) != 1)
|
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);
|
res = class->create_track_object (object, track);
|
||||||
ges_timeline_object_add_track_object (object, res);
|
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -434,13 +433,17 @@ ges_timeline_object_create_track_objects_func (GESTimelineObject * object,
|
||||||
GESTrack * track)
|
GESTrack * track)
|
||||||
{
|
{
|
||||||
GESTrackObject *result;
|
GESTrackObject *result;
|
||||||
|
gboolean ret;
|
||||||
|
|
||||||
result = ges_timeline_object_create_track_object (object, track);
|
result = ges_timeline_object_create_track_object (object, track);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
GST_WARNING ("couldn't create track object");
|
GST_WARNING ("couldn't create track object");
|
||||||
return FALSE;
|
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;
|
return FALSE;
|
||||||
|
|
||||||
ges_track_object_set_timeline_object (trobj, object);
|
ges_track_object_set_timeline_object (trobj, object);
|
||||||
|
|
||||||
g_object_ref (trobj);
|
g_object_ref (trobj);
|
||||||
|
|
||||||
mapping = g_slice_new0 (ObjectMapping);
|
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);
|
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||||
|
|
||||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||||
|
ges_timeline_object_add_track_object (object, trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
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);
|
assert_equals_float (volume, 0);
|
||||||
|
|
||||||
|
|
||||||
freq = ges_track_audio_test_source_get_freq (
|
freq =
|
||||||
GES_TRACK_AUDIO_TEST_SOURCE (trobj));
|
ges_track_audio_test_source_get_freq (GES_TRACK_AUDIO_TEST_SOURCE
|
||||||
volume = ges_track_audio_test_source_get_volume (
|
(trobj));
|
||||||
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 (freq == 440);
|
||||||
g_assert (volume == 0);
|
g_assert (volume == 0);
|
||||||
|
|
||||||
|
@ -183,10 +186,12 @@ GST_START_TEST (test_test_source_in_layer)
|
||||||
assert_equals_float (freq, 2000);
|
assert_equals_float (freq, 2000);
|
||||||
assert_equals_float (volume, 0.5);
|
assert_equals_float (volume, 0.5);
|
||||||
|
|
||||||
freq = ges_track_audio_test_source_get_freq (
|
freq =
|
||||||
GES_TRACK_AUDIO_TEST_SOURCE (trobj));
|
ges_track_audio_test_source_get_freq (GES_TRACK_AUDIO_TEST_SOURCE
|
||||||
volume = ges_track_audio_test_source_get_volume (
|
(trobj));
|
||||||
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 (freq == 2000);
|
||||||
g_assert (volume == 0.5);
|
g_assert (volume == 0.5);
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,8 @@ GST_START_TEST (test_filesource_basic)
|
||||||
trackobject =
|
trackobject =
|
||||||
ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (source),
|
ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (source),
|
||||||
track);
|
track);
|
||||||
|
ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT (source),
|
||||||
|
trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
|
|
||||||
/* The track holds a reference to the object
|
/* 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);
|
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||||
|
|
||||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||||
|
ges_timeline_object_add_track_object (object, trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
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 */
|
/* the returned track object should be an image source */
|
||||||
trobj = ges_timeline_object_create_track_object (tlobj, v);
|
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));
|
fail_unless (GES_IS_TRACK_IMAGE_SOURCE (trobj));
|
||||||
|
|
||||||
/* The track holds a reference to the object
|
/* The track holds a reference to the object
|
||||||
|
@ -187,6 +191,7 @@ GST_START_TEST (test_filesource_images)
|
||||||
* property is set true */
|
* property is set true */
|
||||||
|
|
||||||
trobj = ges_timeline_object_create_track_object (tlobj, a);
|
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));
|
fail_unless (GES_IS_TRACK_AUDIO_TEST_SOURCE (trobj));
|
||||||
|
|
||||||
/* The track holds a reference to the object
|
/* 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);
|
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||||
|
|
||||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||||
|
ges_timeline_object_add_track_object (object, trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
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);
|
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||||
|
|
||||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||||
|
ges_timeline_object_add_track_object (object, trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
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);
|
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||||
|
|
||||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||||
|
ges_timeline_object_add_track_object (object, trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
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);
|
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||||
|
|
||||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||||
|
ges_timeline_object_add_track_object (object, trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ GST_START_TEST (test_transition_basic)
|
||||||
trackobject =
|
trackobject =
|
||||||
ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (tr2),
|
ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (tr2),
|
||||||
track);
|
track);
|
||||||
|
ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT (tr2), trackobject);
|
||||||
|
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_video_transition_get_transition_type
|
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);
|
assert_equals_uint64 (GES_TIMELINE_OBJECT_INPOINT (object), 12);
|
||||||
|
|
||||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||||
|
ges_timeline_object_add_track_object (object, trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||||
|
|
||||||
|
@ -157,6 +159,7 @@ GST_START_TEST (test_transition_properties)
|
||||||
|
|
||||||
GST_DEBUG ("creating track object");
|
GST_DEBUG ("creating track object");
|
||||||
trackobject = ges_timeline_object_create_track_object (object, track);
|
trackobject = ges_timeline_object_create_track_object (object, track);
|
||||||
|
ges_timeline_object_add_track_object (object, trackobject);
|
||||||
fail_unless (trackobject != NULL);
|
fail_unless (trackobject != NULL);
|
||||||
fail_unless (ges_track_object_set_track (trackobject, track));
|
fail_unless (ges_track_object_set_track (trackobject, track));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue