Remove unused AudioFrameProcessor* parameter from WebRtcVoiceEngine constructor
Bug: webrtc:15111 Change-Id: Ia55e55f98ffeceeb91fb9b4fc2323a4fd7bc1046 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326523 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Commit-Queue: Henrik Andreassson <henrika@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41118}
This commit is contained in:
parent
fa4d7c92b7
commit
e567d8a112
@ -54,8 +54,7 @@ class MediaFactoryImpl : public MediaFactory {
|
||||
deps.task_queue_factory.get(), deps.adm.get(),
|
||||
std::move(deps.audio_encoder_factory),
|
||||
std::move(deps.audio_decoder_factory), std::move(deps.audio_mixer),
|
||||
std::move(deps.audio_processing), /*audio_frame_processor=*/nullptr,
|
||||
/*owned_audio_frame_processor=*/std::move(deps.audio_frame_processor),
|
||||
std::move(deps.audio_processing), std::move(deps.audio_frame_processor),
|
||||
*trials);
|
||||
auto video_engine = std::make_unique<WebRtcVideoEngine>(
|
||||
std::move(deps.video_encoder_factory),
|
||||
|
||||
@ -37,7 +37,7 @@ TEST(NullWebRtcVideoEngineTest, CheckInterface) {
|
||||
task_queue_factory.get(), adm.get(),
|
||||
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
||||
webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr,
|
||||
webrtc::AudioProcessingBuilder().Create(), nullptr, nullptr, trials);
|
||||
webrtc::AudioProcessingBuilder().Create(), nullptr, trials);
|
||||
|
||||
CompositeMediaEngine engine(std::move(audio_engine),
|
||||
std::make_unique<NullWebRtcVideoEngine>());
|
||||
|
||||
@ -46,7 +46,6 @@ std::unique_ptr<MediaEngineInterface> CreateMediaEngine(
|
||||
std::move(dependencies.audio_decoder_factory),
|
||||
std::move(dependencies.audio_mixer),
|
||||
std::move(dependencies.audio_processing),
|
||||
dependencies.audio_frame_processor,
|
||||
std::move(dependencies.owned_audio_frame_processor), trials);
|
||||
#ifdef HAVE_WEBRTC_VIDEO
|
||||
auto video_engine = std::make_unique<WebRtcVideoEngine>(
|
||||
|
||||
@ -49,9 +49,6 @@ struct MediaEngineDependencies {
|
||||
rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory;
|
||||
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer;
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing;
|
||||
// TODO(bugs.webrtc.org/15111):
|
||||
// Remove the raw AudioFrameProcessor pointer in the follow-up.
|
||||
webrtc::AudioFrameProcessor* audio_frame_processor = nullptr;
|
||||
std::unique_ptr<webrtc::AudioFrameProcessor> owned_audio_frame_processor;
|
||||
|
||||
std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory;
|
||||
|
||||
@ -342,10 +342,7 @@ WebRtcVoiceEngine::WebRtcVoiceEngine(
|
||||
const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory,
|
||||
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing,
|
||||
// TODO(bugs.webrtc.org/15111):
|
||||
// Remove the raw AudioFrameProcessor pointer in the follow-up.
|
||||
webrtc::AudioFrameProcessor* audio_frame_processor,
|
||||
std::unique_ptr<webrtc::AudioFrameProcessor> owned_audio_frame_processor,
|
||||
std::unique_ptr<webrtc::AudioFrameProcessor> audio_frame_processor,
|
||||
const webrtc::FieldTrialsView& trials)
|
||||
: task_queue_factory_(task_queue_factory),
|
||||
adm_(adm),
|
||||
@ -353,8 +350,7 @@ WebRtcVoiceEngine::WebRtcVoiceEngine(
|
||||
decoder_factory_(decoder_factory),
|
||||
audio_mixer_(audio_mixer),
|
||||
apm_(audio_processing),
|
||||
audio_frame_processor_(audio_frame_processor),
|
||||
owned_audio_frame_processor_(std::move(owned_audio_frame_processor)),
|
||||
audio_frame_processor_(std::move(audio_frame_processor)),
|
||||
minimized_remsampling_on_mobile_trial_enabled_(
|
||||
IsEnabled(trials, "WebRTC-Audio-MinimizeResamplingOnMobile")) {
|
||||
RTC_LOG(LS_INFO) << "WebRtcVoiceEngine::WebRtcVoiceEngine";
|
||||
@ -423,11 +419,7 @@ void WebRtcVoiceEngine::Init() {
|
||||
if (audio_frame_processor_) {
|
||||
config.async_audio_processing_factory =
|
||||
rtc::make_ref_counted<webrtc::AsyncAudioProcessing::Factory>(
|
||||
*audio_frame_processor_, *task_queue_factory_);
|
||||
} else if (owned_audio_frame_processor_) {
|
||||
config.async_audio_processing_factory =
|
||||
rtc::make_ref_counted<webrtc::AsyncAudioProcessing::Factory>(
|
||||
std::move(owned_audio_frame_processor_), *task_queue_factory_);
|
||||
std::move(audio_frame_processor_), *task_queue_factory_);
|
||||
}
|
||||
audio_state_ = webrtc::AudioState::Create(config);
|
||||
}
|
||||
|
||||
@ -90,9 +90,6 @@ class WebRtcVoiceEngine final : public VoiceEngineInterface {
|
||||
const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory,
|
||||
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing,
|
||||
// TODO(bugs.webrtc.org/15111):
|
||||
// Remove the raw AudioFrameProcessor pointer in the follow-up.
|
||||
webrtc::AudioFrameProcessor* audio_frame_processor,
|
||||
std::unique_ptr<webrtc::AudioFrameProcessor> owned_audio_frame_processor,
|
||||
const webrtc::FieldTrialsView& trials);
|
||||
|
||||
@ -166,10 +163,7 @@ class WebRtcVoiceEngine final : public VoiceEngineInterface {
|
||||
// The audio processing module.
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> apm_;
|
||||
// Asynchronous audio processing.
|
||||
// TODO(bugs.webrtc.org/15111):
|
||||
// Remove the raw AudioFrameProcessor pointer in the follow-up.
|
||||
webrtc::AudioFrameProcessor* const audio_frame_processor_;
|
||||
std::unique_ptr<webrtc::AudioFrameProcessor> owned_audio_frame_processor_;
|
||||
std::unique_ptr<webrtc::AudioFrameProcessor> audio_frame_processor_;
|
||||
// The primary instance of WebRtc VoiceEngine.
|
||||
rtc::scoped_refptr<webrtc::AudioState> audio_state_;
|
||||
std::vector<AudioCodec> send_codecs_;
|
||||
|
||||
@ -174,7 +174,7 @@ TEST(WebRtcVoiceEngineTestStubLibrary, StartupShutdown) {
|
||||
task_queue_factory.get(), adm.get(),
|
||||
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
||||
webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, apm,
|
||||
nullptr, nullptr, trials);
|
||||
nullptr, trials);
|
||||
engine.Init();
|
||||
}
|
||||
}
|
||||
@ -220,7 +220,7 @@ class WebRtcVoiceEngineTestFake : public ::testing::TestWithParam<bool> {
|
||||
auto decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory();
|
||||
engine_.reset(new cricket::WebRtcVoiceEngine(
|
||||
task_queue_factory_.get(), adm_.get(), encoder_factory, decoder_factory,
|
||||
nullptr, apm_, nullptr, nullptr, field_trials_));
|
||||
nullptr, apm_, nullptr, field_trials_));
|
||||
engine_->Init();
|
||||
send_parameters_.codecs.push_back(kPcmuCodec);
|
||||
recv_parameters_.codecs.push_back(kPcmuCodec);
|
||||
@ -3689,7 +3689,7 @@ TEST(WebRtcVoiceEngineTest, StartupShutdown) {
|
||||
task_queue_factory.get(), adm.get(),
|
||||
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
||||
webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, apm,
|
||||
nullptr, nullptr, field_trials);
|
||||
nullptr, field_trials);
|
||||
engine.Init();
|
||||
webrtc::RtcEventLogNull event_log;
|
||||
CallConfig call_config(&event_log);
|
||||
@ -3725,7 +3725,7 @@ TEST(WebRtcVoiceEngineTest, StartupShutdownWithExternalADM) {
|
||||
task_queue_factory.get(), adm.get(),
|
||||
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
||||
webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, apm,
|
||||
nullptr, nullptr, field_trials);
|
||||
nullptr, field_trials);
|
||||
engine.Init();
|
||||
webrtc::RtcEventLogNull event_log;
|
||||
CallConfig call_config(&event_log);
|
||||
@ -3765,7 +3765,7 @@ TEST(WebRtcVoiceEngineTest, HasCorrectPayloadTypeMapping) {
|
||||
task_queue_factory.get(), adm.get(),
|
||||
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
||||
webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, apm,
|
||||
nullptr, nullptr, field_trials);
|
||||
nullptr, field_trials);
|
||||
engine.Init();
|
||||
for (const cricket::AudioCodec& codec : engine.send_codecs()) {
|
||||
auto is_codec = [&codec](const char* name, int clockrate = 0) {
|
||||
@ -3815,7 +3815,7 @@ TEST(WebRtcVoiceEngineTest, Has32Channels) {
|
||||
task_queue_factory.get(), adm.get(),
|
||||
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
||||
webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, apm,
|
||||
nullptr, nullptr, field_trials);
|
||||
nullptr, field_trials);
|
||||
engine.Init();
|
||||
webrtc::RtcEventLogNull event_log;
|
||||
CallConfig call_config(&event_log);
|
||||
@ -3861,7 +3861,7 @@ TEST(WebRtcVoiceEngineTest, SetRecvCodecs) {
|
||||
task_queue_factory.get(), adm.get(),
|
||||
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
||||
webrtc::CreateBuiltinAudioDecoderFactory(), nullptr, apm, nullptr,
|
||||
nullptr, field_trials);
|
||||
field_trials);
|
||||
engine.Init();
|
||||
webrtc::RtcEventLogNull event_log;
|
||||
CallConfig call_config(&event_log);
|
||||
@ -3889,8 +3889,7 @@ TEST(WebRtcVoiceEngineTest, SetRtpSendParametersMaxBitrate) {
|
||||
cricket::WebRtcVoiceEngine engine(task_queue_factory.get(), adm.get(),
|
||||
webrtc::CreateBuiltinAudioEncoderFactory(),
|
||||
webrtc::CreateBuiltinAudioDecoderFactory(),
|
||||
nullptr, nullptr, nullptr, nullptr,
|
||||
field_trials);
|
||||
nullptr, nullptr, nullptr, field_trials);
|
||||
engine.Init();
|
||||
webrtc::RtcEventLogNull event_log;
|
||||
CallConfig call_config(&event_log);
|
||||
@ -3965,7 +3964,7 @@ TEST(WebRtcVoiceEngineTest, CollectRecvCodecs) {
|
||||
webrtc::FieldTrialBasedConfig field_trials;
|
||||
cricket::WebRtcVoiceEngine engine(
|
||||
task_queue_factory.get(), adm.get(), unused_encoder_factory,
|
||||
mock_decoder_factory, nullptr, apm, nullptr, nullptr, field_trials);
|
||||
mock_decoder_factory, nullptr, apm, nullptr, field_trials);
|
||||
engine.Init();
|
||||
auto codecs = engine.recv_codecs();
|
||||
EXPECT_EQ(11u, codecs.size());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user