diff --git a/media/BUILD.gn b/media/BUILD.gn index 295a748802..2a9cbcbff4 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -516,7 +516,6 @@ rtc_library("rtc_audio_video") { "../rtc_base:macromagic", "../rtc_base:network_route", "../rtc_base:race_checker", - "../rtc_base:rtc_task_queue", "../rtc_base:safe_conversions", "../rtc_base:socket", "../rtc_base:ssl", diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc index f287cb7d4e..fcc2703f98 100644 --- a/media/engine/webrtc_voice_engine.cc +++ b/media/engine/webrtc_voice_engine.cc @@ -377,9 +377,8 @@ void WebRtcVoiceEngine::Init() { // TaskQueue expects to be created/destroyed on the same thread. RTC_DCHECK(!low_priority_worker_queue_); - low_priority_worker_queue_.reset( - new rtc::TaskQueue(task_queue_factory_->CreateTaskQueue( - "rtc-low-prio", webrtc::TaskQueueFactory::Priority::LOW))); + low_priority_worker_queue_ = task_queue_factory_->CreateTaskQueue( + "rtc-low-prio", webrtc::TaskQueueFactory::Priority::LOW); // Load our audio codec lists. RTC_LOG(LS_VERBOSE) << "Supported send codecs in order of preference:"; diff --git a/media/engine/webrtc_voice_engine.h b/media/engine/webrtc_voice_engine.h index ed71667525..b28b9652bb 100644 --- a/media/engine/webrtc_voice_engine.h +++ b/media/engine/webrtc_voice_engine.h @@ -66,7 +66,6 @@ #include "rtc_base/network/sent_packet.h" #include "rtc_base/network_route.h" #include "rtc_base/system/file_wrapper.h" -#include "rtc_base/task_queue.h" namespace webrtc { class AudioFrameProcessor; @@ -141,7 +140,8 @@ class WebRtcVoiceEngine final : public VoiceEngineInterface { void ApplyOptions(const AudioOptions& options); webrtc::TaskQueueFactory* const task_queue_factory_; - std::unique_ptr low_priority_worker_queue_; + std::unique_ptr + low_priority_worker_queue_; webrtc::AudioDeviceModule* adm(); webrtc::AudioProcessing* apm() const; diff --git a/modules/audio_processing/include/audio_processing.cc b/modules/audio_processing/include/audio_processing.cc index 48cf4610ca..c6c84a0eb0 100644 --- a/modules/audio_processing/include/audio_processing.cc +++ b/modules/audio_processing/include/audio_processing.cc @@ -222,22 +222,4 @@ bool AudioProcessing::CreateAndAttachAecDump(FILE* handle, worker_queue->Get()); } -bool AudioProcessing::CreateAndAttachAecDump( - absl::string_view file_name, - int64_t max_log_size_bytes, - absl::Nonnull worker_queue) { - // Newer code should implement this variant, - // Older code shouldn't call this variant. - RTC_CHECK_NOTREACHED(); -} - -bool AudioProcessing::CreateAndAttachAecDump( - FILE* handle, - int64_t max_log_size_bytes, - absl::Nonnull worker_queue) { - // New ercode should implement this variant, - // Older code shouldn't call this variant. - RTC_CHECK_NOTREACHED(); -} - } // namespace webrtc diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h index a732e92f22..578aded739 100644 --- a/modules/audio_processing/include/audio_processing.h +++ b/modules/audio_processing/include/audio_processing.h @@ -635,22 +635,21 @@ class RTC_EXPORT AudioProcessing : public RefCountInterface { // sucessfully opened, while a value of false indicates that // opening the file failed. // TODO: bugs.webrtc.org/14169 - Delete rtc::TaskQueue variants - virtual bool CreateAndAttachAecDump(absl::string_view file_name, - int64_t max_log_size_bytes, - rtc::TaskQueue* worker_queue); - virtual bool CreateAndAttachAecDump(FILE* handle, - int64_t max_log_size_bytes, - rtc::TaskQueue* worker_queue); - // TODO: bugs.webrtc.org/14169 - Make TaskQueueBase variants pure virtual when - // implemented by derived classes. + [[deprecated]] bool CreateAndAttachAecDump(absl::string_view file_name, + int64_t max_log_size_bytes, + rtc::TaskQueue* worker_queue); + [[deprecated]] bool CreateAndAttachAecDump(FILE* handle, + int64_t max_log_size_bytes, + rtc::TaskQueue* worker_queue); + virtual bool CreateAndAttachAecDump( absl::string_view file_name, int64_t max_log_size_bytes, - absl::Nonnull worker_queue); + absl::Nonnull worker_queue) = 0; virtual bool CreateAndAttachAecDump( absl::Nonnull handle, int64_t max_log_size_bytes, - absl::Nonnull worker_queue); + absl::Nonnull worker_queue) = 0; // TODO(webrtc:5298) Deprecated variant. // Attaches provided webrtc::AecDump for recording debugging diff --git a/test/pc/e2e/BUILD.gn b/test/pc/e2e/BUILD.gn index 32543e1145..3ccf292d58 100644 --- a/test/pc/e2e/BUILD.gn +++ b/test/pc/e2e/BUILD.gn @@ -99,6 +99,7 @@ if (!build_with_chromium) { "../../../api:enable_media_with_defaults", "../../../api:time_controller", "../../../api/rtc_event_log:rtc_event_log_factory", + "../../../api/task_queue", "../../../api/task_queue:default_task_queue_factory", "../../../api/test/pclf:media_configuration", "../../../api/test/pclf:media_quality_test_params", diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc index 5eb47b4682..90f201facd 100644 --- a/test/pc/e2e/peer_connection_quality_test.cc +++ b/test/pc/e2e/peer_connection_quality_test.cc @@ -277,7 +277,7 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) { TestPeerFactory test_peer_factory( signaling_thread.get(), time_controller_, - video_quality_analyzer_injection_helper_.get(), task_queue_.get()); + video_quality_analyzer_injection_helper_.get(), task_queue_->Get()); alice_ = test_peer_factory.CreateTestPeer( std::move(alice_configurer), std::make_unique( diff --git a/test/pc/e2e/test_peer_factory.h b/test/pc/e2e/test_peer_factory.h index f2698e2a15..2cc55e437b 100644 --- a/test/pc/e2e/test_peer_factory.h +++ b/test/pc/e2e/test_peer_factory.h @@ -18,6 +18,7 @@ #include "absl/strings/string_view.h" #include "api/rtc_event_log/rtc_event_log_factory.h" +#include "api/task_queue/task_queue_base.h" #include "api/test/pclf/media_configuration.h" #include "api/test/pclf/media_quality_test_params.h" #include "api/test/pclf/peer_configurer.h" @@ -55,12 +56,22 @@ class TestPeerFactory { TestPeerFactory(rtc::Thread* signaling_thread, TimeController& time_controller, VideoQualityAnalyzerInjectionHelper* video_analyzer_helper, - rtc::TaskQueue* task_queue) + TaskQueueBase* task_queue) : signaling_thread_(signaling_thread), time_controller_(time_controller), video_analyzer_helper_(video_analyzer_helper), task_queue_(task_queue) {} + [[deprecated]] TestPeerFactory( + rtc::Thread* signaling_thread, + TimeController& time_controller, + VideoQualityAnalyzerInjectionHelper* video_analyzer_helper, + rtc::TaskQueue* task_queue) + : TestPeerFactory(signaling_thread, + time_controller, + video_analyzer_helper, + task_queue->Get()) {} + // Setups all components, that should be provided to WebRTC // PeerConnectionFactory and PeerConnection creation methods, // also will setup dependencies, that are required for media analyzers @@ -75,7 +86,7 @@ class TestPeerFactory { rtc::Thread* signaling_thread_; TimeController& time_controller_; VideoQualityAnalyzerInjectionHelper* video_analyzer_helper_; - rtc::TaskQueue* task_queue_; + TaskQueueBase* const task_queue_; }; } // namespace webrtc_pc_e2e