Give shorter names for Report Block fields

This commit is contained in:
Aaro Altonen 2019-06-18 09:15:59 +03:00
parent 62b314dd29
commit 54ba727c0c
2 changed files with 21 additions and 22 deletions

View File

@ -64,12 +64,12 @@ namespace kvz_rtp {
PACKED_STRUCT(rtcp_report_block) {
uint32_t ssrc;
uint8_t fraction_lost;
uint32_t cumulative_pkt_lost:24;
uint32_t highest_seq_recved;
uint32_t interraival_jitter;
uint32_t last_sr;
uint32_t delay_since_last_sr;
uint8_t fraction;
int32_t lost:24;
uint32_t last_seq;
uint32_t jitter;
uint32_t lsr; /* last Sender Report */
uint32_t dlsr; /* delay since last Sender Report */
};
PACKED_STRUCT(rtcp_sender_frame) {

View File

@ -217,15 +217,15 @@ rtp_error_t kvz_rtp::rtcp::generate_sender_report()
frame->blocks[ptr].ssrc = receiver.first;
if (receiver.second->dropped_pkts) {
frame->blocks[ptr].fraction_lost =
frame->blocks[ptr].fraction =
receiver.second->processed_pkts / receiver.second->dropped_pkts;
}
frame->blocks[ptr].cumulative_pkt_lost = receiver.second->dropped_pkts;
frame->blocks[ptr].highest_seq_recved = 222; // TODO ???
frame->blocks[ptr].interraival_jitter = 333; // TODO ???
frame->blocks[ptr].delay_since_last_sr = 555; // TODO ???
frame->blocks[ptr].last_sr = 444; // TODO ???
frame->blocks[ptr].lost = receiver.second->dropped_pkts;
frame->blocks[ptr].last_seq = 222; // TODO ???
frame->blocks[ptr].dlsr = 555; // TODO jitter
frame->blocks[ptr].jitter = 333; // TODO ???
frame->blocks[ptr].lsr = 444; // TODO ???
ptr++;
}
@ -247,22 +247,21 @@ rtp_error_t kvz_rtp::rtcp::generate_receiver_report()
return rtp_errno;
}
rtp_error_t ret = RTP_OK;
size_t ptr = 0;
size_t ptr = 0;
for (auto& receiver : receiver_stats_) {
frame->blocks[ptr].ssrc = receiver.first;
if (receiver.second->dropped_pkts) {
frame->blocks[ptr].fraction_lost =
frame->blocks[ptr].fraction =
receiver.second->processed_pkts / receiver.second->dropped_pkts;
}
frame->blocks[ptr].cumulative_pkt_lost = receiver.second->dropped_pkts;
frame->blocks[ptr].highest_seq_recved = 222; // TODO ???
frame->blocks[ptr].interraival_jitter = 333; // TODO ???
frame->blocks[ptr].delay_since_last_sr = 555; // TODO ???
frame->blocks[ptr].last_sr = 444; // TODO ???
frame->blocks[ptr].lost = receiver.second->dropped_pkts;
frame->blocks[ptr].last_seq = 222; // TODO ???
frame->blocks[ptr].dlsr = 555; // TODO jitter
frame->blocks[ptr].jitter = 333; // TODO ???
frame->blocks[ptr].lsr = 444; // TODO ???
ptr++;
}
@ -290,7 +289,7 @@ rtp_error_t kvz_rtp::rtcp::handle_sender_report_packet(kvz_rtp::frame::rtcp_send
return RTP_INVALID_VALUE;
}
/* TODO: what are we supposed to with this report? */
/* TODO: 6.4.4 Analyzing Sender and Receiver Reports */
return RTP_OK;
}
@ -305,7 +304,7 @@ rtp_error_t kvz_rtp::rtcp::handle_receiver_report_packet(kvz_rtp::frame::rtcp_re
return RTP_INVALID_VALUE;
}
/* TODO: what are we supposed to with this report? */
/* TODO: 6.4.4 Analyzing Sender and Receiver Reports */
return RTP_OK;
}