Esempio n. 1
0
static void sender_info_init(sender_info_t *info, RtpSession *session){
	struct timeval tv;
	uint64_t ntp;
	ortp_gettimeofday(&tv,NULL);
	ntp=ortp_timeval_to_ntp(&tv);
	info->ntp_timestamp_msw=htonl(ntp >>32);
	info->ntp_timestamp_lsw=htonl(ntp & 0xFFFFFFFF);
	info->rtp_timestamp=htonl(session->rtp.snd_last_ts);
	info->senders_packet_count=(uint32_t) htonl((u_long) session->stats.packet_sent);
	info->senders_octet_count=(uint32_t) htonl((u_long) session->rtp.sent_payload_bytes);
	session->rtp.last_rtcp_packet_count=(uint32_t)session->stats.packet_sent;
}
Esempio n. 2
0
static int rtcp_xr_rcvr_rtt_init(uint8_t *buf, RtpSession *session) {
	struct timeval tv;
	uint64_t ntp;
	rtcp_xr_rcvr_rtt_report_block_t *block = (rtcp_xr_rcvr_rtt_report_block_t *)buf;

	block->bh.bt = RTCP_XR_RCVR_RTT;
	block->bh.flags = 0; // Reserved bits
	block->bh.length = htons(2);
	ortp_gettimeofday(&tv, NULL);
	ntp = ortp_timeval_to_ntp(&tv);
	block->ntp_timestamp_msw = htonl(ntp >> 32);
	block->ntp_timestamp_lsw = htonl(ntp & 0xFFFFFFFF);
	return sizeof(rtcp_xr_rcvr_rtt_report_block_t);
}