rtpmux: Free the pad private data on pad release
[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 <string.h>
40
41 #include "gstrtpmux.h"
42
43 GST_DEBUG_CATEGORY_STATIC (gst_rtp_mux_debug);
44 #define GST_CAT_DEFAULT gst_rtp_mux_debug
45
46 /* elementfactory information */
47 static const GstElementDetails gst_rtp_mux_details =
48 GST_ELEMENT_DETAILS ("RTP muxer",
49     "Codec/Muxer",
50     "multiplex N rtp streams into one",
51     "Zeeshan Ali <first.last@nokia.com>");
52
53 enum
54 {
55   ARG_0,
56   PROP_TIMESTAMP_OFFSET,
57   PROP_SEQNUM_OFFSET,
58   PROP_SEQNUM,
59   PROP_SSRC
60 };
61
62 #define DEFAULT_TIMESTAMP_OFFSET -1
63 #define DEFAULT_SEQNUM_OFFSET    -1
64 #define DEFAULT_SSRC             -1
65
66 typedef struct
67 {
68   gboolean have_clock_base;
69   guint clock_base;
70
71   GstCaps *out_caps;
72 } GstRTPMuxPadPrivate;
73
74 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
75     GST_PAD_SRC,
76     GST_PAD_ALWAYS,
77     GST_STATIC_CAPS ("application/x-rtp")
78     );
79
80 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%d",
81     GST_PAD_SINK,
82     GST_PAD_REQUEST,
83     GST_STATIC_CAPS ("application/x-rtp")
84     );
85
86 static void gst_rtp_mux_finalize (GObject * object);
87
88 static GstPad *gst_rtp_mux_request_new_pad (GstElement * element,
89     GstPadTemplate * templ, const gchar * name);
90 static void gst_rtp_mux_release_pad (GstElement * element, GstPad * pad);
91 static GstFlowReturn gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer);
92 static gboolean gst_rtp_mux_setcaps (GstPad * pad, GstCaps * caps);
93 static GstCaps *gst_rtp_mux_getcaps (GstPad * pad);
94
95 static GstStateChangeReturn gst_rtp_mux_change_state (GstElement *
96     element, GstStateChange transition);
97
98 static void gst_rtp_mux_set_property (GObject * object, guint prop_id,
99     const GValue * value, GParamSpec * pspec);
100 static void gst_rtp_mux_get_property (GObject * object, guint prop_id,
101     GValue * value, GParamSpec * pspec);
102
103
104 GST_BOILERPLATE (GstRTPMux, gst_rtp_mux, GstElement, GST_TYPE_ELEMENT);
105
106 static void
107 gst_rtp_mux_base_init (gpointer g_class)
108 {
109   GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
110
111   gst_element_class_add_pad_template (element_class,
112       gst_static_pad_template_get (&src_factory));
113   gst_element_class_add_pad_template (element_class,
114       gst_static_pad_template_get (&sink_factory));
115
116   gst_element_class_set_details (element_class, &gst_rtp_mux_details);
117 }
118
119 static void
120 gst_rtp_mux_class_init (GstRTPMuxClass * klass)
121 {
122   GObjectClass *gobject_class;
123   GstElementClass *gstelement_class;
124
125   gobject_class = (GObjectClass *) klass;
126   gstelement_class = (GstElementClass *) klass;
127
128   gobject_class->finalize = gst_rtp_mux_finalize;
129   gobject_class->get_property = gst_rtp_mux_get_property;
130   gobject_class->set_property = gst_rtp_mux_set_property;
131
132   g_object_class_install_property (G_OBJECT_CLASS (klass),
133       PROP_TIMESTAMP_OFFSET, g_param_spec_int ("timestamp-offset",
134           "Timestamp Offset",
135           "Offset to add to all outgoing timestamps (-1 = random)", -1,
136           G_MAXINT, DEFAULT_TIMESTAMP_OFFSET, G_PARAM_READWRITE));
137   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEQNUM_OFFSET,
138       g_param_spec_int ("seqnum-offset", "Sequence number Offset",
139           "Offset to add to all outgoing seqnum (-1 = random)", -1, G_MAXINT,
140           DEFAULT_SEQNUM_OFFSET, G_PARAM_READWRITE));
141   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEQNUM,
142       g_param_spec_uint ("seqnum", "Sequence number",
143           "The RTP sequence number of the last processed packet",
144           0, G_MAXUINT, 0, G_PARAM_READABLE));
145   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
146       g_param_spec_uint ("ssrc", "SSRC",
147           "The SSRC of the packets (-1 == random)",
148           0, G_MAXUINT, DEFAULT_SSRC, G_PARAM_READWRITE));
149
150   gstelement_class->request_new_pad =
151       GST_DEBUG_FUNCPTR (gst_rtp_mux_request_new_pad);
152   gstelement_class->release_pad = GST_DEBUG_FUNCPTR (gst_rtp_mux_release_pad);
153   gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_rtp_mux_change_state);
154
155   klass->chain_func = gst_rtp_mux_chain;
156 }
157
158 static gboolean
159 gst_rtp_mux_src_event (GstPad * pad, GstEvent * event)
160 {
161   GstElement *rtp_mux;
162   GstIterator *iter;
163   GstPad *sinkpad;
164   gboolean result = FALSE;
165   gboolean done = FALSE;
166
167   rtp_mux = gst_pad_get_parent_element (pad);
168   g_return_val_if_fail (rtp_mux != NULL, FALSE);
169
170   iter = gst_element_iterate_sink_pads (rtp_mux);
171
172   while (!done) {
173     switch (gst_iterator_next (iter, (gpointer) & sinkpad)) {
174       case GST_ITERATOR_OK:
175         gst_event_ref (event);
176         result |= gst_pad_push_event (sinkpad, event);
177         gst_object_unref (sinkpad);
178         break;
179       case GST_ITERATOR_RESYNC:
180         gst_iterator_resync (iter);
181         result = FALSE;
182         break;
183       case GST_ITERATOR_ERROR:
184         GST_WARNING_OBJECT (rtp_mux, "Error iterating sinkpads");
185       case GST_ITERATOR_DONE:
186         done = TRUE;
187         break;
188     }
189   }
190   gst_iterator_free (iter);
191   gst_object_unref (rtp_mux);
192   gst_event_unref (event);
193
194   return result;
195 }
196
197 static void
198 gst_rtp_mux_init (GstRTPMux * object, GstRTPMuxClass * g_class)
199 {
200   GstElementClass *klass = GST_ELEMENT_GET_CLASS (object);
201
202   object->srcpad =
203       gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
204           "src"), "src");
205   gst_pad_set_event_function (object->srcpad,
206       GST_DEBUG_FUNCPTR (gst_rtp_mux_src_event));
207   gst_element_add_pad (GST_ELEMENT (object), object->srcpad);
208
209   object->ssrc = DEFAULT_SSRC;
210   object->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
211   object->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
212 }
213
214 static void
215 gst_rtp_mux_finalize (GObject * object)
216 {
217   GstRTPMux *rtp_mux;
218
219   rtp_mux = GST_RTP_MUX (object);
220
221   G_OBJECT_CLASS (parent_class)->finalize (object);
222 }
223
224 static GstPad *
225 gst_rtp_mux_create_sinkpad (GstRTPMux * rtp_mux, GstPadTemplate * templ)
226 {
227   GstPad *newpad = NULL;
228   GstPadTemplate *class_templ;
229
230   class_templ =
231       gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (rtp_mux),
232       "sink_%d");
233
234   if (templ == class_templ) {
235     gchar *name;
236
237     /* create new pad with the name */
238     name = g_strdup_printf ("sink_%02d", rtp_mux->numpads);
239     newpad = gst_pad_new_from_template (templ, name);
240     g_free (name);
241
242     rtp_mux->numpads++;
243   } else {
244     GST_WARNING_OBJECT (rtp_mux, "this is not our template!\n");
245   }
246
247   return newpad;
248 }
249
250 static void
251 gst_rtp_mux_setup_sinkpad (GstRTPMux * rtp_mux, GstPad * sinkpad)
252 {
253   GstRTPMuxClass *klass;
254   GstRTPMuxPadPrivate *padpriv = g_slice_new0 (GstRTPMuxPadPrivate);
255
256   klass = GST_RTP_MUX_GET_CLASS (rtp_mux);
257
258   /* setup some pad functions */
259   gst_pad_set_setcaps_function (sinkpad, gst_rtp_mux_setcaps);
260   gst_pad_set_getcaps_function (sinkpad, gst_rtp_mux_getcaps);
261   if (klass->chain_func)
262     gst_pad_set_chain_function (sinkpad, klass->chain_func);
263   if (klass->sink_event_func)
264     gst_pad_set_event_function (sinkpad, klass->sink_event_func);
265
266   /* This could break with gstreamer 0.10.9 */
267   gst_pad_set_active (sinkpad, TRUE);
268
269   gst_pad_set_element_private (sinkpad, padpriv);
270
271   /* dd the pad to the element */
272   gst_element_add_pad (GST_ELEMENT (rtp_mux), sinkpad);
273 }
274
275 static GstPad *
276 gst_rtp_mux_request_new_pad (GstElement * element,
277     GstPadTemplate * templ, const gchar * req_name)
278 {
279   GstRTPMux *rtp_mux;
280   GstPad *newpad;
281
282   g_return_val_if_fail (templ != NULL, NULL);
283   g_return_val_if_fail (GST_IS_RTP_MUX (element), NULL);
284
285   rtp_mux = GST_RTP_MUX (element);
286
287   if (templ->direction != GST_PAD_SINK) {
288     GST_WARNING_OBJECT (rtp_mux, "request pad that is not a SINK pad");
289     return NULL;
290   }
291
292   newpad = gst_rtp_mux_create_sinkpad (rtp_mux, templ);
293   if (newpad)
294     gst_rtp_mux_setup_sinkpad (rtp_mux, newpad);
295   else
296     GST_WARNING_OBJECT (rtp_mux, "failed to create request pad");
297
298   return newpad;
299 }
300
301 static void
302 gst_rtp_mux_release_pad (GstElement * element, GstPad * pad)
303 {
304   GstRTPMuxPadPrivate *padpriv;
305
306   GST_OBJECT_LOCK (element);
307   padpriv = gst_pad_get_element_private (pad);
308   gst_pad_set_element_private (pad, NULL);
309   GST_OBJECT_UNLOCK (element);
310
311   gst_element_remove_pad (element, pad);
312
313   if (padpriv) {
314     gst_caps_replace (&padpriv->out_caps, NULL);
315     g_slice_free (GstRTPMuxPadPrivate, padpriv);
316   }
317 }
318
319 /* Put our own clock-base on the buffer */
320 static void
321 gst_rtp_mux_readjust_rtp_timestamp (GstRTPMux * rtp_mux, GstPad * pad,
322     GstBuffer * buffer)
323 {
324   guint32 ts;
325   guint32 sink_ts_base = 0;
326   GstRTPMuxPadPrivate *padpriv;
327
328
329   GST_OBJECT_LOCK (rtp_mux);
330   padpriv = gst_pad_get_element_private (pad);
331   if (padpriv && padpriv->have_clock_base)
332     sink_ts_base = padpriv->clock_base;
333   GST_OBJECT_UNLOCK (rtp_mux);
334
335   ts = gst_rtp_buffer_get_timestamp (buffer) - sink_ts_base + rtp_mux->ts_base;
336   GST_LOG_OBJECT (rtp_mux, "Re-adjusting RTP ts %u to %u",
337       gst_rtp_buffer_get_timestamp (buffer), ts);
338   gst_rtp_buffer_set_timestamp (buffer, ts);
339 }
340
341 static GstFlowReturn
342 gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer)
343 {
344   GstRTPMux *rtp_mux;
345   GstFlowReturn ret;
346   GstRTPMuxPadPrivate *padpriv;
347
348   rtp_mux = GST_RTP_MUX (gst_pad_get_parent (pad));
349
350   if (!gst_rtp_buffer_validate (buffer)) {
351     GST_ERROR_OBJECT (rtp_mux, "Invalid RTP buffer");
352     gst_object_unref (rtp_mux);
353     return GST_FLOW_ERROR;
354   }
355
356   buffer = gst_buffer_make_writable (buffer);
357
358   GST_OBJECT_LOCK (rtp_mux);
359   rtp_mux->seqnum++;
360   gst_rtp_buffer_set_seq (buffer, rtp_mux->seqnum);
361   padpriv = gst_pad_get_element_private (pad);
362   if (padpriv)
363     gst_buffer_set_caps (buffer, padpriv->out_caps);
364   GST_OBJECT_UNLOCK (rtp_mux);
365   gst_rtp_buffer_set_ssrc (buffer, rtp_mux->current_ssrc);
366   gst_rtp_mux_readjust_rtp_timestamp (rtp_mux, pad, buffer);
367   GST_LOG_OBJECT (rtp_mux, "Pushing packet size %d, seq=%d, ts=%u",
368       GST_BUFFER_SIZE (buffer), rtp_mux->seqnum,
369       gst_rtp_buffer_get_timestamp (buffer));
370
371   if (!padpriv) {
372     ret = GST_FLOW_NOT_LINKED;
373     gst_buffer_unref (buffer);
374     goto out;
375   }
376
377   ret = gst_pad_push (rtp_mux->srcpad, buffer);
378
379 out:
380
381   gst_object_unref (rtp_mux);
382   return ret;
383 }
384
385 static gboolean
386 gst_rtp_mux_setcaps (GstPad * pad, GstCaps * caps)
387 {
388   GstRTPMux *rtp_mux;
389   GstStructure *structure;
390   gboolean ret = FALSE;
391   GstRTPMuxPadPrivate *padpriv;
392
393   rtp_mux = GST_RTP_MUX (gst_pad_get_parent (pad));
394
395   structure = gst_caps_get_structure (caps, 0);
396
397   if (!structure)
398     goto out;
399
400   GST_OBJECT_LOCK (rtp_mux);
401   padpriv = gst_pad_get_element_private (pad);
402   if (padpriv &&
403       gst_structure_get_uint (structure, "clock-base", &padpriv->clock_base)) {
404     padpriv->have_clock_base = TRUE;
405   }
406   GST_OBJECT_UNLOCK (rtp_mux);
407
408   caps = gst_caps_copy (caps);
409
410   gst_caps_set_simple (caps,
411       "clock-base", G_TYPE_UINT, rtp_mux->ts_base,
412       "seqnum-base", G_TYPE_UINT, rtp_mux->seqnum_base, NULL);
413
414   GST_DEBUG_OBJECT (rtp_mux,
415       "setting caps %" GST_PTR_FORMAT " on src pad..", caps);
416   ret = gst_pad_set_caps (rtp_mux->srcpad, caps);
417
418   if (ret) {
419     GST_OBJECT_LOCK (rtp_mux);
420     padpriv = gst_pad_get_element_private (pad);
421     if (padpriv)
422       gst_caps_replace (&padpriv->out_caps, caps);
423     GST_OBJECT_UNLOCK (rtp_mux);
424   }
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     gst_object_unref (pad);
466     return TRUE;
467   }
468
469   peercaps = gst_pad_peer_get_caps (pad);
470   if (!peercaps) {
471     gst_object_unref (pad);
472     return TRUE;
473   }
474
475   othercaps = gst_caps_intersect (peercaps,
476       gst_pad_get_pad_template_caps (pad));
477   gst_caps_unref (peercaps);
478
479   accumcaps = gst_value_get_caps (ret);
480
481   clear_caps (othercaps, TRUE);
482
483   intersect = gst_caps_intersect (accumcaps, othercaps);
484
485   g_value_take_boxed (ret, intersect);
486
487   gst_caps_unref (othercaps);
488   gst_object_unref (pad);
489
490   return !gst_caps_is_empty (intersect);
491 }
492
493 static GstCaps *
494 gst_rtp_mux_getcaps (GstPad * pad)
495 {
496   GstRTPMux *mux = GST_RTP_MUX (gst_pad_get_parent (pad));
497   GstCaps *caps = NULL;
498   GstIterator *iter = NULL;
499   GValue v = { 0 };
500   GstIteratorResult res;
501   GstCaps *peercaps = gst_pad_peer_get_caps (mux->srcpad);
502   GstCaps *othercaps = NULL;
503
504   if (peercaps) {
505     othercaps = gst_caps_intersect (peercaps,
506         gst_pad_get_pad_template_caps (pad));
507     gst_caps_unref (peercaps);
508   } else {
509     othercaps = gst_caps_copy (gst_pad_get_pad_template_caps (mux->srcpad));
510   }
511
512   clear_caps (othercaps, FALSE);
513
514   g_value_init (&v, GST_TYPE_CAPS);
515
516   iter = gst_element_iterate_sink_pads (GST_ELEMENT (mux));
517   do {
518     gst_value_set_caps (&v, othercaps);
519     res = gst_iterator_fold (iter, same_clock_rate_fold, &v, pad);
520   } while (res == GST_ITERATOR_RESYNC);
521   gst_iterator_free (iter);
522
523   caps = (GstCaps *) gst_value_get_caps (&v);
524
525   if (res == GST_ITERATOR_ERROR) {
526     gst_caps_unref (caps);
527     caps = gst_caps_new_empty ();
528   }
529
530   if (othercaps)
531     gst_caps_unref (othercaps);
532   gst_object_unref (mux);
533
534   return caps;
535 }
536
537
538 static void
539 gst_rtp_mux_get_property (GObject * object,
540     guint prop_id, GValue * value, GParamSpec * pspec)
541 {
542   GstRTPMux *rtp_mux;
543
544   rtp_mux = GST_RTP_MUX (object);
545
546   switch (prop_id) {
547     case PROP_TIMESTAMP_OFFSET:
548       g_value_set_int (value, rtp_mux->ts_offset);
549       break;
550     case PROP_SEQNUM_OFFSET:
551       g_value_set_int (value, rtp_mux->seqnum_offset);
552       break;
553     case PROP_SEQNUM:
554       GST_OBJECT_LOCK (rtp_mux);
555       g_value_set_uint (value, rtp_mux->seqnum);
556       GST_OBJECT_UNLOCK (rtp_mux);
557       break;
558     case PROP_SSRC:
559       g_value_set_uint (value, rtp_mux->ssrc);
560       break;
561     default:
562       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
563       break;
564   }
565 }
566
567 static void
568 gst_rtp_mux_set_property (GObject * object,
569     guint prop_id, const GValue * value, GParamSpec * pspec)
570 {
571   GstRTPMux *rtp_mux;
572
573   rtp_mux = GST_RTP_MUX (object);
574
575   switch (prop_id) {
576     case PROP_TIMESTAMP_OFFSET:
577       rtp_mux->ts_offset = g_value_get_int (value);
578       break;
579     case PROP_SEQNUM_OFFSET:
580       rtp_mux->seqnum_offset = g_value_get_int (value);
581       break;
582     case PROP_SSRC:
583       rtp_mux->ssrc = g_value_get_uint (value);
584       break;
585     default:
586       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
587       break;
588   }
589 }
590
591 static void
592 gst_rtp_mux_ready_to_paused (GstRTPMux * rtp_mux)
593 {
594   GST_OBJECT_LOCK (rtp_mux);
595
596   if (rtp_mux->ssrc == -1)
597     rtp_mux->current_ssrc = g_random_int ();
598   else
599     rtp_mux->current_ssrc = rtp_mux->ssrc;
600
601   if (rtp_mux->seqnum_offset == -1)
602     rtp_mux->seqnum_base = g_random_int_range (0, G_MAXUINT16);
603   else
604     rtp_mux->seqnum_base = rtp_mux->seqnum_offset;
605   rtp_mux->seqnum = rtp_mux->seqnum_base;
606
607   if (rtp_mux->ts_offset == -1)
608     rtp_mux->ts_base = g_random_int ();
609   else
610     rtp_mux->ts_base = rtp_mux->ts_offset;
611   GST_DEBUG_OBJECT (rtp_mux, "set clock-base to %u", rtp_mux->ts_base);
612
613   GST_OBJECT_UNLOCK (rtp_mux);
614 }
615
616 static GstStateChangeReturn
617 gst_rtp_mux_change_state (GstElement * element, GstStateChange transition)
618 {
619   GstRTPMux *rtp_mux;
620
621   rtp_mux = GST_RTP_MUX (element);
622
623   switch (transition) {
624     case GST_STATE_CHANGE_NULL_TO_READY:
625       break;
626     case GST_STATE_CHANGE_READY_TO_PAUSED:
627       gst_rtp_mux_ready_to_paused (rtp_mux);
628       break;
629     case GST_STATE_CHANGE_PAUSED_TO_READY:
630       break;
631     default:
632       break;
633   }
634
635   return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
636 }
637
638 gboolean
639 gst_rtp_mux_plugin_init (GstPlugin * plugin)
640 {
641   GST_DEBUG_CATEGORY_INIT (gst_rtp_mux_debug, "rtpmux", 0, "rtp muxer");
642
643   return gst_element_register (plugin, "rtpmux", GST_RANK_NONE,
644       GST_TYPE_RTP_MUX);
645 }