From 1cebcfa8c238affe188c9411fd54b633e1526b97 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 17 Oct 2012 12:17:32 +0200 Subject: [PATCH] rtpbin: use running-time for NTP time When use-pipeline-clock is set, use the running-time of the pipeline to calculate the NTP timestamps. This method would previously only work when the base-time is set to 0 but with this change it can also work with different offsets and we can also implement pause/resume of the sender and receiver now. --- gst/rtpmanager/gstrtpbin.c | 4 ++-- gst/rtpmanager/gstrtpsession.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index bcc904a50b..d2ffcf1205 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -939,7 +939,7 @@ get_current_times (GstRtpBin * bin, GstClockTime * running_time, clock_time = gst_clock_get_time (clock); if (bin->use_pipeline_clock) { - ntpns = clock_time; + ntpns = clock_time - base_time; } else { GTimeVal current; @@ -1786,7 +1786,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass) g_object_class_install_property (gobject_class, PROP_USE_PIPELINE_CLOCK, g_param_spec_boolean ("use-pipeline-clock", "Use pipeline clock", - "Use the pipeline clock to set the NTP time in the RTCP SR messages", + "Use the pipeline running-time to set the NTP time in the RTCP SR messages", DEFAULT_USE_PIPELINE_CLOCK, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 5863650f5d..dc2d364df0 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -564,7 +564,7 @@ gst_rtp_session_class_init (GstRtpSessionClass * klass) g_object_class_install_property (gobject_class, PROP_USE_PIPELINE_CLOCK, g_param_spec_boolean ("use-pipeline-clock", "Use pipeline clock", - "Use the pipeline clock to set the NTP time in the RTCP SR messages", + "Use the pipeline running-time to set the NTP time in the RTCP SR messages", DEFAULT_USE_PIPELINE_CLOCK, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ -784,7 +784,7 @@ get_current_times (GstRtpSession * rtpsession, GstClockTime * running_time, clock_time = gst_clock_get_time (clock); if (rtpsession->priv->use_pipeline_clock) { - ntpns = clock_time; + ntpns = clock_time - base_time; } else { GTimeVal current;