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

Unified Diff: webrtc/modules/video_coding/main/source/video_coding_impl.h

Issue 1169543005: Add sent framerates to histogram stats: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 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
Index: webrtc/modules/video_coding/main/source/video_coding_impl.h
diff --git a/webrtc/modules/video_coding/main/source/video_coding_impl.h b/webrtc/modules/video_coding/main/source/video_coding_impl.h
index c8f82215813fe408aaf4a1b209a3ef4006bbaaa8..bd079d271f4b0a740b60417bce0295461e9bea06 100644
--- a/webrtc/modules/video_coding/main/source/video_coding_impl.h
+++ b/webrtc/modules/video_coding/main/source/video_coding_impl.h
@@ -113,6 +113,28 @@ class VideoSender {
int32_t Process();
private:
+
+ struct EncodedFrameStats {
+ EncodedFrameStats()
+ : sum_encode_time_ms(0),
+ max_encode_time_ms(-1),
+ encoded_frames(0) {}
+
+ void Update(int64_t encode_time_ms);
+ int64_t AvgEncodeTimeMs() {
+ return (encoded_frames > 0) ? (sum_encode_time_ms / encoded_frames) : -1;
+ }
+ int64_t MaxEncodeTimeMs() {
+ return (encoded_frames > 0) ? max_encode_time_ms : -1;
+ }
+
+ private:
+ int64_t sum_encode_time_ms; // The total encode time of encoded frames.
+ int64_t max_encode_time_ms; // The maximum encode time of encoded frames.
+ size_t encoded_frames; // The number of encoded frames.
+ };
+
+ void UpdateHistograms();
Clock* clock_;
rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_;
@@ -132,6 +154,8 @@ class VideoSender {
VCMQMSettingsCallback* const qm_settings_callback_;
VCMProtectionCallback* protection_callback_;
+
+ EncodedFrameStats stats_;
};
class VideoReceiver {

Powered by Google App Engine
This is Rietveld 408576698