| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_FRAME_STATS_H_ | 5 #ifndef REMOTING_PROTOCOL_FRAME_STATS_H_ |
| 6 #define REMOTING_PROTOCOL_FRAME_STATS_H_ | 6 #define REMOTING_PROTOCOL_FRAME_STATS_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 | 9 |
| 10 namespace remoting { | 10 namespace remoting { |
| 11 | 11 |
| 12 class VideoPacket; | 12 class VideoPacket; |
| 13 class FrameStatsMessage; | 13 class FrameStatsMessage; |
| 14 | 14 |
| 15 namespace protocol { | 15 namespace protocol { |
| 16 | 16 |
| 17 struct HostFrameStats { | 17 struct HostFrameStats { |
| 18 HostFrameStats(); | 18 HostFrameStats(); |
| 19 HostFrameStats(const HostFrameStats&); | 19 HostFrameStats(const HostFrameStats&); |
| 20 ~HostFrameStats(); | 20 ~HostFrameStats(); |
| 21 | 21 |
| 22 // Extracts timing fields from the |packet|. | 22 // Extracts timing fields from the |packet|. |
| 23 static HostFrameStats GetForVideoPacket(const VideoPacket& packet); | 23 static HostFrameStats GetForVideoPacket(const VideoPacket& packet); |
| 24 | 24 |
| 25 // Converts FrameStatsMessage protobuf message to HostFrameStats. |
| 26 static HostFrameStats FromFrameStatsMessage(const FrameStatsMessage& message); |
| 27 void ToFrameStatsMessage(FrameStatsMessage* message_out) const; |
| 28 |
| 25 // Frame Size. | 29 // Frame Size. |
| 26 int frame_size {}; | 30 int frame_size {}; |
| 27 | 31 |
| 28 // Set to null for frames that were not sent after a fresh input event. | 32 // Set to null for frames that were not sent after a fresh input event. |
| 29 base::TimeTicks latest_event_timestamp; | 33 base::TimeTicks latest_event_timestamp; |
| 30 | 34 |
| 31 // Set to TimeDelta::Max() when unknown. | 35 // Set to TimeDelta::Max() when unknown. |
| 32 base::TimeDelta capture_delay = base::TimeDelta::Max(); | 36 base::TimeDelta capture_delay = base::TimeDelta::Max(); |
| 33 base::TimeDelta encode_delay = base::TimeDelta::Max(); | 37 base::TimeDelta encode_delay = base::TimeDelta::Max(); |
| 34 base::TimeDelta capture_pending_delay = base::TimeDelta::Max(); | 38 base::TimeDelta capture_pending_delay = base::TimeDelta::Max(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 61 public: | 65 public: |
| 62 virtual void OnVideoFrameStats(const FrameStats& stats) = 0; | 66 virtual void OnVideoFrameStats(const FrameStats& stats) = 0; |
| 63 protected: | 67 protected: |
| 64 virtual ~FrameStatsConsumer() {} | 68 virtual ~FrameStatsConsumer() {} |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // namespace protocol | 71 } // namespace protocol |
| 68 } // namespace remoting | 72 } // namespace remoting |
| 69 | 73 |
| 70 #endif // REMOTING_PROTOCOL_FRAME_STATS_H_ | 74 #endif // REMOTING_PROTOCOL_FRAME_STATS_H_ |
| OLD | NEW |