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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/cast/sender/performance_metrics_overlay.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/performance_metrics_overlay.h
diff --git a/media/cast/sender/performance_metrics_overlay.h b/media/cast/sender/performance_metrics_overlay.h
index e9a66524b8bafc066e48b10fcf987feaec9ac7d4..774effe19da3606307bc94985d63f5655366646b 100644
--- a/media/cast/sender/performance_metrics_overlay.h
+++ b/media/cast/sender/performance_metrics_overlay.h
@@ -6,6 +6,7 @@
#define MEDIA_CAST_SENDER_PERFORMANCE_METRICS_OVERLAY_H_
#include "base/time/time.h"
+#include "media/base/video_frame.h"
// This module provides a display of frame-level performance metrics, rendered
// in the lower-right corner of a VideoFrame. It looks like this:
@@ -48,25 +49,30 @@
// media timestamp in minutes:seconds.hundredths format.
namespace media {
-
-class VideoFrame;
-
namespace cast {
-// Renders an overlay of frame-level performance metrics in the lower-right
-// corner of the |frame|, as described above. The verbose logging level for
-// video_frame_overlay.cc determines which lines, if any, are rendered: VLOG
-// level 1 renders the bottom line only, level 2 renders the bottom and middle
-// lines, and level 3 renders all three lines. So, use the
-// --vmodule=performance_metrics_overlay=3 command line argument to turn on
-// rendering of the entire overlay.
-void MaybeRenderPerformanceMetricsOverlay(base::TimeDelta target_playout_delay,
- bool in_low_latency_mode,
- int target_bitrate,
- int frames_ago,
- double encoder_utilization,
- double lossy_utilization,
- VideoFrame* frame);
+// If the user has requested VideoFrames have a performance metrics overlay
+// rendered on them, this function copies the |source| frame and then renders an
+// overlay on the copy. Frame-level performance metrics will be rendered in the
+// lower-right corner of the frame, as described in the module-level comments
+// above.
+//
+// The verbose logging level for video_frame_overlay.cc determines which lines,
+// if any, are rendered: no VLOG level does nothing, level 1 renders the bottom
+// line only, level 2 renders the bottom and middle lines, and level 3 renders
+// all three lines. So, use the --vmodule=performance_metrics_overlay=3 command
+// line argument to turn on rendering of the entire overlay.
+//
+// Note: If |source| is an unsupported format, or no pixels need to be modified,
+// this function will just return |source|.
+scoped_refptr<VideoFrame> MaybeRenderPerformanceMetricsOverlay(
+ base::TimeDelta target_playout_delay,
+ bool in_low_latency_mode,
+ int target_bitrate,
+ int frames_ago,
+ double encoder_utilization,
+ double lossy_utilization,
+ scoped_refptr<VideoFrame> source);
} // namespace cast
} // namespace media
« 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