#include "third_party/blink/renderer/modules/mediastream/media_stream_audio_processor.h"
#include <memory>
#include <optional>
#include <string_view>
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "media/base/audio_parameters.h"
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
#include "third_party/blink/renderer/modules/webrtc/webrtc_audio_device_impl.h"
#include "third_party/blink/renderer/platform/mediastream/aec_dump_agent_impl.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
namespace {
void WebRtcLogStringPiece(std::string_view message) { … }
}
class MediaStreamAudioProcessor::PlayoutListener { … };
MediaStreamAudioProcessor::MediaStreamAudioProcessor(
DeliverProcessedAudioCallback deliver_processed_audio_callback,
const media::AudioProcessingSettings& settings,
const media::AudioParameters& capture_data_source_params,
scoped_refptr<WebRtcAudioDeviceImpl> playout_data_source)
: … { … }
MediaStreamAudioProcessor::~MediaStreamAudioProcessor() { … }
void MediaStreamAudioProcessor::ProcessCapturedAudio(
const media::AudioBus& audio_source,
base::TimeTicks audio_capture_time,
int num_preferred_channels,
double volume,
bool key_pressed) { … }
void MediaStreamAudioProcessor::Stop() { … }
const media::AudioParameters&
MediaStreamAudioProcessor::GetInputFormatForTesting() const { … }
void MediaStreamAudioProcessor::OnStartDump(base::File dump_file) { … }
void MediaStreamAudioProcessor::OnStopDump() { … }
bool MediaStreamAudioProcessor::WouldModifyAudio(
const AudioProcessingProperties& properties) { … }
void MediaStreamAudioProcessor::OnPlayoutData(media::AudioBus* audio_bus,
int sample_rate,
base::TimeDelta audio_delay) { … }
void MediaStreamAudioProcessor::OnPlayoutDataSourceChanged() { … }
void MediaStreamAudioProcessor::OnRenderThreadChanged() { … }
webrtc::AudioProcessorInterface::AudioProcessorStatistics
MediaStreamAudioProcessor::GetStats(bool has_remote_tracks) { … }
}