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

Unified Diff: webrtc/api/video/video_timing.h

Issue 2946413002: Report timing frames info in GetStats. (Closed)
Patch Set: Created 3 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/api/video/video_timing.h
diff --git a/webrtc/api/video/video_timing.h b/webrtc/api/video/video_timing.h
index a44a8ef68d8d8fe6433fe80f7676cbb495e32471..f53c5bae788afa1f9663a8e4b68ceeebd98dbcc1 100644
--- a/webrtc/api/video/video_timing.h
+++ b/webrtc/api/video/video_timing.h
@@ -12,14 +12,16 @@
#define WEBRTC_API_VIDEO_VIDEO_TIMING_H_
#include <stdint.h>
-#include <limits>
+
+#include <string>
+
#include "webrtc/base/checks.h"
#include "webrtc/base/safe_conversions.h"
namespace webrtc {
// Video timing timstamps in ms counted from capture_time_ms of a frame.
-struct VideoTiming {
+struct VideoSendTiming {
static const uint8_t kEncodeStartDeltaIdx = 0;
static const uint8_t kEncodeFinishDeltaIdx = 1;
static const uint8_t kPacketizationFinishDeltaIdx = 2;
@@ -45,6 +47,35 @@ struct VideoTiming {
bool is_timing_frame;
};
+struct TimingFrameInfo {
Taylor Brandstetter 2017/06/25 20:48:03 Can you add a comment (here, or elsewhere in the a
ilnik 2017/06/26 08:46:38 Done.
+ TimingFrameInfo();
+
+ // Returns end-to-end delay of a frame, if sender and receiver timestamps are
+ // synchronized, -1 otherwise.
+ int64_t EndToEndDelay() const;
+
+ // Returns if current frame took longer to process than |other| frame.
Taylor Brandstetter 2017/06/25 20:48:03 nit: "Returns true if...", extra space between "pr
ilnik 2017/06/26 08:46:38 Done.
+ // If other frame's clocks are not synchronized, current frame is always
+ // preferred.
+ bool IsLongerThan(const TimingFrameInfo& other) const;
+
+ std::string ToString() const;
+
+ uint32_t rtp_timestamp;
+ int64_t capture_time_ms;
+ int64_t encode_start_ms;
+ int64_t encode_finish_ms;
+ int64_t packetization_finish_ms;
+ int64_t pacer_exit_ms;
+ int64_t network_timestamp_ms;
+ int64_t network2_timestamp_ms;
+ int64_t receive_start_ms;
+ int64_t receive_finish_ms;
Taylor Brandstetter 2017/06/25 20:48:03 Some of these (mostly the 4 preceding this comment
ilnik 2017/06/26 08:46:38 Done.
+ int64_t decode_start_ms;
+ int64_t decode_finish_ms;
+ int64_t render_time_ms;
+};
+
} // namespace webrtc
#endif // WEBRTC_API_VIDEO_VIDEO_TIMING_H_

Powered by Google App Engine
This is Rietveld 408576698