static void rtp_session_create_and_send_rtcp_packet(RtpSession *session, bool_t full) { mblk_t *m=NULL; bool_t is_sr = FALSE; if (session->rtp.last_rtcp_packet_count < session->stats.packet_sent) { m = make_sr(session); session->rtp.last_rtcp_packet_count = (uint32_t)session->stats.packet_sent; is_sr = TRUE; } else if (session->stats.packet_recv > 0) { /* Don't send RR when no packet are received yet */ m = make_rr(session); is_sr = FALSE; } if (m != NULL) { append_sdes(session, m, full); if ((full == TRUE) && (session->rtcp.xr_conf.enabled == TRUE)) { append_xr_packets(session, m); } if (rtp_session_avpf_enabled(session) == TRUE) { append_fb_packets(session, m); } /* Send the compound packet */ notify_sent_rtcp(session, m); ortp_message("Sending RTCP %s compound message on session [%p].",(is_sr ? "SR" : "RR"), session); rtp_session_rtcp_send(session, m); } }
void rtp_session_rtcp_process_send(RtpSession *session){ RtpStream *st=&session->rtp; RtcpStream *rtcp_st=&session->rtcp; mblk_t *m; if (st->rcv_last_app_ts - rtcp_st->last_rtcp_report_snt_r > rtcp_st->rtcp_report_snt_interval_r || st->snd_last_ts - rtcp_st->last_rtcp_report_snt_s > rtcp_st->rtcp_report_snt_interval_s){ rtcp_st->last_rtcp_report_snt_r=st->rcv_last_app_ts; rtcp_st->last_rtcp_report_snt_s=st->snd_last_ts; m=make_sr(session); /* send the compound packet */ notify_sent_rtcp(session,m); rtp_session_rtcp_send(session,m); ortp_debug("Rtcp compound message sent."); } }
void rtp_session_rtcp_process_recv(RtpSession *session){ RtpStream *st=&session->rtp; RtcpStream *rtcp_st=&session->rtcp; mblk_t *m=NULL; if (st->rcv_last_app_ts - rtcp_st->last_rtcp_report_snt_r > rtcp_st->rtcp_report_snt_interval_r || st->snd_last_ts - rtcp_st->last_rtcp_report_snt_s > rtcp_st->rtcp_report_snt_interval_s){ rtcp_st->last_rtcp_report_snt_r=st->rcv_last_app_ts; rtcp_st->last_rtcp_report_snt_s=st->snd_last_ts; if (session->rtp.last_rtcp_packet_count<session->rtp.stats.packet_sent){ m=make_sr(session); session->rtp.last_rtcp_packet_count=session->rtp.stats.packet_sent; }else if (session->rtp.stats.packet_recv>0){ /*don't send RR when no packet are received yet*/ m=make_rr(session); } if (m!=NULL){ /* send the compound packet */ notify_sent_rtcp(session,m); rtp_session_rtcp_send(session,m); ortp_debug("Rtcp compound message sent."); } } }