#include "media/cast/sender/audio_sender.h"
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/trace_event/trace_event.h"
#include "media/cast/common/openscreen_conversion_helpers.h"
#include "media/cast/common/rtp_time.h"
#include "media/cast/common/sender_encoded_frame.h"
#include "media/cast/encoding/audio_encoder.h"
#include "media/cast/sender/frame_sender.h"
#include "third_party/openscreen/src/cast/streaming/sender.h"
namespace media::cast {
namespace {
constexpr char kHistogramDroppedFrames[] = …;
constexpr char kHistogramFrameDropped[] = …;
}
AudioSender::AudioSender(scoped_refptr<CastEnvironment> cast_environment,
const FrameSenderConfig& audio_config,
StatusChangeOnceCallback status_change_cb,
std::unique_ptr<openscreen::cast::Sender> sender)
: … { … }
AudioSender::~AudioSender() { … }
void AudioSender::InsertAudio(std::unique_ptr<AudioBus> audio_bus,
base::TimeTicks recorded_time) { … }
void AudioSender::SetTargetPlayoutDelay(
base::TimeDelta new_target_playout_delay) { … }
base::TimeDelta AudioSender::GetTargetPlayoutDelay() const { … }
int AudioSender::GetEncoderBitrate() const { … }
base::WeakPtr<AudioSender> AudioSender::AsWeakPtr() { … }
AudioSender::AudioSender() = default;
int AudioSender::GetNumberOfFramesInEncoder() const { … }
base::TimeDelta AudioSender::GetEncoderBacklogDuration() const { … }
void AudioSender::OnEncodedAudioFrame(
std::unique_ptr<SenderEncodedFrame> encoded_frame,
int samples_skipped) { … }
}