tor-browser

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

render_delay_controller.h (1864B)


      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_H_
     12 #define MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_CONTROLLER_H_
     13 
     14 #include <cstddef>
     15 #include <optional>
     16 
     17 #include "api/audio/echo_canceller3_config.h"
     18 #include "modules/audio_processing/aec3/block.h"
     19 #include "modules/audio_processing/aec3/delay_estimate.h"
     20 #include "modules/audio_processing/aec3/downsampled_render_buffer.h"
     21 
     22 namespace webrtc {
     23 
     24 // Class for aligning the render and capture signal using a RenderDelayBuffer.
     25 class RenderDelayController {
     26 public:
     27  static RenderDelayController* Create(const EchoCanceller3Config& config,
     28                                       int sample_rate_hz,
     29                                       size_t num_capture_channels);
     30  virtual ~RenderDelayController() = default;
     31 
     32  // Resets the delay controller. If the delay confidence is reset, the reset
     33  // behavior is as if the call is restarted.
     34  virtual void Reset(bool reset_delay_confidence) = 0;
     35 
     36  // Logs a render call.
     37  virtual void LogRenderCall() = 0;
     38 
     39  // Aligns the render buffer content with the capture signal.
     40  virtual std::optional<DelayEstimate> GetDelay(
     41      const DownsampledRenderBuffer& render_buffer,
     42      size_t render_delay_buffer_delay,
     43      const Block& capture) = 0;
     44 
     45  // Returns true if clockdrift has been detected.
     46  virtual bool HasClockdrift() const = 0;
     47 };
     48 }  // namespace webrtc
     49 
     50 #endif  // MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_CONTROLLER_H_