mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 13:18:52 +00:00
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:
parent
5ec642d0c3
commit
1cebcfa8c2
2 changed files with 4 additions and 4 deletions
|
@ -939,7 +939,7 @@ get_current_times (GstRtpBin * bin, GstClockTime * running_time,
|
||||||
clock_time = gst_clock_get_time (clock);
|
clock_time = gst_clock_get_time (clock);
|
||||||
|
|
||||||
if (bin->use_pipeline_clock) {
|
if (bin->use_pipeline_clock) {
|
||||||
ntpns = clock_time;
|
ntpns = clock_time - base_time;
|
||||||
} else {
|
} else {
|
||||||
GTimeVal current;
|
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_object_class_install_property (gobject_class, PROP_USE_PIPELINE_CLOCK,
|
||||||
g_param_spec_boolean ("use-pipeline-clock", "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,
|
DEFAULT_USE_PIPELINE_CLOCK,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -564,7 +564,7 @@ gst_rtp_session_class_init (GstRtpSessionClass * klass)
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_USE_PIPELINE_CLOCK,
|
g_object_class_install_property (gobject_class, PROP_USE_PIPELINE_CLOCK,
|
||||||
g_param_spec_boolean ("use-pipeline-clock", "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,
|
DEFAULT_USE_PIPELINE_CLOCK,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
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);
|
clock_time = gst_clock_get_time (clock);
|
||||||
|
|
||||||
if (rtpsession->priv->use_pipeline_clock) {
|
if (rtpsession->priv->use_pipeline_clock) {
|
||||||
ntpns = clock_time;
|
ntpns = clock_time - base_time;
|
||||||
} else {
|
} else {
|
||||||
GTimeVal current;
|
GTimeVal current;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue