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

Side by Side Diff: remoting/protocol/frame_stats.cc

Issue 2113523007: More cleanups in FrameStats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « remoting/protocol/frame_stats.h ('k') | remoting/protocol/performance_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « remoting/protocol/frame_stats.h ('k') | remoting/protocol/performance_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698