Add sending REMB support to RtcpTransceiver

Bug: webrtc:8239
Change-Id: If22de91a69b5752baf616520a247f2fdedacc220
Reviewed-on: https://webrtc-review.googlesource.com/22080
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20657}
This commit is contained in:
Danil Chapovalov
2017-11-13 13:46:02 +01:00
committed by Commit Bot
parent b5b5bcee72
commit d328229d38
4 changed files with 138 additions and 1 deletions

View File

@ -17,7 +17,9 @@
#include <vector>
#include "api/array_view.h"
#include "api/optional.h"
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h"
#include "modules/rtp_rtcp/source/rtcp_packet/remb.h"
#include "modules/rtp_rtcp/source/rtcp_packet/report_block.h"
#include "modules/rtp_rtcp/source/rtcp_transceiver_config.h"
#include "rtc_base/constructormagic.h"
@ -40,6 +42,12 @@ class RtcpTransceiverImpl {
// Sends RTCP packets starting with a sender or receiver report.
void SendCompoundPacket();
// (REMB) Receiver Estimated Max Bitrate.
// Includes REMB in following compound packets.
void SetRemb(int bitrate_bps, std::vector<uint32_t> ssrcs);
// Stops sending REMB in following compound packets.
void UnsetRemb();
private:
struct SenderReportTimes {
int64_t local_received_time_us;
@ -56,6 +64,7 @@ class RtcpTransceiverImpl {
const RtcpTransceiverConfig config_;
rtc::Optional<rtcp::Remb> remb_;
std::map<uint32_t, SenderReportTimes> last_received_sender_reports_;
rtc::WeakPtrFactory<RtcpTransceiverImpl> ptr_factory_;