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

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

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/fake_video_renderer.cc ('k') | remoting/protocol/frame_stats.cc » ('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 #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 14
14 namespace protocol { 15 namespace protocol {
15 16
16 // Struct used to track timestamp for various events in the video pipeline for a 17 struct HostFrameStats {
17 // single video frame 18 HostFrameStats();
18 struct FrameStats { 19 HostFrameStats(const HostFrameStats&);
19 FrameStats(); 20 ~HostFrameStats();
20 FrameStats(const FrameStats&);
21 ~FrameStats();
22 21
23 // Copies timing fields from the |packet|. 22 // Extracts timing fields from the |packet|.
24 static FrameStats GetForVideoPacket(const VideoPacket& packet); 23 static HostFrameStats GetForVideoPacket(const VideoPacket& packet);
25 24
26 int frame_size = 0; 25 // Frame Size.
26 int frame_size {};
27 27
28 // Set to null for frames that were not sent after a fresh input event. 28 // Set to null for frames that were not sent after a fresh input event.
29 base::TimeTicks latest_event_timestamp; 29 base::TimeTicks latest_event_timestamp;
30 30
31 // Set to TimeDelta::Max() when unknown. 31 // Set to TimeDelta::Max() when unknown.
32 base::TimeDelta capture_delay = base::TimeDelta::Max(); 32 base::TimeDelta capture_delay = base::TimeDelta::Max();
33 base::TimeDelta encode_delay = base::TimeDelta::Max(); 33 base::TimeDelta encode_delay = base::TimeDelta::Max();
34 base::TimeDelta capture_pending_delay = base::TimeDelta::Max(); 34 base::TimeDelta capture_pending_delay = base::TimeDelta::Max();
35 base::TimeDelta capture_overhead_delay = base::TimeDelta::Max(); 35 base::TimeDelta capture_overhead_delay = base::TimeDelta::Max();
36 base::TimeDelta encode_pending_delay = base::TimeDelta::Max(); 36 base::TimeDelta encode_pending_delay = base::TimeDelta::Max();
37 base::TimeDelta send_pending_delay = base::TimeDelta::Max(); 37 base::TimeDelta send_pending_delay = base::TimeDelta::Max();
38 };
39
40 struct ClientFrameStats {
41 ClientFrameStats();
42 ClientFrameStats(const ClientFrameStats&);
43 ~ClientFrameStats();
44 ClientFrameStats& operator=(const ClientFrameStats&);
38 45
39 base::TimeTicks time_received; 46 base::TimeTicks time_received;
40 base::TimeTicks time_decoded; 47 base::TimeTicks time_decoded;
41 base::TimeTicks time_rendered; 48 base::TimeTicks time_rendered;
42 }; 49 };
43 50
51 struct FrameStats {
52 FrameStats();
53 FrameStats(const FrameStats&);
54 ~FrameStats();
55
56 HostFrameStats host_stats;
57 ClientFrameStats client_stats;
58 };
59
60 class FrameStatsConsumer {
61 public:
62 virtual void OnVideoFrameStats(const FrameStats& stats) = 0;
63 protected:
64 virtual ~FrameStatsConsumer() {}
65 };
66
44 } // namespace protocol 67 } // namespace protocol
45 } // namespace remoting 68 } // namespace remoting
46 69
47 #endif // REMOTING_PROTOCOL_FRAME_STATS_H_ 70 #endif // REMOTING_PROTOCOL_FRAME_STATS_H_
OLDNEW
« no previous file with comments | « remoting/protocol/fake_video_renderer.cc ('k') | remoting/protocol/frame_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698