Commit 0291c2ce authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Add NewAudioRendererSink and GetSourceLatencyType methods to blink::Platform

This CL is a preparation step to Onion soup webrtc_audio_renderer.cc|h.
It adds to blink::Platform two methods that expose the AudioDeviceFactory
functionality needed by WebRtcAudioRenderer.

It is part of the phase 3.3.10 in the design doc [1]

[1] https://docs.google.com/document/d/1rHJGi1U72qZsOGIctIf7GKRaY8d7BgtVW8MaMYumzYY/

BUG=704136
R=guidou@chromium.org, haraken@chromium.org

Change-Id: If9e4c03f583fee43bfe5cb182f852c16266c6acb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1678297
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672739}
parent 625afbbd
...@@ -713,6 +713,21 @@ RendererBlinkPlatformImpl::GetWebRtcMaxCaptureFrameRate() { ...@@ -713,6 +713,21 @@ RendererBlinkPlatformImpl::GetWebRtcMaxCaptureFrameRate() {
return base::nullopt; return base::nullopt;
} }
scoped_refptr<media::AudioRendererSink>
RendererBlinkPlatformImpl::NewAudioRendererSink(
blink::WebAudioDeviceSourceType source_type,
blink::WebLocalFrame* web_frame,
const media::AudioSinkParameters& params) {
return AudioDeviceFactory::NewAudioRendererSink(
source_type, RenderFrame::GetRoutingIdForWebFrame(web_frame), params);
}
media::AudioLatency::LatencyType
RendererBlinkPlatformImpl::GetAudioSourceLatencyType(
blink::WebAudioDeviceSourceType source_type) {
return AudioDeviceFactory::GetSourceLatencyType(source_type);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::unique_ptr<blink::WebSpeechSynthesizer> std::unique_ptr<blink::WebSpeechSynthesizer>
......
...@@ -158,6 +158,12 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { ...@@ -158,6 +158,12 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
const blink::WebString& kind) override; const blink::WebString& kind) override;
void UpdateWebRTCAPICount(blink::WebRTCAPIName api_name) override; void UpdateWebRTCAPICount(blink::WebRTCAPIName api_name) override;
base::Optional<double> GetWebRtcMaxCaptureFrameRate() override; base::Optional<double> GetWebRtcMaxCaptureFrameRate() override;
scoped_refptr<media::AudioRendererSink> NewAudioRendererSink(
blink::WebAudioDeviceSourceType source_type,
blink::WebLocalFrame* web_frame,
const media::AudioSinkParameters& params) override;
media::AudioLatency::LatencyType GetAudioSourceLatencyType(
blink::WebAudioDeviceSourceType source_type) override;
std::unique_ptr<blink::WebGraphicsContext3DProvider> std::unique_ptr<blink::WebGraphicsContext3DProvider>
CreateOffscreenGraphicsContext3DProvider( CreateOffscreenGraphicsContext3DProvider(
......
...@@ -41,12 +41,14 @@ ...@@ -41,12 +41,14 @@
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "components/viz/common/surfaces/frame_sink_id.h" #include "components/viz/common/surfaces/frame_sink_id.h"
#include "media/base/audio_renderer_sink.h"
#include "mojo/public/cpp/system/data_pipe.h" #include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/cpp/system/message_pipe.h" #include "mojo/public/cpp/system/message_pipe.h"
#include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/shared_url_loader_factory.h"
#include "third_party/blink/public/common/feature_policy/feature_policy.h" #include "third_party/blink/public/common/feature_policy/feature_policy.h"
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h" #include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
#include "third_party/blink/public/mojom/loader/code_cache.mojom-shared.h" #include "third_party/blink/public/mojom/loader/code_cache.mojom-shared.h"
#include "third_party/blink/public/platform/audio/web_audio_device_source_type.h"
#include "third_party/blink/public/platform/blame_context.h" #include "third_party/blink/public/platform/blame_context.h"
#include "third_party/blink/public/platform/code_cache_loader.h" #include "third_party/blink/public/platform/code_cache_loader.h"
#include "third_party/blink/public/platform/user_metrics_action.h" #include "third_party/blink/public/platform/user_metrics_action.h"
...@@ -77,6 +79,7 @@ class GpuMemoryBufferManager; ...@@ -77,6 +79,7 @@ class GpuMemoryBufferManager;
} }
namespace media { namespace media {
struct AudioSinkParameters;
class GpuVideoAcceleratorFactories; class GpuVideoAcceleratorFactories;
} }
...@@ -628,6 +631,17 @@ class BLINK_PLATFORM_EXPORT Platform { ...@@ -628,6 +631,17 @@ class BLINK_PLATFORM_EXPORT Platform {
return base::nullopt; return base::nullopt;
} }
virtual scoped_refptr<media::AudioRendererSink> NewAudioRendererSink(
blink::WebAudioDeviceSourceType source_type,
blink::WebLocalFrame* web_frame,
const media::AudioSinkParameters& params) {
return nullptr;
}
virtual media::AudioLatency::LatencyType GetAudioSourceLatencyType(
blink::WebAudioDeviceSourceType source_type) {
return media::AudioLatency::LATENCY_PLAYBACK;
}
// WebWorker ---------------------------------------------------------- // WebWorker ----------------------------------------------------------
virtual std::unique_ptr<WebDedicatedWorkerHostFactoryClient> virtual std::unique_ptr<WebDedicatedWorkerHostFactoryClient>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment