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
committerWim Taymans <wim.taymans@gmail.com>2007-08-28 20:30:16 +0000
commitc0a64d008a0b8cc4416039935e4fbc4a7da3931d (patch)
treec4ec574dee72de29f5c2b34560301853d0e92692 /gst/rtpmanager/rtpsource.c
parent3db14a2b604d8161b2794c49d100e79393a149c0 (diff)
downloadgst-plugins-bad-c0a64d008a0b8cc4416039935e4fbc4a7da3931d.tar.gz
gst-plugins-bad-c0a64d008a0b8cc4416039935e4fbc4a7da3931d.tar.bz2
gst-plugins-bad-c0a64d008a0b8cc4416039935e4fbc4a7da3931d.zip
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);