/* caps mapping */
GHashTable *ptmap;
+ GstClockTime send_latency;
+
gboolean use_pipeline_clock;
};
return ret;
}
+static gboolean
+gst_rtp_session_event_send_rtp_src (GstPad * pad, GstObject * parent,
+ GstEvent * event)
+{
+ GstRtpSession *rtpsession;
+ gboolean ret = FALSE;
+
+ rtpsession = GST_RTP_SESSION (parent);
+
+ GST_DEBUG_OBJECT (rtpsession, "received EVENT %s",
+ GST_EVENT_TYPE_NAME (event));
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_LATENCY:
+ /* save the latency, we need this to know when an RTP packet will be
+ * rendered by the sink */
+ gst_event_parse_latency (event, &rtpsession->priv->send_latency);
+
+ ret = gst_pad_event_default (pad, parent, event);
+ break;
+ default:
+ ret = gst_pad_event_default (pad, parent, event);
+ break;
+ }
+ return ret;
+}
+
static GstCaps *
gst_rtp_session_getcaps_send_rtp (GstPad * pad, GstRtpSession * rtpsession,
GstCaps * filter)
running_time =
gst_segment_to_running_time (&rtpsession->send_rtp_seg, GST_FORMAT_TIME,
timestamp);
+ running_time += priv->send_latency;
} else {
/* no timestamp. */
running_time = -1;
"send_rtp_src");
gst_pad_set_iterate_internal_links_function (rtpsession->send_rtp_src,
gst_rtp_session_iterate_internal_links);
+ gst_pad_set_event_function (rtpsession->send_rtp_src,
+ gst_rtp_session_event_send_rtp_src);
gst_pad_set_active (rtpsession->send_rtp_src, TRUE);
gst_element_add_pad (GST_ELEMENT_CAST (rtpsession), rtpsession->send_rtp_src);