Pass Clock and RtcEventLog as Environment into AudioReceiveStream
To make Environment available for creating AudioDecoders to use propagated field trials Bug: webrtc:356878416 Change-Id: I5dc4a3514d1182db6a7a5aa770b87daba529a5c8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357442 Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42719}
This commit is contained in:
parent
943828b7ff
commit
3732b84c17
@ -194,7 +194,6 @@ if (rtc_include_tests) {
|
|||||||
"../call:rtp_receiver",
|
"../call:rtp_receiver",
|
||||||
"../call:rtp_sender",
|
"../call:rtp_sender",
|
||||||
"../common_audio",
|
"../common_audio",
|
||||||
"../logging:mocks",
|
|
||||||
"../modules/audio_coding:audio_coding_module_typedefs",
|
"../modules/audio_coding:audio_coding_module_typedefs",
|
||||||
"../modules/audio_device:audio_device_impl", # For TestAudioDeviceModule
|
"../modules/audio_device:audio_device_impl", # For TestAudioDeviceModule
|
||||||
"../modules/audio_device:mock_audio_device",
|
"../modules/audio_device:mock_audio_device",
|
||||||
@ -240,6 +239,7 @@ if (rtc_include_tests) {
|
|||||||
"../api/audio:audio_device",
|
"../api/audio:audio_device",
|
||||||
"../api/audio_codecs:builtin_audio_decoder_factory",
|
"../api/audio_codecs:builtin_audio_decoder_factory",
|
||||||
"../api/crypto:frame_decryptor_interface",
|
"../api/crypto:frame_decryptor_interface",
|
||||||
|
"../api/environment:environment_factory",
|
||||||
"../api/task_queue:default_task_queue_factory",
|
"../api/task_queue:default_task_queue_factory",
|
||||||
"../logging:mocks",
|
"../logging:mocks",
|
||||||
"../modules/audio_device:mock_audio_device",
|
"../modules/audio_device:mock_audio_device",
|
||||||
|
|||||||
@ -62,53 +62,47 @@ std::string AudioReceiveStreamInterface::Config::ToString() const {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
std::unique_ptr<voe::ChannelReceiveInterface> CreateChannelReceive(
|
std::unique_ptr<voe::ChannelReceiveInterface> CreateChannelReceive(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
webrtc::AudioState* audio_state,
|
webrtc::AudioState* audio_state,
|
||||||
NetEqFactory* neteq_factory,
|
NetEqFactory* neteq_factory,
|
||||||
const webrtc::AudioReceiveStreamInterface::Config& config,
|
const webrtc::AudioReceiveStreamInterface::Config& config) {
|
||||||
RtcEventLog* event_log) {
|
|
||||||
RTC_DCHECK(audio_state);
|
RTC_DCHECK(audio_state);
|
||||||
internal::AudioState* internal_audio_state =
|
internal::AudioState* internal_audio_state =
|
||||||
static_cast<internal::AudioState*>(audio_state);
|
static_cast<internal::AudioState*>(audio_state);
|
||||||
return voe::CreateChannelReceive(
|
return voe::CreateChannelReceive(
|
||||||
clock, neteq_factory, internal_audio_state->audio_device_module(),
|
env, neteq_factory, internal_audio_state->audio_device_module(),
|
||||||
config.rtcp_send_transport, event_log, config.rtp.local_ssrc,
|
config.rtcp_send_transport, config.rtp.local_ssrc, config.rtp.remote_ssrc,
|
||||||
config.rtp.remote_ssrc, config.jitter_buffer_max_packets,
|
config.jitter_buffer_max_packets, config.jitter_buffer_fast_accelerate,
|
||||||
config.jitter_buffer_fast_accelerate, config.jitter_buffer_min_delay_ms,
|
config.jitter_buffer_min_delay_ms, config.enable_non_sender_rtt,
|
||||||
config.enable_non_sender_rtt, config.decoder_factory,
|
config.decoder_factory, config.codec_pair_id,
|
||||||
config.codec_pair_id, std::move(config.frame_decryptor),
|
std::move(config.frame_decryptor), config.crypto_options,
|
||||||
config.crypto_options, std::move(config.frame_transformer));
|
std::move(config.frame_transformer));
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
AudioReceiveStreamImpl::AudioReceiveStreamImpl(
|
AudioReceiveStreamImpl::AudioReceiveStreamImpl(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
PacketRouter* packet_router,
|
PacketRouter* packet_router,
|
||||||
NetEqFactory* neteq_factory,
|
NetEqFactory* neteq_factory,
|
||||||
const webrtc::AudioReceiveStreamInterface::Config& config,
|
const webrtc::AudioReceiveStreamInterface::Config& config,
|
||||||
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
|
const rtc::scoped_refptr<webrtc::AudioState>& audio_state)
|
||||||
webrtc::RtcEventLog* event_log)
|
: AudioReceiveStreamImpl(
|
||||||
: AudioReceiveStreamImpl(clock,
|
env,
|
||||||
packet_router,
|
packet_router,
|
||||||
config,
|
config,
|
||||||
audio_state,
|
audio_state,
|
||||||
event_log,
|
CreateChannelReceive(env, audio_state.get(), neteq_factory, config)) {
|
||||||
CreateChannelReceive(clock,
|
}
|
||||||
audio_state.get(),
|
|
||||||
neteq_factory,
|
|
||||||
config,
|
|
||||||
event_log)) {}
|
|
||||||
|
|
||||||
AudioReceiveStreamImpl::AudioReceiveStreamImpl(
|
AudioReceiveStreamImpl::AudioReceiveStreamImpl(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
PacketRouter* packet_router,
|
PacketRouter* packet_router,
|
||||||
const webrtc::AudioReceiveStreamInterface::Config& config,
|
const webrtc::AudioReceiveStreamInterface::Config& config,
|
||||||
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
|
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
|
||||||
webrtc::RtcEventLog* event_log,
|
|
||||||
std::unique_ptr<voe::ChannelReceiveInterface> channel_receive)
|
std::unique_ptr<voe::ChannelReceiveInterface> channel_receive)
|
||||||
: config_(config),
|
: config_(config),
|
||||||
audio_state_(audio_state),
|
audio_state_(audio_state),
|
||||||
source_tracker_(clock),
|
source_tracker_(&env.clock()),
|
||||||
channel_receive_(std::move(channel_receive)) {
|
channel_receive_(std::move(channel_receive)) {
|
||||||
RTC_LOG(LS_INFO) << "AudioReceiveStreamImpl: " << config.rtp.remote_ssrc;
|
RTC_LOG(LS_INFO) << "AudioReceiveStreamImpl: " << config.rtp.remote_ssrc;
|
||||||
RTC_DCHECK(config.decoder_factory);
|
RTC_DCHECK(config.decoder_factory);
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "api/audio/audio_mixer.h"
|
#include "api/audio/audio_mixer.h"
|
||||||
|
#include "api/environment/environment.h"
|
||||||
#include "api/neteq/neteq_factory.h"
|
#include "api/neteq/neteq_factory.h"
|
||||||
#include "api/rtp_headers.h"
|
#include "api/rtp_headers.h"
|
||||||
#include "api/sequence_checker.h"
|
#include "api/sequence_checker.h"
|
||||||
@ -26,11 +27,9 @@
|
|||||||
#include "call/syncable.h"
|
#include "call/syncable.h"
|
||||||
#include "modules/rtp_rtcp/source/source_tracker.h"
|
#include "modules/rtp_rtcp/source/source_tracker.h"
|
||||||
#include "rtc_base/system/no_unique_address.h"
|
#include "rtc_base/system/no_unique_address.h"
|
||||||
#include "system_wrappers/include/clock.h"
|
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
class PacketRouter;
|
class PacketRouter;
|
||||||
class RtcEventLog;
|
|
||||||
class RtpStreamReceiverControllerInterface;
|
class RtpStreamReceiverControllerInterface;
|
||||||
class RtpStreamReceiverInterface;
|
class RtpStreamReceiverInterface;
|
||||||
|
|
||||||
@ -47,19 +46,17 @@ class AudioReceiveStreamImpl final : public webrtc::AudioReceiveStreamInterface,
|
|||||||
public Syncable {
|
public Syncable {
|
||||||
public:
|
public:
|
||||||
AudioReceiveStreamImpl(
|
AudioReceiveStreamImpl(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
PacketRouter* packet_router,
|
PacketRouter* packet_router,
|
||||||
NetEqFactory* neteq_factory,
|
NetEqFactory* neteq_factory,
|
||||||
const webrtc::AudioReceiveStreamInterface::Config& config,
|
const webrtc::AudioReceiveStreamInterface::Config& config,
|
||||||
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
|
const rtc::scoped_refptr<webrtc::AudioState>& audio_state);
|
||||||
webrtc::RtcEventLog* event_log);
|
|
||||||
// For unit tests, which need to supply a mock channel receive.
|
// For unit tests, which need to supply a mock channel receive.
|
||||||
AudioReceiveStreamImpl(
|
AudioReceiveStreamImpl(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
PacketRouter* packet_router,
|
PacketRouter* packet_router,
|
||||||
const webrtc::AudioReceiveStreamInterface::Config& config,
|
const webrtc::AudioReceiveStreamInterface::Config& config,
|
||||||
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
|
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
|
||||||
webrtc::RtcEventLog* event_log,
|
|
||||||
std::unique_ptr<voe::ChannelReceiveInterface> channel_receive);
|
std::unique_ptr<voe::ChannelReceiveInterface> channel_receive);
|
||||||
|
|
||||||
AudioReceiveStreamImpl() = delete;
|
AudioReceiveStreamImpl() = delete;
|
||||||
|
|||||||
@ -15,12 +15,12 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "api/environment/environment_factory.h"
|
||||||
#include "api/test/mock_audio_mixer.h"
|
#include "api/test/mock_audio_mixer.h"
|
||||||
#include "api/test/mock_frame_decryptor.h"
|
#include "api/test/mock_frame_decryptor.h"
|
||||||
#include "audio/conversion.h"
|
#include "audio/conversion.h"
|
||||||
#include "audio/mock_voe_channel_proxy.h"
|
#include "audio/mock_voe_channel_proxy.h"
|
||||||
#include "call/rtp_stream_receiver_controller.h"
|
#include "call/rtp_stream_receiver_controller.h"
|
||||||
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
|
|
||||||
#include "modules/audio_device/include/mock_audio_device.h"
|
#include "modules/audio_device/include/mock_audio_device.h"
|
||||||
#include "modules/audio_processing/include/mock_audio_processing.h"
|
#include "modules/audio_processing/include/mock_audio_processing.h"
|
||||||
#include "modules/pacing/packet_router.h"
|
#include "modules/pacing/packet_router.h"
|
||||||
@ -146,8 +146,7 @@ struct ConfigHelper {
|
|||||||
|
|
||||||
std::unique_ptr<AudioReceiveStreamImpl> CreateAudioReceiveStream() {
|
std::unique_ptr<AudioReceiveStreamImpl> CreateAudioReceiveStream() {
|
||||||
auto ret = std::make_unique<AudioReceiveStreamImpl>(
|
auto ret = std::make_unique<AudioReceiveStreamImpl>(
|
||||||
Clock::GetRealTimeClock(), &packet_router_, stream_config_,
|
CreateEnvironment(), &packet_router_, stream_config_, audio_state_,
|
||||||
audio_state_, &event_log_,
|
|
||||||
std::unique_ptr<voe::ChannelReceiveInterface>(channel_receive_));
|
std::unique_ptr<voe::ChannelReceiveInterface>(channel_receive_));
|
||||||
ret->RegisterWithTransport(&rtp_stream_receiver_controller_);
|
ret->RegisterWithTransport(&rtp_stream_receiver_controller_);
|
||||||
return ret;
|
return ret;
|
||||||
@ -184,7 +183,6 @@ struct ConfigHelper {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
PacketRouter packet_router_;
|
PacketRouter packet_router_;
|
||||||
MockRtcEventLog event_log_;
|
|
||||||
rtc::scoped_refptr<AudioState> audio_state_;
|
rtc::scoped_refptr<AudioState> audio_state_;
|
||||||
rtc::scoped_refptr<MockAudioMixer> audio_mixer_;
|
rtc::scoped_refptr<MockAudioMixer> audio_mixer_;
|
||||||
AudioReceiveStreamInterface::Config stream_config_;
|
AudioReceiveStreamInterface::Config stream_config_;
|
||||||
|
|||||||
@ -91,11 +91,10 @@ class ChannelReceive : public ChannelReceiveInterface,
|
|||||||
public:
|
public:
|
||||||
// Used for receive streams.
|
// Used for receive streams.
|
||||||
ChannelReceive(
|
ChannelReceive(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
NetEqFactory* neteq_factory,
|
NetEqFactory* neteq_factory,
|
||||||
AudioDeviceModule* audio_device_module,
|
AudioDeviceModule* audio_device_module,
|
||||||
Transport* rtcp_send_transport,
|
Transport* rtcp_send_transport,
|
||||||
RtcEventLog* rtc_event_log,
|
|
||||||
uint32_t local_ssrc,
|
uint32_t local_ssrc,
|
||||||
uint32_t remote_ssrc,
|
uint32_t remote_ssrc,
|
||||||
size_t jitter_buffer_max_packets,
|
size_t jitter_buffer_max_packets,
|
||||||
@ -221,6 +220,7 @@ class ChannelReceive : public ChannelReceiveInterface,
|
|||||||
RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_thread_checker_;
|
RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_thread_checker_;
|
||||||
RTC_NO_UNIQUE_ADDRESS SequenceChecker network_thread_checker_;
|
RTC_NO_UNIQUE_ADDRESS SequenceChecker network_thread_checker_;
|
||||||
|
|
||||||
|
const Environment env_;
|
||||||
TaskQueueBase* const worker_thread_;
|
TaskQueueBase* const worker_thread_;
|
||||||
ScopedTaskSafety worker_safety_;
|
ScopedTaskSafety worker_safety_;
|
||||||
|
|
||||||
@ -234,8 +234,6 @@ class ChannelReceive : public ChannelReceiveInterface,
|
|||||||
|
|
||||||
bool playing_ RTC_GUARDED_BY(worker_thread_checker_) = false;
|
bool playing_ RTC_GUARDED_BY(worker_thread_checker_) = false;
|
||||||
|
|
||||||
RtcEventLog* const event_log_;
|
|
||||||
|
|
||||||
// Indexed by payload type.
|
// Indexed by payload type.
|
||||||
std::map<uint8_t, int> payload_type_frequencies_;
|
std::map<uint8_t, int> payload_type_frequencies_;
|
||||||
|
|
||||||
@ -392,7 +390,7 @@ AudioMixer::Source::AudioFrameInfo ChannelReceive::GetAudioFrameWithInfo(
|
|||||||
RTC_DCHECK_RUNS_SERIALIZED(&audio_thread_race_checker_);
|
RTC_DCHECK_RUNS_SERIALIZED(&audio_thread_race_checker_);
|
||||||
audio_frame->sample_rate_hz_ = sample_rate_hz;
|
audio_frame->sample_rate_hz_ = sample_rate_hz;
|
||||||
|
|
||||||
event_log_->Log(std::make_unique<RtcEventAudioPlayout>(remote_ssrc_));
|
env_.event_log().Log(std::make_unique<RtcEventAudioPlayout>(remote_ssrc_));
|
||||||
|
|
||||||
// Get 10ms raw PCM data from the ACM (mixer limits output frequency)
|
// Get 10ms raw PCM data from the ACM (mixer limits output frequency)
|
||||||
if (acm_receiver_.GetAudio(audio_frame->sample_rate_hz_, audio_frame) == -1) {
|
if (acm_receiver_.GetAudio(audio_frame->sample_rate_hz_, audio_frame) == -1) {
|
||||||
@ -521,11 +519,10 @@ void ChannelReceive::SetSourceTracker(SourceTracker* source_tracker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ChannelReceive::ChannelReceive(
|
ChannelReceive::ChannelReceive(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
NetEqFactory* neteq_factory,
|
NetEqFactory* neteq_factory,
|
||||||
AudioDeviceModule* audio_device_module,
|
AudioDeviceModule* audio_device_module,
|
||||||
Transport* rtcp_send_transport,
|
Transport* rtcp_send_transport,
|
||||||
RtcEventLog* rtc_event_log,
|
|
||||||
uint32_t local_ssrc,
|
uint32_t local_ssrc,
|
||||||
uint32_t remote_ssrc,
|
uint32_t remote_ssrc,
|
||||||
size_t jitter_buffer_max_packets,
|
size_t jitter_buffer_max_packets,
|
||||||
@ -537,9 +534,9 @@ ChannelReceive::ChannelReceive(
|
|||||||
rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor,
|
rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor,
|
||||||
const webrtc::CryptoOptions& crypto_options,
|
const webrtc::CryptoOptions& crypto_options,
|
||||||
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer)
|
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer)
|
||||||
: worker_thread_(TaskQueueBase::Current()),
|
: env_(env),
|
||||||
event_log_(rtc_event_log),
|
worker_thread_(TaskQueueBase::Current()),
|
||||||
rtp_receive_statistics_(ReceiveStatistics::Create(clock)),
|
rtp_receive_statistics_(ReceiveStatistics::Create(&env_.clock())),
|
||||||
remote_ssrc_(remote_ssrc),
|
remote_ssrc_(remote_ssrc),
|
||||||
acm_receiver_(AcmConfig(neteq_factory,
|
acm_receiver_(AcmConfig(neteq_factory,
|
||||||
decoder_factory,
|
decoder_factory,
|
||||||
@ -548,7 +545,7 @@ ChannelReceive::ChannelReceive(
|
|||||||
jitter_buffer_fast_playout,
|
jitter_buffer_fast_playout,
|
||||||
jitter_buffer_min_delay_ms)),
|
jitter_buffer_min_delay_ms)),
|
||||||
_outputAudioLevel(),
|
_outputAudioLevel(),
|
||||||
ntp_estimator_(clock),
|
ntp_estimator_(&env_.clock()),
|
||||||
playout_timestamp_rtp_(0),
|
playout_timestamp_rtp_(0),
|
||||||
playout_delay_ms_(0),
|
playout_delay_ms_(0),
|
||||||
capture_start_rtp_time_stamp_(-1),
|
capture_start_rtp_time_stamp_(-1),
|
||||||
@ -558,19 +555,19 @@ ChannelReceive::ChannelReceive(
|
|||||||
associated_send_channel_(nullptr),
|
associated_send_channel_(nullptr),
|
||||||
frame_decryptor_(frame_decryptor),
|
frame_decryptor_(frame_decryptor),
|
||||||
crypto_options_(crypto_options),
|
crypto_options_(crypto_options),
|
||||||
absolute_capture_time_interpolator_(clock) {
|
absolute_capture_time_interpolator_(&env_.clock()) {
|
||||||
RTC_DCHECK(audio_device_module);
|
RTC_DCHECK(audio_device_module);
|
||||||
|
|
||||||
network_thread_checker_.Detach();
|
network_thread_checker_.Detach();
|
||||||
|
|
||||||
rtp_receive_statistics_->EnableRetransmitDetection(remote_ssrc_, true);
|
rtp_receive_statistics_->EnableRetransmitDetection(remote_ssrc_, true);
|
||||||
RtpRtcpInterface::Configuration configuration;
|
RtpRtcpInterface::Configuration configuration;
|
||||||
configuration.clock = clock;
|
configuration.clock = &env_.clock();
|
||||||
configuration.audio = true;
|
configuration.audio = true;
|
||||||
configuration.receiver_only = true;
|
configuration.receiver_only = true;
|
||||||
configuration.outgoing_transport = rtcp_send_transport;
|
configuration.outgoing_transport = rtcp_send_transport;
|
||||||
configuration.receive_statistics = rtp_receive_statistics_.get();
|
configuration.receive_statistics = rtp_receive_statistics_.get();
|
||||||
configuration.event_log = event_log_;
|
configuration.event_log = &env_.event_log();
|
||||||
configuration.local_media_ssrc = local_ssrc;
|
configuration.local_media_ssrc = local_ssrc;
|
||||||
configuration.rtcp_packet_type_counter_observer = this;
|
configuration.rtcp_packet_type_counter_observer = this;
|
||||||
configuration.non_sender_rtt_measurement = enable_non_sender_rtt;
|
configuration.non_sender_rtt_measurement = enable_non_sender_rtt;
|
||||||
@ -1022,7 +1019,7 @@ ChannelReceive::GetCurrentEstimatedPlayoutNtpTimestampMs(int64_t now_ms) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ChannelReceive::SetBaseMinimumPlayoutDelayMs(int delay_ms) {
|
bool ChannelReceive::SetBaseMinimumPlayoutDelayMs(int delay_ms) {
|
||||||
event_log_->Log(
|
env_.event_log().Log(
|
||||||
std::make_unique<RtcEventNetEqSetMinimumDelay>(remote_ssrc_, delay_ms));
|
std::make_unique<RtcEventNetEqSetMinimumDelay>(remote_ssrc_, delay_ms));
|
||||||
return acm_receiver_.SetBaseMinimumDelayMs(delay_ms);
|
return acm_receiver_.SetBaseMinimumDelayMs(delay_ms);
|
||||||
}
|
}
|
||||||
@ -1109,11 +1106,10 @@ int ChannelReceive::GetRtpTimestampRateHz() const {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
std::unique_ptr<ChannelReceiveInterface> CreateChannelReceive(
|
std::unique_ptr<ChannelReceiveInterface> CreateChannelReceive(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
NetEqFactory* neteq_factory,
|
NetEqFactory* neteq_factory,
|
||||||
AudioDeviceModule* audio_device_module,
|
AudioDeviceModule* audio_device_module,
|
||||||
Transport* rtcp_send_transport,
|
Transport* rtcp_send_transport,
|
||||||
RtcEventLog* rtc_event_log,
|
|
||||||
uint32_t local_ssrc,
|
uint32_t local_ssrc,
|
||||||
uint32_t remote_ssrc,
|
uint32_t remote_ssrc,
|
||||||
size_t jitter_buffer_max_packets,
|
size_t jitter_buffer_max_packets,
|
||||||
@ -1126,11 +1122,11 @@ std::unique_ptr<ChannelReceiveInterface> CreateChannelReceive(
|
|||||||
const webrtc::CryptoOptions& crypto_options,
|
const webrtc::CryptoOptions& crypto_options,
|
||||||
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) {
|
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) {
|
||||||
return std::make_unique<ChannelReceive>(
|
return std::make_unique<ChannelReceive>(
|
||||||
clock, neteq_factory, audio_device_module, rtcp_send_transport,
|
env, neteq_factory, audio_device_module, rtcp_send_transport, local_ssrc,
|
||||||
rtc_event_log, local_ssrc, remote_ssrc, jitter_buffer_max_packets,
|
remote_ssrc, jitter_buffer_max_packets, jitter_buffer_fast_playout,
|
||||||
jitter_buffer_fast_playout, jitter_buffer_min_delay_ms,
|
jitter_buffer_min_delay_ms, enable_non_sender_rtt, decoder_factory,
|
||||||
enable_non_sender_rtt, decoder_factory, codec_pair_id,
|
codec_pair_id, std::move(frame_decryptor), crypto_options,
|
||||||
std::move(frame_decryptor), crypto_options, std::move(frame_transformer));
|
std::move(frame_transformer));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace voe
|
} // namespace voe
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
#include "api/call/audio_sink.h"
|
#include "api/call/audio_sink.h"
|
||||||
#include "api/call/transport.h"
|
#include "api/call/transport.h"
|
||||||
#include "api/crypto/crypto_options.h"
|
#include "api/crypto/crypto_options.h"
|
||||||
|
#include "api/environment/environment.h"
|
||||||
#include "api/frame_transformer_interface.h"
|
#include "api/frame_transformer_interface.h"
|
||||||
#include "api/neteq/neteq_factory.h"
|
#include "api/neteq/neteq_factory.h"
|
||||||
#include "api/transport/rtp/rtp_source.h"
|
#include "api/transport/rtp/rtp_source.h"
|
||||||
@ -29,7 +30,6 @@
|
|||||||
#include "call/syncable.h"
|
#include "call/syncable.h"
|
||||||
#include "modules/audio_coding/include/audio_coding_module_typedefs.h"
|
#include "modules/audio_coding/include/audio_coding_module_typedefs.h"
|
||||||
#include "modules/rtp_rtcp/source/source_tracker.h"
|
#include "modules/rtp_rtcp/source/source_tracker.h"
|
||||||
#include "system_wrappers/include/clock.h"
|
|
||||||
|
|
||||||
// TODO(solenberg, nisse): This file contains a few NOLINT marks, to silence
|
// TODO(solenberg, nisse): This file contains a few NOLINT marks, to silence
|
||||||
// warnings about use of unsigned short.
|
// warnings about use of unsigned short.
|
||||||
@ -46,7 +46,6 @@ class FrameDecryptorInterface;
|
|||||||
class PacketRouter;
|
class PacketRouter;
|
||||||
class RateLimiter;
|
class RateLimiter;
|
||||||
class ReceiveStatistics;
|
class ReceiveStatistics;
|
||||||
class RtcEventLog;
|
|
||||||
class RtpPacketReceived;
|
class RtpPacketReceived;
|
||||||
class RtpRtcp;
|
class RtpRtcp;
|
||||||
|
|
||||||
@ -172,11 +171,10 @@ class ChannelReceiveInterface : public RtpPacketSinkInterface {
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<ChannelReceiveInterface> CreateChannelReceive(
|
std::unique_ptr<ChannelReceiveInterface> CreateChannelReceive(
|
||||||
Clock* clock,
|
const Environment& env,
|
||||||
NetEqFactory* neteq_factory,
|
NetEqFactory* neteq_factory,
|
||||||
AudioDeviceModule* audio_device_module,
|
AudioDeviceModule* audio_device_module,
|
||||||
Transport* rtcp_send_transport,
|
Transport* rtcp_send_transport,
|
||||||
RtcEventLog* rtc_event_log,
|
|
||||||
uint32_t local_ssrc,
|
uint32_t local_ssrc,
|
||||||
uint32_t remote_ssrc,
|
uint32_t remote_ssrc,
|
||||||
size_t jitter_buffer_max_packets,
|
size_t jitter_buffer_max_packets,
|
||||||
|
|||||||
@ -14,9 +14,8 @@
|
|||||||
#include "api/audio/audio_device.h"
|
#include "api/audio/audio_device.h"
|
||||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||||
#include "api/crypto/frame_decryptor_interface.h"
|
#include "api/crypto/frame_decryptor_interface.h"
|
||||||
#include "api/task_queue/default_task_queue_factory.h"
|
#include "api/environment/environment_factory.h"
|
||||||
#include "api/test/mock_frame_transformer.h"
|
#include "api/test/mock_frame_transformer.h"
|
||||||
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
|
|
||||||
#include "modules/audio_device/include/mock_audio_device.h"
|
#include "modules/audio_device/include/mock_audio_device.h"
|
||||||
#include "modules/rtp_rtcp/source/byte_io.h"
|
#include "modules/rtp_rtcp/source/byte_io.h"
|
||||||
#include "modules/rtp_rtcp/source/ntp_time_util.h"
|
#include "modules/rtp_rtcp/source/ntp_time_util.h"
|
||||||
@ -61,9 +60,9 @@ class ChannelReceiveTest : public Test {
|
|||||||
std::unique_ptr<ChannelReceiveInterface> CreateTestChannelReceive() {
|
std::unique_ptr<ChannelReceiveInterface> CreateTestChannelReceive() {
|
||||||
CryptoOptions crypto_options;
|
CryptoOptions crypto_options;
|
||||||
auto channel = CreateChannelReceive(
|
auto channel = CreateChannelReceive(
|
||||||
time_controller_.GetClock(),
|
CreateEnvironment(time_controller_.GetClock()),
|
||||||
/* neteq_factory= */ nullptr, audio_device_module_.get(), &transport_,
|
/* neteq_factory= */ nullptr, audio_device_module_.get(), &transport_,
|
||||||
&event_log_, kLocalSsrc, kRemoteSsrc,
|
kLocalSsrc, kRemoteSsrc,
|
||||||
/* jitter_buffer_max_packets= */ 0,
|
/* jitter_buffer_max_packets= */ 0,
|
||||||
/* jitter_buffer_fast_playout= */ false,
|
/* jitter_buffer_fast_playout= */ false,
|
||||||
/* jitter_buffer_min_delay_ms= */ 0,
|
/* jitter_buffer_min_delay_ms= */ 0,
|
||||||
@ -160,7 +159,6 @@ class ChannelReceiveTest : public Test {
|
|||||||
rtc::scoped_refptr<test::MockAudioDeviceModule> audio_device_module_;
|
rtc::scoped_refptr<test::MockAudioDeviceModule> audio_device_module_;
|
||||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory_;
|
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory_;
|
||||||
MockTransport transport_;
|
MockTransport transport_;
|
||||||
NiceMock<MockRtcEventLog> event_log_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(ChannelReceiveTest, CreateAndDestroy) {
|
TEST_F(ChannelReceiveTest, CreateAndDestroy) {
|
||||||
|
|||||||
@ -816,8 +816,8 @@ webrtc::AudioReceiveStreamInterface* Call::CreateAudioReceiveStream(
|
|||||||
CreateRtcLogStreamConfig(config)));
|
CreateRtcLogStreamConfig(config)));
|
||||||
|
|
||||||
AudioReceiveStreamImpl* receive_stream = new AudioReceiveStreamImpl(
|
AudioReceiveStreamImpl* receive_stream = new AudioReceiveStreamImpl(
|
||||||
&env_.clock(), transport_send_->packet_router(), config_.neteq_factory,
|
env_, transport_send_->packet_router(), config_.neteq_factory, config,
|
||||||
config, config_.audio_state, &env_.event_log());
|
config_.audio_state);
|
||||||
audio_receive_streams_.insert(receive_stream);
|
audio_receive_streams_.insert(receive_stream);
|
||||||
|
|
||||||
// TODO(bugs.webrtc.org/11993): Make the registration on the network thread
|
// TODO(bugs.webrtc.org/11993): Make the registration on the network thread
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user