#include <gst/rtp/rtp.h>
#include <gio/gio.h>
+/* UDP/IP is assumed for bandwidth calculation */
+#define UDP_IP_HEADER_OVERHEAD 28
+
/**
* RTPSenderReport:
*
* @seqnum: the seqnum of the packet
* @pt: the payload type of the packet
* @rtptime: the RTP time of the packet
+ * @marker: the marker bit
+ *
+ * @tw_seqnum_ext_id: the extension-header ID for transport-wide seqnums
+ * @tw_seqnum: the transport-wide seqnum of the packet
*
* Structure holding information about the packet.
*/
guint16 seqnum;
guint8 pt;
guint32 rtptime;
+ gboolean marker;
guint32 csrc_count;
guint32 csrcs[16];
+ GBytes *header_ext;
+ guint16 header_ext_bit_pattern;
} RTPPacketInfo;
/**
guint nacks_received;
} RTPSessionStats;
+/**
+ * RTPTWCCStats:
+ *
+ * Stats kept for a session and used to produce TWCC stats.
+ */
+typedef struct {
+ GArray *packets;
+ GstClockTime window_size;
+ GstClockTime last_local_ts;
+ GstClockTime last_remote_ts;
+
+ guint bitrate_sent;
+ guint bitrate_recv;
+ guint packets_sent;
+ guint packets_recv;
+ gfloat packet_loss_pct;
+ GstClockTimeDiff avg_delta_of_delta;
+ gfloat avg_delta_of_delta_change;
+} RTPTWCCStats;
+
+
void rtp_stats_init_defaults (RTPSessionStats *stats);
void rtp_stats_set_bandwidths (RTPSessionStats *stats,
gboolean __g_socket_address_equal (GSocketAddress *a, GSocketAddress *b);
gchar * __g_socket_address_to_string (GSocketAddress * addr);
+RTPTWCCStats * rtp_twcc_stats_new (void);
+void rtp_twcc_stats_free (RTPTWCCStats * stats);
+GstStructure * rtp_twcc_stats_process_packets (RTPTWCCStats * stats,
+ GArray * twcc_packets);
+GstStructure * rtp_twcc_stats_get_packets_structure (GArray * twcc_packets);
+
#endif /* __RTP_STATS_H__ */