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

Side by Side Diff: media/cast/sender/performance_metrics_overlay.h

Issue 2775993002: Crash Fix (Cast Streaming): Render overlay on copy of source frame. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | media/cast/sender/performance_metrics_overlay.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 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 #include "media/base/video_frame.h"
9 10
10 // This module provides a display of frame-level performance metrics, rendered 11 // This module provides a display of frame-level performance metrics, rendered
11 // in the lower-right corner of a VideoFrame. It looks like this: 12 // in the lower-right corner of a VideoFrame. It looks like this:
12 // 13 //
13 // +---------------------------------------------------------------------+ 14 // +---------------------------------------------------------------------+
14 // | @@@@@@@@@@@@@@@@@@@@@@@ | 15 // | @@@@@@@@@@@@@@@@@@@@@@@ |
15 // | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | 16 // | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
16 // | @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@ | 17 // | @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@ |
17 // | @@@@@@@@@@@@@ @@@@ | 18 // | @@@@@@@@@@@@@ @@@@ |
18 // | @@@@@@@@@@ @@@@ | 19 // | @@@@@@@@@@ @@@@ |
(...skipping 22 matching lines...) Expand all
41 // playout delay is 400 ms and low-latency adjustment mode is not active. The 42 // 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 43 // 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 44 // mark (!) after the playout delay number instead of a period (.), it would
44 // indicate low-latency adjustment mode is active. See VideoSender for more 45 // indicate low-latency adjustment mode is active. See VideoSender for more
45 // details. 46 // details.
46 // 47 //
47 // Line 3: Contains the frame's duration (16.7 milliseconds), resolution, and 48 // Line 3: Contains the frame's duration (16.7 milliseconds), resolution, and
48 // media timestamp in minutes:seconds.hundredths format. 49 // media timestamp in minutes:seconds.hundredths format.
49 50
50 namespace media { 51 namespace media {
51
52 class VideoFrame;
53
54 namespace cast { 52 namespace cast {
55 53
56 // Renders an overlay of frame-level performance metrics in the lower-right 54 // If the user has requested VideoFrames have a performance metrics overlay
57 // corner of the |frame|, as described above. The verbose logging level for 55 // rendered on them, this function copies the |source| frame and then renders an
58 // video_frame_overlay.cc determines which lines, if any, are rendered: VLOG 56 // overlay on the copy. Frame-level performance metrics will be rendered in the
59 // level 1 renders the bottom line only, level 2 renders the bottom and middle 57 // lower-right corner of the frame, as described in the module-level comments
60 // lines, and level 3 renders all three lines. So, use the 58 // above.
61 // --vmodule=performance_metrics_overlay=3 command line argument to turn on 59 //
62 // rendering of the entire overlay. 60 // The verbose logging level for video_frame_overlay.cc determines which lines,
63 void MaybeRenderPerformanceMetricsOverlay(base::TimeDelta target_playout_delay, 61 // if any, are rendered: no VLOG level does nothing, level 1 renders the bottom
64 bool in_low_latency_mode, 62 // line only, level 2 renders the bottom and middle lines, and level 3 renders
65 int target_bitrate, 63 // all three lines. So, use the --vmodule=performance_metrics_overlay=3 command
66 int frames_ago, 64 // line argument to turn on rendering of the entire overlay.
67 double encoder_utilization, 65 //
68 double lossy_utilization, 66 // Note: If |source| is an unsupported format, or no pixels need to be modified,
69 VideoFrame* frame); 67 // this function will just return |source|.
68 scoped_refptr<VideoFrame> MaybeRenderPerformanceMetricsOverlay(
69 base::TimeDelta target_playout_delay,
70 bool in_low_latency_mode,
71 int target_bitrate,
72 int frames_ago,
73 double encoder_utilization,
74 double lossy_utilization,
75 scoped_refptr<VideoFrame> source);
70 76
71 } // namespace cast 77 } // namespace cast
72 } // namespace media 78 } // namespace media
73 79
74 #endif // MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_ 80 #endif // MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_
OLDNEW
« no previous file with comments | « no previous file | media/cast/sender/performance_metrics_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698