Skip to content

Commit

Permalink
Fix: Missing bwe setting from alphaRTC (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Ze Gan <ganze718@gmail.com>
  • Loading branch information
Pterosaur authored Jan 14, 2021
1 parent fad8291 commit 8fffae6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions modules/rtp_rtcp/source/rtcp_receiver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ struct RTCPReceiver::PacketInformation {
absl::optional<VideoBitrateAllocation> target_bitrate_allocation;
absl::optional<NetworkStateEstimate> network_state_estimate;
std::unique_ptr<rtcp::LossNotification> loss_notification;
std::unique_ptr<rtcp::App> application;
};

// Structure for handing TMMBR and TMMBN rtcp messages (RFC5104, section 3.5.4).
Expand Down Expand Up @@ -696,18 +697,14 @@ void RTCPReceiver::HandleNack(const CommonHeader& rtcp_block,

void RTCPReceiver::HandleApp(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) {
rtcp::App app;
if (app.Parse(rtcp_block)) {
if (app.name() == rtcp::RemoteEstimate::kName &&
app.sub_type() == rtcp::RemoteEstimate::kSubType) {
rtcp::RemoteEstimate estimate(std::move(app));
if (estimate.ParseData()) {
packet_information->network_state_estimate = estimate.estimate();
return;
}
}
std::unique_ptr<rtcp::App> app_packet(new rtcp::App());
if (!app_packet->Parse(rtcp_block)) {
++num_skipped_packets_;
return;
}
++num_skipped_packets_;

packet_information->packet_type_flags |= kRtcpApp;
packet_information->application = std::move(app_packet);
}

void RTCPReceiver::HandleBye(const CommonHeader& rtcp_block) {
Expand Down Expand Up @@ -1082,6 +1079,12 @@ void RTCPReceiver::TriggerCallbacksFromRtcpPacket(
}
}

if (transport_feedback_observer_ &&
(packet_information.packet_type_flags & kRtcpApp)) {
transport_feedback_observer_->OnApplicationPacket(
*packet_information.application);
}

if (network_state_estimate_observer_ &&
packet_information.network_state_estimate) {
network_state_estimate_observer_->OnRemoteNetworkEstimate(
Expand Down

0 comments on commit 8fffae6

Please sign in to comment.