context: use context on buffers instead of caps
[platform/upstream/gstreamer.git] / tests / check / elements / tee.c
1 /* GStreamer
2  *
3  * unit test for tee
4  *
5  * Copyright (C) <2007> Wim Taymans <wim dot taymans at gmail dot com>
6  * Copyright (C) <2008> Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
7  * Copyright (C) <2008> Christian Berentsen <christian.berentsen@tandberg.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #include <unistd.h>
26 #include <sys/types.h>
27 #include <sys/stat.h>
28 #include <fcntl.h>
29
30 #include <gst/check/gstcheck.h>
31
32 static void
33 handoff (GstElement * fakesink, GstBuffer * buf, GstPad * pad, guint * count)
34 {
35   *count = *count + 1;
36 }
37
38 /* construct fakesrc num-buffers=3 ! tee name=t ! queue ! fakesink t. ! queue !
39  * fakesink. Each fakesink should exactly receive 3 buffers.
40  */
41 GST_START_TEST (test_num_buffers)
42 {
43 #define NUM_SUBSTREAMS 15
44 #define NUM_BUFFERS 3
45   GstElement *pipeline, *src, *tee;
46   GstElement *queues[NUM_SUBSTREAMS];
47   GstElement *sinks[NUM_SUBSTREAMS];
48   GstPad *req_pads[NUM_SUBSTREAMS];
49   guint counts[NUM_SUBSTREAMS];
50   GstBus *bus;
51   GstMessage *msg;
52   gint i;
53
54   pipeline = gst_pipeline_new ("pipeline");
55   src = gst_check_setup_element ("fakesrc");
56   g_object_set (src, "num-buffers", NUM_BUFFERS, NULL);
57   tee = gst_check_setup_element ("tee");
58   fail_unless (gst_bin_add (GST_BIN (pipeline), src));
59   fail_unless (gst_bin_add (GST_BIN (pipeline), tee));
60   fail_unless (gst_element_link (src, tee));
61
62   for (i = 0; i < NUM_SUBSTREAMS; ++i) {
63     GstPad *qpad;
64     gchar name[32];
65
66     counts[i] = 0;
67
68     queues[i] = gst_check_setup_element ("queue");
69     g_snprintf (name, 32, "queue%d", i);
70     gst_object_set_name (GST_OBJECT (queues[i]), name);
71     fail_unless (gst_bin_add (GST_BIN (pipeline), queues[i]));
72
73     sinks[i] = gst_check_setup_element ("fakesink");
74     g_snprintf (name, 32, "sink%d", i);
75     gst_object_set_name (GST_OBJECT (sinks[i]), name);
76     fail_unless (gst_bin_add (GST_BIN (pipeline), sinks[i]));
77     fail_unless (gst_element_link (queues[i], sinks[i]));
78     g_object_set (sinks[i], "signal-handoffs", TRUE, NULL);
79     g_signal_connect (sinks[i], "handoff", (GCallback) handoff, &counts[i]);
80
81     req_pads[i] = gst_element_get_request_pad (tee, "src%d");
82     fail_unless (req_pads[i] != NULL);
83
84     qpad = gst_element_get_static_pad (queues[i], "sink");
85     fail_unless_equals_int (gst_pad_link (req_pads[i], qpad), GST_PAD_LINK_OK);
86     gst_object_unref (qpad);
87   }
88
89   bus = gst_element_get_bus (pipeline);
90   fail_if (bus == NULL);
91   gst_element_set_state (pipeline, GST_STATE_PLAYING);
92
93   msg = gst_bus_poll (bus, GST_MESSAGE_EOS | GST_MESSAGE_ERROR, -1);
94   fail_if (GST_MESSAGE_TYPE (msg) != GST_MESSAGE_EOS);
95   gst_message_unref (msg);
96
97   for (i = 0; i < NUM_SUBSTREAMS; ++i) {
98     fail_unless_equals_int (counts[i], NUM_BUFFERS);
99   }
100
101   gst_element_set_state (pipeline, GST_STATE_NULL);
102   gst_object_unref (bus);
103
104   for (i = 0; i < NUM_SUBSTREAMS; ++i) {
105     gst_element_release_request_pad (tee, req_pads[i]);
106     gst_object_unref (req_pads[i]);
107   }
108   gst_object_unref (pipeline);
109 }
110
111 GST_END_TEST;
112
113 /* we use fakesrc ! tee ! fakesink and then randomly request/release and link
114  * some pads from tee. This should happily run without any errors. */
115 GST_START_TEST (test_stress)
116 {
117   GstElement *pipeline;
118   GstElement *tee;
119   const gchar *desc;
120   GstBus *bus;
121   GstMessage *msg;
122   gint i;
123
124   /* Pump 1000 buffers (10 bytes each) per second through tee for 5 secs */
125   desc = "fakesrc datarate=10000 sizemin=10 sizemax=10 num-buffers=5000 ! "
126       "video/x-raw-rgb,framerate=25/1 ! tee name=t ! "
127       "queue max-size-buffers=2 ! fakesink sync=true";
128
129   pipeline = gst_parse_launch (desc, NULL);
130   fail_if (pipeline == NULL);
131
132   tee = gst_bin_get_by_name (GST_BIN (pipeline), "t");
133   fail_if (tee == NULL);
134
135   /* bring the pipeline to PLAYING, then start switching */
136   bus = gst_element_get_bus (pipeline);
137   fail_if (bus == NULL);
138   gst_element_set_state (pipeline, GST_STATE_PLAYING);
139   /* Wait for the pipeline to hit playing so that parse_launch can do the
140    * initial link, otherwise we perform linking from multiple threads and cause
141    * trouble */
142   gst_element_get_state (pipeline, NULL, NULL, GST_CLOCK_TIME_NONE);
143
144   for (i = 0; i < 50000; i++) {
145     GstPad *pad;
146
147     pad = gst_element_get_request_pad (tee, "src%d");
148     gst_element_release_request_pad (tee, pad);
149     gst_object_unref (pad);
150
151     if ((msg = gst_bus_poll (bus, GST_MESSAGE_EOS | GST_MESSAGE_ERROR, 0)))
152       break;
153   }
154
155   /* now wait for completion or error */
156   if (msg == NULL)
157     msg = gst_bus_poll (bus, GST_MESSAGE_EOS | GST_MESSAGE_ERROR, -1);
158   fail_if (GST_MESSAGE_TYPE (msg) != GST_MESSAGE_EOS);
159   gst_message_unref (msg);
160
161   gst_element_set_state (pipeline, GST_STATE_NULL);
162   gst_object_unref (tee);
163   gst_object_unref (bus);
164   gst_object_unref (pipeline);
165 }
166
167 GST_END_TEST;
168
169 typedef struct
170 {
171   GstElement *tee;
172   GstCaps *caps;
173   GstPad *start_srcpad;
174   GstPad *tee_sinkpad;
175   GstPad *tee_srcpad;
176   GstPad *final_sinkpad;
177   GThread *app_thread;
178   gint countdown;
179   gboolean app_thread_prepped;
180   gboolean bufferalloc_blocked;
181 } BufferAllocHarness;
182
183 static void
184 buffer_alloc_harness_setup (BufferAllocHarness * h, gint countdown)
185 {
186   h->tee = gst_check_setup_element ("tee");
187   fail_if (h->tee == NULL);
188
189   h->countdown = countdown;
190
191   fail_unless_equals_int (gst_element_set_state (h->tee, GST_STATE_PLAYING),
192       TRUE);
193
194   h->caps = gst_caps_new_simple ("video/x-raw-yuv", NULL);
195
196   h->start_srcpad = gst_pad_new ("src", GST_PAD_SRC);
197   fail_if (h->start_srcpad == NULL);
198   fail_unless (gst_pad_set_caps (h->start_srcpad, h->caps) == TRUE);
199   fail_unless (gst_pad_set_active (h->start_srcpad, TRUE) == TRUE);
200
201   h->tee_sinkpad = gst_element_get_static_pad (h->tee, "sink");
202   fail_if (h->tee_sinkpad == NULL);
203
204   h->tee_srcpad = gst_element_get_request_pad (h->tee, "src%d");
205   fail_if (h->tee_srcpad == NULL);
206
207   h->final_sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
208   fail_if (h->final_sinkpad == NULL);
209   fail_unless (gst_pad_set_caps (h->final_sinkpad, h->caps) == TRUE);
210   fail_unless (gst_pad_set_active (h->final_sinkpad, TRUE) == TRUE);
211   g_object_set_qdata (G_OBJECT (h->final_sinkpad),
212       g_quark_from_static_string ("buffer-alloc-harness"), h);
213
214   fail_unless_equals_int (gst_pad_link (h->start_srcpad, h->tee_sinkpad),
215       GST_PAD_LINK_OK);
216   fail_unless_equals_int (gst_pad_link (h->tee_srcpad, h->final_sinkpad),
217       GST_PAD_LINK_OK);
218 }
219
220 static void
221 buffer_alloc_harness_teardown (BufferAllocHarness * h)
222 {
223   if (h->app_thread)
224     g_thread_join (h->app_thread);
225
226   gst_pad_set_active (h->final_sinkpad, FALSE);
227   gst_object_unref (h->final_sinkpad);
228   gst_object_unref (h->tee_srcpad);
229   gst_object_unref (h->tee_sinkpad);
230   gst_pad_set_active (h->start_srcpad, FALSE);
231   gst_object_unref (h->start_srcpad);
232   gst_caps_unref (h->caps);
233   gst_check_teardown_element (h->tee);
234 }
235
236 #if 0
237 static gpointer
238 app_thread_func (gpointer data)
239 {
240   BufferAllocHarness *h = data;
241
242   /* Signal that we are about to call release_request_pad(). */
243   g_mutex_lock (check_mutex);
244   h->app_thread_prepped = TRUE;
245   g_cond_signal (check_cond);
246   g_mutex_unlock (check_mutex);
247
248   /* Simulate that the app releases the pad while the streaming thread is in
249    * buffer_alloc below. */
250   gst_element_release_request_pad (h->tee, h->tee_srcpad);
251
252   /* Signal the bufferalloc function below if it's still waiting. */
253   g_mutex_lock (check_mutex);
254   h->bufferalloc_blocked = FALSE;
255   g_cond_signal (check_cond);
256   g_mutex_unlock (check_mutex);
257
258   return NULL;
259 }
260 #endif
261
262 #if 0
263 static GstFlowReturn
264 final_sinkpad_bufferalloc (GstPad * pad, guint64 offset, guint size,
265     GstCaps * caps, GstBuffer ** buf)
266 {
267   BufferAllocHarness *h;
268   GTimeVal deadline;
269
270   h = g_object_get_qdata (G_OBJECT (pad),
271       g_quark_from_static_string ("buffer-alloc-harness"));
272   g_assert (h != NULL);
273
274   if (--(h->countdown) == 0) {
275     /* Time to make the app release the pad. */
276     h->app_thread_prepped = FALSE;
277     h->bufferalloc_blocked = TRUE;
278
279     h->app_thread = g_thread_create (app_thread_func, h, TRUE, NULL);
280     fail_if (h->app_thread == NULL);
281
282     /* Wait for the app thread to get ready to call release_request_pad(). */
283     g_mutex_lock (check_mutex);
284     while (!h->app_thread_prepped)
285       g_cond_wait (check_cond, check_mutex);
286     g_mutex_unlock (check_mutex);
287
288     /* Now wait for it to do that within a second, to avoid deadlocking
289      * in the event of future changes to the locking semantics. */
290     g_mutex_lock (check_mutex);
291     g_get_current_time (&deadline);
292     deadline.tv_sec += 1;
293     while (h->bufferalloc_blocked) {
294       if (!g_cond_timed_wait (check_cond, check_mutex, &deadline))
295         break;
296     }
297     g_mutex_unlock (check_mutex);
298   }
299
300   *buf = gst_buffer_new_and_alloc (size);
301   gst_buffer_set_caps (*buf, caps);
302
303   return GST_FLOW_OK;
304 }
305 #endif
306
307 /* Simulate an app releasing the pad while the first alloc_buffer() is in
308  * progress. */
309 GST_START_TEST (test_release_while_buffer_alloc)
310 {
311   BufferAllocHarness h;
312
313   buffer_alloc_harness_setup (&h, 1);
314
315   buffer_alloc_harness_teardown (&h);
316 }
317
318 GST_END_TEST;
319
320 /* Simulate an app releasing the pad while the second alloc_buffer() is in
321  * progress. */
322 GST_START_TEST (test_release_while_second_buffer_alloc)
323 {
324   BufferAllocHarness h;
325
326   buffer_alloc_harness_setup (&h, 2);
327
328   buffer_alloc_harness_teardown (&h);
329 }
330
331 GST_END_TEST;
332
333 /* Check the internal pads of tee */
334 GST_START_TEST (test_internal_links)
335 {
336   GstElement *tee;
337   GstPad *sinkpad, *srcpad1, *srcpad2;
338   GstIterator *it;
339   GstIteratorResult res;
340   gpointer val1, val2;
341
342   tee = gst_check_setup_element ("tee");
343
344   sinkpad = gst_element_get_static_pad (tee, "sink");
345   fail_unless (sinkpad != NULL);
346   it = gst_pad_iterate_internal_links (sinkpad);
347   fail_unless (it != NULL);
348
349   /* iterator should not return anything */
350   val1 = NULL;
351   res = gst_iterator_next (it, &val1);
352   fail_unless (res == GST_ITERATOR_DONE);
353   fail_unless (val1 == NULL);
354
355   srcpad1 = gst_element_get_request_pad (tee, "src%d");
356   fail_unless (srcpad1 != NULL);
357
358   /* iterator should resync */
359   res = gst_iterator_next (it, &val1);
360   fail_unless (res == GST_ITERATOR_RESYNC);
361   fail_unless (val1 == NULL);
362   gst_iterator_resync (it);
363
364   /* we should get something now */
365   res = gst_iterator_next (it, &val1);
366   fail_unless (res == GST_ITERATOR_OK);
367   fail_unless (GST_PAD_CAST (val1) == srcpad1);
368
369   gst_object_unref (val1);
370
371   val1 = NULL;
372   res = gst_iterator_next (it, &val1);
373   fail_unless (res == GST_ITERATOR_DONE);
374   fail_unless (val1 == NULL);
375
376   srcpad2 = gst_element_get_request_pad (tee, "src%d");
377   fail_unless (srcpad2 != NULL);
378
379   /* iterator should resync */
380   res = gst_iterator_next (it, &val1);
381   fail_unless (res == GST_ITERATOR_RESYNC);
382   fail_unless (val1 == NULL);
383   gst_iterator_resync (it);
384
385   /* we should get one of the 2 pads now */
386   res = gst_iterator_next (it, &val1);
387   fail_unless (res == GST_ITERATOR_OK);
388   fail_unless (GST_PAD_CAST (val1) == srcpad1
389       || GST_PAD_CAST (val1) == srcpad2);
390
391   /* and the other */
392   res = gst_iterator_next (it, &val2);
393   fail_unless (res == GST_ITERATOR_OK);
394   fail_unless (GST_PAD_CAST (val2) == srcpad1
395       || GST_PAD_CAST (val2) == srcpad2);
396   fail_unless (val1 != val2);
397   gst_object_unref (val1);
398   gst_object_unref (val2);
399
400   val1 = NULL;
401   res = gst_iterator_next (it, &val1);
402   fail_unless (res == GST_ITERATOR_DONE);
403   fail_unless (val1 == NULL);
404
405   gst_iterator_free (it);
406
407   /* get an iterator for the other direction */
408   it = gst_pad_iterate_internal_links (srcpad1);
409   fail_unless (it != NULL);
410
411   res = gst_iterator_next (it, &val1);
412   fail_unless (res == GST_ITERATOR_OK);
413   fail_unless (GST_PAD_CAST (val1) == sinkpad);
414   gst_object_unref (val1);
415
416   res = gst_iterator_next (it, &val1);
417   fail_unless (res == GST_ITERATOR_DONE);
418   gst_iterator_free (it);
419
420   it = gst_pad_iterate_internal_links (srcpad2);
421   fail_unless (it != NULL);
422
423   res = gst_iterator_next (it, &val1);
424   fail_unless (res == GST_ITERATOR_OK);
425   fail_unless (GST_PAD_CAST (val1) == sinkpad);
426   gst_object_unref (val1);
427
428   res = gst_iterator_next (it, &val1);
429   fail_unless (res == GST_ITERATOR_DONE);
430
431   gst_iterator_free (it);
432   gst_object_unref (srcpad1);
433   gst_object_unref (srcpad2);
434   gst_object_unref (sinkpad);
435   gst_object_unref (tee);
436 }
437
438 GST_END_TEST;
439
440 static GstFlowReturn
441 _fake_chain (GstPad * pad, GstBuffer * buffer)
442 {
443   gst_buffer_unref (buffer);
444   return GST_FLOW_OK;
445 }
446
447 static GstFlowReturn
448 _fake_chain_error (GstPad * pad, GstBuffer * buffer)
449 {
450   gst_buffer_unref (buffer);
451   return GST_FLOW_ERROR;
452 }
453
454 GST_START_TEST (test_flow_aggregation)
455 {
456   GstPad *mysrc, *mysink1, *mysink2;
457   GstPad *teesink, *teesrc1, *teesrc2;
458   GstElement *tee;
459   GstBuffer *buffer;
460   GstCaps *caps;
461
462   caps = gst_caps_new_simple ("test/test", NULL);
463
464   tee = gst_element_factory_make ("tee", NULL);
465   fail_unless (tee != NULL);
466   teesink = gst_element_get_static_pad (tee, "sink");
467   fail_unless (teesink != NULL);
468   teesrc1 = gst_element_get_request_pad (tee, "src%d");
469   fail_unless (teesrc1 != NULL);
470   teesrc2 = gst_element_get_request_pad (tee, "src%d");
471   fail_unless (teesrc2 != NULL);
472
473   mysink1 = gst_pad_new ("mysink1", GST_PAD_SINK);
474   gst_pad_set_caps (mysink1, caps);
475   mysink2 = gst_pad_new ("mysink2", GST_PAD_SINK);
476   gst_pad_set_caps (mysink2, caps);
477   mysrc = gst_pad_new ("mysrc", GST_PAD_SRC);
478   gst_pad_set_caps (mysrc, caps);
479
480   gst_pad_set_chain_function (mysink1, _fake_chain);
481   gst_pad_set_active (mysink1, TRUE);
482   gst_pad_set_chain_function (mysink2, _fake_chain);
483   gst_pad_set_active (mysink2, TRUE);
484
485   fail_unless (gst_pad_link (mysrc, teesink) == GST_PAD_LINK_OK);
486   fail_unless (gst_pad_link (teesrc1, mysink1) == GST_PAD_LINK_OK);
487   fail_unless (gst_pad_link (teesrc2, mysink2) == GST_PAD_LINK_OK);
488
489   fail_unless (gst_element_set_state (tee,
490           GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS);
491
492   buffer = gst_buffer_new ();
493   //gst_buffer_set_caps (buffer, caps);
494
495   /* First check if everything works in normal state */
496   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_OK);
497
498   /* One pad being in wrong state must result in wrong state */
499   gst_pad_set_active (mysink2, FALSE);
500   fail_unless (gst_pad_push (mysrc,
501           gst_buffer_ref (buffer)) == GST_FLOW_WRONG_STATE);
502
503   gst_pad_set_active (mysink1, FALSE);
504   gst_pad_set_active (mysink2, TRUE);
505   fail_unless (gst_pad_push (mysrc,
506           gst_buffer_ref (buffer)) == GST_FLOW_WRONG_STATE);
507
508   gst_pad_set_active (mysink2, FALSE);
509   fail_unless (gst_pad_push (mysrc,
510           gst_buffer_ref (buffer)) == GST_FLOW_WRONG_STATE);
511
512   /* Test if everything still works in normal state */
513   gst_pad_set_active (mysink1, TRUE);
514   gst_pad_set_active (mysink2, TRUE);
515   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_OK);
516
517   /* One unlinked pad must return OK, two unlinked pads must return NOT_LINKED */
518   fail_unless (gst_pad_unlink (teesrc1, mysink1) == TRUE);
519   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_OK);
520
521   fail_unless (gst_pad_link (teesrc1, mysink1) == GST_PAD_LINK_OK);
522   fail_unless (gst_pad_unlink (teesrc2, mysink2) == TRUE);
523   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_OK);
524
525   fail_unless (gst_pad_unlink (teesrc1, mysink1) == TRUE);
526   fail_unless (gst_pad_push (mysrc,
527           gst_buffer_ref (buffer)) == GST_FLOW_NOT_LINKED);
528
529   /* Test if everything still works in normal state */
530   fail_unless (gst_pad_link (teesrc1, mysink1) == GST_PAD_LINK_OK);
531   fail_unless (gst_pad_link (teesrc2, mysink2) == GST_PAD_LINK_OK);
532   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_OK);
533
534   /* One pad returning ERROR should result in ERROR */
535   gst_pad_set_chain_function (mysink1, _fake_chain_error);
536   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_ERROR);
537
538   gst_pad_set_chain_function (mysink1, _fake_chain);
539   gst_pad_set_chain_function (mysink2, _fake_chain_error);
540   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_ERROR);
541
542   gst_pad_set_chain_function (mysink1, _fake_chain_error);
543   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_ERROR);
544
545   /* And now everything still needs to work */
546   gst_pad_set_chain_function (mysink1, _fake_chain);
547   gst_pad_set_chain_function (mysink2, _fake_chain);
548   fail_unless (gst_pad_push (mysrc, gst_buffer_ref (buffer)) == GST_FLOW_OK);
549
550   fail_unless (gst_element_set_state (tee,
551           GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS);
552
553   fail_unless (gst_pad_unlink (mysrc, teesink) == TRUE);
554   fail_unless (gst_pad_unlink (teesrc1, mysink1) == TRUE);
555   fail_unless (gst_pad_unlink (teesrc2, mysink2) == TRUE);
556
557
558   gst_object_unref (teesink);
559   gst_object_unref (teesrc1);
560   gst_object_unref (teesrc2);
561   gst_element_release_request_pad (tee, teesrc1);
562   gst_element_release_request_pad (tee, teesrc2);
563   gst_object_unref (tee);
564
565   gst_object_unref (mysink1);
566   gst_object_unref (mysink2);
567   gst_object_unref (mysrc);
568   gst_caps_unref (caps);
569   gst_buffer_unref (buffer);
570 }
571
572 GST_END_TEST;
573
574 static Suite *
575 tee_suite (void)
576 {
577   Suite *s = suite_create ("tee");
578   TCase *tc_chain = tcase_create ("general");
579
580   /* Set the timeout to a much larger time - 3 minutes */
581   tcase_set_timeout (tc_chain, 180);
582
583   suite_add_tcase (s, tc_chain);
584   tcase_add_test (tc_chain, test_num_buffers);
585   tcase_add_test (tc_chain, test_stress);
586   tcase_add_test (tc_chain, test_release_while_buffer_alloc);
587   tcase_add_test (tc_chain, test_release_while_second_buffer_alloc);
588   tcase_add_test (tc_chain, test_internal_links);
589   tcase_add_test (tc_chain, test_flow_aggregation);
590
591   return s;
592 }
593
594 GST_CHECK_MAIN (tee);