diff --git a/webrtc/modules/rtp_rtcp/interface/receive_statistics.h b/webrtc/modules/rtp_rtcp/interface/receive_statistics.h index f7de91fc4b..6bd5cd846e 100644 --- a/webrtc/modules/rtp_rtcp/interface/receive_statistics.h +++ b/webrtc/modules/rtp_rtcp/interface/receive_statistics.h @@ -35,9 +35,6 @@ class StreamStatistician { virtual uint32_t BitrateReceived() const = 0; - // Resets all statistics. - virtual void ResetStatistics() = 0; - // Returns true if the packet with RTP header |header| is likely to be a // retransmitted packet, false otherwise. virtual bool IsRetransmitOfOldPacket(const RTPHeader& header, diff --git a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h index 4fe10c8a30..98f7c26b55 100644 --- a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h +++ b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h @@ -414,13 +414,6 @@ class RtpRtcp : public Module { */ virtual int32_t SendRTCPSliceLossIndication(uint8_t pictureID) = 0; - /* - * Reset RTP data counters for the sending side - * - * return -1 on failure else 0 - */ - virtual int32_t ResetSendDataCountersRTP() = 0; - /* * Statistics of the amount of data sent * diff --git a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h index 1587762763..ed7dfe06a0 100644 --- a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h +++ b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h @@ -252,8 +252,6 @@ public: virtual void OnIncomingCSRCChanged( const int32_t id, const uint32_t CSRC, const bool added) = 0; - - virtual void ResetStatistics(uint32_t ssrc) = 0; }; class RtpAudioFeedback { @@ -323,8 +321,6 @@ class NullRtpFeedback : public RtpFeedback { void OnIncomingCSRCChanged(const int32_t id, const uint32_t CSRC, const bool added) override {} - - void ResetStatistics(uint32_t ssrc) override {} }; // Null object version of RtpData. diff --git a/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h b/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h index fce5f1be50..99e5b1c15a 100644 --- a/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h +++ b/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h @@ -161,8 +161,6 @@ class MockRtpRtcp : public RtpRtcp { int32_t(const uint64_t pictureID)); MOCK_METHOD1(SendRTCPSliceLossIndication, int32_t(const uint8_t pictureID)); - MOCK_METHOD0(ResetSendDataCountersRTP, - int32_t()); MOCK_CONST_METHOD2(DataCountersRTP, int32_t(size_t *bytesSent, uint32_t *packetsSent)); MOCK_CONST_METHOD2(GetSendStreamDataCounters, diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc index 3846558975..01116d6e60 100644 --- a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc +++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc @@ -51,22 +51,6 @@ StreamStatisticianImpl::StreamStatisticianImpl( rtcp_callback_(rtcp_callback), rtp_callback_(rtp_callback) {} -void StreamStatisticianImpl::ResetStatistics() { - CriticalSectionScoped cs(stream_lock_.get()); - last_report_inorder_packets_ = 0; - last_report_old_packets_ = 0; - last_report_seq_max_ = 0; - last_reported_statistics_ = RtcpStatistics(); - jitter_q4_ = 0; - cumulative_loss_ = 0; - jitter_q4_transmission_time_offset_ = 0; - received_seq_wraps_ = 0; - received_seq_max_ = 0; - received_seq_first_ = 0; - stored_sum_receive_counters_.Add(receive_counters_); - receive_counters_ = StreamDataCounters(); -} - void StreamStatisticianImpl::IncomingPacket(const RTPHeader& header, size_t packet_length, bool retransmitted) { @@ -320,7 +304,6 @@ void StreamStatisticianImpl::GetReceiveStreamDataCounters( StreamDataCounters* data_counters) const { CriticalSectionScoped cs(stream_lock_.get()); *data_counters = receive_counters_; - data_counters->Add(stored_sum_receive_counters_); } uint32_t StreamStatisticianImpl::BitrateReceived() const { diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h index cd41744d8d..e9492298b9 100644 --- a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h +++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h @@ -36,7 +36,6 @@ class StreamStatisticianImpl : public StreamStatistician { void GetReceiveStreamDataCounters( StreamDataCounters* data_counters) const override; uint32_t BitrateReceived() const override; - void ResetStatistics() override; bool IsRetransmitOfOldPacket(const RTPHeader& header, int64_t min_rtt) const override; bool IsPacketInOrder(uint16_t sequence_number) const override; @@ -85,9 +84,6 @@ class StreamStatisticianImpl : public StreamStatistician { size_t received_packet_overhead_; StreamDataCounters receive_counters_; - // Stored counter values. Includes sum of reset counter values for the stream. - StreamDataCounters stored_sum_receive_counters_; - // Counter values when we sent the last report. uint32_t last_report_inorder_packets_; uint32_t last_report_old_packets_; diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_unittest.cc b/webrtc/modules/rtp_rtcp/source/receive_statistics_unittest.cc index 8b25bcf615..fe9f71444e 100644 --- a/webrtc/modules/rtp_rtcp/source/receive_statistics_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_unittest.cc @@ -143,12 +143,6 @@ TEST_F(ReceiveStatisticsTest, GetReceiveStreamDataCounters) { EXPECT_GT(counters.first_packet_time_ms, -1); EXPECT_EQ(1u, counters.transmitted.packets); - statistician->ResetStatistics(); - // GetReceiveStreamDataCounters includes reset counter values. - statistician->GetReceiveStreamDataCounters(&counters); - EXPECT_GT(counters.first_packet_time_ms, -1); - EXPECT_EQ(1u, counters.transmitted.packets); - receive_statistics_->IncomingPacket(header1_, kPacketSize1, false); statistician->GetReceiveStreamDataCounters(&counters); EXPECT_GT(counters.first_packet_time_ms, -1); diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc b/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc index e19378aa2e..c9a1adf196 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.cc @@ -228,10 +228,8 @@ RTPAliveType RTPReceiverAudio::ProcessDeadOrAlive( void RTPReceiverAudio::CheckPayloadChanged(int8_t payload_type, PayloadUnion* specific_payload, - bool* should_reset_statistics, bool* should_discard_changes) { *should_discard_changes = false; - *should_reset_statistics = false; if (TelephoneEventPayloadType(payload_type)) { // Don't do callbacks for DTMF packets. @@ -244,8 +242,6 @@ void RTPReceiverAudio::CheckPayloadChanged(int8_t payload_type, &specific_payload->Audio.frequency, &cng_payload_type_has_changed); - *should_reset_statistics = cng_payload_type_has_changed; - if (is_cng_payload_type) { // Don't do callbacks for DTMF packets. *should_discard_changes = true; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h b/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h index cd146b9332..a7efcbba34 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h @@ -93,7 +93,6 @@ class RTPReceiverAudio : public RTPReceiverStrategy, // statistics. In addition we sometimes need to tweak the frequency. void CheckPayloadChanged(int8_t payload_type, PayloadUnion* specific_payload, - bool* should_reset_statistics, bool* should_discard_changes) override; int Energy(uint8_t array_of_energy[kRtpCsrcSize]) const override; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc index 3640933324..6be0c5a827 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc @@ -171,13 +171,9 @@ bool RtpReceiverImpl::IncomingRtpPacket( int8_t first_payload_byte = payload_length > 0 ? payload[0] : 0; bool is_red = false; - bool should_reset_statistics = false; - if (CheckPayloadChanged(rtp_header, - first_payload_byte, - is_red, - &payload_specific, - &should_reset_statistics) == -1) { + if (CheckPayloadChanged(rtp_header, first_payload_byte, is_red, + &payload_specific) == -1) { if (payload_length == 0) { // OK, keep-alive packet. return true; @@ -186,10 +182,6 @@ bool RtpReceiverImpl::IncomingRtpPacket( return false; } - if (should_reset_statistics) { - cb_rtp_feedback_->ResetStatistics(ssrc_); - } - WebRtcRTPHeader webrtc_rtp_header; memset(&webrtc_rtp_header, 0, sizeof(webrtc_rtp_header)); webrtc_rtp_header.header = rtp_header; @@ -276,8 +268,6 @@ void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) { // We need the payload_type_ to make the call if the remote SSRC is 0. new_ssrc = true; - cb_rtp_feedback_->ResetStatistics(ssrc_); - last_received_timestamp_ = 0; last_received_sequence_number_ = 0; last_received_frame_time_ms_ = -1; @@ -330,12 +320,10 @@ void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) { // this code path moves we can get rid of some of the rtp_receiver -> // media_specific interface (such as CheckPayloadChange, possibly get/set // last known payload). -int32_t RtpReceiverImpl::CheckPayloadChanged( - const RTPHeader& rtp_header, - const int8_t first_payload_byte, - bool& is_red, - PayloadUnion* specific_payload, - bool* should_reset_statistics) { +int32_t RtpReceiverImpl::CheckPayloadChanged(const RTPHeader& rtp_header, + const int8_t first_payload_byte, + bool& is_red, + PayloadUnion* specific_payload) { bool re_initialize_decoder = false; char payload_name[RTP_PAYLOAD_NAME_SIZE]; @@ -367,11 +355,10 @@ int32_t RtpReceiverImpl::CheckPayloadChanged( return 0; } } - *should_reset_statistics = false; bool should_discard_changes = false; rtp_media_receiver_->CheckPayloadChanged( - payload_type, specific_payload, should_reset_statistics, + payload_type, specific_payload, &should_discard_changes); if (should_discard_changes) { @@ -403,9 +390,6 @@ int32_t RtpReceiverImpl::CheckPayloadChanged( re_initialize_decoder = false; } } - if (re_initialize_decoder) { - *should_reset_statistics = true; - } } else { rtp_media_receiver_->GetLastMediaSpecificPayload(specific_payload); is_red = false; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h index 539c22676d..c904e1fcac 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h @@ -73,8 +73,7 @@ class RtpReceiverImpl : public RtpReceiver { int32_t CheckPayloadChanged(const RTPHeader& rtp_header, const int8_t first_payload_byte, bool& is_red, - PayloadUnion* payload, - bool* should_reset_statistics); + PayloadUnion* payload); Clock* clock_; RTPPayloadRegistry* rtp_payload_registry_; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.cc b/webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.cc index 56dd081fc8..5fae3db028 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.cc @@ -36,11 +36,9 @@ void RTPReceiverStrategy::SetLastMediaSpecificPayload( void RTPReceiverStrategy::CheckPayloadChanged(int8_t payload_type, PayloadUnion* specific_payload, - bool* should_reset_statistics, bool* should_discard_changes) { - // Default: Keep changes and don't reset statistics. + // Default: Keep changes. *should_discard_changes = false; - *should_reset_statistics = false; } int RTPReceiverStrategy::Energy(uint8_t array_of_energy[kRtpCsrcSize]) const { diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h b/webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h index b34ad38cdb..9c09f8e43f 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h @@ -79,7 +79,6 @@ class RTPReceiverStrategy { // reset statistics and/or discard this packet. virtual void CheckPayloadChanged(int8_t payload_type, PayloadUnion* specific_payload, - bool* should_reset_statistics, bool* should_discard_changes); virtual int Energy(uint8_t array_of_energy[kRtpCsrcSize]) const; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc index 50382ea03c..d2e224dfa4 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc @@ -540,12 +540,6 @@ int32_t ModuleRtpRtcpImpl::RTT(const uint32_t remote_ssrc, return ret; } -// Reset RTP data counters for the sending side. -int32_t ModuleRtpRtcpImpl::ResetSendDataCountersRTP() { - rtp_sender_.ResetDataCounters(); - return 0; // TODO(pwestin): change to void. -} - // Force a send of an RTCP packet. // Normal SR and RR are triggered via the process function. int32_t ModuleRtpRtcpImpl::SendRTCP(RTCPPacketType packet_type) { diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h index 96eee96c0f..9cd7e70263 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h @@ -162,8 +162,6 @@ class ModuleRtpRtcpImpl : public RtpRtcp { int32_t SendCompoundRTCP( const std::set& rtcpPacketTypes) override; - int32_t ResetSendDataCountersRTP() override; - // Statistics of the amount of data sent and received. int32_t DataCountersRTP(size_t* bytes_sent, uint32_t* packets_sent) const override; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc index 29b2897b34..0456688a89 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc @@ -1101,26 +1101,6 @@ uint16_t RTPSender::AllocateSequenceNumber(uint16_t packets_to_send) { return first_allocated_sequence_number; } -void RTPSender::ResetDataCounters() { - uint32_t ssrc; - uint32_t ssrc_rtx; - bool report_rtx; - { - CriticalSectionScoped ssrc_lock(send_critsect_.get()); - ssrc = ssrc_; - ssrc_rtx = ssrc_rtx_; - report_rtx = rtx_ != kRtxOff; - } - CriticalSectionScoped lock(statistics_crit_.get()); - rtp_stats_ = StreamDataCounters(); - rtx_rtp_stats_ = StreamDataCounters(); - if (rtp_stats_callback_) { - rtp_stats_callback_->DataCountersUpdated(rtp_stats_, ssrc); - if (report_rtx) - rtp_stats_callback_->DataCountersUpdated(rtx_rtp_stats_, ssrc_rtx); - } -} - void RTPSender::GetDataCounters(StreamDataCounters* rtp_stats, StreamDataCounters* rtx_stats) const { CriticalSectionScoped lock(statistics_crit_.get()); diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.h b/webrtc/modules/rtp_rtcp/source/rtp_sender.h index 8a624c724b..61a1fb5ec7 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.h @@ -131,8 +131,6 @@ class RTPSender : public RTPSenderInterface { void GetDataCounters(StreamDataCounters* rtp_stats, StreamDataCounters* rtx_stats) const; - void ResetDataCounters(); - uint32_t StartTimestamp() const; void SetStartTimestamp(uint32_t timestamp, bool force); diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc index 10f5055246..83ce92b420 100644 --- a/webrtc/video/video_send_stream_tests.cc +++ b/webrtc/video/video_send_stream_tests.cc @@ -245,7 +245,6 @@ class FakeReceiveStatistics : public NullReceiveStatistics { void GetReceiveStreamDataCounters( StreamDataCounters* data_counters) const override {} uint32_t BitrateReceived() const override { return 0; } - void ResetStatistics() override {} bool IsRetransmitOfOldPacket(const RTPHeader& header, int64_t min_rtt) const override { return false; diff --git a/webrtc/video_engine/vie_channel.cc b/webrtc/video_engine/vie_channel.cc index 2eb7a5c6d0..f4d28eb645 100644 --- a/webrtc/video_engine/vie_channel.cc +++ b/webrtc/video_engine/vie_channel.cc @@ -229,20 +229,61 @@ void ViEChannel::UpdateHistograms() { int64_t elapsed_sec = rtcp_counter.TimeSinceFirstPacketInMs(now) / 1000; if (elapsed_sec > metrics::kMinRunTimeInSeconds) { RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.NackPacketsReceivedPerMinute", - rtcp_counter.nack_packets * 60 / elapsed_sec); + rtcp_counter.nack_packets * 60 / elapsed_sec); RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FirPacketsReceivedPerMinute", - rtcp_counter.fir_packets * 60 / elapsed_sec); + rtcp_counter.fir_packets * 60 / elapsed_sec); RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.PliPacketsReceivedPerMinute", - rtcp_counter.pli_packets * 60 / elapsed_sec); + rtcp_counter.pli_packets * 60 / elapsed_sec); if (rtcp_counter.nack_requests > 0) { RTC_HISTOGRAM_PERCENTAGE( "WebRTC.Video.UniqueNackRequestsReceivedInPercent", - rtcp_counter.UniqueNackRequestsInPercent()); + rtcp_counter.UniqueNackRequestsInPercent()); } int fraction_lost = report_block_stats_sender_->FractionLostInPercent(); if (fraction_lost != -1) { RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.SentPacketsLostInPercent", - fraction_lost); + fraction_lost); + } + } + + StreamDataCounters rtp; + StreamDataCounters rtx; + GetSendStreamDataCounters(&rtp, &rtx); + StreamDataCounters rtp_rtx = rtp; + rtp_rtx.Add(rtx); + elapsed_sec = rtp_rtx.TimeSinceFirstPacketInMs( + Clock::GetRealTimeClock()->TimeInMilliseconds()) / + 1000; + if (elapsed_sec > metrics::kMinRunTimeInSeconds) { + RTC_HISTOGRAM_COUNTS_100000( + "WebRTC.Video.BitrateSentInKbps", + static_cast(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec / + 1000)); + RTC_HISTOGRAM_COUNTS_10000( + "WebRTC.Video.MediaBitrateSentInKbps", + static_cast(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000)); + RTC_HISTOGRAM_COUNTS_10000( + "WebRTC.Video.PaddingBitrateSentInKbps", + static_cast(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec / + 1000)); + RTC_HISTOGRAM_COUNTS_10000( + "WebRTC.Video.RetransmittedBitrateSentInKbps", + static_cast(rtp_rtx.retransmitted.TotalBytes() * 8 / + elapsed_sec / 1000)); + if (rtp_rtcp_->RtxSendStatus() != kRtxOff) { + RTC_HISTOGRAM_COUNTS_10000( + "WebRTC.Video.RtxBitrateSentInKbps", + static_cast(rtx.transmitted.TotalBytes() * 8 / elapsed_sec / + 1000)); + } + bool fec_enabled = false; + uint8_t pltype_red; + uint8_t pltype_fec; + rtp_rtcp_->GenericFECStatus(fec_enabled, pltype_red, pltype_fec); + if (fec_enabled) { + RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FecBitrateSentInKbps", + static_cast(rtp_rtx.fec.TotalBytes() * + 8 / elapsed_sec / 1000)); } } } else if (vie_receiver_.GetRemoteSsrc() > 0) { @@ -302,49 +343,6 @@ void ViEChannel::UpdateHistograms() { } } -void ViEChannel::UpdateHistogramsAtStopSend() { - StreamDataCounters rtp; - StreamDataCounters rtx; - GetSendStreamDataCounters(&rtp, &rtx); - StreamDataCounters rtp_rtx = rtp; - rtp_rtx.Add(rtx); - - int64_t elapsed_sec = rtp_rtx.TimeSinceFirstPacketInMs( - Clock::GetRealTimeClock()->TimeInMilliseconds()) / 1000; - if (elapsed_sec < metrics::kMinRunTimeInSeconds) { - return; - } - RTC_HISTOGRAM_COUNTS_100000( - "WebRTC.Video.BitrateSentInKbps", - static_cast(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec / - 1000)); - RTC_HISTOGRAM_COUNTS_10000( - "WebRTC.Video.MediaBitrateSentInKbps", - static_cast(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000)); - RTC_HISTOGRAM_COUNTS_10000( - "WebRTC.Video.PaddingBitrateSentInKbps", - static_cast(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec / - 1000)); - RTC_HISTOGRAM_COUNTS_10000( - "WebRTC.Video.RetransmittedBitrateSentInKbps", - static_cast(rtp_rtx.retransmitted.TotalBytes() * 8 / elapsed_sec / - 1000)); - if (rtp_rtcp_->RtxSendStatus() != kRtxOff) { - RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtxBitrateSentInKbps", - static_cast(rtx.transmitted.TotalBytes() * - 8 / elapsed_sec / 1000)); - } - bool fec_enabled = false; - uint8_t pltype_red; - uint8_t pltype_fec; - rtp_rtcp_->GenericFECStatus(fec_enabled, pltype_red, pltype_fec); - if (fec_enabled) { - RTC_HISTOGRAM_COUNTS_10000( - "WebRTC.Video.FecBitrateSentInKbps", - static_cast(rtp_rtx.fec.TotalBytes() * 8 / elapsed_sec / 1000)); - } -} - int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec, bool new_stream) { DCHECK(sender_); @@ -1336,7 +1334,6 @@ int32_t ViEChannel::StartSend() { } int32_t ViEChannel::StopSend() { - UpdateHistogramsAtStopSend(); send_payload_router_->set_active(false); CriticalSectionScoped cs(rtp_rtcp_cs_.get()); rtp_rtcp_->SetSendingMediaStatus(false); @@ -1350,8 +1347,6 @@ int32_t ViEChannel::StopSend() { return -1; } - // Reset. - rtp_rtcp_->ResetSendDataCountersRTP(); if (rtp_rtcp_->SetSendingStatus(false) != 0) { return -1; } @@ -1359,7 +1354,6 @@ int32_t ViEChannel::StopSend() { it != simulcast_rtp_rtcp_.end(); it++) { RtpRtcp* rtp_rtcp = *it; - rtp_rtcp->ResetSendDataCountersRTP(); rtp_rtcp->SetSendingStatus(false); } return 0; @@ -1698,13 +1692,6 @@ void ViEChannel::OnIncomingCSRCChanged(const int32_t id, CriticalSectionScoped cs(callback_cs_.get()); } -void ViEChannel::ResetStatistics(uint32_t ssrc) { - StreamStatistician* statistician = - vie_receiver_.GetReceiveStatistics()->GetStatistician(ssrc); - if (statistician) - statistician->ResetStatistics(); -} - void ViEChannel::RegisterSendFrameCountObserver( FrameCountObserver* observer) { send_frame_count_observer_.Set(observer); diff --git a/webrtc/video_engine/vie_channel.h b/webrtc/video_engine/vie_channel.h index 12f23fb35e..426cc3a700 100644 --- a/webrtc/video_engine/vie_channel.h +++ b/webrtc/video_engine/vie_channel.h @@ -258,7 +258,6 @@ class ViEChannel : public VCMFrameTypeCallback, virtual void OnIncomingCSRCChanged(const int32_t id, const uint32_t CSRC, const bool added); - virtual void ResetStatistics(uint32_t); int32_t SetRemoteSSRCType(const StreamType usage, const uint32_t SSRC); @@ -375,7 +374,6 @@ class ViEChannel : public VCMFrameTypeCallback, void SetRtxSendStatus(bool enable); void UpdateHistograms(); - void UpdateHistogramsAtStopSend(); // ViEChannel exposes methods that allow to modify observers and callbacks // to be modified. Such an API-style is cumbersome to implement and maintain diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc index 6dd64c7634..8992425b53 100644 --- a/webrtc/voice_engine/channel.cc +++ b/webrtc/voice_engine/channel.cc @@ -74,11 +74,6 @@ class StatisticsProxy : public RtcpStatisticsCallback { void CNameChanged(const char* cname, uint32_t ssrc) override {} - void ResetStatistics() { - CriticalSectionScoped cs(stats_lock_.get()); - stats_ = ChannelStatistics(); - } - ChannelStatistics GetStats() { CriticalSectionScoped cs(stats_lock_.get()); return stats_; @@ -340,15 +335,6 @@ void Channel::OnIncomingCSRCChanged(int32_t id, id, CSRC, added); } -void Channel::ResetStatistics(uint32_t ssrc) { - StreamStatistician* statistician = - rtp_receive_statistics_->GetStatistician(ssrc); - if (statistician) { - statistician->ResetStatistics(); - } - statistics_proxy_->ResetStatistics(); -} - int32_t Channel::OnInitializeDecoder( int32_t id, @@ -1206,8 +1192,7 @@ Channel::StopSend() // Reset sending SSRC and sequence number and triggers direct transmission // of RTCP BYE - if (_rtpRtcpModule->SetSendingStatus(false) == -1 || - _rtpRtcpModule->ResetSendDataCountersRTP() == -1) + if (_rtpRtcpModule->SetSendingStatus(false) == -1) { _engineStatisticsPtr->SetLastError( VE_RTP_RTCP_MODULE_ERROR, kTraceWarning, diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h index bb9ded9f05..398087eefb 100644 --- a/webrtc/voice_engine/channel.h +++ b/webrtc/voice_engine/channel.h @@ -368,7 +368,6 @@ public: uint32_t rate) override; void OnIncomingSSRCChanged(int32_t id, uint32_t ssrc) override; void OnIncomingCSRCChanged(int32_t id, uint32_t CSRC, bool added) override; - void ResetStatistics(uint32_t ssrc) override; // From RtpAudioFeedback in the RTP/RTCP module void OnPlayTelephoneEvent(int32_t id,