summaryrefslogtreecommitdiffstats
path: root/gst/rtpmanager/rtpsource.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-08-28 20:30:16 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-11 02:30:29 +0100
commiteb86865a62b01688fcfdbcb2c0d374e36d37ec3f (patch)
tree7771f708a597cbdd644ad83dc1c8871beb159e97 /gst/rtpmanager/rtpsource.c
parent6835b966ec20faaea3a81d6486f8378c884fa5c4 (diff)
gst/rtpmanager/gstrtpbin.c: Add some more advanced example pipelines.
Original commit message from CVS: * gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_clear_pt_map): Add some more advanced example pipelines. * gst/rtpmanager/gstrtpsession.c: (rtcp_thread), (stop_rtcp_thread), (gst_rtp_session_send_rtcp): Add some debug and FIXME. Release LOCK when performing session cleanup. * gst/rtpmanager/rtpsession.c: (session_report_blocks): Add some debug. * gst/rtpmanager/rtpsource.c: (calculate_jitter), (rtp_source_send_rtp): Make sure we always send RTP packets with the session SSRC.
Diffstat (limited to 'gst/rtpmanager/rtpsource.c')
-rw-r--r--gst/rtpmanager/rtpsource.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gst/rtpmanager/rtpsource.c b/gst/rtpmanager/rtpsource.c
index 8007d54b..1a989517 100644
--- a/gst/rtpmanager/rtpsource.c
+++ b/gst/rtpmanager/rtpsource.c
@@ -266,8 +266,8 @@ calculate_jitter (RTPSource * src, GstBuffer * buffer,
src->stats.prev_rtptime = src->stats.last_rtptime;
src->stats.last_rtptime = rtparrival;
- GST_DEBUG ("rtparrival %u, rtptime %u, clock-rate %d, diff %d, jitter: %u",
- rtparrival, rtptime, clock_rate, diff, src->stats.jitter);
+ GST_DEBUG ("rtparrival %u, rtptime %u, clock-rate %d, diff %d, jitter: %f",
+ rtparrival, rtptime, clock_rate, diff, (src->stats.jitter) / 16.0);
return;
@@ -446,6 +446,8 @@ rtp_source_process_bye (RTPSource * src, const gchar * reason)
* @buffer: an RTP buffer
*
* Send an RTP @buffer originating from @src. This will make @src a sender.
+ * This function takes ownership of @buffer and modifies the SSRC in the RTP
+ * packet to that of @src.
*
* Returns: a #GstFlowReturn.
*/
@@ -467,9 +469,18 @@ rtp_source_send_rtp (RTPSource * src, GstBuffer * buffer)
src->stats.packets_sent++;
src->stats.octets_sent += len;
-
/* push packet */
if (src->callbacks.push_rtp) {
+ guint32 ssrc;
+
+ ssrc = gst_rtp_buffer_get_ssrc (buffer);
+ if (ssrc != src->ssrc) {
+ GST_DEBUG ("updating SSRC from %u to %u", ssrc, src->ssrc);
+ buffer = gst_buffer_make_writable (buffer);
+
+ gst_rtp_buffer_set_ssrc (buffer, src->ssrc);
+ }
+
GST_DEBUG ("pushing RTP packet %" G_GUINT64_FORMAT,
src->stats.packets_sent);
result = src->callbacks.push_rtp (src, buffer, src->user_data);