diff --git a/cobalt/renderer/BUILD.gn b/cobalt/renderer/BUILD.gn index 73d80ea2fc06..e2f1c404cfe0 100644 --- a/cobalt/renderer/BUILD.gn +++ b/cobalt/renderer/BUILD.gn @@ -26,6 +26,7 @@ source_set("renderer") { "//content/public/renderer", "//content/test:content_test_mojo_bindings", "//media/mojo:buildflags", + "//media/starboard:webaudio", "//starboard:starboard_headers_only", "//v8", ] diff --git a/cobalt/renderer/cobalt_content_renderer_client.cc b/cobalt/renderer/cobalt_content_renderer_client.cc index 13485a2b9513..117c0b1a81a9 100644 --- a/cobalt/renderer/cobalt_content_renderer_client.cc +++ b/cobalt/renderer/cobalt_content_renderer_client.cc @@ -89,7 +89,14 @@ class CobaltContentRendererUrlLoaderThrottleProvider } // namespace -CobaltContentRendererClient::CobaltContentRendererClient() {} +CobaltContentRendererClient::CobaltContentRendererClient() { +#if BUILDFLAG(USE_STARBOARD_MEDIA) + // Registers a custom content::AudioDeviceFactory + starboard_audio_device_factory_ = + std::make_unique(); +#endif // BUILDFLAG(USE_STARBOARD_MEDIA) +} + CobaltContentRendererClient::~CobaltContentRendererClient() {} void CobaltContentRendererClient::RenderThreadStarted() { diff --git a/cobalt/renderer/cobalt_content_renderer_client.h b/cobalt/renderer/cobalt_content_renderer_client.h index 855c705cdb66..bfb2b80052ed 100644 --- a/cobalt/renderer/cobalt_content_renderer_client.h +++ b/cobalt/renderer/cobalt_content_renderer_client.h @@ -16,6 +16,10 @@ // For BUILDFLAG(USE_STARBOARD_MEDIA) #include "build/build_config.h" +#if BUILDFLAG(USE_STARBOARD_MEDIA) +#include "media/starboard/starboard_audio_device_factory.h" +#endif // BUILDFLAG(USE_STARBOARD_MEDIA) + namespace blink { class URLLoaderThrottleProvider; enum class URLLoaderThrottleProviderType; @@ -72,6 +76,11 @@ class CobaltContentRendererClient : public content::ContentRendererClient { private: std::unique_ptr web_cache_impl_; + +#if BUILDFLAG(USE_STARBOARD_MEDIA) + std::unique_ptr + starboard_audio_device_factory_; +#endif // BUILDFLAG(USE_STARBOARD_MEDIA) }; } // namespace cobalt diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn index 65b7f8be63cd..0c169741a534 100644 --- a/content/shell/BUILD.gn +++ b/content/shell/BUILD.gn @@ -446,7 +446,6 @@ static_library("content_shell_lib") { if (is_cobalt && use_starboard_media) { deps += [ "//starboard($starboard_toolchain)", - "//media/starboard:webaudio($starboard_toolchain)", ] } } diff --git a/content/shell/renderer/shell_content_renderer_client.cc b/content/shell/renderer/shell_content_renderer_client.cc index 103591246d37..0ffa369c1668 100644 --- a/content/shell/renderer/shell_content_renderer_client.cc +++ b/content/shell/renderer/shell_content_renderer_client.cc @@ -186,13 +186,7 @@ void CreateRendererTestService( } // namespace -ShellContentRendererClient::ShellContentRendererClient() { -#if BUILDFLAG(USE_STARBOARD_MEDIA) - // Registers a custom content::AudioDeviceFactory - starboard_audio_device_factory_ = - std::make_unique(); -#endif // BUILDFLAG(USE_STARBOARD_MEDIA) -} +ShellContentRendererClient::ShellContentRendererClient() {} ShellContentRendererClient::~ShellContentRendererClient() { }