Upstream commit: https://webrtc.googlesource.com/src/+/3901cac157827a74e6edf140303ea2260519c7bc Stash PacketBuffer::Packet instead of recreating it during unstash To reduce cost of re-trying and re-parsing the same packet multiple times. Bug: b/510362066 Change-Id: Ic1ffe2c2e6466d0c028a9d4dff9b6c656787633e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/496061 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/main@{#48366}
74 lines
3.3 KiB
Diff
74 lines
3.3 KiB
Diff
From: "Byron Campen [:bwc]" <docfaraday@gmail.com>
|
|
Date: Fri, 12 Mar 2021 08:55:00 -0600
|
|
Subject: Bug 1654112 - libwebrtc modification: Surface video RTCP SR stats
|
|
again. r=ng
|
|
|
|
libwebrtc has stopped surfacing these, and Chromium does not support
|
|
these stats at all.
|
|
|
|
Differential Revision: https://phabricator.services.mozilla.com/D108674
|
|
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/edac9d01a9ac7594f4b22708a4690753638ca32c
|
|
---
|
|
video/rtp_video_stream_receiver2.cc | 10 ++++++++++
|
|
video/rtp_video_stream_receiver2.h | 6 ++++++
|
|
video/video_receive_stream2.cc | 8 ++++++++
|
|
3 files changed, 24 insertions(+)
|
|
|
|
diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc
|
|
index 927b539ae7..6fc448d135 100644
|
|
--- a/video/rtp_video_stream_receiver2.cc
|
|
+++ b/video/rtp_video_stream_receiver2.cc
|
|
@@ -1156,6 +1156,16 @@ std::optional<int64_t> RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs()
|
|
return std::nullopt;
|
|
}
|
|
|
|
+// Mozilla modification: VideoReceiveStream2 and friends do not surface RTCP
|
|
+// stats at all, and even on the most recent libwebrtc code there does not
|
|
+// seem to be any support for these stats right now. So, we hack this in.
|
|
+void RtpVideoStreamReceiver2::RemoteRTCPSenderInfo(
|
|
+ uint32_t* packet_count, uint32_t* octet_count,
|
|
+ int64_t* ntp_timestamp_ms) const {
|
|
+ RTC_DCHECK_RUN_ON(&worker_task_checker_);
|
|
+ rtp_rtcp_->RemoteRTCPSenderInfo(packet_count, octet_count, ntp_timestamp_ms);
|
|
+}
|
|
+
|
|
std::optional<RtpRtcpInterface::SenderReportStats>
|
|
RtpVideoStreamReceiver2::GetSenderReportStats() const {
|
|
RTC_DCHECK_RUN_ON(worker_queue_);
|
|
diff --git a/video/rtp_video_stream_receiver2.h b/video/rtp_video_stream_receiver2.h
|
|
index e16fd2732e..3dc8b6aebe 100644
|
|
--- a/video/rtp_video_stream_receiver2.h
|
|
+++ b/video/rtp_video_stream_receiver2.h
|
|
@@ -243,6 +243,12 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender,
|
|
const RtpPacketReceived& rtp_packet,
|
|
const RTPVideoHeader& video);
|
|
|
|
+ // Mozilla modification: VideoReceiveStream2 and friends do not surface RTCP
|
|
+ // stats at all, and even on the most recent libwebrtc code there does not
|
|
+ // seem to be any support for these stats right now. So, we hack this in.
|
|
+ void RemoteRTCPSenderInfo(uint32_t* packet_count, uint32_t* octet_count,
|
|
+ int64_t* ntp_timestamp_ms) const;
|
|
+
|
|
private:
|
|
// Implements RtpVideoFrameReceiver.
|
|
void ManageFrame(std::unique_ptr<RtpFrameObject> frame) override;
|
|
diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc
|
|
index 366ea3689f..3facaabe82 100644
|
|
--- a/video/video_receive_stream2.cc
|
|
+++ b/video/video_receive_stream2.cc
|
|
@@ -619,6 +619,14 @@ VideoReceiveStreamInterface::Stats VideoReceiveStream2::GetStats() const {
|
|
non_sender_rtt_stats->round_trip_time_measurements;
|
|
stats.total_round_trip_time = non_sender_rtt_stats->total_round_trip_time;
|
|
}
|
|
+
|
|
+ // Mozilla modification: VideoReceiveStream2 and friends do not surface RTCP
|
|
+ // stats at all, and even on the most recent libwebrtc code there does not
|
|
+ // seem to be any support for these stats right now. So, we hack this in.
|
|
+ rtp_video_stream_receiver_.RemoteRTCPSenderInfo(
|
|
+ &stats.rtcp_sender_packets_sent, &stats.rtcp_sender_octets_sent,
|
|
+ &stats.rtcp_sender_ntp_timestamp_ms);
|
|
+
|
|
return stats;
|
|
}
|
|
|