Commit 28895f74 authored by Byron Campen's avatar Byron Campen
Browse files

Bug 1822194 - Vendor libwebrtc from a3a3b6d798

Upstream commit: https://webrtc.googlesource.com/src/+/a3a3b6d7981d475b4018fda2cbcce212e83686a9
    [Stats] If remote-inbound-rtp has no RTT, leave it undefined.

    Bug: webrtc:14692
    Change-Id: I49878449cd91b590f1aedef7676c3715d563ac61
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284660


    Commit-Queue: Henrik Boström <hbos@webrtc.org>
    Auto-Submit: Henrik Boström <hbos@webrtc.org>
    Reviewed-by: default avatarHarald Alvestrand <hta@webrtc.org>
    Commit-Queue: Harald Alvestrand <hta@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#38706}
parent f354660e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -19719,3 +19719,6 @@ ca0481751d
# MOZ_LIBWEBRTC_SRC=/home/bcampen/checkouts/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
dd35e244ce
# MOZ_LIBWEBRTC_SRC=/home/bcampen/checkouts/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
a3a3b6d798
+2 −0
Original line number Diff line number Diff line
@@ -13168,3 +13168,5 @@ libwebrtc updated from /home/bcampen/checkouts/moz-libwebrtc commit mozpatches o
libwebrtc updated from /home/bcampen/checkouts/moz-libwebrtc commit mozpatches on 2023-03-31T23:35:25.993253.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/bcampen/checkouts/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/bcampen/checkouts/moz-libwebrtc commit mozpatches on 2023-03-31T23:36:47.138202.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/bcampen/checkouts/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/bcampen/checkouts/moz-libwebrtc commit mozpatches on 2023-03-31T23:38:03.896437.
+5 −3
Original line number Diff line number Diff line
@@ -815,9 +815,11 @@ ProduceRemoteInboundRtpStreamStatsFromReportBlockData(
  remote_inbound->packets_lost = report_block.packets_lost;
  remote_inbound->fraction_lost =
      static_cast<double>(report_block.fraction_lost) / (1 << 8);
  if (report_block_data.num_rtts() > 0) {
    remote_inbound->round_trip_time =
        static_cast<double>(report_block_data.last_rtt_ms()) /
        rtc::kNumMillisecsPerSec;
  }
  remote_inbound->total_round_trip_time =
      static_cast<double>(report_block_data.sum_rtt_ms()) /
      rtc::kNumMillisecsPerSec;
+26 −0
Original line number Diff line number Diff line
@@ -3557,6 +3557,32 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
  }
}

TEST_P(RTCStatsCollectorTestWithParamKind,
       RTCRemoteInboundRtpStreamStatsRttMissingBeforeMeasurement) {
  constexpr int64_t kReportBlockTimestampUtcUs = 123456789;

  RTCPReportBlock report_block;
  // The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
  // `source_ssrc`, "SSRC of the RTP packet sender".
  report_block.source_ssrc = 12;
  ReportBlockData report_block_data;  // AddRoundTripTimeSample() not called.
  report_block_data.SetReportBlock(report_block, kReportBlockTimestampUtcUs);

  AddSenderInfoAndMediaChannel("TransportName", {report_block_data},
                               absl::nullopt);

  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();

  std::string remote_inbound_rtp_id = "RI" + MediaTypeCharStr() + "12";
  ASSERT_TRUE(report->Get(remote_inbound_rtp_id));
  auto& remote_inbound_rtp = report->Get(remote_inbound_rtp_id)
                                 ->cast_to<RTCRemoteInboundRtpStreamStats>();

  EXPECT_TRUE(remote_inbound_rtp.round_trip_time_measurements.is_defined());
  EXPECT_EQ(0, *remote_inbound_rtp.round_trip_time_measurements);
  EXPECT_FALSE(remote_inbound_rtp.round_trip_time.is_defined());
}

TEST_P(RTCStatsCollectorTestWithParamKind,
       RTCRemoteInboundRtpStreamStatsWithTimestampFromReportBlock) {
  const int64_t kReportBlockTimestampUtcUs = 123456789;