From da17b1b643fb29e2fb3070a8298224fc6f21ea65 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 20 Nov 2008 18:41:34 +0000 Subject: gst/rtpmanager/gstrtpsession.c: Pass the running time to the session when processing RTP packets. Original commit message from CVS: * gst/rtpmanager/gstrtpsession.c: (get_current_times), (rtcp_thread), (gst_rtp_session_chain_recv_rtp): Pass the running time to the session when processing RTP packets. Improve the time function to provide more info. * gst/rtpmanager/rtpsession.c: (rtp_session_class_init), (rtp_session_init), (update_arrival_stats), (rtp_session_process_rtp), (rtp_session_process_sdes), (rtp_session_process_rtcp), (session_start_rtcp), (rtp_session_on_timeout): * gst/rtpmanager/rtpsession.h: Mark the internal source with a flag. Use running_time instead of the more useless timestamp. Validate a source when a valid SDES has been received. Pass the current system time when processing SR packets. * gst/rtpmanager/rtpsource.c: (rtp_source_class_init), (rtp_source_init), (rtp_source_create_stats), (rtp_source_get_property), (rtp_source_send_rtp), (rtp_source_process_rb), (rtp_source_get_new_rb), (rtp_source_get_last_rb): * gst/rtpmanager/rtpsource.h: Add property to get source stats. Mark params as STATIC_STRINGS. Calculate the bitrate at the sender SSRC. Avoid negative values in the round trip time calculations. * gst/rtpmanager/rtpstats.h: Update some docs and change some variable name to more closely reflect what it contains. --- gst/rtpmanager/rtpsource.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gst/rtpmanager/rtpsource.h') diff --git a/gst/rtpmanager/rtpsource.h b/gst/rtpmanager/rtpsource.h index c4c23a8b..0353a58b 100644 --- a/gst/rtpmanager/rtpsource.h +++ b/gst/rtpmanager/rtpsource.h @@ -113,6 +113,7 @@ struct _RTPSource { gint probation; gboolean validated; + gboolean internal; gboolean is_csrc; gboolean is_sender; @@ -139,6 +140,11 @@ struct _RTPSource { GstClockTime last_rtptime; GstClockTime last_ntpnstime; + /* for bitrate estimation */ + guint64 bitrate; + GstClockTime prev_ntpnstime; + guint64 bytes_sent; + GQueue *packets; RTPSourceCallbacks callbacks; @@ -198,7 +204,7 @@ void rtp_source_process_rb (RTPSource *src, GstClockTime tim gint32 packetslost, guint32 exthighestseq, guint32 jitter, guint32 lsr, guint32 dlsr); -gboolean rtp_source_get_new_sr (RTPSource *src, GstClockTime time, guint64 *ntptime, +gboolean rtp_source_get_new_sr (RTPSource *src, guint64 ntpnstime, guint64 *ntptime, guint32 *rtptime, guint32 *packet_count, guint32 *octet_count); gboolean rtp_source_get_new_rb (RTPSource *src, GstClockTime time, guint8 *fractionlost, @@ -210,7 +216,7 @@ gboolean rtp_source_get_last_sr (RTPSource *src, GstClockTime *ti guint32 *octet_count); gboolean rtp_source_get_last_rb (RTPSource *src, guint8 *fractionlost, gint32 *packetslost, guint32 *exthighestseq, guint32 *jitter, - guint32 *lsr, guint32 *dlsr); + guint32 *lsr, guint32 *dlsr, guint32 *round_trip); void rtp_source_reset (RTPSource * src); -- cgit v1.2.1