Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Unified Diff: webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h

Issue 2997803002: Reduce locking when collecting receive statistics. (Closed)
Patch Set: Remove callback helpers. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h
diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h
index 1256562d7d12c4d8148881afa28220104486bf69..d567869357c8e6589a3c47c695b31c82e85508a3 100644
--- a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h
+++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h
@@ -25,7 +25,8 @@ namespace webrtc {
class StreamStatisticianImpl : public StreamStatistician {
public:
- StreamStatisticianImpl(Clock* clock,
+ StreamStatisticianImpl(uint32_t ssrc,
+ Clock* clock,
RtcpStatisticsCallback* rtcp_callback,
StreamDataCountersCallback* rtp_callback);
virtual ~StreamStatisticianImpl() {}
@@ -49,18 +50,17 @@ class StreamStatisticianImpl : public StreamStatistician {
private:
bool InOrderPacketInternal(uint16_t sequence_number) const;
- RtcpStatistics CalculateRtcpStatistics();
+ RtcpStatistics CalculateRtcpStatistics()
+ EXCLUSIVE_LOCKS_REQUIRED(stream_lock_);
void UpdateJitter(const RTPHeader& header, NtpTime receive_time);
- void UpdateCounters(const RTPHeader& rtp_header,
- size_t packet_length,
- bool retransmitted);
- void NotifyRtpCallback() LOCKS_EXCLUDED(stream_lock_);
- void NotifyRtcpCallback() LOCKS_EXCLUDED(stream_lock_);
+ StreamDataCounters UpdateCounters(const RTPHeader& rtp_header,
+ size_t packet_length,
+ bool retransmitted);
+ const uint32_t ssrc_;
Clock* const clock_;
rtc::CriticalSection stream_lock_;
RateStatistics incoming_bitrate_;
- uint32_t ssrc_;
int max_reordering_threshold_; // In number of packets or sequence numbers.
// Stats on received RTP packets.
@@ -86,6 +86,7 @@ class StreamStatisticianImpl : public StreamStatistician {
uint16_t last_report_seq_max_;
RtcpStatistics last_reported_statistics_;
+ // stream_lock_ shouldn't be held when calling callbacks.
RtcpStatisticsCallback* const rtcp_callback_;
StreamDataCountersCallback* const rtp_callback_;
};
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698