Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1737)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

Issue 1746773002: [rtp_rtcp] tmmbr helper simplified by moving set_to_send member out (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
index 154093b156ff32f929407913c8aaa67799b61560..4a509b001ea0db5d438268b6011a163096f6abee 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -639,16 +639,11 @@ std::unique_ptr<rtcp::RtcpPacket> RTCPSender::BuildTMMBR(
std::unique_ptr<rtcp::RtcpPacket> RTCPSender::BuildTMMBN(
const RtcpContext& ctx) {
- TMMBRSet* boundingSet = tmmbr_help_.BoundingSetToSend();
- if (boundingSet == nullptr)
- return nullptr;
-
rtcp::Tmmbn* tmmbn = new rtcp::Tmmbn();
tmmbn->From(ssrc_);
- for (uint32_t i = 0; i < boundingSet->lengthOfSet(); i++) {
- if (boundingSet->Tmmbr(i) > 0) {
- tmmbn->WithTmmbr(boundingSet->Ssrc(i), boundingSet->Tmmbr(i),
- boundingSet->PacketOH(i));
+ for (const rtcp::TmmbItem& tmmbr : tmmbn_to_send_) {
+ if (tmmbr.bitrate_bps() > 0) {
+ tmmbn->WithTmmbr(tmmbr);
}
}
@@ -975,14 +970,14 @@ bool RTCPSender::RtcpXrReceiverReferenceTime() const {
}
// no callbacks allowed inside this function
-int32_t RTCPSender::SetTMMBN(const TMMBRSet* boundingSet) {
+void RTCPSender::SetTMMBN(const std::vector<rtcp::TmmbItem>* bounding_set) {
rtc::CritScope lock(&critical_section_rtcp_sender_);
-
- if (0 == tmmbr_help_.SetTMMBRBoundingSetToSend(boundingSet)) {
- SetFlag(kRtcpTmmbn, true);
- return 0;
+ if (bounding_set) {
+ tmmbn_to_send_ = *bounding_set;
+ } else {
+ tmmbn_to_send_.clear();
}
- return -1;
+ SetFlag(kRtcpTmmbn, true);
}
void RTCPSender::SetFlag(RTCPPacketType type, bool is_volatile) {
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698