Use Default instead of GlobalTaskQueueFactory to create AudioDeviceBuffer for android
Bug: webrtc:10284 Change-Id: I979eab78e1841e2b6900d7729159ee69274af8e5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144031 Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28425}
This commit is contained in:

committed by
Commit Bot

parent
a63aede22b
commit
896f4b666c
@ -1076,7 +1076,8 @@ if (is_android) {
|
||||
":base_jni",
|
||||
":generated_audio_device_module_base_jni",
|
||||
":native_api_jni",
|
||||
"../../api/task_queue:global_task_queue_factory",
|
||||
"../../api/task_queue",
|
||||
"../../api/task_queue:default_task_queue_factory",
|
||||
"../../modules/audio_device:audio_device_api",
|
||||
"../../modules/audio_device:audio_device_buffer",
|
||||
"../../rtc_base:checks",
|
||||
|
@ -13,7 +13,8 @@
|
||||
#include <utility>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/task_queue/global_task_queue_factory.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "modules/audio_device/audio_device_buffer.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
@ -63,6 +64,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
is_stereo_playout_supported_(is_stereo_playout_supported),
|
||||
is_stereo_record_supported_(is_stereo_record_supported),
|
||||
playout_delay_ms_(playout_delay_ms),
|
||||
task_queue_factory_(CreateDefaultTaskQueueFactory()),
|
||||
input_(std::move(audio_input)),
|
||||
output_(std::move(audio_output)),
|
||||
initialized_(false) {
|
||||
@ -90,7 +92,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DCHECK(thread_checker_.IsCurrent());
|
||||
audio_device_buffer_ =
|
||||
absl::make_unique<AudioDeviceBuffer>(&GlobalTaskQueueFactory());
|
||||
absl::make_unique<AudioDeviceBuffer>(task_queue_factory_.get());
|
||||
AttachAudioBuffer();
|
||||
if (initialized_) {
|
||||
return 0;
|
||||
@ -596,6 +598,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
const bool is_stereo_playout_supported_;
|
||||
const bool is_stereo_record_supported_;
|
||||
const uint16_t playout_delay_ms_;
|
||||
const std::unique_ptr<TaskQueueFactory> task_queue_factory_;
|
||||
const std::unique_ptr<AudioInput> input_;
|
||||
const std::unique_ptr<AudioOutput> output_;
|
||||
std::unique_ptr<AudioDeviceBuffer> audio_device_buffer_;
|
||||
|
Reference in New Issue
Block a user