/**
* SECTION:element-rtpmux
+ * @title: rtpmux
* @see_also: rtpdtmfmux
*
* The rtp muxer takes multiple RTP streams having the same clock-rate and
* muxes into a single stream with a single SSRC.
*
- * <refsect2>
- * <title>Example pipelines</title>
+ * ## Example pipelines
* |[
* gst-launch-1.0 rtpmux name=mux ! udpsink host=127.0.0.1 port=8888 \
* alsasrc ! alawenc ! rtppcmapay ! \
* In this example, an audio stream is captured from ALSA and another is
* generated, both are encoded into different payload types and muxed together
* so they can be sent on the same port.
- * </refsect2>
+ *
*/
#ifdef HAVE_CONFIG_H
if (!gst_structure_get_uint (s, "ssrc", &ssrc))
ssrc = -1;
- GST_DEBUG_OBJECT (rtp_mux, "collided ssrc: %" G_GUINT32_FORMAT, ssrc);
+ GST_DEBUG_OBJECT (rtp_mux, "collided ssrc: %x", ssrc);
/* choose another ssrc for our stream */
GST_OBJECT_LOCK (rtp_mux);
rtp_mux->current_ssrc = g_random_int ();
new_ssrc = rtp_mux->current_ssrc;
+ GST_INFO_OBJECT (rtp_mux, "New ssrc after collision %x (was: %x)",
+ new_ssrc, ssrc);
GST_OBJECT_UNLOCK (rtp_mux);
caps = gst_pad_get_current_caps (rtp_mux->srcpad);
gst_rtp_buffer_set_ssrc (rtpbuffer, rtp_mux->current_ssrc);
gst_rtp_mux_readjust_rtp_timestamp_locked (rtp_mux, padpriv, rtpbuffer);
GST_LOG_OBJECT (rtp_mux,
- "Pushing packet size %" G_GSIZE_FORMAT ", seq=%d, ts=%u",
+ "Pushing packet size %" G_GSIZE_FORMAT ", seq=%d, ts=%u, ssrc=%x",
rtpbuffer->map[0].size, rtp_mux->seqnum,
- gst_rtp_buffer_get_timestamp (rtpbuffer));
+ gst_rtp_buffer_get_timestamp (rtpbuffer), rtp_mux->current_ssrc);
if (padpriv) {
if (padpriv->segment.format == GST_FORMAT_TIME) {
structure = gst_caps_get_structure (othercaps, 0);
GST_OBJECT_LOCK (rtp_mux);
if (gst_structure_get_uint (structure, "ssrc", &rtp_mux->current_ssrc)) {
- GST_DEBUG_OBJECT (pad, "Use downstream ssrc: %x",
- rtp_mux->current_ssrc);
+ GST_INFO_OBJECT (pad, "Use downstream ssrc: %x", rtp_mux->current_ssrc);
rtp_mux->have_ssrc = TRUE;
}
+ if (gst_structure_get_uint (structure,
+ "timestamp-offset", &rtp_mux->ts_base)) {
+ GST_INFO_OBJECT (pad, "Use downstream timestamp-offset: %u",
+ rtp_mux->ts_base);
+ }
GST_OBJECT_UNLOCK (rtp_mux);
}
and if that fails, generate one */
if (rtp_mux->ssrc == DEFAULT_SSRC) {
if (rtp_mux->current_ssrc == DEFAULT_SSRC) {
- if (!gst_structure_get_uint (structure, "ssrc", &rtp_mux->current_ssrc))
+ if (!gst_structure_get_uint (structure, "ssrc", &rtp_mux->current_ssrc)) {
rtp_mux->current_ssrc = g_random_int ();
+ GST_INFO_OBJECT (rtp_mux, "Set random ssrc %x", rtp_mux->current_ssrc);
+ }
}
} else {
rtp_mux->current_ssrc = rtp_mux->ssrc;
+ GST_INFO_OBJECT (rtp_mux, "Set ssrc %x", rtp_mux->current_ssrc);
}
gst_caps_set_simple (caps,
structure = gst_caps_get_structure (othercaps, 0);
if (mux->ssrc == DEFAULT_SSRC) {
if (gst_structure_get_uint (structure, "ssrc", &mux->current_ssrc))
- GST_DEBUG_OBJECT (pad, "Use downstream ssrc: %u", mux->current_ssrc);
+ GST_DEBUG_OBJECT (pad, "Use downstream ssrc: %x", mux->current_ssrc);
}
clear_caps (othercaps, TRUE);
rtp_mux->ssrc = g_value_get_uint (value);
rtp_mux->current_ssrc = rtp_mux->ssrc;
rtp_mux->have_ssrc = TRUE;
- rtp_mux->ssrc_random = FALSE;
+ GST_DEBUG_OBJECT (rtp_mux, "ssrc prop set to %x", rtp_mux->ssrc);
GST_OBJECT_UNLOCK (rtp_mux);
break;
default:
rtp_mux->last_stop = GST_CLOCK_TIME_NONE;
- if (rtp_mux->ssrc_random) {
- rtp_mux->have_ssrc = FALSE;
- } else {
+ if (rtp_mux->have_ssrc)
rtp_mux->current_ssrc = rtp_mux->ssrc;
- rtp_mux->have_ssrc = TRUE;
- }
GST_DEBUG_OBJECT (rtp_mux, "set timestamp-offset to %u", rtp_mux->ts_base);