tests: Use compositor instead of videomixer
[platform/upstream/gstreamer.git] / tests / check / gnl / gnloperation.c
1 #include "common.h"
2
3 static void
4 fill_pipeline_and_check (GstElement * comp, GList * segments)
5 {
6   GstElement *pipeline, *sink;
7   CollectStructure *collect;
8   GstBus *bus;
9   GstMessage *message;
10   gboolean carry_on = TRUE;
11   GstPad *sinkpad;
12   GList *listcopy = copy_segment_list (segments);
13
14   pipeline = gst_pipeline_new ("test_pipeline");
15   sink = gst_element_factory_make_or_warn ("fakesink", "sink");
16   fail_if (sink == NULL);
17
18   gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
19
20   /* Shared data */
21   collect = g_new0 (CollectStructure, 1);
22   collect->comp = comp;
23   collect->sink = sink;
24
25   /* Expected segments */
26   collect->expected_segments = segments;
27
28   gst_element_link (comp, sink);
29
30   sinkpad = gst_element_get_static_pad (sink, "sink");
31   gst_pad_add_probe (sinkpad, GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM,
32       (GstPadProbeCallback) sinkpad_probe, collect, NULL);
33
34   bus = gst_element_get_bus (GST_ELEMENT (pipeline));
35
36   GST_DEBUG ("Setting pipeline to PLAYING");
37
38   fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
39           GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
40
41   GST_DEBUG ("Let's poll the bus");
42   while (carry_on) {
43     message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 10);
44     if (message) {
45       switch (GST_MESSAGE_TYPE (message)) {
46         case GST_MESSAGE_EOS:
47           /* we should check if we really finished here */
48           GST_WARNING ("Got an EOS");
49           carry_on = FALSE;
50           break;
51         case GST_MESSAGE_SEGMENT_START:
52         case GST_MESSAGE_SEGMENT_DONE:
53           /* We shouldn't see any segement messages, since we didn't do a segment seek */
54           GST_WARNING ("Saw a Segment start/stop");
55           fail_if (TRUE);
56           break;
57         case GST_MESSAGE_ERROR:
58           fail_error_message (message);
59         default:
60           break;
61       }
62       gst_mini_object_unref (GST_MINI_OBJECT (message));
63     }
64   }
65
66   GST_DEBUG ("Setting pipeline to READY");
67
68   fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
69           GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
70
71   fail_if (collect->expected_segments != NULL);
72
73   GST_DEBUG ("Resetted pipeline to READY");
74
75   collect->expected_base = 0;
76   collect->expected_segments = listcopy;
77   collect->gotsegment = FALSE;
78
79   GST_DEBUG ("Setting pipeline to PLAYING again");
80
81   fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
82           GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
83
84   carry_on = TRUE;
85
86   GST_DEBUG ("Let's poll the bus");
87
88   while (carry_on) {
89     message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 10);
90     if (message) {
91       switch (GST_MESSAGE_TYPE (message)) {
92         case GST_MESSAGE_EOS:
93           /* we should check if we really finished here */
94           carry_on = FALSE;
95           break;
96         case GST_MESSAGE_SEGMENT_START:
97         case GST_MESSAGE_SEGMENT_DONE:
98           /* We shouldn't see any segement messages, since we didn't do a segment seek */
99           GST_WARNING ("Saw a Segment start/stop");
100           fail_if (TRUE);
101           break;
102         case GST_MESSAGE_ERROR:
103           fail_error_message (message);
104         default:
105           break;
106       }
107       gst_mini_object_unref (GST_MINI_OBJECT (message));
108     } else {
109       GST_DEBUG ("bus_poll responded, but there wasn't any message...");
110     }
111   }
112
113   fail_if (collect->expected_segments != NULL);
114
115   fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
116           GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE);
117
118   gst_object_unref (GST_OBJECT (sinkpad));
119   ASSERT_OBJECT_REFCOUNT_BETWEEN (pipeline, "main pipeline", 1, 2);
120   gst_object_unref (pipeline);
121   ASSERT_OBJECT_REFCOUNT_BETWEEN (bus, "main bus", 1, 2);
122   gst_object_unref (bus);
123
124   g_free (collect);
125 }
126
127 GST_START_TEST (test_simple_operation)
128 {
129   gboolean ret = FALSE;
130   GstElement *comp, *oper, *source;
131   GList *segments = NULL;
132
133   comp =
134       gst_element_factory_make_or_warn ("gnlcomposition", "test_composition");
135
136   /* TOPOLOGY
137    *
138    * 0           1           2           3           4          5 | Priority
139    * ----------------------------------------------------------------------------
140    *             [-- oper --]                                     | 0
141    * [------------- source -------------]                         | 1
142    * */
143
144   /*
145      source
146      Start : 0s
147      Duration : 3s
148      Priority : 1
149    */
150
151   source = videotest_gnl_src ("source", 0, 3 * GST_SECOND, 2, 1);
152   fail_if (source == NULL);
153
154   /*
155      operation
156      Start : 1s
157      Duration : 1s
158      Priority : 0
159    */
160
161   oper = new_operation ("oper", "identity", 1 * GST_SECOND, 1 * GST_SECOND, 0);
162   fail_if (oper == NULL);
163
164   /* Add source */
165   ASSERT_OBJECT_REFCOUNT (source, "source", 1);
166   ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
167
168   gnl_composition_add (GST_BIN (comp), source);
169   commit_and_wait (comp, &ret);
170   check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
171
172   ASSERT_OBJECT_REFCOUNT (source, "source", 1);
173
174   /* Add operaton */
175
176   gnl_composition_add (GST_BIN (comp), oper);
177   commit_and_wait (comp, &ret);
178   check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
179
180   ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
181
182   /* remove source */
183
184   gst_object_ref (source);
185   gnl_composition_remove (GST_BIN (comp), source);
186   check_start_stop_duration (comp, 1 * GST_SECOND, 2 * GST_SECOND,
187       1 * GST_SECOND);
188
189   ASSERT_OBJECT_REFCOUNT (source, "source", 1);
190
191   /* re-add source */
192   gnl_composition_add (GST_BIN (comp), source);
193   commit_and_wait (comp, &ret);
194   check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
195   gst_object_unref (source);
196
197   ASSERT_OBJECT_REFCOUNT (source, "source", 1);
198
199   /* Expected segments */
200   segments = g_list_append (segments,
201       segment_new (1.0, GST_FORMAT_TIME, 0, 1 * GST_SECOND, 0));
202   segments = g_list_append (segments,
203       segment_new (1.0, GST_FORMAT_TIME,
204           1 * GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND));
205   segments = g_list_append (segments,
206       segment_new (1.0, GST_FORMAT_TIME,
207           2 * GST_SECOND, 3 * GST_SECOND, 2 * GST_SECOND));
208
209   fill_pipeline_and_check (comp, segments);
210 }
211
212 GST_END_TEST;
213
214 GST_START_TEST (test_pyramid_operations)
215 {
216   GstElement *comp, *oper1, *oper2, *source;
217   gboolean ret = FALSE;
218   GList *segments = NULL;
219
220   comp =
221       gst_element_factory_make_or_warn ("gnlcomposition", "test_composition");
222
223   /*
224      source
225      Start : 0s
226      Duration : 10s
227      Priority : 2
228    */
229
230   source = videotest_gnl_src ("source", 0, 10 * GST_SECOND, 2, 2);
231
232   /*
233      operation1
234      Start : 4s
235      Duration : 2s
236      Priority : 1
237    */
238
239   oper1 =
240       new_operation ("oper1", "identity", 4 * GST_SECOND, 2 * GST_SECOND, 1);
241
242   /*
243      operation2
244      Start : 2s
245      Duration : 6s
246      Priority : 0
247    */
248
249   oper2 =
250       new_operation ("oper2", "identity", 2 * GST_SECOND, 6 * GST_SECOND, 0);
251
252   /* Add source */
253   ASSERT_OBJECT_REFCOUNT (source, "source", 1);
254   ASSERT_OBJECT_REFCOUNT (oper1, "oper1", 1);
255   ASSERT_OBJECT_REFCOUNT (oper2, "oper2", 1);
256
257   gnl_composition_add (GST_BIN (comp), source);
258   commit_and_wait (comp, &ret);
259   check_start_stop_duration (source, 0, 10 * GST_SECOND, 10 * GST_SECOND);
260   check_start_stop_duration (comp, 0, 10 * GST_SECOND, 10 * GST_SECOND);
261
262   ASSERT_OBJECT_REFCOUNT (source, "source", 1);
263
264   /* Add operation 1 */
265
266   gnl_composition_add (GST_BIN (comp), oper1);
267   commit_and_wait (comp, &ret);
268   check_start_stop_duration (oper1, 4 * GST_SECOND, 6 * GST_SECOND,
269       2 * GST_SECOND);
270   check_start_stop_duration (comp, 0, 10 * GST_SECOND, 10 * GST_SECOND);
271
272   ASSERT_OBJECT_REFCOUNT (oper1, "oper1", 1);
273
274   /* Add operation 2 */
275
276   gnl_composition_add (GST_BIN (comp), oper2);
277   commit_and_wait (comp, &ret);
278   check_start_stop_duration (oper2, 2 * GST_SECOND, 8 * GST_SECOND,
279       6 * GST_SECOND);
280   check_start_stop_duration (comp, 0, 10 * GST_SECOND, 10 * GST_SECOND);
281
282   ASSERT_OBJECT_REFCOUNT (oper1, "oper2", 1);
283
284   /* Expected segments */
285   segments = g_list_append (segments,
286       segment_new (1.0, GST_FORMAT_TIME, 0, 2 * GST_SECOND, 0));
287   segments = g_list_append (segments,
288       segment_new (1.0, GST_FORMAT_TIME,
289           2 * GST_SECOND, 4 * GST_SECOND, 2 * GST_SECOND));
290   segments = g_list_append (segments,
291       segment_new (1.0, GST_FORMAT_TIME,
292           4 * GST_SECOND, 6 * GST_SECOND, 4 * GST_SECOND));
293   segments = g_list_append (segments,
294       segment_new (1.0, GST_FORMAT_TIME,
295           6 * GST_SECOND, 8 * GST_SECOND, 6 * GST_SECOND));
296   segments = g_list_append (segments,
297       segment_new (1.0, GST_FORMAT_TIME,
298           8 * GST_SECOND, 10 * GST_SECOND, 8 * GST_SECOND));
299
300   fill_pipeline_and_check (comp, segments);
301 }
302
303 GST_END_TEST;
304
305 GST_START_TEST (test_pyramid_operations2)
306 {
307   gboolean ret;
308   GstElement *comp, *oper, *source1, *source2, *def;
309   GList *segments = NULL;
310
311   comp =
312       gst_element_factory_make_or_warn ("gnlcomposition", "test_composition");
313
314   /*
315      source1
316      Start : 0s
317      Duration : 2s
318      Priority : 2
319    */
320
321   source1 = videotest_gnl_src ("source1", 0, 2 * GST_SECOND, 2, 2);
322
323   /*
324      operation
325      Start : 1s
326      Duration : 4s
327      Priority : 1
328    */
329
330   oper = new_operation ("oper", "identity", 1 * GST_SECOND, 4 * GST_SECOND, 1);
331
332   /*
333      source2
334      Start : 4s
335      Duration : 2s
336      Priority : 2
337    */
338
339   source2 = videotest_gnl_src ("source2", 4 * GST_SECOND, 2 * GST_SECOND, 2, 2);
340
341   /*
342      def (default source)
343      Priority = G_MAXUINT32
344    */
345   def =
346       videotest_gnl_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2,
347       G_MAXUINT32);
348   g_object_set (def, "expandable", TRUE, NULL);
349
350   ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
351   ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
352   ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
353   ASSERT_OBJECT_REFCOUNT (def, "default", 1);
354
355   /* Add source 1 */
356
357   gnl_composition_add (GST_BIN (comp), source1);
358   commit_and_wait (comp, &ret);
359   check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
360
361   /* Add source 2 */
362
363   gnl_composition_add (GST_BIN (comp), source2);
364   commit_and_wait (comp, &ret);
365   check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
366
367   /* Add operation */
368
369   gnl_composition_add (GST_BIN (comp), oper);
370   commit_and_wait (comp, &ret);
371   check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
372
373   /* Add default */
374
375   gnl_composition_add (GST_BIN (comp), def);
376   commit_and_wait (comp, &ret);
377   check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
378
379
380   /* Expected segments */
381   segments = g_list_append (segments,
382       segment_new (1.0, GST_FORMAT_TIME, 0, 1 * GST_SECOND, 0));
383   segments = g_list_append (segments,
384       segment_new (1.0, GST_FORMAT_TIME,
385           1 * GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND));
386   segments = g_list_append (segments,
387       segment_new (1.0, GST_FORMAT_TIME,
388           2 * GST_SECOND, 4 * GST_SECOND, 2 * GST_SECOND));
389   segments = g_list_append (segments,
390       segment_new (1.0, GST_FORMAT_TIME,
391           4 * GST_SECOND, 5 * GST_SECOND, 4 * GST_SECOND));
392   segments = g_list_append (segments,
393       segment_new (1.0, GST_FORMAT_TIME,
394           5 * GST_SECOND, 6 * GST_SECOND, 5 * GST_SECOND));
395
396   fill_pipeline_and_check (comp, segments);
397 }
398
399 GST_END_TEST;
400
401 GST_START_TEST (test_pyramid_operations_expandable)
402 {
403   GstElement *comp, *oper, *source1, *source2, *def;
404   gboolean ret = FALSE;
405   GList *segments = NULL;
406
407   comp =
408       gst_element_factory_make_or_warn ("gnlcomposition", "test_composition");
409
410   /*
411      source1
412      Start : 0s
413      Duration : 2s
414      Priority : 2
415    */
416
417   source1 = videotest_gnl_src ("source1", 0, 2 * GST_SECOND, 2, 2);
418
419   /*
420      operation (expandable)
421      Start : XX
422      Duration : XX
423      Priority : 1
424    */
425
426   oper = new_operation ("oper", "identity", 1 * GST_SECOND, 4 * GST_SECOND, 1);
427   g_object_set (oper, "expandable", TRUE, NULL);
428
429   /*
430      source2
431      Start : 4s
432      Duration : 2s
433      Priority : 2
434    */
435
436   source2 = videotest_gnl_src ("source2", 4 * GST_SECOND, 2 * GST_SECOND, 2, 2);
437
438   /*
439      def (default source)
440      Priority = G_MAXUINT32
441    */
442   def =
443       videotest_gnl_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2,
444       G_MAXUINT32);
445   g_object_set (def, "expandable", TRUE, NULL);
446
447   ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
448   ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
449   ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
450   ASSERT_OBJECT_REFCOUNT (def, "default", 1);
451
452   /* Add source 1 */
453   gnl_composition_add (GST_BIN (comp), source1);
454   /* Add source 2 */
455   gnl_composition_add (GST_BIN (comp), source2);
456   /* Add operation */
457   gnl_composition_add (GST_BIN (comp), oper);
458   /* Add default */
459   gnl_composition_add (GST_BIN (comp), def);
460
461   commit_and_wait (comp, &ret);
462   check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND);
463   check_start_stop_duration (oper, 0 * GST_SECOND, 6 * GST_SECOND,
464       6 * GST_SECOND);
465   check_start_stop_duration (source2, 4 * GST_SECOND, 6 * GST_SECOND,
466       2 * GST_SECOND);
467   check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
468
469   /* Expected segments */
470   segments = g_list_append (segments,
471       segment_new (1.0, GST_FORMAT_TIME, 0, 2 * GST_SECOND, 0));
472   segments = g_list_append (segments,
473       segment_new (1.0, GST_FORMAT_TIME,
474           2 * GST_SECOND, 4 * GST_SECOND, 2 * GST_SECOND));
475   segments = g_list_append (segments,
476       segment_new (1.0, GST_FORMAT_TIME,
477           4 * GST_SECOND, 6 * GST_SECOND, 4 * GST_SECOND));
478
479   fill_pipeline_and_check (comp, segments);
480 }
481
482 GST_END_TEST;
483
484
485 GST_START_TEST (test_complex_operations)
486 {
487   GstElement *comp, *oper, *source1, *source2;
488   gboolean ret = FALSE;
489   GList *segments = NULL;
490
491   comp =
492       gst_element_factory_make_or_warn ("gnlcomposition", "test_composition");
493
494   /* TOPOLOGY
495    *
496    * 0           1           2           3           4     5    6 | Priority
497    * ----------------------------------------------------------------------------
498    *                         [    -oper-            ]             | 1
499    *                         [    -source2-                   -]  | 2
500    * [                    -source1-                -]             | 3
501    * */
502
503   /*
504      source1
505      Start : 0s
506      Duration : 4s
507      Priority : 3
508    */
509
510   source1 = videotest_in_bin_gnl_src ("source1", 0, 4 * GST_SECOND, 2, 3);
511   fail_if (source1 == NULL);
512
513   /*
514      source2
515      Start : 2s
516      Duration : 4s
517      Priority : 2
518    */
519
520   source2 =
521       videotest_in_bin_gnl_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2,
522       2);
523   fail_if (source2 == NULL);
524
525   /*
526      operation
527      Start : 2s
528      Duration : 2s
529      Priority : 1
530    */
531
532   oper =
533       new_operation ("oper", "compositor", 2 * GST_SECOND, 2 * GST_SECOND, 1);
534   fail_if (oper == NULL);
535
536   ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
537   ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
538   ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
539
540   /* Add source1 */
541   gnl_composition_add (GST_BIN (comp), source1);
542   check_start_stop_duration (comp, 0, 0, 0);
543   ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
544
545   /* Add source2 */
546   gnl_composition_add (GST_BIN (comp), source2);
547   check_start_stop_duration (comp, 0, 0, 0);
548   ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
549
550   /* Add operaton */
551   gnl_composition_add (GST_BIN (comp), oper);
552   check_start_stop_duration (comp, 0, 0, 0);
553
554   commit_and_wait (comp, &ret);
555   check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
556
557   ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
558
559   /* Expected segments */
560   segments = g_list_append (segments,
561       segment_new (1.0, GST_FORMAT_TIME, 0, 2 * GST_SECOND, 0));
562   segments = g_list_append (segments,
563       segment_new (1.0, GST_FORMAT_TIME,
564           0 * GST_SECOND, 2 * GST_SECOND, 2 * GST_SECOND));
565   segments = g_list_append (segments,
566       segment_new (1.0, GST_FORMAT_TIME,
567           4 * GST_SECOND, 6 * GST_SECOND, 4 * GST_SECOND));
568
569   fill_pipeline_and_check (comp, segments);
570 }
571
572 GST_END_TEST;
573
574
575 GST_START_TEST (test_complex_operations_bis)
576 {
577   GstElement *comp, *oper, *source1, *source2;
578   gboolean ret;
579   GList *segments = NULL;
580
581   comp =
582       gst_element_factory_make_or_warn ("gnlcomposition", "test_composition");
583
584   /* TOPOLOGY
585    *
586    * 0           1           2           3           4     ..   6 | Priority
587    * ----------------------------------------------------------------------------
588    * [ ......................[------ oper ----------]..........]  | 1 EXPANDABLE
589    * [--------------------- source1 ----------------]             | 2
590    *                         [------------ source2 ------------]  | 3
591    * */
592
593
594   /*
595      source1
596      Start : 0s
597      Duration : 4s
598      Priority : 2
599    */
600
601   source1 = videotest_in_bin_gnl_src ("source1", 0, 4 * GST_SECOND, 3, 2);
602   fail_if (source1 == NULL);
603
604   /*
605      source2
606      Start : 2s
607      Duration : 4s
608      Priority : 3
609    */
610
611   source2 =
612       videotest_in_bin_gnl_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2,
613       3);
614   fail_if (source2 == NULL);
615
616   /*
617      operation
618      Start : 2s
619      Duration : 2s
620      Priority : 1
621      EXPANDABLE
622    */
623
624   oper =
625       new_operation ("oper", "compositor", 2 * GST_SECOND, 2 * GST_SECOND, 1);
626   fail_if (oper == NULL);
627   g_object_set (oper, "expandable", TRUE, NULL);
628
629   ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
630   ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
631   ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
632
633   /* Add source1 */
634   gnl_composition_add (GST_BIN (comp), source1);
635   commit_and_wait (comp, &ret);
636   check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND);
637
638   ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
639
640   /* Add source2 */
641   gnl_composition_add (GST_BIN (comp), source2);
642   commit_and_wait (comp, &ret);
643   check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
644
645   ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
646
647   /* Add operaton */
648
649   gnl_composition_add (GST_BIN (comp), oper);
650   commit_and_wait (comp, &ret);
651   check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
652   /* Since it's expandable, it should have changed to full length */
653   check_start_stop_duration (oper, 0 * GST_SECOND, 6 * GST_SECOND,
654       6 * GST_SECOND);
655
656   ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
657
658   /* Expected segments */
659   segments = g_list_append (segments,
660       segment_new (1.0, GST_FORMAT_TIME, 0, 2 * GST_SECOND, 0));
661   segments = g_list_append (segments,
662       segment_new (1.0, GST_FORMAT_TIME,
663           0 * GST_SECOND, 2 * GST_SECOND, 2 * GST_SECOND));
664   segments = g_list_append (segments,
665       segment_new (1.0, GST_FORMAT_TIME,
666           0 * GST_SECOND, 2 * GST_SECOND, 4 * GST_SECOND));
667
668   fill_pipeline_and_check (comp, segments);
669 }
670
671 GST_END_TEST;
672
673
674
675 static Suite *
676 gnonlin_suite (void)
677 {
678   Suite *s = suite_create ("gnloperation");
679   TCase *tc_chain = tcase_create ("gnloperation");
680
681   suite_add_tcase (s, tc_chain);
682
683   tcase_add_test (tc_chain, test_simple_operation);
684   tcase_add_test (tc_chain, test_pyramid_operations);
685   tcase_add_test (tc_chain, test_pyramid_operations2);
686   tcase_add_test (tc_chain, test_pyramid_operations_expandable);
687   if (gst_registry_check_feature_version (gst_registry_get (), "compositor", 0,
688           11, 0)) {
689     tcase_add_test (tc_chain, test_complex_operations);
690     tcase_add_test (tc_chain, test_complex_operations_bis);
691   } else
692     GST_WARNING ("compositor element not available, skipping 1 test");
693
694   return s;
695 }
696
697 GST_CHECK_MAIN (gnonlin)