aboutsummaryrefslogtreecommitdiff
path: root/webrtc/video/receive_statistics_proxy.h
diff options
context:
space:
mode:
authorChih-hung Hsieh <chh@google.com>2015-12-01 17:07:48 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-12-01 17:07:48 +0000
commita4acd9d6bc9b3b033d7d274316e75ee067df8d20 (patch)
tree672a185b294789cf991f385c3e395dd63bea9063 /webrtc/video/receive_statistics_proxy.h
parent3681b90ba4fe7a27232dd3e27897d5d7ed9d651c (diff)
parentfe8b4a657979b49e1701bd92f6d5814a99e0b2be (diff)
downloadwebrtc-a4acd9d6bc9b3b033d7d274316e75ee067df8d20.tar.gz
Merge changes I7bbf776e,I1b827825
am: fe8b4a6579 * commit 'fe8b4a657979b49e1701bd92f6d5814a99e0b2be': (7237 commits) WIP: Changes after merge commit 'cb3f9bd' Make the nonlinear beamformer steerable Utilize bitrate above codec max to protect video. Enable VP9 internal resize by default. Filter overlapping RTP header extensions. Make VCMEncodedFrameCallback const. MediaCodecVideoEncoder: Add number of quality resolution downscales to Encoded callback. Remove redudant encoder rate calls. Create isolate files for nonparallel tests. Register header extensions in RtpRtcpObserver to avoid log spam. Make an enum class out of NetEqDecoder, and hide the neteq_decoders_ table ACM: Move NACK functionality inside NetEq Fix chromium-style warnings in webrtc/sound/. Create a 'webrtc_nonparallel_tests' target. Update scalability structure data according to updates in the RTP payload profile. audio_coding: rename interface -> include Rewrote perform_action_on_all_files to be parallell. Update reference indices according to updates in the RTP payload profile. Disable P2PTransport...TestFailoverControlledSide on Memcheck pass clangcl compile options to ignore warnings in gflags.cc ...
Diffstat (limited to 'webrtc/video/receive_statistics_proxy.h')
-rw-r--r--webrtc/video/receive_statistics_proxy.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/webrtc/video/receive_statistics_proxy.h b/webrtc/video/receive_statistics_proxy.h
new file mode 100644
index 0000000000..b6741f9cde
--- /dev/null
+++ b/webrtc/video/receive_statistics_proxy.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_
+#define WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_
+
+#include <string>
+
+#include "webrtc/base/criticalsection.h"
+#include "webrtc/base/ratetracker.h"
+#include "webrtc/base/thread_annotations.h"
+#include "webrtc/common_types.h"
+#include "webrtc/frame_callback.h"
+#include "webrtc/modules/remote_bitrate_estimator/rate_statistics.h"
+#include "webrtc/modules/video_coding/main/interface/video_coding_defines.h"
+#include "webrtc/video_engine/report_block_stats.h"
+#include "webrtc/video_engine/vie_channel.h"
+#include "webrtc/video_receive_stream.h"
+#include "webrtc/video_renderer.h"
+
+namespace webrtc {
+
+class Clock;
+class ViECodec;
+class ViEDecoderObserver;
+struct CodecSpecificInfo;
+
+class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
+ public RtcpStatisticsCallback,
+ public RtcpPacketTypeCounterObserver,
+ public StreamDataCountersCallback {
+ public:
+ ReceiveStatisticsProxy(uint32_t ssrc, Clock* clock);
+ virtual ~ReceiveStatisticsProxy();
+
+ VideoReceiveStream::Stats GetStats() const;
+
+ void OnDecodedFrame();
+ void OnRenderedFrame(int width, int height);
+ void OnIncomingPayloadType(int payload_type);
+ 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);
+
+ // Overrides VCMReceiveStatisticsCallback.
+ void OnReceiveRatesUpdated(uint32_t bitRate, uint32_t frameRate) override;
+ void OnFrameCountsUpdated(const FrameCounts& frame_counts) override;
+ void OnDiscardedPacketsUpdated(int discarded_packets) override;
+
+ // Overrides RtcpStatisticsCallback.
+ void StatisticsUpdated(const webrtc::RtcpStatistics& statistics,
+ uint32_t ssrc) override;
+ void CNameChanged(const char* cname, uint32_t ssrc) override;
+
+ // Overrides RtcpPacketTypeCounterObserver.
+ void RtcpPacketTypesCounterUpdated(
+ uint32_t ssrc,
+ const RtcpPacketTypeCounter& packet_counter) override;
+ // Overrides StreamDataCountersCallback.
+ void DataCountersUpdated(const webrtc::StreamDataCounters& counters,
+ uint32_t ssrc) override;
+
+ private:
+ struct SampleCounter {
+ SampleCounter() : sum(0), num_samples(0) {}
+ void Add(int sample);
+ int Avg(int min_required_samples) const;
+
+ private:
+ int sum;
+ int num_samples;
+ };
+ struct QpCounters {
+ SampleCounter vp8;
+ };
+
+ void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_);
+
+ Clock* const clock_;
+
+ mutable rtc::CriticalSection crit_;
+ 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_);
+ rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_);
+ SampleCounter render_width_counter_ GUARDED_BY(crit_);
+ SampleCounter render_height_counter_ GUARDED_BY(crit_);
+ SampleCounter decode_time_counter_ GUARDED_BY(crit_);
+ SampleCounter delay_counter_ GUARDED_BY(crit_);
+ ReportBlockStats report_block_stats_ GUARDED_BY(crit_);
+ QpCounters qp_counters_; // Only accessed on the decoding thread.
+};
+
+} // namespace webrtc
+#endif // WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_