Index: webrtc/video/receive_statistics_proxy.h |
diff --git a/webrtc/video/receive_statistics_proxy.h b/webrtc/video/receive_statistics_proxy.h |
index e54f53aac1a372585419fbd3df7cfbc45f25657b..73a9b378a2611f95fa1d2718fcf955ba61f91982 100644 |
--- a/webrtc/video/receive_statistics_proxy.h |
+++ b/webrtc/video/receive_statistics_proxy.h |
@@ -37,7 +37,8 @@ struct CodecSpecificInfo; |
class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, |
public RtcpStatisticsCallback, |
public RtcpPacketTypeCounterObserver, |
- public StreamDataCountersCallback { |
+ public StreamDataCountersCallback, |
+ public CallStatsObserver { |
public: |
ReceiveStatisticsProxy(const VideoReceiveStream::Config* config, |
Clock* clock); |
@@ -51,14 +52,6 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, |
void OnIncomingPayloadType(int payload_type); |
void OnDecoderImplementationName(const char* implementation_name); |
void OnIncomingRate(unsigned int framerate, unsigned int bitrate_bps); |
- void OnDecoderTiming(int decode_ms, |
- int max_decode_ms, |
- int current_delay_ms, |
- int target_delay_ms, |
- int jitter_buffer_ms, |
- int min_playout_delay_ms, |
- int render_delay_ms, |
- int64_t rtt_ms); |
void OnPreDecode(const EncodedImage& encoded_image, |
const CodecSpecificInfo* codec_specific_info); |
@@ -67,6 +60,14 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, |
void OnReceiveRatesUpdated(uint32_t bitRate, uint32_t frameRate) override; |
void OnFrameCountsUpdated(const FrameCounts& frame_counts) override; |
void OnDiscardedPacketsUpdated(int discarded_packets) override; |
+ void OnCompleteFrame(bool is_keyframe, size_t size_bytes) override; |
+ void OnFrameBufferTimingsUpdated(int decode_ms, |
+ int max_decode_ms, |
+ int current_delay_ms, |
+ int target_delay_ms, |
+ int jitter_buffer_ms, |
+ int min_playout_delay_ms, |
+ int render_delay_ms) override; |
// Overrides RtcpStatisticsCallback. |
void StatisticsUpdated(const webrtc::RtcpStatistics& statistics, |
@@ -81,6 +82,9 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, |
void DataCountersUpdated(const webrtc::StreamDataCounters& counters, |
uint32_t ssrc) override; |
+ // Implements CallStatsObserver. |
+ void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; |
+ |
private: |
struct SampleCounter { |
SampleCounter() : sum(0), num_samples(0) {} |
@@ -100,6 +104,10 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, |
void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
+ // Removes info about old frames and then updates the framerate/bitrate. |
+ void UpdateFrameAndBitrate(int64_t now_ms) const |
+ EXCLUSIVE_LOCKS_REQUIRED(crit_); |
+ |
Clock* const clock_; |
// Ownership of this object lies with the owner of the ReceiveStatisticsProxy |
// instance. Lifetime is guaranteed to outlive |this|. |
@@ -119,7 +127,7 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, |
SampleCounter qp_sample_ GUARDED_BY(crit_); |
int num_bad_states_ GUARDED_BY(crit_); |
int num_certain_states_ GUARDED_BY(crit_); |
- VideoReceiveStream::Stats stats_ GUARDED_BY(crit_); |
+ mutable VideoReceiveStream::Stats stats_ GUARDED_BY(crit_); |
RateStatistics decode_fps_estimator_ GUARDED_BY(crit_); |
RateStatistics renders_fps_estimator_ GUARDED_BY(crit_); |
rtc::RateTracker render_fps_tracker_ GUARDED_BY(crit_); |
@@ -138,6 +146,9 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, |
ReportBlockStats report_block_stats_ GUARDED_BY(crit_); |
QpCounters qp_counters_; // Only accessed on the decoding thread. |
std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_); |
+ int64_t avg_rtt_ms_ GUARDED_BY(crit_); |
+ mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_); |
+ mutable size_t frame_window_accumulated_bytes_ GUARDED_BY(&crit_); |
}; |
} // namespace webrtc |