| Index: content/browser/renderer_host/media/audio_output_delegate_impl.cc
|
| diff --git a/content/browser/renderer_host/media/audio_output_delegate_impl.cc b/content/browser/renderer_host/media/audio_output_delegate_impl.cc
|
| index 3625fcbfefaaa18f1dabe65e3af7eabbc3175f99..892e54caf65214379c455c74deeb90df09920f65 100644
|
| --- a/content/browser/renderer_host/media/audio_output_delegate_impl.cc
|
| +++ b/content/browser/renderer_host/media/audio_output_delegate_impl.cc
|
| @@ -12,6 +12,7 @@
|
| #include "content/browser/media/capture/audio_mirroring_manager.h"
|
| #include "content/browser/media/media_internals.h"
|
| #include "content/browser/renderer_host/media/audio_sync_reader.h"
|
| +#include "content/browser/renderer_host/media/media_stream_manager.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/media_observer.h"
|
| #include "media/audio/audio_output_controller.h"
|
| @@ -34,6 +35,8 @@ class AudioOutputDelegateImpl::ControllerEventHandler
|
| void OnControllerPaused() override;
|
| void OnControllerError() override;
|
|
|
| + void OnLog(const std::string& message) override;
|
| +
|
| base::WeakPtr<AudioOutputDelegateImpl> delegate_;
|
| };
|
|
|
| @@ -68,6 +71,13 @@ void AudioOutputDelegateImpl::ControllerEventHandler::OnControllerError() {
|
| base::BindOnce(&AudioOutputDelegateImpl::OnError, delegate_));
|
| }
|
|
|
| +void AudioOutputDelegateImpl::ControllerEventHandler::OnLog(
|
| + const std::string& message) {
|
| + BrowserThread::PostTask(
|
| + BrowserThread::IO, FROM_HERE,
|
| + base::Bind(&AudioOutputDelegateImpl::DoLog, delegate_, message));
|
| +}
|
| +
|
| std::unique_ptr<media::AudioOutputDelegate> AudioOutputDelegateImpl::Create(
|
| EventHandler* handler,
|
| media::AudioManager* audio_manager,
|
| @@ -221,6 +231,15 @@ void AudioOutputDelegateImpl::OnError() {
|
| subscriber_->OnStreamError(stream_id_);
|
| }
|
|
|
| +void AudioOutputDelegateImpl::DoLog(const std::string& msg) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| + std::ostringstream oss;
|
| + oss << "[stream_id=" << stream_id_ << "] " << msg;
|
| + const std::string message = oss.str();
|
| + content::MediaStreamManager::SendMessageToNativeLog(message);
|
| + DVLOG(1) << message;
|
| +}
|
| +
|
| media::AudioOutputController* AudioOutputDelegateImpl::GetControllerForTesting()
|
| const {
|
| return controller_.get();
|
|
|