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.
This commit is contained in:
Wim Taymans 2012-10-17 12:17:32 +02:00
parent 5ec642d0c3
commit 1cebcfa8c2
2 changed files with 4 additions and 4 deletions

View file

@ -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));
/**

View file

@ -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;