#include "audio/audio_receive_stream.h"
#include <string>
#include <utility>
#include "absl/memory/memory.h"
#include "api/array_view.h"
#include "api/audio_codecs/audio_format.h"
#include "api/call/audio_sink.h"
#include "api/rtp_parameters.h"
#include "api/sequence_checker.h"
#include "audio/audio_send_stream.h"
#include "audio/audio_state.h"
#include "audio/channel_receive.h"
#include "audio/conversion.h"
#include "call/rtp_config.h"
#include "call/rtp_stream_receiver_controller_interface.h"
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/time_utils.h"
namespace webrtc {
std::string AudioReceiveStreamInterface::Config::Rtp::ToString() const { … }
std::string AudioReceiveStreamInterface::Config::ToString() const { … }
namespace {
std::unique_ptr<voe::ChannelReceiveInterface> CreateChannelReceive(
const Environment& env,
webrtc::AudioState* audio_state,
NetEqFactory* neteq_factory,
const webrtc::AudioReceiveStreamInterface::Config& config) { … }
}
AudioReceiveStreamImpl::AudioReceiveStreamImpl(
const Environment& env,
PacketRouter* packet_router,
NetEqFactory* neteq_factory,
const webrtc::AudioReceiveStreamInterface::Config& config,
const rtc::scoped_refptr<webrtc::AudioState>& audio_state)
: … { … }
AudioReceiveStreamImpl::AudioReceiveStreamImpl(
const Environment& env,
PacketRouter* packet_router,
const webrtc::AudioReceiveStreamInterface::Config& config,
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
std::unique_ptr<voe::ChannelReceiveInterface> channel_receive)
: … { … }
AudioReceiveStreamImpl::~AudioReceiveStreamImpl() { … }
void AudioReceiveStreamImpl::RegisterWithTransport(
RtpStreamReceiverControllerInterface* receiver_controller) { … }
void AudioReceiveStreamImpl::UnregisterFromTransport() { … }
void AudioReceiveStreamImpl::ReconfigureForTesting(
const webrtc::AudioReceiveStreamInterface::Config& config) { … }
void AudioReceiveStreamImpl::Start() { … }
void AudioReceiveStreamImpl::Stop() { … }
bool AudioReceiveStreamImpl::IsRunning() const { … }
void AudioReceiveStreamImpl::SetDepacketizerToDecoderFrameTransformer(
rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) { … }
void AudioReceiveStreamImpl::SetDecoderMap(
std::map<int, SdpAudioFormat> decoder_map) { … }
void AudioReceiveStreamImpl::SetNackHistory(int history_ms) { … }
void AudioReceiveStreamImpl::SetRtcpMode(webrtc::RtcpMode mode) { … }
void AudioReceiveStreamImpl::SetNonSenderRttMeasurement(bool enabled) { … }
void AudioReceiveStreamImpl::SetFrameDecryptor(
rtc::scoped_refptr<webrtc::FrameDecryptorInterface> frame_decryptor) { … }
webrtc::AudioReceiveStreamInterface::Stats AudioReceiveStreamImpl::GetStats(
bool get_and_clear_legacy_stats) const { … }
void AudioReceiveStreamImpl::SetSink(AudioSinkInterface* sink) { … }
void AudioReceiveStreamImpl::SetGain(float gain) { … }
bool AudioReceiveStreamImpl::SetBaseMinimumPlayoutDelayMs(int delay_ms) { … }
int AudioReceiveStreamImpl::GetBaseMinimumPlayoutDelayMs() const { … }
std::vector<RtpSource> AudioReceiveStreamImpl::GetSources() const { … }
AudioMixer::Source::AudioFrameInfo
AudioReceiveStreamImpl::GetAudioFrameWithInfo(int sample_rate_hz,
AudioFrame* audio_frame) { … }
int AudioReceiveStreamImpl::Ssrc() const { … }
int AudioReceiveStreamImpl::PreferredSampleRate() const { … }
uint32_t AudioReceiveStreamImpl::id() const { … }
absl::optional<Syncable::Info> AudioReceiveStreamImpl::GetInfo() const { … }
bool AudioReceiveStreamImpl::GetPlayoutRtpTimestamp(uint32_t* rtp_timestamp,
int64_t* time_ms) const { … }
void AudioReceiveStreamImpl::SetEstimatedPlayoutNtpTimestampMs(
int64_t ntp_timestamp_ms,
int64_t time_ms) { … }
bool AudioReceiveStreamImpl::SetMinimumPlayoutDelay(int delay_ms) { … }
void AudioReceiveStreamImpl::AssociateSendStream(
internal::AudioSendStream* send_stream) { … }
void AudioReceiveStreamImpl::DeliverRtcp(const uint8_t* packet, size_t length) { … }
void AudioReceiveStreamImpl::SetSyncGroup(absl::string_view sync_group) { … }
void AudioReceiveStreamImpl::SetLocalSsrc(uint32_t local_ssrc) { … }
uint32_t AudioReceiveStreamImpl::local_ssrc() const { … }
const std::string& AudioReceiveStreamImpl::sync_group() const { … }
const AudioSendStream*
AudioReceiveStreamImpl::GetAssociatedSendStreamForTesting() const { … }
internal::AudioState* AudioReceiveStreamImpl::audio_state() const { … }
}