#include "media/mojo/clients/mojo_audio_encoder.h"
#include "base/functional/bind.h"
#include "base/task/sequenced_task_runner.h"
#include "build/build_config.h"
#include "media/base/audio_buffer.h"
#include "media/base/media_switches.h"
#include "media/mojo/common/media_type_converters.h"
#if BUILDFLAG(IS_ANDROID)
#include "media/base/android/media_codec_util.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "base/win/windows_version.h"
#endif
namespace media {
bool MojoAudioEncoder::IsSupported(AudioCodec codec) { … }
MojoAudioEncoder::MojoAudioEncoder(
mojo::PendingRemote<mojom::AudioEncoder> remote_encoder)
: … { … }
MojoAudioEncoder::~MojoAudioEncoder() = default;
void MojoAudioEncoder::Initialize(const Options& options,
OutputCB output_cb,
EncoderStatusCB done_cb) { … }
void MojoAudioEncoder::Encode(std::unique_ptr<AudioBus> audio_bus,
base::TimeTicks capture_time,
EncoderStatusCB done_cb) { … }
void MojoAudioEncoder::Flush(EncoderStatusCB done_cb) { … }
void MojoAudioEncoder::OnEncodedBufferReady(media::EncodedAudioBuffer buffer,
const CodecDescription& desc) { … }
void MojoAudioEncoder::CallAndReleaseCallback(PendingCallbackHandle handle,
const EncoderStatus& status) { … }
MojoAudioEncoder::WrappedEncoderStatusCB
MojoAudioEncoder::WrapCallbackAsPending(EncoderStatusCB callback) { … }
void MojoAudioEncoder::CallAndReleaseAllPendingCallbacks(EncoderStatus status) { … }
void MojoAudioEncoder::BindRemote() { … }
void MojoAudioEncoder::OnConnectionError() { … }
void MojoAudioEncoder::PostStatusCallback(EncoderStatusCB callback,
EncoderStatus status) { … }
}