Chromium Code Reviews| Index: webrtc/video/receive_statistics_proxy.h |
| diff --git a/webrtc/video/receive_statistics_proxy.h b/webrtc/video/receive_statistics_proxy.h |
| index 6b21a01510f053c857912f0140ef6312b0b6b772..ecd0818ee8760c4d77fe9f8720b0f6d05d0a9ce2 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 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) 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; |
|
philipel
2017/01/11 16:12:34
Since I don't use the VideoStreamDecoder to pass i
|
| + |
| 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|. |
| @@ -117,7 +125,7 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, |
| QualityThreshold qp_threshold_ GUARDED_BY(crit_); |
| QualityThreshold variance_threshold_ GUARDED_BY(crit_); |
| SampleCounter qp_sample_ GUARDED_BY(crit_); |
| - VideoReceiveStream::Stats stats_ GUARDED_BY(crit_); |
| + mutable VideoReceiveStream::Stats stats_ GUARDED_BY(crit_); |
|
philipel
2017/01/11 16:12:34
Since GetStats is marked as const and we want to u
|
| RateStatistics decode_fps_estimator_ GUARDED_BY(crit_); |
| RateStatistics renders_fps_estimator_ GUARDED_BY(crit_); |
| rtc::RateTracker render_fps_tracker_ GUARDED_BY(crit_); |
| @@ -136,6 +144,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 |