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

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

Issue 2096643003: Rework PerformanceTracker to make it usable with WebRTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address feedback 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "remoting/protocol/frame_stats.h"
6
7 #include "remoting/proto/video.pb.h"
8
9 namespace remoting {
10 namespace protocol {
11
12 FrameStats::FrameStats() = default;
13 FrameStats::FrameStats(const FrameStats&) = default;
14 FrameStats::~FrameStats() = default;
15
16 // static
17 FrameStats FrameStats::GetForVideoPacket(const VideoPacket& packet) {
18 FrameStats result;
19 result.frame_size = packet.data().size();
20 result.time_received = base::TimeTicks::Now();
21 if (packet.has_latest_event_timestamp()) {
22 result.latest_event_timestamp =
23 base::TimeTicks::FromInternalValue(packet.latest_event_timestamp());
24 }
25 if (packet.has_capture_time_ms()) {
26 result.capture_delay =
27 base::TimeDelta::FromMilliseconds(packet.capture_time_ms());
28 }
29 if (packet.has_encode_time_ms()) {
30 result.encode_delay =
31 base::TimeDelta::FromMilliseconds(packet.encode_time_ms());
32 }
33 if (packet.has_capture_pending_time_ms()) {
34 result.capture_pending_delay =
35 base::TimeDelta::FromMilliseconds(packet.capture_pending_time_ms());
36 }
37 if (packet.has_capture_overhead_time_ms()) {
38 result.capture_overhead_delay =
39 base::TimeDelta::FromMilliseconds(packet.capture_overhead_time_ms());
40 }
41 if (packet.has_encode_pending_time_ms()) {
42 result.encode_pending_delay =
43 base::TimeDelta::FromMilliseconds(packet.encode_pending_time_ms());
44 }
45 if (packet.has_send_pending_time_ms()) {
46 result.send_pending_delay =
47 base::TimeDelta::FromMilliseconds(packet.send_pending_time_ms());
48 }
49 return result;
50 }
51
52 } // namespace protocol
53 } // 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