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

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

Issue 2540363003: Wire up rtcp xr target bitrate on receive side. (Closed)
Patch Set: Created 4 years 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
11 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h"
12 12
13 #include <assert.h> 13 #include <assert.h>
14 #include <string.h> 14 #include <string.h>
15 15
16 #include <limits> 16 #include <limits>
17 #include <map> 17 #include <map>
18 #include <memory> 18 #include <memory>
19 #include <utility> 19 #include <utility>
20 #include <vector> 20 #include <vector>
21 21
22 #include "webrtc/base/checks.h" 22 #include "webrtc/base/checks.h"
23 #include "webrtc/base/logging.h" 23 #include "webrtc/base/logging.h"
24 #include "webrtc/base/trace_event.h" 24 #include "webrtc/base/trace_event.h"
25 #include "webrtc/common_video/include/video_bitrate_allocator.h"
25 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h"
26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h"
27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.h" 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h"
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h" 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h"
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h"
31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h" 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h"
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request.h" 33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request.h"
33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" 34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h"
34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h" 35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 size_t num_rtts = 0; 97 size_t num_rtts = 0;
97 }; 98 };
98 99
99 RTCPReceiver::RTCPReceiver( 100 RTCPReceiver::RTCPReceiver(
100 Clock* clock, 101 Clock* clock,
101 bool receiver_only, 102 bool receiver_only,
102 RtcpPacketTypeCounterObserver* packet_type_counter_observer, 103 RtcpPacketTypeCounterObserver* packet_type_counter_observer,
103 RtcpBandwidthObserver* rtcp_bandwidth_observer, 104 RtcpBandwidthObserver* rtcp_bandwidth_observer,
104 RtcpIntraFrameObserver* rtcp_intra_frame_observer, 105 RtcpIntraFrameObserver* rtcp_intra_frame_observer,
105 TransportFeedbackObserver* transport_feedback_observer, 106 TransportFeedbackObserver* transport_feedback_observer,
107 VideoBitrateAllocationObserver* bitrate_allocation_observer,
106 ModuleRtpRtcp* owner) 108 ModuleRtpRtcp* owner)
107 : _clock(clock), 109 : _clock(clock),
108 receiver_only_(receiver_only), 110 receiver_only_(receiver_only),
109 _rtpRtcp(*owner), 111 _rtpRtcp(*owner),
110 _cbRtcpBandwidthObserver(rtcp_bandwidth_observer), 112 rtcp_bandwidth_observer_(rtcp_bandwidth_observer),
111 _cbRtcpIntraFrameObserver(rtcp_intra_frame_observer), 113 rtcp_intra_frame_observer_(rtcp_intra_frame_observer),
112 _cbTransportFeedbackObserver(transport_feedback_observer), 114 transport_feedback_observer_(transport_feedback_observer),
115 bitrate_allocation_observer_(bitrate_allocation_observer),
113 main_ssrc_(0), 116 main_ssrc_(0),
114 _remoteSSRC(0), 117 _remoteSSRC(0),
115 _remoteSenderInfo(), 118 _remoteSenderInfo(),
116 xr_rrtr_status_(false), 119 xr_rrtr_status_(false),
117 xr_rr_rtt_ms_(0), 120 xr_rr_rtt_ms_(0),
118 _lastReceivedRrMs(0), 121 _lastReceivedRrMs(0),
119 _lastIncreasedSequenceNumberMs(0), 122 _lastIncreasedSequenceNumberMs(0),
120 stats_callback_(NULL), 123 stats_callback_(nullptr),
121 packet_type_counter_observer_(packet_type_counter_observer), 124 packet_type_counter_observer_(packet_type_counter_observer),
122 num_skipped_packets_(0), 125 num_skipped_packets_(0),
123 last_skipped_packets_warning_(clock->TimeInMilliseconds()) { 126 last_skipped_packets_warning_(clock->TimeInMilliseconds()) {
124 memset(&_remoteSenderInfo, 0, sizeof(_remoteSenderInfo)); 127 memset(&_remoteSenderInfo, 0, sizeof(_remoteSenderInfo));
125 } 128 }
126 129
127 RTCPReceiver::~RTCPReceiver() {} 130 RTCPReceiver::~RTCPReceiver() {}
128 131
129 bool RTCPReceiver::IncomingPacket(const uint8_t* packet, size_t packet_size) { 132 bool RTCPReceiver::IncomingPacket(const uint8_t* packet, size_t packet_size) {
130 if (packet_size == 0) { 133 if (packet_size == 0) {
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 PacketInformation* packet_information) { 623 PacketInformation* packet_information) {
621 rtcp::Sdes sdes; 624 rtcp::Sdes sdes;
622 if (!sdes.Parse(rtcp_block)) { 625 if (!sdes.Parse(rtcp_block)) {
623 ++num_skipped_packets_; 626 ++num_skipped_packets_;
624 return; 627 return;
625 } 628 }
626 629
627 for (const rtcp::Sdes::Chunk& chunk : sdes.chunks()) { 630 for (const rtcp::Sdes::Chunk& chunk : sdes.chunks()) {
628 received_cnames_[chunk.ssrc] = chunk.cname; 631 received_cnames_[chunk.ssrc] = chunk.cname;
629 { 632 {
630 rtc::CritScope lock(&_criticalSectionFeedbacks); 633 rtc::CritScope lock(&feedbacks_lock_);
631 if (stats_callback_) 634 if (stats_callback_)
632 stats_callback_->CNameChanged(chunk.cname.c_str(), chunk.ssrc); 635 stats_callback_->CNameChanged(chunk.cname.c_str(), chunk.ssrc);
633 } 636 }
634 } 637 }
635 packet_information->packet_type_flags |= kRtcpSdes; 638 packet_information->packet_type_flags |= kRtcpSdes;
636 } 639 }
637 640
638 void RTCPReceiver::HandleNACK(const CommonHeader& rtcp_block, 641 void RTCPReceiver::HandleNACK(const CommonHeader& rtcp_block,
639 PacketInformation* packet_information) { 642 PacketInformation* packet_information) {
640 rtcp::Nack nack; 643 rtcp::Nack nack;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 } 684 }
682 685
683 void RTCPReceiver::HandleXr(const CommonHeader& rtcp_block, 686 void RTCPReceiver::HandleXr(const CommonHeader& rtcp_block,
684 PacketInformation* packet_information) { 687 PacketInformation* packet_information) {
685 rtcp::ExtendedReports xr; 688 rtcp::ExtendedReports xr;
686 if (!xr.Parse(rtcp_block)) { 689 if (!xr.Parse(rtcp_block)) {
687 ++num_skipped_packets_; 690 ++num_skipped_packets_;
688 return; 691 return;
689 } 692 }
690 693
691 if (xr.rrtr()) 694 // TODO(sprang): Add VoIP metrics?
danilchap 2016/12/01 17:05:40 do we have any part of code that might be interest
sprang_webrtc 2016/12/02 09:28:44 Hm, ok. Shall I add a todo in the send side about
695
696 if (xr.rrtr()) {
692 HandleXrReceiveReferenceTime(xr.sender_ssrc(), *xr.rrtr()); 697 HandleXrReceiveReferenceTime(xr.sender_ssrc(), *xr.rrtr());
698 packet_information->packet_type_flags |= kRtcpXrReceiverReferenceTime;
danilchap 2016/12/01 17:05:41 kRtcpXrReceiverReferenceTime is not used in the pa
sprang_webrtc 2016/12/02 09:28:44 Done.
699 }
693 700
694 for (const rtcp::ReceiveTimeInfo& time_info : xr.dlrr().sub_blocks()) 701 if (!xr.dlrr().sub_blocks().empty()) {
695 HandleXrDlrrReportBlock(time_info); 702 for (const rtcp::ReceiveTimeInfo& time_info : xr.dlrr().sub_blocks())
703 HandleXrDlrrReportBlock(time_info);
704 packet_information->packet_type_flags |= kRtcpXrDlrrReportBlock;
danilchap 2016/12/01 17:05:40 ditto
sprang_webrtc 2016/12/02 09:28:44 Done.
705 }
706
707 if (xr.target_bitrate()) {
708 HandleXrTargetBitrate(*xr.target_bitrate());
709 packet_information->packet_type_flags |= kRtcpXrTargetBitrate;
danilchap 2016/12/01 17:05:40 ditto
sprang_webrtc 2016/12/02 09:28:44 Done.
710 }
696 } 711 }
697 712
698 void RTCPReceiver::HandleXrReceiveReferenceTime( 713 void RTCPReceiver::HandleXrReceiveReferenceTime(
699 uint32_t sender_ssrc, 714 uint32_t sender_ssrc,
700 const rtcp::Rrtr& rrtr) { 715 const rtcp::Rrtr& rrtr) {
701 remote_time_info_.ssrc = sender_ssrc; 716 remote_time_info_.ssrc = sender_ssrc;
702 remote_time_info_.last_rr = CompactNtp(rrtr.ntp()); 717 remote_time_info_.last_rr = CompactNtp(rrtr.ntp());
703 last_received_xr_ntp_.SetCurrent(*_clock); 718 last_received_xr_ntp_.SetCurrent(*_clock);
704 } 719 }
705 720
(...skipping 12 matching lines...) Expand all
718 if (send_time == 0) 733 if (send_time == 0)
719 return; 734 return;
720 735
721 uint32_t delay_rr = rti.delay_since_last_rr; 736 uint32_t delay_rr = rti.delay_since_last_rr;
722 uint32_t now = CompactNtp(NtpTime(*_clock)); 737 uint32_t now = CompactNtp(NtpTime(*_clock));
723 738
724 uint32_t rtt_ntp = now - delay_rr - send_time; 739 uint32_t rtt_ntp = now - delay_rr - send_time;
725 xr_rr_rtt_ms_ = CompactNtpRttToMs(rtt_ntp); 740 xr_rr_rtt_ms_ = CompactNtpRttToMs(rtt_ntp);
726 } 741 }
727 742
743 void RTCPReceiver::HandleXrTargetBitrate(
744 const rtcp::TargetBitrate& target_bitrate) {
745 BitrateAllocation bitrate_allocation;
746 for (const auto& item : target_bitrate.GetTargetBitrates()) {
747 bitrate_allocation.SetBitrate(item.spatial_layer, item.temporal_layer,
748 item.target_bitrate_kbps * 1000);
749 }
750 bitrate_allocation_.emplace(std::move(bitrate_allocation));
danilchap 2016/12/01 17:05:40 copy constructor is as expensive as move construct
sprang_webrtc 2016/12/02 09:28:44 I forgot to remove the move when I changed from an
751 }
752
728 void RTCPReceiver::HandlePLI(const CommonHeader& rtcp_block, 753 void RTCPReceiver::HandlePLI(const CommonHeader& rtcp_block,
729 PacketInformation* packet_information) { 754 PacketInformation* packet_information) {
730 rtcp::Pli pli; 755 rtcp::Pli pli;
731 if (!pli.Parse(rtcp_block)) { 756 if (!pli.Parse(rtcp_block)) {
732 ++num_skipped_packets_; 757 ++num_skipped_packets_;
733 return; 758 return;
734 } 759 }
735 760
736 if (main_ssrc_ == pli.media_ssrc()) { 761 if (main_ssrc_ == pli.media_ssrc()) {
737 TRACE_EVENT_INSTANT0(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "PLI"); 762 TRACE_EVENT_INSTANT0(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "PLI");
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 916
892 packet_information->packet_type_flags |= kRtcpTransportFeedback; 917 packet_information->packet_type_flags |= kRtcpTransportFeedback;
893 packet_information->transport_feedback = std::move(transport_feedback); 918 packet_information->transport_feedback = std::move(transport_feedback);
894 } 919 }
895 920
896 void RTCPReceiver::UpdateTmmbr() { 921 void RTCPReceiver::UpdateTmmbr() {
897 // Find bounding set. 922 // Find bounding set.
898 std::vector<rtcp::TmmbItem> bounding = 923 std::vector<rtcp::TmmbItem> bounding =
899 TMMBRHelp::FindBoundingSet(TmmbrReceived()); 924 TMMBRHelp::FindBoundingSet(TmmbrReceived());
900 925
901 if (!bounding.empty() && _cbRtcpBandwidthObserver) { 926 if (!bounding.empty() && rtcp_bandwidth_observer_) {
902 // We have a new bandwidth estimate on this channel. 927 // We have a new bandwidth estimate on this channel.
903 uint64_t bitrate_bps = TMMBRHelp::CalcMinBitrateBps(bounding); 928 uint64_t bitrate_bps = TMMBRHelp::CalcMinBitrateBps(bounding);
904 if (bitrate_bps <= std::numeric_limits<uint32_t>::max()) 929 if (bitrate_bps <= std::numeric_limits<uint32_t>::max())
905 _cbRtcpBandwidthObserver->OnReceivedEstimatedBitrate(bitrate_bps); 930 rtcp_bandwidth_observer_->OnReceivedEstimatedBitrate(bitrate_bps);
906 } 931 }
907 932
908 // Set bounding set: inform remote clients about the new bandwidth. 933 // Set bounding set: inform remote clients about the new bandwidth.
909 _rtpRtcp.SetTmmbn(std::move(bounding)); 934 _rtpRtcp.SetTmmbn(std::move(bounding));
910 } 935 }
911 936
912 void RTCPReceiver::RegisterRtcpStatisticsCallback( 937 void RTCPReceiver::RegisterRtcpStatisticsCallback(
913 RtcpStatisticsCallback* callback) { 938 RtcpStatisticsCallback* callback) {
914 rtc::CritScope cs(&_criticalSectionFeedbacks); 939 rtc::CritScope cs(&feedbacks_lock_);
915 stats_callback_ = callback; 940 stats_callback_ = callback;
916 } 941 }
917 942
918 RtcpStatisticsCallback* RTCPReceiver::GetRtcpStatisticsCallback() { 943 RtcpStatisticsCallback* RTCPReceiver::GetRtcpStatisticsCallback() {
919 rtc::CritScope cs(&_criticalSectionFeedbacks); 944 rtc::CritScope cs(&feedbacks_lock_);
920 return stats_callback_; 945 return stats_callback_;
921 } 946 }
922 947
923 // Holding no Critical section 948 // Holding no Critical section
924 void RTCPReceiver::TriggerCallbacksFromRTCPPacket( 949 void RTCPReceiver::TriggerCallbacksFromRTCPPacket(
925 const PacketInformation& packet_information) { 950 const PacketInformation& packet_information) {
926 // Process TMMBR and REMB first to avoid multiple callbacks 951 // Process TMMBR and REMB first to avoid multiple callbacks
927 // to OnNetworkChanged. 952 // to OnNetworkChanged.
928 if (packet_information.packet_type_flags & kRtcpTmmbr) { 953 if (packet_information.packet_type_flags & kRtcpTmmbr) {
929 // Might trigger a OnReceivedBandwidthEstimateUpdate. 954 // Might trigger a OnReceivedBandwidthEstimateUpdate.
(...skipping 10 matching lines...) Expand all
940 if (!receiver_only_ && (packet_information.packet_type_flags & kRtcpSrReq)) { 965 if (!receiver_only_ && (packet_information.packet_type_flags & kRtcpSrReq)) {
941 _rtpRtcp.OnRequestSendReport(); 966 _rtpRtcp.OnRequestSendReport();
942 } 967 }
943 if (!receiver_only_ && (packet_information.packet_type_flags & kRtcpNack)) { 968 if (!receiver_only_ && (packet_information.packet_type_flags & kRtcpNack)) {
944 if (!packet_information.nack_sequence_numbers.empty()) { 969 if (!packet_information.nack_sequence_numbers.empty()) {
945 LOG(LS_VERBOSE) << "Incoming NACK length: " 970 LOG(LS_VERBOSE) << "Incoming NACK length: "
946 << packet_information.nack_sequence_numbers.size(); 971 << packet_information.nack_sequence_numbers.size();
947 _rtpRtcp.OnReceivedNack(packet_information.nack_sequence_numbers); 972 _rtpRtcp.OnReceivedNack(packet_information.nack_sequence_numbers);
948 } 973 }
949 } 974 }
950 { 975
951 // We need feedback that we have received a report block(s) so that we 976 // We need feedback that we have received a report block(s) so that we
952 // can generate a new packet in a conference relay scenario, one received 977 // can generate a new packet in a conference relay scenario, one received
953 // report can generate several RTCP packets, based on number relayed/mixed 978 // report can generate several RTCP packets, based on number relayed/mixed
954 // a send report block should go out to all receivers. 979 // a send report block should go out to all receivers.
955 if (_cbRtcpIntraFrameObserver) { 980 if (rtcp_intra_frame_observer_) {
956 RTC_DCHECK(!receiver_only_); 981 RTC_DCHECK(!receiver_only_);
957 if ((packet_information.packet_type_flags & kRtcpPli) || 982 if ((packet_information.packet_type_flags & kRtcpPli) ||
958 (packet_information.packet_type_flags & kRtcpFir)) { 983 (packet_information.packet_type_flags & kRtcpFir)) {
959 if (packet_information.packet_type_flags & kRtcpPli) { 984 if (packet_information.packet_type_flags & kRtcpPli) {
960 LOG(LS_VERBOSE) << "Incoming PLI from SSRC " 985 LOG(LS_VERBOSE) << "Incoming PLI from SSRC "
961 << packet_information.remote_ssrc; 986 << packet_information.remote_ssrc;
962 } else { 987 } else {
963 LOG(LS_VERBOSE) << "Incoming FIR from SSRC " 988 LOG(LS_VERBOSE) << "Incoming FIR from SSRC "
964 << packet_information.remote_ssrc; 989 << packet_information.remote_ssrc;
965 }
966 _cbRtcpIntraFrameObserver->OnReceivedIntraFrameRequest(local_ssrc);
967 } 990 }
968 if (packet_information.packet_type_flags & kRtcpSli) { 991 rtcp_intra_frame_observer_->OnReceivedIntraFrameRequest(local_ssrc);
969 _cbRtcpIntraFrameObserver->OnReceivedSLI(
970 local_ssrc, packet_information.sli_picture_id);
971 }
972 if (packet_information.packet_type_flags & kRtcpRpsi) {
973 _cbRtcpIntraFrameObserver->OnReceivedRPSI(
974 local_ssrc, packet_information.rpsi_picture_id);
975 }
976 } 992 }
977 if (_cbRtcpBandwidthObserver) { 993 if (packet_information.packet_type_flags & kRtcpSli) {
978 RTC_DCHECK(!receiver_only_); 994 rtcp_intra_frame_observer_->OnReceivedSLI(
979 if (packet_information.packet_type_flags & kRtcpRemb) { 995 local_ssrc, packet_information.sli_picture_id);
980 LOG(LS_VERBOSE) 996 }
981 << "Incoming REMB: " 997 if (packet_information.packet_type_flags & kRtcpRpsi) {
982 << packet_information.receiver_estimated_max_bitrate_bps; 998 rtcp_intra_frame_observer_->OnReceivedRPSI(
983 _cbRtcpBandwidthObserver->OnReceivedEstimatedBitrate( 999 local_ssrc, packet_information.rpsi_picture_id);
984 packet_information.receiver_estimated_max_bitrate_bps); 1000 }
985 } 1001 }
986 if ((packet_information.packet_type_flags & kRtcpSr) || 1002 if (rtcp_bandwidth_observer_) {
987 (packet_information.packet_type_flags & kRtcpRr)) { 1003 RTC_DCHECK(!receiver_only_);
988 int64_t now = _clock->TimeInMilliseconds(); 1004 if (packet_information.packet_type_flags & kRtcpRemb) {
989 _cbRtcpBandwidthObserver->OnReceivedRtcpReceiverReport( 1005 LOG(LS_VERBOSE) << "Incoming REMB: "
990 packet_information.report_blocks, packet_information.rtt_ms, now); 1006 << packet_information.receiver_estimated_max_bitrate_bps;
991 } 1007 rtcp_bandwidth_observer_->OnReceivedEstimatedBitrate(
1008 packet_information.receiver_estimated_max_bitrate_bps);
992 } 1009 }
993 if ((packet_information.packet_type_flags & kRtcpSr) || 1010 if ((packet_information.packet_type_flags & kRtcpSr) ||
994 (packet_information.packet_type_flags & kRtcpRr)) { 1011 (packet_information.packet_type_flags & kRtcpRr)) {
995 _rtpRtcp.OnReceivedRtcpReportBlocks(packet_information.report_blocks); 1012 int64_t now = _clock->TimeInMilliseconds();
1013 rtcp_bandwidth_observer_->OnReceivedRtcpReceiverReport(
1014 packet_information.report_blocks, packet_information.rtt_ms, now);
996 } 1015 }
1016 }
1017 if ((packet_information.packet_type_flags & kRtcpSr) ||
1018 (packet_information.packet_type_flags & kRtcpRr)) {
1019 _rtpRtcp.OnReceivedRtcpReportBlocks(packet_information.report_blocks);
1020 }
997 1021
998 if (_cbTransportFeedbackObserver && 1022 if (transport_feedback_observer_ &&
999 (packet_information.packet_type_flags & kRtcpTransportFeedback)) { 1023 (packet_information.packet_type_flags & kRtcpTransportFeedback)) {
1000 uint32_t media_source_ssrc = 1024 uint32_t media_source_ssrc =
1001 packet_information.transport_feedback->media_ssrc(); 1025 packet_information.transport_feedback->media_ssrc();
1002 if (media_source_ssrc == local_ssrc || 1026 if (media_source_ssrc == local_ssrc ||
1003 registered_ssrcs.find(media_source_ssrc) != registered_ssrcs.end()) { 1027 registered_ssrcs.find(media_source_ssrc) != registered_ssrcs.end()) {
1004 _cbTransportFeedbackObserver->OnTransportFeedback( 1028 transport_feedback_observer_->OnTransportFeedback(
1005 *packet_information.transport_feedback); 1029 *packet_information.transport_feedback);
1006 }
1007 } 1030 }
1008 } 1031 }
1009 1032
1033 if (bitrate_allocation_observer_ && bitrate_allocation_) {
1034 bitrate_allocation_observer_->OnBitrateAllocationUpdated(
danilchap 2016/12/01 17:05:40 Do you want to call OnBitrateAllocationUpdated eve
sprang_webrtc 2016/12/02 09:28:44 Whoops. I was debating with myself whether to have
1035 *bitrate_allocation_);
1036 }
1037
1010 if (!receiver_only_) { 1038 if (!receiver_only_) {
1011 rtc::CritScope cs(&_criticalSectionFeedbacks); 1039 rtc::CritScope cs(&feedbacks_lock_);
1012 if (stats_callback_) { 1040 if (stats_callback_) {
1013 for (const auto& report_block : packet_information.report_blocks) { 1041 for (const auto& report_block : packet_information.report_blocks) {
1014 RtcpStatistics stats; 1042 RtcpStatistics stats;
1015 stats.cumulative_lost = report_block.cumulativeLost; 1043 stats.cumulative_lost = report_block.cumulativeLost;
1016 stats.extended_max_sequence_number = report_block.extendedHighSeqNum; 1044 stats.extended_max_sequence_number = report_block.extendedHighSeqNum;
1017 stats.fraction_lost = report_block.fractionLost; 1045 stats.fraction_lost = report_block.fractionLost;
1018 stats.jitter = report_block.jitter; 1046 stats.jitter = report_block.jitter;
1019 1047
1020 stats_callback_->StatisticsUpdated(stats, report_block.sourceSSRC); 1048 stats_callback_->StatisticsUpdated(stats, report_block.sourceSSRC);
1021 } 1049 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 } else { 1081 } else {
1054 candidates.push_back(it->second.tmmbr_item); 1082 candidates.push_back(it->second.tmmbr_item);
1055 ++it; 1083 ++it;
1056 } 1084 }
1057 } 1085 }
1058 } 1086 }
1059 return candidates; 1087 return candidates;
1060 } 1088 }
1061 1089
1062 } // namespace webrtc 1090 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698