Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  0032.patch   Sprache: unbekannt

 
From: Andreas Pehrson <apehrson@mozilla.com>
Date: Mon, 18 Jan 2021 11:04:00 +0100
Subject: Bug 1654112 - Include RtcpPacketTypeCounter in audio send stats, to
 not regress nackCount. r=ng

This is similar to how it's already included for video send.

Differential Revision: https://phabricator.services.mozilla.com/D102273
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d380a43d59f4f7cbc001f4eab9b63ee993b32cd8
---
 audio/audio_send_stream.cc |  1 +
 audio/channel_send.cc      | 31 +++++++++++++++++++++++++++++++
 audio/channel_send.h       |  1 +
 call/audio_send_stream.h   |  2 ++
 4 files changed, 35 insertions(+)

diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
index 6e5bd18fef..831e6c2815 100644
--- a/audio/audio_send_stream.cc
+++ b/audio/audio_send_stream.cc
@@ -413,6 +413,7 @@ webrtc::AudioSendStream::Stats AudioSendStream::GetStats(
   stats.target_bitrate_bps = channel_send_->GetTargetBitrate();
 
   webrtc::CallSendStatistics call_stats = channel_send_->GetRTCPStatistics();
+  stats.rtcp_packet_type_counts = call_stats.rtcp_packet_type_counts;
   stats.payload_bytes_sent = call_stats.payload_bytes_sent;
   stats.header_and_padding_bytes_sent =
       call_stats.header_and_padding_bytes_sent;
diff --git a/audio/channel_send.cc b/audio/channel_send.cc
index fa8a42146c..70d3eaabbd 100644
--- a/audio/channel_send.cc
+++ b/audio/channel_send.cc
@@ -57,6 +57,31 @@ constexpr int64_t kMinRetransmissionWindowMs = 30;
 class RtpPacketSenderProxy;
 class TransportSequenceNumberProxy;
 
+class RtcpCounterObserver : public RtcpPacketTypeCounterObserver {
+ public:
+  explicit RtcpCounterObserver(uint32_t ssrc) : ssrc_(ssrc) {}
+
+  void RtcpPacketTypesCounterUpdated(
+      uint32_t ssrc, const RtcpPacketTypeCounter& packet_counter) override {
+    if (ssrc_ != ssrc) {
+      return;
+    }
+
+    MutexLock lock(&mutex_);
+    packet_counter_ = packet_counter;
+  }
+
+  RtcpPacketTypeCounter GetCounts() {
+    MutexLock lock(&mutex_);
+    return packet_counter_;
+  }
+
+ private:
+  Mutex mutex_;
+  const uint32_t ssrc_;
+  RtcpPacketTypeCounter packet_counter_;
+};
+
 class AudioBitrateAccountant {
  public:
   void RegisterPacketOverhead(int packet_byte_overhead) {
@@ -261,6 +286,8 @@ class ChannelSend : public ChannelSendInterface,
   bool input_mute_ RTC_GUARDED_BY(volume_settings_mutex_) = false;
   bool previous_frame_muted_ RTC_GUARDED_BY(encoder_queue_checker_) = false;
 
+  const std::unique_ptr<RtcpCounterObserver> rtcp_counter_observer_;
+
   PacketRouter* packet_router_ RTC_GUARDED_BY(&worker_thread_checker_) =
       nullptr;
   const std::unique_ptr<RtpPacketSenderProxy> rtp_packet_pacer_proxy_;
@@ -472,6 +499,7 @@ ChannelSend::ChannelSend(
     RtpTransportControllerSendInterface* transport_controller)
     : env_(env),
       ssrc_(ssrc),
+      rtcp_counter_observer_(new RtcpCounterObserver(ssrc)),
       rtp_packet_pacer_proxy_(new RtpPacketSenderProxy()),
       retransmission_rate_limiter_(
           new RateLimiter(&env_.clock(), kMaxRetransmissionWindowMs)),
@@ -493,6 +521,8 @@ ChannelSend::ChannelSend(
 
   configuration.paced_sender = rtp_packet_pacer_proxy_.get();
   configuration.rtt_stats = rtcp_rtt_stats;
+  configuration.rtcp_packet_type_counter_observer =
+      rtcp_counter_observer_.get();
   if (env_.field_trials().IsDisabled("WebRTC-DisableRtxRateLimiter")) {
     configuration.retransmission_rate_limiter =
         retransmission_rate_limiter_.get();
@@ -760,6 +790,7 @@ CallSendStatistics ChannelSend::GetRTCPStatistics() const {
   RTC_DCHECK_RUN_ON(&worker_thread_checker_);
   CallSendStatistics stats = {0};
   stats.rttMs = GetRTT();
+  stats.rtcp_packet_type_counts = rtcp_counter_observer_->GetCounts();
 
   StreamDataCounters rtp_stats;
   StreamDataCounters rtx_stats;
diff --git a/audio/channel_send.h b/audio/channel_send.h
index 02215e49cb..a1b09feb5e 100644
--- a/audio/channel_send.h
+++ b/audio/channel_send.h
@@ -41,6 +41,7 @@ struct CallSendStatistics {
   TimeDelta total_packet_send_delay = TimeDelta::Zero();
   // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-retransmittedpacketssent
   uint64_t retransmitted_packets_sent;
+  RtcpPacketTypeCounter rtcp_packet_type_counts;
   // A snapshot of Report Blocks with additional data of interest to statistics.
   // Within this list, the sender-source SSRC pair is unique and per-pair the
   // ReportBlockData represents the latest Report Block that was received for
diff --git a/call/audio_send_stream.h b/call/audio_send_stream.h
index c60526771e..949bb32a88 100644
--- a/call/audio_send_stream.h
+++ b/call/audio_send_stream.h
@@ -32,6 +32,7 @@
 #include "api/units/time_delta.h"
 #include "call/audio_sender.h"
 #include "modules/rtp_rtcp/include/report_block_data.h"
+#include "modules/rtp_rtcp/include/rtcp_statistics.h"
 
 namespace webrtc {
 
@@ -66,6 +67,7 @@ class AudioSendStream : public AudioSender {
 
     ANAStats ana_statistics;
     AudioProcessingStats apm_statistics;
+    RtcpPacketTypeCounter rtcp_packet_type_counts;
 
     int64_t target_bitrate_bps = 0;
     // A snapshot of Report Blocks with additional data of interest to

[ Dauer der Verarbeitung: 0.29 Sekunden  (vorverarbeitet)  ]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge