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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

Issue 1675583002: [rtp_rtcp] rtcp::Tmmbr cleaned and got Parse function (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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 return nullptr; 671 return nullptr;
672 } 672 }
673 } 673 }
674 } 674 }
675 675
676 if (!tmmbr_send_) 676 if (!tmmbr_send_)
677 return nullptr; 677 return nullptr;
678 678
679 rtcp::Tmmbr* tmmbr = new rtcp::Tmmbr(); 679 rtcp::Tmmbr* tmmbr = new rtcp::Tmmbr();
680 tmmbr->From(ssrc_); 680 tmmbr->From(ssrc_);
681 tmmbr->To(remote_ssrc_); 681 rtcp::TmmbItem request;
682 tmmbr->WithBitrateKbps(tmmbr_send_); 682 request.set_ssrc(remote_ssrc_);
683 tmmbr->WithOverhead(packet_oh_send_); 683 request.set_bitrate_bps(tmmbr_send_ * 1000);
684 request.set_packet_overhead(packet_oh_send_);
685 tmmbr->WithTmmbr(request);
684 686
685 return rtc::scoped_ptr<rtcp::Tmmbr>(tmmbr); 687 return rtc::scoped_ptr<rtcp::Tmmbr>(tmmbr);
686 } 688 }
687 689
688 rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildTMMBN( 690 rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildTMMBN(
689 const RtcpContext& ctx) { 691 const RtcpContext& ctx) {
690 TMMBRSet* boundingSet = tmmbr_help_.BoundingSetToSend(); 692 TMMBRSet* boundingSet = tmmbr_help_.BoundingSetToSend();
691 if (boundingSet == nullptr) 693 if (boundingSet == nullptr)
692 return nullptr; 694 return nullptr;
693 695
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 // RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Sender); 1081 // RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Sender);
1080 // but we can't because of an incorrect warning (C4822) in MVS 2013. 1082 // but we can't because of an incorrect warning (C4822) in MVS 2013.
1081 } sender(transport_, event_log_); 1083 } sender(transport_, event_log_);
1082 1084
1083 uint8_t buffer[IP_PACKET_SIZE]; 1085 uint8_t buffer[IP_PACKET_SIZE];
1084 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && 1086 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) &&
1085 !sender.send_failure_; 1087 !sender.send_failure_;
1086 } 1088 }
1087 1089
1088 } // namespace webrtc 1090 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698