1 /* GStreamer Editing Services
2 * Copyright (C) 2009 Edward Hervey <bilboed@bilboed.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #include <gst/check/gstcheck.h>
24 my_fill_track_func (GESTimelineObject * object,
25 GESTrackObject * trobject, GstElement * gnlobj, gpointer user_data)
29 GST_DEBUG ("timelineobj:%p, trackobjec:%p, gnlobj:%p",
30 object, trobject, gnlobj);
32 /* Let's just put a fakesource in for the time being */
33 src = gst_element_factory_make ("fakesrc", NULL);
35 /* If this fails... that means that there already was something
37 fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
43 arbitrary_fill_track_func (GESTimelineObject * object,
44 GESTrackObject * trobject, GstElement * gnlobj, gpointer user_data)
50 GST_DEBUG ("element:%s, timelineobj:%p, trackobjects:%p, gnlobj:%p,",
51 user_data, object, trobject, gnlobj);
53 /* interpret user_data as name of element to create */
54 src = gst_element_factory_make (user_data, NULL);
56 /* If this fails... that means that there already was something
58 fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
63 GST_START_TEST (test_gsl_add)
65 GESTimeline *timeline;
66 GESTimelineLayer *layer;
68 GESCustomTimelineSource *source;
69 GESTimelineObject *source2;
73 /* This is the simplest scenario ever */
75 /* Timeline and 1 Layer */
76 timeline = ges_timeline_new ();
77 layer = (GESTimelineLayer *) ges_simple_timeline_layer_new ();
78 fail_unless (ges_timeline_add_layer (timeline, layer));
79 track = ges_track_new (GES_TRACK_TYPE_CUSTOM, GST_CAPS_ANY);
80 fail_unless (ges_timeline_add_track (timeline, track));
82 source = ges_custom_timeline_source_new (my_fill_track_func, NULL);
83 fail_unless (source != NULL);
84 g_object_set (source, "duration", GST_SECOND, "start", (guint64) 42, NULL);
85 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source), GST_SECOND);
86 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source), 42);
88 fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
89 (layer), GES_TIMELINE_OBJECT (source), -1));
90 fail_unless (ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (source)) ==
92 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source), GST_SECOND);
93 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source), 0);
97 ges_simple_timeline_layer_nth ((GESSimpleTimelineLayer *) layer, -1);
99 source2 = ges_simple_timeline_layer_nth ((GESSimpleTimelineLayer *) layer, 2);
101 source2 = ges_simple_timeline_layer_nth ((GESSimpleTimelineLayer *) layer, 0);
102 fail_unless ((GESTimelineObject *) source == source2);
106 result = ges_simple_timeline_layer_index ((GESSimpleTimelineLayer *) layer,
108 fail_unless_equals_int (result, 0);
109 result = ges_simple_timeline_layer_index ((GESSimpleTimelineLayer *) layer,
110 (GESTimelineObject *) NULL);
111 fail_unless_equals_int (result, -1);
113 fail_unless (ges_timeline_layer_remove_object (layer,
114 GES_TIMELINE_OBJECT (source)));
115 fail_unless (ges_timeline_remove_track (timeline, track));
116 fail_unless (ges_timeline_remove_layer (timeline, layer));
117 g_object_unref (timeline);
129 object_moved_cb (GESSimpleTimelineLayer * layer,
130 GESTimelineObject * object, gint old, gint new, gpointer user)
133 info = (siginfo *) user;
138 GST_START_TEST (test_gsl_move_simple)
140 GESTimeline *timeline;
141 GESTimelineLayer *layer;
143 GESCustomTimelineSource *source1, *source2;
144 siginfo info = { 0, 0 };
148 /* Timeline and 1 Layer */
149 timeline = ges_timeline_new ();
150 layer = (GESTimelineLayer *) ges_simple_timeline_layer_new ();
151 fail_unless (ges_timeline_add_layer (timeline, layer));
152 track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_new_any ());
153 fail_unless (ges_timeline_add_track (timeline, track));
154 g_signal_connect (G_OBJECT (layer), "object-moved", G_CALLBACK
155 (object_moved_cb), &info);
157 /* Create two 1s sources */
158 source1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
159 g_object_set (source1, "duration", GST_SECOND, "start", (guint64) 42, NULL);
160 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
162 source2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
163 g_object_set (source2, "duration", GST_SECOND, "start", (guint64) 42, NULL);
164 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
167 /* Add source to any position */
168 GST_DEBUG ("Adding the source to the timeline layer");
169 fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
170 (layer), GES_TIMELINE_OBJECT (source1), -1));
171 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
173 /* Add source2 to the end */
174 GST_DEBUG ("Adding the source to the timeline layer");
175 fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
176 (layer), GES_TIMELINE_OBJECT (source2), -1));
177 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
178 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), GST_SECOND);
180 /* Move source2 before source 1 (newpos:0) */
181 fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
182 (layer), GES_TIMELINE_OBJECT (source2), 0));
183 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), GST_SECOND);
184 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
185 fail_unless_equals_int (info.new, 0);
186 fail_unless_equals_int (info.old, 1);
188 /* Move source2 after source 1 (newpos:0) */
189 fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
190 (layer), GES_TIMELINE_OBJECT (source2), 1));
191 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
192 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), GST_SECOND);
193 fail_unless_equals_int (info.new, 1);
194 fail_unless_equals_int (info.old, 0);
196 /* Move source1 to end (newpos:-1) */
197 fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
198 (layer), GES_TIMELINE_OBJECT (source1), -1));
199 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), GST_SECOND);
200 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
201 /* position will be decremented, this is expected */
202 fail_unless_equals_int (info.new, -1);
203 fail_unless_equals_int (info.old, 0);
205 /* remove source1, source2 should be moved to the beginning */
206 g_object_ref (source1);
207 fail_unless (ges_timeline_layer_remove_object (layer,
208 GES_TIMELINE_OBJECT (source1)));
209 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
211 g_object_set (source1, "start", (guint64) 42, NULL);
213 /* re-add source1... using the normal API, it should be added to the end */
214 fail_unless (ges_timeline_layer_add_object (layer,
215 GES_TIMELINE_OBJECT (source1)));
216 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
217 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), GST_SECOND);
219 /* remove source1 ... */
220 fail_unless (ges_timeline_layer_remove_object (layer,
221 GES_TIMELINE_OBJECT (source1)));
222 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), 0);
223 /* ... and source2 */
224 fail_unless (ges_timeline_layer_remove_object (layer,
225 GES_TIMELINE_OBJECT (source2)));
227 fail_unless (ges_timeline_remove_track (timeline, track));
228 fail_unless (ges_timeline_remove_layer (timeline, layer));
229 g_object_unref (timeline);
235 valid_notify_cb (GObject * obj, GParamSpec * unused G_GNUC_UNUSED, gint * count)
240 GST_START_TEST (test_gsl_with_transitions)
242 GESTimeline *timeline;
243 GESTimelineLayer *layer;
245 GESCustomTimelineSource *source1, *source2, *source3, *source4;
246 GESTimelineStandardTransition *tr1, *tr2, *tr3, *tr4, *tr5;
247 GESSimpleTimelineLayer *gstl;
253 /* Timeline and 1 Layer */
254 timeline = ges_timeline_new ();
255 layer = (GESTimelineLayer *) ges_simple_timeline_layer_new ();
257 g_signal_connect (G_OBJECT (layer), "notify::valid",
258 G_CALLBACK (valid_notify_cb), &count);
260 fail_unless (ges_timeline_add_layer (timeline, layer));
261 ges_timeline_layer_set_priority (layer, 0);
263 track = ges_track_new (GES_TRACK_TYPE_VIDEO, gst_caps_new_any ());
264 fail_unless (ges_timeline_add_track (timeline, track));
266 track = ges_track_new (GES_TRACK_TYPE_AUDIO, gst_caps_new_any ());
267 fail_unless (ges_timeline_add_track (timeline, track));
270 #define ELEMENT "videotestsrc"
272 /* Create four 1s sources */
273 source1 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
275 g_object_set (source1, "duration", GST_SECOND, "start", (guint64) 42, NULL);
276 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
279 /* make this source taller than the others, so we can check that
280 * gstlrecalculate handles this properly */
282 source2 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
284 g_object_set (source2, "duration", GST_SECOND, "start", (guint64) 42, NULL);
285 GES_TIMELINE_OBJECT (source2)->height = 4;
286 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
289 source3 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
291 g_object_set (source3, "duration", GST_SECOND, "start", (guint64) 42, NULL);
292 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source3),
295 source4 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
297 g_object_set (source4, "duration", GST_SECOND, "start", (guint64) 42, NULL);
298 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source4),
301 /* create half-second transitions */
303 #define HALF_SECOND ((guint64) (0.5 * GST_SECOND))
304 #define SECOND(a) ((guint64) (a * GST_SECOND))
307 ges_timeline_standard_transition_new
308 (GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
309 g_object_set (tr1, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
310 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
313 ges_timeline_standard_transition_new
314 (GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
315 g_object_set (tr2, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
316 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr2), HALF_SECOND);
319 ges_timeline_standard_transition_new
320 (GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
321 g_object_set (tr3, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
322 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr3), HALF_SECOND);
325 ges_timeline_standard_transition_new
326 (GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
327 g_object_set (tr4, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
328 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr4), HALF_SECOND);
331 ges_timeline_standard_transition_new
332 (GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
333 g_object_set (tr5, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
334 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr5), HALF_SECOND);
336 /* simple test scenario with several sources in layer */
337 /* [0 0.5 1 1.5 2 2.5 3] */
340 /* 2 [0--source1----][3-tr2--] */
341 /* 3 [2---source2-----] */
342 /* 4 [2---source2-----] */
343 /* 5 [2---source2-----] */
344 /* 6 [2---source2-----] */
345 /* 7 [4---source3---] */
346 /* 8 [5---source4-----] */
349 gstl = GES_SIMPLE_TIMELINE_LAYER (layer);
351 /* add objects in sequence */
353 GST_DEBUG ("Adding source1");
355 fail_unless (ges_simple_timeline_layer_add_object (gstl,
356 GES_TIMELINE_OBJECT (source1), -1));
357 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
359 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
360 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
362 GST_DEBUG ("Adding tr1");
364 fail_unless (ges_simple_timeline_layer_add_object (gstl,
365 GES_TIMELINE_OBJECT (tr1), -1));
366 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
368 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
369 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
370 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
371 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
372 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
374 GST_DEBUG ("Adding source2");
376 fail_unless (ges_simple_timeline_layer_add_object (gstl,
377 GES_TIMELINE_OBJECT (source2), -1));
378 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
380 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
381 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
382 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
383 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
384 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
385 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
387 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), HALF_SECOND);
388 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source2), 3);
390 /* add the third source before the second transition */
392 GST_DEBUG ("Adding source3");
394 fail_unless (ges_simple_timeline_layer_add_object (gstl,
395 GES_TIMELINE_OBJECT (source3), -1));
396 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
398 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
399 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
400 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
401 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
402 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
403 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
405 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), HALF_SECOND);
406 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source2), 3);
407 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source3),
409 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source3), SECOND (1.5));
410 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source3), 7);
412 /* now add the second transition */
414 GST_DEBUG ("Adding tr2");
416 fail_unless (ges_simple_timeline_layer_add_object (gstl,
417 GES_TIMELINE_OBJECT (tr2), 3));
418 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
420 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
421 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
422 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
423 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
424 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
425 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
427 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), HALF_SECOND);
428 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source2), 3);
429 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr2), HALF_SECOND);
430 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr2), GST_SECOND);
431 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr2), 2);
432 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source3),
434 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source3), GST_SECOND);
435 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source3), 7);
439 GST_DEBUG ("Adding source4");
441 fail_unless (ges_simple_timeline_layer_add_object (gstl,
442 GES_TIMELINE_OBJECT (source4), -1));
443 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source1),
445 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source1), 0);
446 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source1), 2);
447 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
448 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr1), HALF_SECOND);
449 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr1), 1);
450 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source2),
452 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source2), HALF_SECOND);
453 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source2), 3);
454 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr2), HALF_SECOND);
455 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (tr2), GST_SECOND);
456 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (tr2), 2);
457 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source3),
459 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source3), GST_SECOND);
460 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source3), 7);
461 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source4),
463 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source4), SECOND (2));
464 fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_PRIORITY (source4), 8);
466 /* check that any insertion which might result in two adjacent transitions
469 GST_DEBUG ("Checking wrong insertion of tr3");
471 fail_if (ges_simple_timeline_layer_add_object (gstl,
472 GES_TIMELINE_OBJECT (tr3), 1));
474 fail_if (ges_simple_timeline_layer_add_object (gstl,
475 GES_TIMELINE_OBJECT (tr3), 2));
477 fail_if (ges_simple_timeline_layer_add_object (gstl,
478 GES_TIMELINE_OBJECT (tr3), 3));
480 fail_if (ges_simple_timeline_layer_add_object (gstl,
481 GES_TIMELINE_OBJECT (tr3), 4));
483 /* check that insertions which don't cause problems still work */
485 GST_DEBUG ("Checking correct insertion of tr3");
487 fail_unless (ges_simple_timeline_layer_add_object (gstl,
488 GES_TIMELINE_OBJECT (tr3), 5));
490 /* at this point the layer should still be valid */
491 g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
493 fail_unless_equals_int (count, 3);
495 GST_DEBUG ("Checking correct insertion of tr4");
497 fail_unless (ges_simple_timeline_layer_add_object (gstl,
498 GES_TIMELINE_OBJECT (tr4), -1));
500 GST_DEBUG ("Checking correct insertion of tr5");
502 fail_unless (ges_simple_timeline_layer_add_object (gstl,
503 GES_TIMELINE_OBJECT (tr5), 0));
505 /* removals which result in two or more adjacent transitions will also
506 * print a warning on the console. This is expected */
508 GST_DEBUG ("Removing source1");
510 fail_unless (ges_timeline_layer_remove_object (layer,
511 GES_TIMELINE_OBJECT (source1)));
513 /* layer should now be invalid */
515 g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
516 fail_unless (!valid);
517 fail_unless_equals_int (count, 4);
519 GST_DEBUG ("Removing source2/3/4");
521 fail_unless (ges_timeline_layer_remove_object (layer,
522 GES_TIMELINE_OBJECT (source2)));
523 fail_unless (ges_timeline_layer_remove_object (layer,
524 GES_TIMELINE_OBJECT (source3)));
525 fail_unless (ges_timeline_layer_remove_object (layer,
526 GES_TIMELINE_OBJECT (source4)));
528 g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
529 fail_unless (!valid);
530 fail_unless_equals_int (count, 4);
532 GST_DEBUG ("Removing transitions");
534 fail_unless (ges_timeline_layer_remove_object (layer,
535 GES_TIMELINE_OBJECT (tr1)));
536 fail_unless (ges_timeline_layer_remove_object (layer,
537 GES_TIMELINE_OBJECT (tr2)));
538 fail_unless (ges_timeline_layer_remove_object (layer,
539 GES_TIMELINE_OBJECT (tr3)));
540 fail_unless (ges_timeline_layer_remove_object (layer,
541 GES_TIMELINE_OBJECT (tr4)));
542 fail_unless (ges_timeline_layer_remove_object (layer,
543 GES_TIMELINE_OBJECT (tr5)));
545 GST_DEBUG ("done removing transition");
547 g_object_unref (timeline);
555 Suite *s = suite_create ("ges-simple-timeline-layer");
556 TCase *tc_chain = tcase_create ("basic");
558 suite_add_tcase (s, tc_chain);
560 tcase_add_test (tc_chain, test_gsl_add);
561 tcase_add_test (tc_chain, test_gsl_move_simple);
562 tcase_add_test (tc_chain, test_gsl_with_transitions);
568 main (int argc, char **argv)
572 Suite *s = ges_suite ();
573 SRunner *sr = srunner_create (s);
575 gst_check_init (&argc, &argv);
577 srunner_run_all (sr, CK_NORMAL);
578 nf = srunner_ntests_failed (sr);