#include "components/capture_mode/audio_capturer.h"
#include "base/functional/bind.h"
#include "base/sequence_checker.h"
#include "media/base/audio_bus.h"
#include "services/audio/public/cpp/device_factory.h"
namespace capture_mode {
namespace {
constexpr int kPreAllocatedBuses = …;
constexpr int kMaxBusCapacity = …;
}
AudioCapturer::AudioCapturer(
std::string_view device_id,
mojo::PendingRemote<media::mojom::AudioStreamFactory> audio_stream_factory,
const media::AudioParameters& audio_params,
OnAudioCapturedCallback callback)
: … { … }
AudioCapturer::~AudioCapturer() = default;
void AudioCapturer::Start() { … }
void AudioCapturer::Stop() { … }
void AudioCapturer::OnCaptureStarted() { … }
void AudioCapturer::Capture(const media::AudioBus* audio_source,
base::TimeTicks audio_capture_time,
const media::AudioGlitchInfo& glitch_info,
double volume,
bool key_pressed) { … }
void AudioCapturer::OnCaptureError(media::AudioCapturerSource::ErrorCode code,
const std::string& message) { … }
void AudioCapturer::OnCaptureMuted(bool is_muted) { … }
void AudioCapturer::OnAudioBusDone(
std::unique_ptr<media::AudioBus> backing_audio_bus) { … }
}