Commit 86610e8f authored by Ghislain MARY's avatar Ghislain MARY

Add functions to configure RTCP XR packet sending intervals.

parent 7cc042ba
......@@ -209,6 +209,9 @@ typedef struct _RtcpStream
uint32_t rtcp_report_snt_interval_s; /* the interval in timestamp unit for send path between rtcp report sent */
bool_t enabled; /*tells whether we can send RTCP packets */
OrtpRtcpXrConfiguration xr_conf;
uint32_t rtcp_xr_rcvr_rtt_interval;
uint32_t rtcp_xr_stat_summary_interval;
uint32_t rtcp_xr_voip_metrics_interval;
} RtcpStream;
typedef struct _RtpSession RtpSession;
......@@ -365,6 +368,9 @@ ORTP_PUBLIC void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno);
ORTP_PUBLIC void rtp_session_set_rtcp_report_interval(RtpSession *session, int value_ms);
ORTP_PUBLIC void rtp_session_configure_rtcp_xr(RtpSession *session, const OrtpRtcpXrConfiguration *config);
ORTP_PUBLIC void rtp_session_set_rtcp_xr_rcvr_rtt_interval(RtpSession *session, int value_ms);
ORTP_PUBLIC void rtp_session_set_rtcp_xr_stat_summary_interval(RtpSession *session, int value_ms);
ORTP_PUBLIC void rtp_session_set_rtcp_xr_voip_metrics_interval(RtpSession *session, int value_ms);
ORTP_PUBLIC void rtp_session_set_ssrc_changed_threshold(RtpSession *session, int numpackets);
......
......@@ -437,6 +437,28 @@ void rtp_session_configure_rtcp_xr(RtpSession *session, const OrtpRtcpXrConfigur
}
}
static void set_rtcp_xr_interval(RtpSession *session, uint32_t *interval, int value_ms) {
int sendpt = rtp_session_get_send_payload_type(session);
if (sendpt != -1) {
PayloadType *pt = rtp_profile_get_payload(session->snd.profile, sendpt);
if (pt != NULL){
*interval = (value_ms * pt->clock_rate) / 1000;
}
}
}
void rtp_session_set_rtcp_xr_rcvr_rtt_interval(RtpSession *session, int value_ms) {
set_rtcp_xr_interval(session, &session->rtcp.rtcp_xr_rcvr_rtt_interval, value_ms);
}
void rtp_session_set_rtcp_xr_stat_summary_interval(RtpSession *session, int value_ms) {
set_rtcp_xr_interval(session, &session->rtcp.rtcp_xr_stat_summary_interval, value_ms);
}
void rtp_session_set_rtcp_xr_voip_metrics_interval(RtpSession *session, int value_ms) {
set_rtcp_xr_interval(session, &session->rtcp.rtcp_xr_voip_metrics_interval, value_ms);
}
/**
* Set the RTP profile to be used for the sending by this session. By default, all session are created by
* rtp_session_new() are initialized with the AV profile, as defined in RFC 3551. The application
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment