rtpbin: remove use of ntp_ns_base

This commit is contained in:
Wim Taymans 2010-01-20 18:52:51 +01:00 committed by Wim Taymans
parent 5a4ecc9da1
commit 9d40d60960
2 changed files with 1 additions and 33 deletions

View file

@ -210,9 +210,6 @@ struct _GstRtpBinPrivate
/* lock protecting dynamic adding/removing */ /* lock protecting dynamic adding/removing */
GMutex *dyn_lock; GMutex *dyn_lock;
/* the time when we went to playing */
GstClockTime ntp_ns_base;
/* if we are shutting down or not */ /* if we are shutting down or not */
gint shutdown; gint shutdown;
@ -536,8 +533,6 @@ create_session (GstRtpBin * rtpbin, gint id)
(GDestroyNotify) gst_caps_unref); (GDestroyNotify) gst_caps_unref);
rtpbin->sessions = g_slist_prepend (rtpbin->sessions, sess); rtpbin->sessions = g_slist_prepend (rtpbin->sessions, sess);
/* set NTP base or new session */
g_object_set (session, "ntp-ns-base", rtpbin->priv->ntp_ns_base, NULL);
/* configure SDES items */ /* configure SDES items */
GST_OBJECT_LOCK (rtpbin); GST_OBJECT_LOCK (rtpbin);
g_object_set (session, "sdes", rtpbin->sdes, NULL); g_object_set (session, "sdes", rtpbin->sdes, NULL);
@ -1928,30 +1923,6 @@ gst_rtp_bin_handle_message (GstBin * bin, GstMessage * message)
} }
} }
static void
calc_ntp_ns_base (GstRtpBin * bin)
{
GstClockTime now;
GTimeVal current;
GSList *walk;
/* get the current time and convert it to NTP time in nanoseconds */
g_get_current_time (&current);
now = GST_TIMEVAL_TO_TIME (current);
now += (2208988800LL * GST_SECOND);
GST_RTP_BIN_LOCK (bin);
bin->priv->ntp_ns_base = now;
for (walk = bin->sessions; walk; walk = g_slist_next (walk)) {
GstRtpBinSession *session = (GstRtpBinSession *) walk->data;
g_object_set (session->session, "ntp-ns-base", now, NULL);
}
GST_RTP_BIN_UNLOCK (bin);
return;
}
static GstStateChangeReturn static GstStateChangeReturn
gst_rtp_bin_change_state (GstElement * element, GstStateChange transition) gst_rtp_bin_change_state (GstElement * element, GstStateChange transition)
{ {
@ -1969,9 +1940,6 @@ gst_rtp_bin_change_state (GstElement * element, GstStateChange transition)
GST_LOG_OBJECT (rtpbin, "clearing shutdown flag"); GST_LOG_OBJECT (rtpbin, "clearing shutdown flag");
g_atomic_int_set (&priv->shutdown, 0); g_atomic_int_set (&priv->shutdown, 0);
break; break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
calc_ntp_ns_base (rtpbin);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_LOG_OBJECT (rtpbin, "setting shutdown flag"); GST_LOG_OBJECT (rtpbin, "setting shutdown flag");
g_atomic_int_set (&priv->shutdown, 1); g_atomic_int_set (&priv->shutdown, 1);

View file

@ -530,7 +530,7 @@ gst_rtp_session_class_init (GstRtpSessionClass * klass)
g_object_class_install_property (gobject_class, PROP_NTP_NS_BASE, g_object_class_install_property (gobject_class, PROP_NTP_NS_BASE,
g_param_spec_uint64 ("ntp-ns-base", "NTP base time", g_param_spec_uint64 ("ntp-ns-base", "NTP base time",
"The NTP base time corresponding to running_time 0", 0, "The NTP base time corresponding to running_time 0 (deprecated)", 0,
G_MAXUINT64, DEFAULT_NTP_NS_BASE, G_PARAM_READWRITE)); G_MAXUINT64, DEFAULT_NTP_NS_BASE, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_BANDWIDTH, g_object_class_install_property (gobject_class, PROP_BANDWIDTH,