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 #include "remoting/protocol/frame_stats.h" | 5 #include "remoting/protocol/frame_stats.h" |
6 | 6 |
7 #include "remoting/proto/video.pb.h" | 7 #include "remoting/proto/video.pb.h" |
8 | 8 |
9 namespace remoting { | 9 namespace remoting { |
10 namespace protocol { | 10 namespace protocol { |
11 | 11 |
12 FrameStats::FrameStats() = default; | 12 ClientFrameStats::ClientFrameStats() = default; |
13 FrameStats::FrameStats(const FrameStats&) = default; | 13 ClientFrameStats::ClientFrameStats(const ClientFrameStats&) = default; |
14 FrameStats::~FrameStats() = default; | 14 ClientFrameStats::~ClientFrameStats() = default; |
| 15 ClientFrameStats& ClientFrameStats::operator=(const ClientFrameStats&) = |
| 16 default; |
| 17 |
| 18 HostFrameStats::HostFrameStats() = default; |
| 19 HostFrameStats::HostFrameStats(const HostFrameStats&) = default; |
| 20 HostFrameStats::~HostFrameStats() = default; |
15 | 21 |
16 // static | 22 // static |
17 FrameStats FrameStats::GetForVideoPacket(const VideoPacket& packet) { | 23 HostFrameStats HostFrameStats::GetForVideoPacket(const VideoPacket& packet) { |
18 FrameStats result; | 24 HostFrameStats result; |
19 result.frame_size = packet.data().size(); | 25 result.frame_size = packet.data().size(); |
20 result.time_received = base::TimeTicks::Now(); | |
21 if (packet.has_latest_event_timestamp()) { | 26 if (packet.has_latest_event_timestamp()) { |
22 result.latest_event_timestamp = | 27 result.latest_event_timestamp = |
23 base::TimeTicks::FromInternalValue(packet.latest_event_timestamp()); | 28 base::TimeTicks::FromInternalValue(packet.latest_event_timestamp()); |
24 } | 29 } |
25 if (packet.has_capture_time_ms()) { | 30 if (packet.has_capture_time_ms()) { |
26 result.capture_delay = | 31 result.capture_delay = |
27 base::TimeDelta::FromMilliseconds(packet.capture_time_ms()); | 32 base::TimeDelta::FromMilliseconds(packet.capture_time_ms()); |
28 } | 33 } |
29 if (packet.has_encode_time_ms()) { | 34 if (packet.has_encode_time_ms()) { |
30 result.encode_delay = | 35 result.encode_delay = |
(...skipping 11 matching lines...) Expand all Loading... |
42 result.encode_pending_delay = | 47 result.encode_pending_delay = |
43 base::TimeDelta::FromMilliseconds(packet.encode_pending_time_ms()); | 48 base::TimeDelta::FromMilliseconds(packet.encode_pending_time_ms()); |
44 } | 49 } |
45 if (packet.has_send_pending_time_ms()) { | 50 if (packet.has_send_pending_time_ms()) { |
46 result.send_pending_delay = | 51 result.send_pending_delay = |
47 base::TimeDelta::FromMilliseconds(packet.send_pending_time_ms()); | 52 base::TimeDelta::FromMilliseconds(packet.send_pending_time_ms()); |
48 } | 53 } |
49 return result; | 54 return result; |
50 } | 55 } |
51 | 56 |
| 57 FrameStats::FrameStats() = default; |
| 58 FrameStats::FrameStats(const FrameStats&) = default; |
| 59 FrameStats::~FrameStats() = default; |
| 60 |
52 } // namespace protocol | 61 } // namespace protocol |
53 } // namespace remoting | 62 } // namespace remoting |
OLD | NEW |