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

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: Created 4 years, 10 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 a3de360cf6a4a399eb82bbfa5353bf2e83061d2a..ea53524ae1f0ce051bc8619a6914b9aa216d760f 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -648,16 +648,11 @@ rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildTMMBR(
rtc::scoped_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& timber : tmmbn_to_send_) {
+ if (timber.bitrate_bps() > 0) {
+ tmmbn->WithTmmbr(timber);
}
}
@@ -982,14 +977,14 @@ bool RTCPSender::RtcpXrReceiverReferenceTime() const {
}
// no callbacks allowed inside this function
-int32_t RTCPSender::SetTMMBN(const TMMBRSet* boundingSet) {
+void RTCPSender::SetTMMBN(const TMMBRSet* bounding_set) {
CriticalSectionScoped lock(critical_section_rtcp_sender_.get());
-
- if (0 == tmmbr_help_.SetTMMBRBoundingSetToSend(boundingSet)) {
- SetFlag(kRtcpTmmbn, true);
- return 0;
+ if (!bounding_set) {
+ tmmbn_to_send_.clear();
+ } else {
+ tmmbn_to_send_ = *bounding_set;
}
- return -1;
+ SetFlag(kRtcpTmmbn, true);
}
void RTCPSender::SetFlag(RTCPPacketType type, bool is_volatile) {

Powered by Google App Engine
This is Rietveld 408576698