mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-20 00:57:49 +01:00
Deprecate PeerConnectionFactoryDependencies::audio_processing
Bug: webrtc:369904700 Change-Id: Ic0982abcff2097e4e52e55a4b9c90ec25ae33b90 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367961 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43444}
This commit is contained in:
parent
e5f6f1fab4
commit
c63e43f27d
6 changed files with 20 additions and 2 deletions
|
@ -49,7 +49,10 @@ class MediaFactoryImpl : public MediaFactory {
|
||||||
absl::Nullable<scoped_refptr<AudioProcessing>> audio_processing =
|
absl::Nullable<scoped_refptr<AudioProcessing>> audio_processing =
|
||||||
deps.audio_processing_builder != nullptr
|
deps.audio_processing_builder != nullptr
|
||||||
? std::move(deps.audio_processing_builder)->Build(env)
|
? std::move(deps.audio_processing_builder)->Build(env)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
: std::move(deps.audio_processing);
|
: std::move(deps.audio_processing);
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
auto audio_engine = std::make_unique<WebRtcVoiceEngine>(
|
auto audio_engine = std::make_unique<WebRtcVoiceEngine>(
|
||||||
&env.task_queue_factory(), deps.adm.get(),
|
&env.task_queue_factory(), deps.adm.get(),
|
||||||
|
|
|
@ -34,7 +34,10 @@ void EnableMediaWithDefaults(PeerConnectionFactoryDependencies& deps) {
|
||||||
if (deps.audio_decoder_factory == nullptr) {
|
if (deps.audio_decoder_factory == nullptr) {
|
||||||
deps.audio_decoder_factory = CreateBuiltinAudioDecoderFactory();
|
deps.audio_decoder_factory = CreateBuiltinAudioDecoderFactory();
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
if (deps.audio_processing == nullptr &&
|
if (deps.audio_processing == nullptr &&
|
||||||
|
#pragma clang diagnostic pop
|
||||||
deps.audio_processing_builder == nullptr) {
|
deps.audio_processing_builder == nullptr) {
|
||||||
deps.audio_processing_builder =
|
deps.audio_processing_builder =
|
||||||
std::make_unique<BuiltinAudioProcessingBuilder>();
|
std::make_unique<BuiltinAudioProcessingBuilder>();
|
||||||
|
|
|
@ -67,8 +67,13 @@ PeerConnectionDependencies::~PeerConnectionDependencies() = default;
|
||||||
PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
|
PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
|
||||||
default;
|
default;
|
||||||
|
|
||||||
|
// TODO: bugs.webrtc.org/369904700 - remove pragma once `audio_processing`
|
||||||
|
// is removed from PeerConnectionFactoryDependencies.
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
|
PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
|
||||||
PeerConnectionFactoryDependencies&&) = default;
|
PeerConnectionFactoryDependencies&&) = default;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
|
PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
|
||||||
default;
|
default;
|
||||||
|
|
|
@ -1472,9 +1472,9 @@ struct RTC_EXPORT PeerConnectionFactoryDependencies final {
|
||||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory;
|
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory;
|
||||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory;
|
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory;
|
||||||
rtc::scoped_refptr<AudioMixer> audio_mixer;
|
rtc::scoped_refptr<AudioMixer> audio_mixer;
|
||||||
// TODO: bugs.webrtc.org/369904700 - Deprecate `audio_processing` in favor
|
// TODO: bugs.webrtc.org/369904700 - Delete `audio_processing` in favor
|
||||||
// of `audio_processing_builder`.
|
// of `audio_processing_builder`.
|
||||||
rtc::scoped_refptr<AudioProcessing> audio_processing;
|
[[deprecated]] scoped_refptr<AudioProcessing> audio_processing;
|
||||||
std::unique_ptr<AudioProcessingBuilderInterface> audio_processing_builder;
|
std::unique_ptr<AudioProcessingBuilderInterface> audio_processing_builder;
|
||||||
std::unique_ptr<AudioFrameProcessor> audio_frame_processor;
|
std::unique_ptr<AudioFrameProcessor> audio_frame_processor;
|
||||||
std::unique_ptr<VideoEncoderFactory> video_encoder_factory;
|
std::unique_ptr<VideoEncoderFactory> video_encoder_factory;
|
||||||
|
|
|
@ -753,7 +753,10 @@ TEST(PeerConnectionFactoryDependenciesTest, UsesAudioProcessingWhenProvided) {
|
||||||
|
|
||||||
PeerConnectionFactoryDependencies pcf_dependencies;
|
PeerConnectionFactoryDependencies pcf_dependencies;
|
||||||
pcf_dependencies.adm = FakeAudioCaptureModule::Create();
|
pcf_dependencies.adm = FakeAudioCaptureModule::Create();
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
pcf_dependencies.audio_processing = std::move(audio_processing);
|
pcf_dependencies.audio_processing = std::move(audio_processing);
|
||||||
|
#pragma clang diagnostic pop
|
||||||
EnableMediaWithDefaults(pcf_dependencies);
|
EnableMediaWithDefaults(pcf_dependencies);
|
||||||
|
|
||||||
scoped_refptr<PeerConnectionFactoryInterface> pcf =
|
scoped_refptr<PeerConnectionFactoryInterface> pcf =
|
||||||
|
|
|
@ -205,8 +205,12 @@
|
||||||
|
|
||||||
- (instancetype)initWithMediaAndDependencies:
|
- (instancetype)initWithMediaAndDependencies:
|
||||||
(webrtc::PeerConnectionFactoryDependencies)dependencies {
|
(webrtc::PeerConnectionFactoryDependencies)dependencies {
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
// audio_processing_builder should be used instead in new code.
|
// audio_processing_builder should be used instead in new code.
|
||||||
RTC_CHECK(dependencies.audio_processing == nullptr);
|
RTC_CHECK(dependencies.audio_processing == nullptr);
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#ifndef WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE
|
#ifndef WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE
|
||||||
if (dependencies.audio_processing_builder == nullptr) {
|
if (dependencies.audio_processing_builder == nullptr) {
|
||||||
dependencies.audio_processing_builder =
|
dependencies.audio_processing_builder =
|
||||||
|
|
Loading…
Reference in a new issue