Chromium Code Reviews| Index: webrtc/api/video/video_timing.h |
| diff --git a/webrtc/api/video/video_timing.h b/webrtc/api/video/video_timing.h |
| index 44991dfbeb13ab9b9a4b05a85fc4be2a6c79c166..4feb46c4e5b4c57480727f65326c31edd0cf5930 100644 |
| --- a/webrtc/api/video/video_timing.h |
| +++ b/webrtc/api/video/video_timing.h |
| @@ -13,6 +13,7 @@ |
| #include <stdint.h> |
| +#include <limits> |
| #include <string> |
| #include "webrtc/rtc_base/checks.h" |
| @@ -20,15 +21,25 @@ |
| namespace webrtc { |
| +enum TimingFrameFlags : uint8_t { |
| + kDefault = 0, // No flags set (used by old protocol) |
| + kTriggeredByTimer = 1 << 0, // Frame marked for tracing by periodic timer. |
| + kTriggeredBySize = 1 << 1, // Frame marked for tracing due to size. |
| + kInvalid = std::numeric_limits<uint8_t>::max() // Invalid, ignore! |
| +}; |
| + |
| // Video timing timestamps in ms counted from capture_time_ms of a frame. |
| // This structure represents data sent in video-timing RTP header extension. |
| struct VideoSendTiming { |
| - static const uint8_t kEncodeStartDeltaIdx = 0; |
| - static const uint8_t kEncodeFinishDeltaIdx = 1; |
| - static const uint8_t kPacketizationFinishDeltaIdx = 2; |
| - static const uint8_t kPacerExitDeltaIdx = 3; |
| - static const uint8_t kNetworkTimestampDeltaIdx = 4; |
| - static const uint8_t kNetwork2TimestampDeltaIdx = 5; |
| + // Indices of the fields in the RTP header extension, counting from the first |
|
danilchap
2017/08/11 13:51:16
Offsets of the...
sprang_webrtc
2017/08/11 15:06:33
Done.
|
| + // byte after the one-byte header. |
| + static constexpr uint8_t kEncodeStartDeltaOffset = 0; |
| + static constexpr uint8_t kEncodeFinishDeltaOffset = 2; |
| + static constexpr uint8_t kPacketizationFinishDeltaOffset = 4; |
| + static constexpr uint8_t kPacerExitDeltaOffset = 6; |
| + static constexpr uint8_t kNetworkTimestampDeltaOffset = 8; |
| + static constexpr uint8_t kNetwork2TimestampDeltaOffset = 10; |
| + static constexpr uint8_t kFLagsOffset = 12; |
|
danilchap
2017/08/11 13:51:16
lowercase l
sprang_webrtc
2017/08/11 15:06:33
Done.
|
| // Returns |time_ms - base_ms| capped at max 16-bit value. |
| // Used to fill this data structure as per |
| @@ -45,7 +56,7 @@ struct VideoSendTiming { |
| uint16_t pacer_exit_delta_ms; |
| uint16_t network_timstamp_delta_ms; |
| uint16_t network2_timstamp_delta_ms; |
| - bool is_timing_frame; |
| + uint8_t flags; |
| }; |
| // Used to report precise timings of a 'timing frames'. Contains all important |
| @@ -64,6 +75,14 @@ struct TimingFrameInfo { |
| // preferred. |
| bool IsLongerThan(const TimingFrameInfo& other) const; |
| + // Returns true if flags are set to indicate this frame was marked for tracing |
| + // due to the size being outside some limit. |
| + bool IsOutlier() const; |
| + |
| + // Returns true if the timing data is marked as invalid, in which case it |
| + // should be ignored. |
| + bool IsInvalid() const; |
| + |
| std::string ToString() const; |
| uint32_t rtp_timestamp; // Identifier of a frame. |
| @@ -84,6 +103,8 @@ struct TimingFrameInfo { |
| int64_t decode_start_ms; // Decode start time. |
| int64_t decode_finish_ms; // Decode completion time. |
| int64_t render_time_ms; // Proposed render time to insure smooth playback. |
| + |
| + uint8_t flags; // Flags indicating validity and/or why tracing was triggered. |
| }; |
| } // namespace webrtc |