From 3f7566abda841021e53b400232db411ba185040e Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Fri, 19 Jan 2024 13:12:50 +0100 Subject: [PATCH] Cleanup rtc::TaskQueue in AsyncAudioProcessing use TaskQueueBase directly - rtc::TaskQueue wrapper adds no benefit here. Bug: webrtc:14169 Change-Id: If3d4feb11ffa507919a8ce4d7545172a25f0aa86 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335322 Reviewed-by: Tomas Gunnarsson Auto-Submit: Danil Chapovalov Commit-Queue: Tomas Gunnarsson Cr-Commit-Position: refs/heads/main@{#41809} --- modules/async_audio_processing/BUILD.gn | 1 - modules/async_audio_processing/async_audio_processing.cc | 8 ++++---- modules/async_audio_processing/async_audio_processing.h | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/async_audio_processing/BUILD.gn b/modules/async_audio_processing/BUILD.gn index 7a7ca20df1..0a8fc58520 100644 --- a/modules/async_audio_processing/BUILD.gn +++ b/modules/async_audio_processing/BUILD.gn @@ -24,7 +24,6 @@ rtc_library("async_audio_processing") { "../../api/task_queue:task_queue", "../../rtc_base:checks", "../../rtc_base:refcount", - "../../rtc_base:rtc_task_queue", ] } diff --git a/modules/async_audio_processing/async_audio_processing.cc b/modules/async_audio_processing/async_audio_processing.cc index 19c08dc3e5..d61b1264fc 100644 --- a/modules/async_audio_processing/async_audio_processing.cc +++ b/modules/async_audio_processing/async_audio_processing.cc @@ -63,7 +63,7 @@ AsyncAudioProcessing::AsyncAudioProcessing( "AsyncAudioProcessing", TaskQueueFactory::Priority::NORMAL)) { frame_processor_.SetSink([this](std::unique_ptr frame) { - task_queue_.PostTask([this, frame = std::move(frame)]() mutable { + task_queue_->PostTask([this, frame = std::move(frame)]() mutable { on_frame_processed_callback_(std::move(frame)); }); }); @@ -80,7 +80,7 @@ AsyncAudioProcessing::AsyncAudioProcessing( "AsyncAudioProcessing", TaskQueueFactory::Priority::NORMAL)) { owned_frame_processor_->SetSink([this](std::unique_ptr frame) { - task_queue_.PostTask([this, frame = std::move(frame)]() mutable { + task_queue_->PostTask([this, frame = std::move(frame)]() mutable { on_frame_processed_callback_(std::move(frame)); }); }); @@ -88,11 +88,11 @@ AsyncAudioProcessing::AsyncAudioProcessing( void AsyncAudioProcessing::Process(std::unique_ptr frame) { if (owned_frame_processor_) { - task_queue_.PostTask([this, frame = std::move(frame)]() mutable { + task_queue_->PostTask([this, frame = std::move(frame)]() mutable { owned_frame_processor_->Process(std::move(frame)); }); } else { - task_queue_.PostTask([this, frame = std::move(frame)]() mutable { + task_queue_->PostTask([this, frame = std::move(frame)]() mutable { frame_processor_.Process(std::move(frame)); }); } diff --git a/modules/async_audio_processing/async_audio_processing.h b/modules/async_audio_processing/async_audio_processing.h index f3ed96959b..2e78e716a8 100644 --- a/modules/async_audio_processing/async_audio_processing.h +++ b/modules/async_audio_processing/async_audio_processing.h @@ -14,8 +14,8 @@ #include #include "api/audio/audio_frame_processor.h" +#include "api/task_queue/task_queue_base.h" #include "rtc_base/ref_count.h" -#include "rtc_base/task_queue.h" namespace webrtc { @@ -101,7 +101,7 @@ class AsyncAudioProcessing final { // called. AudioFrameProcessor& frame_processor_; std::unique_ptr owned_frame_processor_; - rtc::TaskQueue task_queue_; + std::unique_ptr task_queue_; }; } // namespace webrtc