// Copyright 2015 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifdef UNSAFE_BUFFERS_BUILD // TODO(crbug.com/40285824): Remove this and convert code to safer constructs. #pragma allow_unsafe_buffers #endif #include "media/cast/sender/performance_metrics_overlay.h" #include <stddef.h> #include <stdint.h> #include <algorithm> #include <string> #include "base/functional/bind.h" #include "base/logging.h" #include "base/numerics/safe_conversions.h" #include "base/strings/stringprintf.h" #include "media/base/video_frame.h" namespace media { namespace cast { namespace { constexpr int kScale = …; // Physical pixels per one logical pixel. constexpr int kCharacterWidth = …; // Logical pixel width of one character. constexpr int kCharacterHeight = …; // Logical pixel height of one character. constexpr int kCharacterSpacing = …; // Logical pixels between each character. constexpr int kLineSpacing = …; // Logical pixels between each line of chars. constexpr int kPlane = …; // Y-plane in YUV formats. // For each pixel in the |rect| (logical coordinates), either decrease the // intensity or increase it so that the resulting pixel has a perceivably // different value than it did before. |p_ul| is a pointer to the pixel at // coordinate (0,0) in a single-channel 8bpp bitmap. |stride| is the number of // bytes per row in the output bitmap. void DivergePixels(const gfx::Rect& rect, uint8_t* p_ul, int stride) { … } // Render |line| into |frame| at physical pixel row |top| and aligned to the // right edge. Only number digits and a smattering of punctuation characters // will be rendered. void RenderLineOfText(const std::string& line, int top, VideoFrame* frame) { … } } // namespace scoped_refptr<VideoFrame> RenderPerformanceMetricsOverlay( base::TimeDelta target_playout_delay, bool in_low_latency_mode, int target_bitrate, int frames_ago, double encoder_utilization, double lossiness, scoped_refptr<VideoFrame> source) { … } } // namespace cast } // namespace media