#include "content/browser/renderer_host/media/audio_input_device_manager.h"
#include <memory>
#include <utility>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/metrics/histogram_macros.h"
#include "base/observer_list.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "media/audio/audio_input_ipc.h"
#include "media/audio/audio_system.h"
#include "media/base/audio_parameters.h"
#include "media/base/channel_layout.h"
#include "media/base/media_switches.h"
#include "third_party/blink/public/common/mediastream/media_stream_request.h"
#include "third_party/blink/public/mojom/mediastream/media_stream.mojom-shared.h"
namespace content {
namespace {
void SendAudioLogMessage(const std::string& message) { … }
const char* TypeToString(blink::mojom::MediaStreamType type) { … }
std::string GetOpenLogString(const base::UnguessableToken& session_id,
const blink::MediaStreamDevice& device) { … }
}
AudioInputDeviceManager::AudioInputDeviceManager(
media::AudioSystem* audio_system)
: … { … }
AudioInputDeviceManager::~AudioInputDeviceManager() { … }
const blink::MediaStreamDevice* AudioInputDeviceManager::GetOpenedDeviceById(
const base::UnguessableToken& session_id) { … }
void AudioInputDeviceManager::RegisterListener(
MediaStreamProviderListener* listener) { … }
void AudioInputDeviceManager::UnregisterListener(
MediaStreamProviderListener* listener) { … }
base::UnguessableToken AudioInputDeviceManager::Open(
const blink::MediaStreamDevice& device) { … }
void AudioInputDeviceManager::Close(const base::UnguessableToken& session_id) { … }
void AudioInputDeviceManager::OpenedOnIOThread(
const base::UnguessableToken& session_id,
const blink::MediaStreamDevice& device,
const std::optional<media::AudioParameters>& input_params,
const std::optional<std::string>& matched_output_device_id) { … }
void AudioInputDeviceManager::ClosedOnIOThread(
blink::mojom::MediaStreamType stream_type,
const base::UnguessableToken& session_id) { … }
blink::MediaStreamDevices::iterator AudioInputDeviceManager::GetDevice(
const base::UnguessableToken& session_id) { … }
}