OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_ | 5 #ifndef MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_ |
6 #define MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_ | 6 #define MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 | 9 |
10 // This module provides a display of frame-level performance metrics, rendered | 10 // This module provides a display of frame-level performance metrics, rendered |
(...skipping 11 matching lines...) Expand all Loading... |
22 // | @@@@ @@@ @@@ | | 22 // | @@@@ @@@ @@@ | |
23 // | @@@@ @@ @@@ | | 23 // | @@@@ @@ @@@ | |
24 // | @@@@@ @@@ @@@ @@@ | | 24 // | @@@@@ @@@ @@@ @@@ | |
25 // | @@@@@ @@@@@ @@@@ @@@@ | | 25 // | @@@@@ @@@@@ @@@@ @@@@ | |
26 // | @@@@@ @@@@@@@@@@@@@ @@@@ | | 26 // | @@@@@ @@@@@@@@@@@@@ @@@@ | |
27 // | @@@@@@ @@@@ 1 45% 75% | | 27 // | @@@@@@ @@@@ 1 45% 75% | |
28 // | @@@@@@@@ @@@@@@ 22 400. 4000 | | 28 // | @@@@@@@@ @@@@@@ 22 400. 4000 | |
29 // | @@@@@@@@@@@@@@@@ 16.7 1280x720 0:15.12 | | 29 // | @@@@@@@@@@@@@@@@ 16.7 1280x720 0:15.12 | |
30 // +---------------------------------------------------------------------+ | 30 // +---------------------------------------------------------------------+ |
31 // | 31 // |
32 // Line 1: Reads as, "1 frame ago, the encoder deadline utilization for the | 32 // Line 1: Reads as, "1 frame ago, the encoder utilization for the frame was 45% |
33 // frame was 45% and the lossy utilization was 75%." Encoder deadline | 33 // and the lossy utilization was 75%." For CPU-bound encoders, encoder |
34 // utilization is in terms the amount of real-world time it took to encode the | 34 // utilization is usually measured as the amount of real-world time it took to |
35 // frame, divided by the maximum amount of time allowed. Lossy utilization is | 35 // encode the frame, divided by the maximum amount of time allowed. Lossy |
36 // the amount of "complexity" in the frame's content versus the target encoded | 36 // utilization is the amount of "complexity" in the frame's content versus the |
37 // byte size, where a value over 100% means the frame's content is too complex | 37 // target encoded byte size, where a value over 100% means the frame's content |
38 // to encode within the target number of bytes. | 38 // is too complex to encode within the target number of bytes. |
39 // | 39 // |
40 // Line 2: Reads as, "Capture of this frame took 22 ms. The current target | 40 // Line 2: Reads as, "Capture of this frame took 22 ms. The current target |
41 // playout delay is 400 ms and low-latency adjustment mode is not active. The | 41 // playout delay is 400 ms and low-latency adjustment mode is not active. The |
42 // target bitrate for this frame is 4000 kbps." If there were an exclamation | 42 // target bitrate for this frame is 4000 kbps." If there were an exclamation |
43 // mark (!) after the playout delay number instead of a period (.), it would | 43 // mark (!) after the playout delay number instead of a period (.), it would |
44 // indicate low-latency adjustment mode is active. See VideoSender for more | 44 // indicate low-latency adjustment mode is active. See VideoSender for more |
45 // details. | 45 // details. |
46 // | 46 // |
47 // Line 3: Contains the frame's duration (16.7 milliseconds), resolution, and | 47 // Line 3: Contains the frame's duration (16.7 milliseconds), resolution, and |
48 // media timestamp in minutes:seconds.hundredths format. | 48 // media timestamp in minutes:seconds.hundredths format. |
49 | 49 |
50 namespace media { | 50 namespace media { |
51 | 51 |
52 class VideoFrame; | 52 class VideoFrame; |
53 | 53 |
54 namespace cast { | 54 namespace cast { |
55 | 55 |
56 // Renders an overlay of frame-level performance metrics in the lower-right | 56 // Renders an overlay of frame-level performance metrics in the lower-right |
57 // corner of the |frame|, as described above. The verbose logging level for | 57 // corner of the |frame|, as described above. The verbose logging level for |
58 // video_frame_overlay.cc determines which lines, if any, are rendered: VLOG | 58 // video_frame_overlay.cc determines which lines, if any, are rendered: VLOG |
59 // level 1 renders the bottom line only, level 2 renders the bottom and middle | 59 // level 1 renders the bottom line only, level 2 renders the bottom and middle |
60 // lines, and level 3 renders all three lines. So, use the | 60 // lines, and level 3 renders all three lines. So, use the |
61 // --vmodule=performance_metrics_overlay=3 command line argument to turn on | 61 // --vmodule=performance_metrics_overlay=3 command line argument to turn on |
62 // rendering of the entire overlay. | 62 // rendering of the entire overlay. |
63 void MaybeRenderPerformanceMetricsOverlay(base::TimeDelta target_playout_delay, | 63 void MaybeRenderPerformanceMetricsOverlay(base::TimeDelta target_playout_delay, |
64 bool in_low_latency_mode, | 64 bool in_low_latency_mode, |
65 int target_bitrate, | 65 int target_bitrate, |
66 int frames_ago, | 66 int frames_ago, |
67 double deadline_utilization, | 67 double encoder_utilization, |
68 double lossy_utilization, | 68 double lossy_utilization, |
69 VideoFrame* frame); | 69 VideoFrame* frame); |
70 | 70 |
71 } // namespace cast | 71 } // namespace cast |
72 } // namespace media | 72 } // namespace media |
73 | 73 |
74 #endif // MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_ | 74 #endif // MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_ |
OLD | NEW |