in RtcpTransceiver implement sending rtcp sender reports

Bug: webrtc:8239
Change-Id: Id3298bf4e0eb18a3fc8072fb19416e67a126705f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249788
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35995}
This commit is contained in:
Danil Chapovalov
2022-02-14 15:24:30 +01:00
committed by WebRTC LUCI CQ
parent 66bfd6f57d
commit f2b987377b
5 changed files with 298 additions and 37 deletions

View File

@ -64,6 +64,41 @@ class MediaReceiverRtcpObserver {
const VideoBitrateAllocation& allocation) {}
};
// Handles RTCP related messages for a single RTP stream (i.e. single SSRC)
class RtpStreamRtcpHandler {
public:
virtual ~RtpStreamRtcpHandler() = default;
// Statistic about sent RTP packets to propagate to RTCP sender report.
class RtpStats {
public:
RtpStats() = default;
RtpStats(const RtpStats&) = default;
RtpStats& operator=(const RtpStats&) = default;
~RtpStats() = default;
size_t num_sent_packets() const { return num_sent_packets_; }
size_t num_sent_bytes() const { return num_sent_bytes_; }
Timestamp last_capture_time() const { return last_capture_time_; }
uint32_t last_rtp_timestamp() const { return last_rtp_timestamp_; }
int last_clock_rate() const { return last_clock_rate_; }
void set_num_sent_packets(size_t v) { num_sent_packets_ = v; }
void set_num_sent_bytes(size_t v) { num_sent_bytes_ = v; }
void set_last_capture_time(Timestamp v) { last_capture_time_ = v; }
void set_last_rtp_timestamp(uint32_t v) { last_rtp_timestamp_ = v; }
void set_last_clock_rate(int v) { last_clock_rate_ = v; }
private:
size_t num_sent_packets_ = 0;
size_t num_sent_bytes_ = 0;
Timestamp last_capture_time_ = Timestamp::Zero();
uint32_t last_rtp_timestamp_ = 0;
int last_clock_rate_ = 90'000;
};
virtual RtpStats SentStats() = 0;
};
struct RtcpTransceiverConfig {
RtcpTransceiverConfig();
RtcpTransceiverConfig(const RtcpTransceiverConfig&);