mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
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 <tommi@webrtc.org> Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41809}
This commit is contained in:
parent
97df932ecc
commit
3f7566abda
3 changed files with 6 additions and 7 deletions
|
@ -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",
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ AsyncAudioProcessing::AsyncAudioProcessing(
|
|||
"AsyncAudioProcessing",
|
||||
TaskQueueFactory::Priority::NORMAL)) {
|
||||
frame_processor_.SetSink([this](std::unique_ptr<AudioFrame> 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<AudioFrame> 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<AudioFrame> 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));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#include <memory>
|
||||
|
||||
#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<AudioFrameProcessor> owned_frame_processor_;
|
||||
rtc::TaskQueue task_queue_;
|
||||
std::unique_ptr<TaskQueueBase, TaskQueueDeleter> task_queue_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
Loading…
Reference in a new issue