docs: various doc fixes
[platform/upstream/gst-plugins-good.git] / gst / rtpmanager / gstrtpmux.c
1 /* RTP muxer element for GStreamer
2  *
3  * gstrtpmux.c:
4  *
5  * Copyright (C) <2007> Nokia Corporation.
6  *   Contact: Zeeshan Ali <zeeshan.ali@nokia.com>
7  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
8  *               2000,2005 Wim Taymans <wim@fluendo.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public
21  * License along with this library; if not, write to the
22  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23  * Boston, MA 02111-1307, USA.
24  */
25
26 /**
27  * SECTION:element-rtpmux
28  *
29  * The rtp muxer takes multiple RTP streams having the same clock-rate and
30  * muxes into a single stream with a single SSRC.
31  */
32
33 #ifdef HAVE_CONFIG_H
34 #include "config.h"
35 #endif
36
37 #include <gst/gst.h>
38 #include <gst/rtp/gstrtpbuffer.h>
39 #include <gstrtpmux.h>
40 #include <string.h>
41
42 GST_DEBUG_CATEGORY_STATIC (gst_rtp_mux_debug);
43 #define GST_CAT_DEFAULT gst_rtp_mux_debug
44
45 /* elementfactory information */
46 static const GstElementDetails gst_rtp_mux_details =
47 GST_ELEMENT_DETAILS ("RTP muxer",
48     "Codec/Muxer",
49     "multiplex N rtp streams into one",
50     "Zeeshan Ali <first.last@nokia.com>");
51
52 enum
53 {
54   ARG_0,
55   PROP_TIMESTAMP_OFFSET,
56   PROP_SEQNUM_OFFSET,
57   PROP_SEQNUM,
58   PROP_SSRC
59 };
60
61 #define DEFAULT_TIMESTAMP_OFFSET -1
62 #define DEFAULT_SEQNUM_OFFSET    -1
63 #define DEFAULT_SSRC             -1
64
65 typedef struct
66 {
67   gboolean have_ts_base;
68   guint clock_base;
69 } GstRTPMuxPadPrivate;
70
71 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
72     GST_PAD_SRC,
73     GST_PAD_ALWAYS,
74     GST_STATIC_CAPS ("application/x-rtp")
75     );
76
77 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%d",
78     GST_PAD_SINK,
79     GST_PAD_REQUEST,
80     GST_STATIC_CAPS ("application/x-rtp")
81     );
82
83 static void gst_rtp_mux_base_init (gpointer g_class);
84 static void gst_rtp_mux_class_init (GstRTPMuxClass * klass);
85 static void gst_rtp_mux_init (GstRTPMux * rtp_mux);
86
87 static void gst_rtp_mux_finalize (GObject * object);
88
89 static GstPad *gst_rtp_mux_request_new_pad (GstElement * element,
90     GstPadTemplate * templ, const gchar * name);
91 static void gst_rtp_mux_release_pad (GstElement * element, GstPad * pad);
92 static GstFlowReturn gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer);
93 static gboolean gst_rtp_mux_setcaps (GstPad * pad, GstCaps * caps);
94 static GstCaps *gst_rtp_mux_getcaps (GstPad * pad);
95
96 static GstStateChangeReturn gst_rtp_mux_change_state (GstElement *
97     element, GstStateChange transition);
98
99 static void gst_rtp_mux_set_property (GObject * object, guint prop_id,
100     const GValue * value, GParamSpec * pspec);
101 static void gst_rtp_mux_get_property (GObject * object, guint prop_id,
102     GValue * value, GParamSpec * pspec);
103
104 static gboolean gst_rtp_mux_src_event (GstPad * pad, GstEvent * event);
105
106 static GstElementClass *parent_class = NULL;
107
108 GType
109 gst_rtp_mux_get_type (void)
110 {
111   static GType rtp_mux_type = 0;
112
113   if (!rtp_mux_type) {
114     static const GTypeInfo rtp_mux_info = {
115       sizeof (GstRTPMuxClass),
116       gst_rtp_mux_base_init,
117       NULL,
118       (GClassInitFunc) gst_rtp_mux_class_init,
119       NULL,
120       NULL,
121       sizeof (GstRTPMux),
122       0,
123       (GInstanceInitFunc) gst_rtp_mux_init,
124     };
125
126     rtp_mux_type =
127         g_type_register_static (GST_TYPE_ELEMENT, "GstRTPMux",
128         &rtp_mux_info, 0);
129   }
130   return rtp_mux_type;
131 }
132
133 static void
134 gst_rtp_mux_base_init (gpointer g_class)
135 {
136   GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
137
138   gst_element_class_add_pad_template (element_class,
139       gst_static_pad_template_get (&src_factory));
140   gst_element_class_add_pad_template (element_class,
141       gst_static_pad_template_get (&sink_factory));
142
143   gst_element_class_set_details (element_class, &gst_rtp_mux_details);
144 }
145
146 static void
147 gst_rtp_mux_class_init (GstRTPMuxClass * klass)
148 {
149   GObjectClass *gobject_class;
150   GstElementClass *gstelement_class;
151
152   gobject_class = (GObjectClass *) klass;
153   gstelement_class = (GstElementClass *) klass;
154
155   parent_class = g_type_class_peek_parent (klass);
156
157   gobject_class->finalize = gst_rtp_mux_finalize;
158   gobject_class->get_property = gst_rtp_mux_get_property;
159   gobject_class->set_property = gst_rtp_mux_set_property;
160
161   g_object_class_install_property (G_OBJECT_CLASS (klass),
162       PROP_TIMESTAMP_OFFSET, g_param_spec_int ("timestamp-offset",
163           "Timestamp Offset",
164           "Offset to add to all outgoing timestamps (-1 = random)", -1,
165           G_MAXINT, DEFAULT_TIMESTAMP_OFFSET, G_PARAM_READWRITE));
166   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEQNUM_OFFSET,
167       g_param_spec_int ("seqnum-offset", "Sequence number Offset",
168           "Offset to add to all outgoing seqnum (-1 = random)", -1, G_MAXINT,
169           DEFAULT_SEQNUM_OFFSET, G_PARAM_READWRITE));
170   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEQNUM,
171       g_param_spec_uint ("seqnum", "Sequence number",
172           "The RTP sequence number of the last processed packet",
173           0, G_MAXUINT, 0, G_PARAM_READABLE));
174   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
175       g_param_spec_uint ("ssrc", "SSRC",
176           "The SSRC of the packets (-1 == random)",
177           0, G_MAXUINT, DEFAULT_SSRC, G_PARAM_READWRITE));
178
179   gstelement_class->request_new_pad = gst_rtp_mux_request_new_pad;
180   gstelement_class->release_pad = gst_rtp_mux_release_pad;
181   gstelement_class->change_state = gst_rtp_mux_change_state;
182
183   klass->chain_func = gst_rtp_mux_chain;
184 }
185
186 static gboolean
187 gst_rtp_mux_src_event (GstPad * pad, GstEvent * event)
188 {
189   GstElement *rtp_mux;
190   GstIterator *iter;
191   GstPad *sinkpad;
192   gboolean result = FALSE;
193   gboolean done = FALSE;
194
195   rtp_mux = gst_pad_get_parent_element (pad);
196   g_return_val_if_fail (rtp_mux != NULL, FALSE);
197
198   iter = gst_element_iterate_sink_pads (rtp_mux);
199
200   while (!done) {
201     switch (gst_iterator_next (iter, (gpointer) & sinkpad)) {
202       case GST_ITERATOR_OK:
203         gst_event_ref (event);
204         result |= gst_pad_push_event (sinkpad, event);
205         gst_object_unref (sinkpad);
206         break;
207       case GST_ITERATOR_RESYNC:
208         gst_iterator_resync (iter);
209         result = FALSE;
210         break;
211       case GST_ITERATOR_ERROR:
212         GST_WARNING_OBJECT (rtp_mux, "Error iterating sinkpads");
213       case GST_ITERATOR_DONE:
214         done = TRUE;
215         break;
216     }
217   }
218   gst_iterator_free (iter);
219   gst_object_unref (rtp_mux);
220   gst_event_unref (event);
221
222   return result;
223 }
224
225 static void
226 gst_rtp_mux_init (GstRTPMux * rtp_mux)
227 {
228   GstElementClass *klass = GST_ELEMENT_GET_CLASS (rtp_mux);
229
230   rtp_mux->srcpad =
231       gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
232           "src"), "src");
233   gst_pad_set_event_function (rtp_mux->srcpad, gst_rtp_mux_src_event);
234   gst_element_add_pad (GST_ELEMENT (rtp_mux), rtp_mux->srcpad);
235
236   rtp_mux->ssrc = DEFAULT_SSRC;
237   rtp_mux->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
238   rtp_mux->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
239 }
240
241 static void
242 gst_rtp_mux_finalize (GObject * object)
243 {
244   GstRTPMux *rtp_mux;
245
246   rtp_mux = GST_RTP_MUX (object);
247
248   G_OBJECT_CLASS (parent_class)->finalize (object);
249 }
250
251 static GstPad *
252 gst_rtp_mux_create_sinkpad (GstRTPMux * rtp_mux, GstPadTemplate * templ)
253 {
254   GstPad *newpad = NULL;
255   GstPadTemplate *class_templ;
256
257   class_templ =
258       gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (rtp_mux),
259       "sink_%d");
260
261   if (templ == class_templ) {
262     gchar *name;
263
264     /* create new pad with the name */
265     name = g_strdup_printf ("sink_%02d", rtp_mux->numpads);
266     newpad = gst_pad_new_from_template (templ, name);
267     g_free (name);
268
269     rtp_mux->numpads++;
270   } else {
271     GST_WARNING_OBJECT (rtp_mux, "this is not our template!\n");
272   }
273
274   return newpad;
275 }
276
277 static void
278 gst_rtp_mux_setup_sinkpad (GstRTPMux * rtp_mux, GstPad * sinkpad)
279 {
280   GstRTPMuxClass *klass;
281   GstRTPMuxPadPrivate *padpriv = g_slice_new0 (GstRTPMuxPadPrivate);
282
283   klass = GST_RTP_MUX_GET_CLASS (rtp_mux);
284
285   /* setup some pad functions */
286   gst_pad_set_setcaps_function (sinkpad, gst_rtp_mux_setcaps);
287   gst_pad_set_getcaps_function (sinkpad, gst_rtp_mux_getcaps);
288   if (klass->chain_func)
289     gst_pad_set_chain_function (sinkpad, klass->chain_func);
290   if (klass->sink_event_func)
291     gst_pad_set_event_function (sinkpad, klass->sink_event_func);
292
293   /* This could break with gstreamer 0.10.9 */
294   gst_pad_set_active (sinkpad, TRUE);
295
296   gst_pad_set_element_private (sinkpad, padpriv);
297
298   /* dd the pad to the element */
299   gst_element_add_pad (GST_ELEMENT (rtp_mux), sinkpad);
300 }
301
302 static GstPad *
303 gst_rtp_mux_request_new_pad (GstElement * element,
304     GstPadTemplate * templ, const gchar * req_name)
305 {
306   GstRTPMux *rtp_mux;
307   GstPad *newpad;
308
309   g_return_val_if_fail (templ != NULL, NULL);
310   g_return_val_if_fail (GST_IS_RTP_MUX (element), NULL);
311
312   rtp_mux = GST_RTP_MUX (element);
313
314   if (templ->direction != GST_PAD_SINK) {
315     GST_WARNING_OBJECT (rtp_mux, "request pad that is not a SINK pad");
316     return NULL;
317   }
318
319   newpad = gst_rtp_mux_create_sinkpad (rtp_mux, templ);
320   if (newpad)
321     gst_rtp_mux_setup_sinkpad (rtp_mux, newpad);
322   else
323     GST_WARNING_OBJECT (rtp_mux, "failed to create request pad");
324
325   return newpad;
326 }
327
328 static void
329 gst_rtp_mux_release_pad (GstElement * element, GstPad * pad)
330 {
331   GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad);
332
333   if (padpriv)
334     g_slice_free (GstRTPMuxPadPrivate, padpriv);
335   gst_pad_set_element_private (pad, NULL);
336
337   gst_element_remove_pad (element, pad);
338 }
339
340 /* Put our own clock-base on the buffer */
341 static void
342 gst_rtp_mux_readjust_rtp_timestamp (GstRTPMux * rtp_mux, GstPad * pad,
343     GstBuffer * buffer)
344 {
345   guint32 ts;
346   guint32 sink_ts_base = 0;
347   GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad);
348
349   if (padpriv->have_ts_base)
350     sink_ts_base = padpriv->clock_base;
351
352   ts = gst_rtp_buffer_get_timestamp (buffer) - sink_ts_base + rtp_mux->ts_base;
353   GST_LOG_OBJECT (rtp_mux, "Re-adjusting RTP ts %u to %u",
354       gst_rtp_buffer_get_timestamp (buffer), ts);
355   gst_rtp_buffer_set_timestamp (buffer, ts);
356 }
357
358 static GstFlowReturn
359 gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer)
360 {
361   GstRTPMux *rtp_mux;
362   GstStructure *structure;
363   GstFlowReturn ret;
364
365   rtp_mux = GST_RTP_MUX (gst_pad_get_parent (pad));
366
367   if (!gst_rtp_buffer_validate (buffer)) {
368     GST_ERROR_OBJECT (rtp_mux, "Invalid RTP buffer");
369     gst_object_unref (rtp_mux);
370     return GST_FLOW_ERROR;
371   }
372
373   buffer = gst_buffer_make_writable (buffer);
374
375   GST_OBJECT_LOCK (rtp_mux);
376   rtp_mux->seqnum++;
377   gst_rtp_buffer_set_seq (buffer, rtp_mux->seqnum);
378   GST_OBJECT_UNLOCK (rtp_mux);
379   GST_BUFFER_CAPS (buffer) = gst_caps_make_writable (GST_BUFFER_CAPS (buffer));
380   structure = gst_caps_get_structure (GST_BUFFER_CAPS (buffer), 0U);
381   gst_structure_set (structure, "seqnum-base", G_TYPE_UINT,
382       rtp_mux->seqnum_base, NULL);
383   gst_rtp_buffer_set_ssrc (buffer, rtp_mux->current_ssrc);
384   gst_rtp_mux_readjust_rtp_timestamp (rtp_mux, pad, buffer);
385   GST_LOG_OBJECT (rtp_mux, "Pushing packet size %d, seq=%d, ts=%u",
386       GST_BUFFER_SIZE (buffer), rtp_mux->seqnum,
387       gst_rtp_buffer_get_timestamp (buffer));
388
389   gst_buffer_set_caps (buffer, GST_PAD_CAPS (rtp_mux->srcpad));
390
391   ret = gst_pad_push (rtp_mux->srcpad, buffer);
392
393   gst_object_unref (rtp_mux);
394   return ret;
395 }
396
397 static gboolean
398 gst_rtp_mux_setcaps (GstPad * pad, GstCaps * caps)
399 {
400   GstRTPMux *rtp_mux;
401   GstStructure *structure;
402   gboolean ret = TRUE;
403   GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad);
404
405   rtp_mux = GST_RTP_MUX (gst_pad_get_parent (pad));
406
407   structure = gst_caps_get_structure (caps, 0);
408
409   if (!ret)
410     goto out;
411
412   if (gst_structure_get_uint (structure, "clock-base", &padpriv->clock_base)) {
413     padpriv->have_ts_base = TRUE;
414   }
415
416   caps = gst_caps_copy (caps);
417
418   gst_caps_set_simple (caps,
419       "clock-base", G_TYPE_UINT, rtp_mux->ts_base,
420       "seqnum-base", G_TYPE_UINT, rtp_mux->seqnum_base, NULL);
421
422   GST_DEBUG_OBJECT (rtp_mux,
423       "setting caps %" GST_PTR_FORMAT " on src pad..", caps);
424   ret = gst_pad_set_caps (rtp_mux->srcpad, caps);
425   gst_caps_unref (caps);
426
427 out:
428   gst_object_unref (rtp_mux);
429
430   return ret;
431 }
432
433 static void
434 clear_caps (GstCaps * caps, gboolean only_clock_rate)
435 {
436   gint i, j;
437
438   /* Lets only match on the clock-rate */
439   for (i = 0; i < gst_caps_get_size (caps); i++) {
440     GstStructure *s = gst_caps_get_structure (caps, i);
441
442     for (j = 0; j < gst_structure_n_fields (s); j++) {
443       const gchar *name = gst_structure_nth_field_name (s, j);
444
445       if (strcmp (name, "clock-rate") && (only_clock_rate ||
446               (strcmp (name, "ssrc")))) {
447         gst_structure_remove_field (s, name);
448         j--;
449       }
450     }
451   }
452 }
453
454 static gboolean
455 same_clock_rate_fold (gpointer item, GValue * ret, gpointer user_data)
456 {
457   GstPad *mypad = user_data;
458   GstPad *pad = item;
459   GstCaps *peercaps;
460   GstCaps *othercaps;
461   const GstCaps *accumcaps;
462   GstCaps *intersect;
463
464   if (pad == mypad)
465     return TRUE;
466
467   peercaps = gst_pad_peer_get_caps (pad);
468   if (!peercaps)
469     return TRUE;
470
471   othercaps = gst_caps_intersect (peercaps,
472       gst_pad_get_pad_template_caps (pad));
473   gst_caps_unref (peercaps);
474
475   accumcaps = gst_value_get_caps (ret);
476
477   clear_caps (othercaps, TRUE);
478
479   intersect = gst_caps_intersect (accumcaps, othercaps);
480
481   g_value_take_boxed (ret, intersect);
482
483   gst_caps_unref (othercaps);
484
485   return !gst_caps_is_empty (intersect);
486 }
487
488 static GstCaps *
489 gst_rtp_mux_getcaps (GstPad * pad)
490 {
491   GstRTPMux *mux = GST_RTP_MUX (gst_pad_get_parent (pad));
492   GstCaps *caps = NULL;
493   GstIterator *iter = NULL;
494   GValue v = { 0 };
495   GstIteratorResult res;
496   GstCaps *peercaps = gst_pad_peer_get_caps (mux->srcpad);
497   GstCaps *othercaps = NULL;
498
499   if (peercaps) {
500     othercaps = gst_caps_intersect (peercaps,
501         gst_pad_get_pad_template_caps (pad));
502     gst_caps_unref (peercaps);
503   } else {
504     othercaps = gst_caps_copy (gst_pad_get_pad_template_caps (mux->srcpad));
505   }
506
507   clear_caps (othercaps, FALSE);
508
509   g_value_init (&v, GST_TYPE_CAPS);
510
511   iter = gst_element_iterate_sink_pads (GST_ELEMENT (mux));
512   do {
513     gst_value_set_caps (&v, othercaps);
514     res = gst_iterator_fold (iter, same_clock_rate_fold, &v, pad);
515   } while (res == GST_ITERATOR_RESYNC);
516   gst_iterator_free (iter);
517
518   caps = (GstCaps *) gst_value_get_caps (&v);
519
520   if (res == GST_ITERATOR_ERROR) {
521     gst_caps_unref (caps);
522     caps = gst_caps_new_empty ();
523   }
524
525   if (othercaps)
526     gst_caps_unref (othercaps);
527   gst_object_unref (mux);
528
529   return caps;
530 }
531
532
533 static void
534 gst_rtp_mux_get_property (GObject * object,
535     guint prop_id, GValue * value, GParamSpec * pspec)
536 {
537   GstRTPMux *rtp_mux;
538
539   rtp_mux = GST_RTP_MUX (object);
540
541   switch (prop_id) {
542     case PROP_TIMESTAMP_OFFSET:
543       g_value_set_int (value, rtp_mux->ts_offset);
544       break;
545     case PROP_SEQNUM_OFFSET:
546       g_value_set_int (value, rtp_mux->seqnum_offset);
547       break;
548     case PROP_SEQNUM:
549       GST_OBJECT_LOCK (rtp_mux);
550       g_value_set_uint (value, rtp_mux->seqnum);
551       GST_OBJECT_UNLOCK (rtp_mux);
552       break;
553     case PROP_SSRC:
554       g_value_set_uint (value, rtp_mux->ssrc);
555       break;
556     default:
557       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
558       break;
559   }
560 }
561
562 static void
563 gst_rtp_mux_set_property (GObject * object,
564     guint prop_id, const GValue * value, GParamSpec * pspec)
565 {
566   GstRTPMux *rtp_mux;
567
568   rtp_mux = GST_RTP_MUX (object);
569
570   switch (prop_id) {
571     case PROP_TIMESTAMP_OFFSET:
572       rtp_mux->ts_offset = g_value_get_int (value);
573       break;
574     case PROP_SEQNUM_OFFSET:
575       rtp_mux->seqnum_offset = g_value_get_int (value);
576       break;
577     case PROP_SSRC:
578       rtp_mux->ssrc = g_value_get_uint (value);
579       break;
580     default:
581       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
582       break;
583   }
584 }
585
586 static void
587 gst_rtp_mux_ready_to_paused (GstRTPMux * rtp_mux)
588 {
589   GST_OBJECT_LOCK (rtp_mux);
590
591   if (rtp_mux->ssrc == -1)
592     rtp_mux->current_ssrc = g_random_int ();
593   else
594     rtp_mux->current_ssrc = rtp_mux->ssrc;
595
596   if (rtp_mux->seqnum_offset == -1)
597     rtp_mux->seqnum_base = g_random_int_range (0, G_MAXUINT16);
598   else
599     rtp_mux->seqnum_base = rtp_mux->seqnum_offset;
600   rtp_mux->seqnum = rtp_mux->seqnum_base;
601
602   if (rtp_mux->ts_offset == -1)
603     rtp_mux->ts_base = g_random_int ();
604   else
605     rtp_mux->ts_base = rtp_mux->ts_offset;
606   GST_DEBUG_OBJECT (rtp_mux, "set clock-base to %u", rtp_mux->ts_base);
607
608   GST_OBJECT_UNLOCK (rtp_mux);
609 }
610
611 static GstStateChangeReturn
612 gst_rtp_mux_change_state (GstElement * element, GstStateChange transition)
613 {
614   GstRTPMux *rtp_mux;
615
616   rtp_mux = GST_RTP_MUX (element);
617
618   switch (transition) {
619     case GST_STATE_CHANGE_NULL_TO_READY:
620       break;
621     case GST_STATE_CHANGE_READY_TO_PAUSED:
622       gst_rtp_mux_ready_to_paused (rtp_mux);
623       break;
624     case GST_STATE_CHANGE_PAUSED_TO_READY:
625       break;
626     default:
627       break;
628   }
629
630   return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
631 }
632
633 gboolean
634 gst_rtp_mux_plugin_init (GstPlugin * plugin)
635 {
636   GST_DEBUG_CATEGORY_INIT (gst_rtp_mux_debug, "rtpmux", 0, "rtp muxer");
637
638   return gst_element_register (plugin, "rtpmux", GST_RANK_NONE,
639       GST_TYPE_RTP_MUX);
640 }