gint shutdown;
gboolean autoremove;
+
+ /* UNIX (ntp) time of last SR sync used */
+ guint64 last_unix;
};
/* signals and args */
#define DEFAULT_AUTOREMOVE FALSE
#define DEFAULT_BUFFER_MODE RTP_JITTER_BUFFER_MODE_SLAVE
#define DEFAULT_USE_PIPELINE_CLOCK FALSE
+#define DEFAULT_RTCP_SYNC_INTERVAL 0
enum
{
PROP_DO_LOST,
PROP_IGNORE_PT,
PROP_NTP_SYNC,
+ PROP_RTCP_SYNC_INTERVAL,
PROP_AUTOREMOVE,
PROP_BUFFER_MODE,
PROP_USE_PIPELINE_CLOCK,
GST_DEBUG_OBJECT (bin, "client %p min delta %" G_GINT64_FORMAT, client,
min);
+ /* bail out if we adjusted recently enough */
+ if (all_sync && (last_unix - bin->priv->last_unix) <
+ bin->rtcp_sync_interval * GST_MSECOND) {
+ GST_DEBUG_OBJECT (bin, "discarding RTCP sender packet for sync; "
+ "previous sender info too recent "
+ "(previous UNIX %" G_GUINT64_FORMAT ")", bin->priv->last_unix);
+ return;
+ }
+ bin->priv->last_unix = last_unix;
+
/* calculate offsets for each stream */
for (walk = client->streams; walk; walk = g_slist_next (walk)) {
GstRtpBinStream *ostream = (GstRtpBinStream *) walk->data;
"Synchronize received streams to the NTP clock", DEFAULT_NTP_SYNC,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstRtpBin::rtcp-sync-interval:
+ *
+ * Determines how often to sync streams using RTCP data.
+ *
+ * Since: 0.10.31
+ */
+ g_object_class_install_property (gobject_class, PROP_RTCP_SYNC_INTERVAL,
+ g_param_spec_uint ("rtcp-sync-interval", "RTCP Sync Interval",
+ "RTCP SR interval synchronization (ms) (0 = always)",
+ 0, G_MAXUINT, DEFAULT_RTCP_SYNC_INTERVAL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_rtp_bin_change_state);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_rtp_bin_request_new_pad);
rtpbin->do_lost = DEFAULT_DO_LOST;
rtpbin->ignore_pt = DEFAULT_IGNORE_PT;
rtpbin->ntp_sync = DEFAULT_NTP_SYNC;
+ rtpbin->rtcp_sync_interval = DEFAULT_RTCP_SYNC_INTERVAL;
rtpbin->priv->autoremove = DEFAULT_AUTOREMOVE;
rtpbin->buffer_mode = DEFAULT_BUFFER_MODE;
rtpbin->use_pipeline_clock = DEFAULT_USE_PIPELINE_CLOCK;
case PROP_NTP_SYNC:
rtpbin->ntp_sync = g_value_get_boolean (value);
break;
+ case PROP_RTCP_SYNC_INTERVAL:
+ rtpbin->rtcp_sync_interval = g_value_get_uint (value);
+ break;
case PROP_IGNORE_PT:
rtpbin->ignore_pt = g_value_get_boolean (value);
break;
case PROP_NTP_SYNC:
g_value_set_boolean (value, rtpbin->ntp_sync);
break;
+ case PROP_RTCP_SYNC_INTERVAL:
+ g_value_set_uint (value, rtpbin->rtcp_sync_interval);
+ break;
case PROP_AUTOREMOVE:
g_value_set_boolean (value, rtpbin->priv->autoremove);
break;
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
+ priv->last_unix = 0;
GST_LOG_OBJECT (rtpbin, "clearing shutdown flag");
g_atomic_int_set (&priv->shutdown, 0);
break;