tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

render_delay_controller_metrics.h (1568B)


      1 /*
      2 *  Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
      3 *
      4 *  Use of this source code is governed by a BSD-style license
      5 *  that can be found in the LICENSE file in the root of the source
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 
     11 #ifndef MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_CONTROLLER_METRICS_H_
     12 #define MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_CONTROLLER_METRICS_H_
     13 
     14 #include <stddef.h>
     15 
     16 #include <optional>
     17 
     18 #include "modules/audio_processing/aec3/clockdrift_detector.h"
     19 
     20 namespace webrtc {
     21 
     22 // Handles the reporting of metrics for the render delay controller.
     23 class RenderDelayControllerMetrics {
     24 public:
     25  RenderDelayControllerMetrics();
     26 
     27  RenderDelayControllerMetrics(const RenderDelayControllerMetrics&) = delete;
     28  RenderDelayControllerMetrics& operator=(const RenderDelayControllerMetrics&) =
     29      delete;
     30 
     31  // Updates the metric with new data.
     32  void Update(std::optional<size_t> delay_samples,
     33              std::optional<size_t> buffer_delay_blocks,
     34              ClockdriftDetector::Level clockdrift);
     35 
     36 private:
     37  // Resets the metrics.
     38  void ResetMetrics();
     39 
     40  size_t delay_blocks_ = 0;
     41  int reliable_delay_estimate_counter_ = 0;
     42  int delay_change_counter_ = 0;
     43  int call_counter_ = 0;
     44  int initial_call_counter_ = 0;
     45  bool initial_update = true;
     46 };
     47 
     48 }  // namespace webrtc
     49 
     50 #endif  // MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_CONTROLLER_METRICS_H_