From 6eaa15db812358de4339adbb098eddc94edf3ffe Mon Sep 17 00:00:00 2001 From: Colin Liang Date: Tue, 13 Aug 2024 16:56:43 -0700 Subject: [PATCH 1/4] Add new files to apk_sources.gni (#3983) The files were added in https://github.com/youtube/cobalt/pull/3707 b/347963541 Change-Id: Ibab302808d5373759606898bf4c451385aed400a Co-authored-by: Colin Liang --- starboard/android/apk/apk_sources.gni | 2 ++ 1 file changed, 2 insertions(+) diff --git a/starboard/android/apk/apk_sources.gni b/starboard/android/apk/apk_sources.gni index a0ed8ac617fe..f5b796ad01ea 100644 --- a/starboard/android/apk/apk_sources.gni +++ b/starboard/android/apk/apk_sources.gni @@ -34,6 +34,8 @@ apk_sources = [ "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfo.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfoModule.java", + "//starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloader.java", + "//starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloaderDefault.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkLoader.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java", From d4f1e954b1b997f65e4badde6685eb103f8e22d0 Mon Sep 17 00:00:00 2001 From: Yijia Zhang <45114178+yjzhang111@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:00:26 -0700 Subject: [PATCH 2/4] Fix C25 xbox build failure on SbFileOpen. (#3982) b/302715109 --- starboard/shared/win32/file_open.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starboard/shared/win32/file_open.cc b/starboard/shared/win32/file_open.cc index be8459b9921d..d632c234a363 100644 --- a/starboard/shared/win32/file_open.cc +++ b/starboard/shared/win32/file_open.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if SB_API_VERSION < 16 +#if SB_API_VERSION < 17 #include "starboard/file.h" @@ -42,4 +42,4 @@ SbFile SbFileOpen(const char* path, return new SbFilePrivate(file_handle); } -#endif // SB_API_VERSION < 16 +#endif // SB_API_VERSION < 17 From a9495fedb6ee711476d707ad375c2c4dc694b40e Mon Sep 17 00:00:00 2001 From: Jelle Foks Date: Wed, 14 Aug 2024 20:04:25 -0700 Subject: [PATCH 3/4] Don't start DebugConsole with debug_console=off. (#3989) When started with `--debug_console=off`, don't start the DebugConsole at all. Note: The web debugger (devtools) still works but no longer will show overlay changes. To also disable the web debugger, also start with `--disable_web_debugger`. b/205134049 --- cobalt/browser/browser_module.cc | 50 ++++++++++++++++++++------------ cobalt/browser/debug_console.cc | 12 ++++++++ cobalt/browser/debug_console.h | 3 ++ 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/cobalt/browser/browser_module.cc b/cobalt/browser/browser_module.cc index 3a23822791c2..99b582d3d70a 100644 --- a/cobalt/browser/browser_module.cc +++ b/cobalt/browser/browser_module.cc @@ -288,7 +288,10 @@ BrowserModule::BrowserModule(const GURL& url, splash_screen_layer_ = render_tree_combiner_.CreateLayer(kSplashScreenZIndex); // Create the debug console layer. #if defined(ENABLE_DEBUGGER) - debug_console_layer_ = render_tree_combiner_.CreateLayer(kDebugConsoleZIndex); + if (DebugConsole::IsEnabled()) { + debug_console_layer_ = + render_tree_combiner_.CreateLayer(kDebugConsoleZIndex); + } #endif int qr_code_overlay_slots = 4; @@ -367,15 +370,17 @@ BrowserModule::BrowserModule(const GURL& url, resource_provider_stub_.emplace(true /*allocate_image_data*/); #if defined(ENABLE_DEBUGGER) - debug_console_.reset(new DebugConsole( - platform_info_.get(), application_state_, - base::Bind(&BrowserModule::QueueOnDebugConsoleRenderTreeProduced, - base::Unretained(this)), - &web_settings_, network_module_, GetViewportSize(), GetResourceProvider(), - kLayoutMaxRefreshFrequencyInHz, - base::Bind(&BrowserModule::CreateDebugClient, base::Unretained(this)), - base::Bind(&BrowserModule::OnMaybeFreeze, base::Unretained(this)))); - lifecycle_observers_.AddObserver(debug_console_.get()); + if (debug_console_layer_) { + debug_console_.reset(new DebugConsole( + platform_info_.get(), application_state_, + base::Bind(&BrowserModule::QueueOnDebugConsoleRenderTreeProduced, + base::Unretained(this)), + &web_settings_, network_module_, GetViewportSize(), + GetResourceProvider(), kLayoutMaxRefreshFrequencyInHz, + base::Bind(&BrowserModule::CreateDebugClient, base::Unretained(this)), + base::Bind(&BrowserModule::OnMaybeFreeze, base::Unretained(this)))); + lifecycle_observers_.AddObserver(debug_console_.get()); + } #endif // defined(ENABLE_DEBUGGER) const renderer::Pipeline* pipeline = @@ -1095,6 +1100,7 @@ void BrowserModule::OnDisableMediaCodecs(const std::string& codecs) { void BrowserModule::QueueOnDebugConsoleRenderTreeProduced( const browser::WebModule::LayoutResults& layout_results) { +#if defined(ENABLE_DEBUGGER) TRACE_EVENT0("cobalt::browser", "BrowserModule::QueueOnDebugConsoleRenderTreeProduced()"); render_tree_submission_queue_.AddMessage( @@ -1103,14 +1109,17 @@ void BrowserModule::QueueOnDebugConsoleRenderTreeProduced( task_runner_->PostTask( FROM_HERE, base::Bind(&BrowserModule::ProcessRenderTreeSubmissionQueue, weak_this_)); +#endif } void BrowserModule::OnDebugConsoleRenderTreeProduced( const browser::WebModule::LayoutResults& layout_results) { +#if defined(ENABLE_DEBUGGER) TRACE_EVENT0("cobalt::browser", "BrowserModule::OnDebugConsoleRenderTreeProduced()"); DCHECK(task_runner_->RunsTasksInCurrentSequence()); - if (application_state_ == base::kApplicationStateConcealed) { + if (!debug_console_ || + (application_state_ == base::kApplicationStateConcealed)) { return; } @@ -1127,6 +1136,7 @@ void BrowserModule::OnDebugConsoleRenderTreeProduced( } SubmitCurrentRenderTreeToRenderer(); +#endif } void BrowserModule::OnNavigateTimedTrace(const std::string& time) { @@ -1151,7 +1161,8 @@ void BrowserModule::OnOnScreenKeyboardInputEventProduced( } #if defined(ENABLE_DEBUGGER) - if (!debug_console_->FilterOnScreenKeyboardInputEvent(type, event)) { + if (debug_console_ && + !debug_console_->FilterOnScreenKeyboardInputEvent(type, event)) { return; } #endif // defined(ENABLE_DEBUGGER) @@ -1188,7 +1199,7 @@ void BrowserModule::OnPointerEventProduced(base_token::Token type, } #if defined(ENABLE_DEBUGGER) - if (!debug_console_->FilterPointerEvent(type, event)) { + if (debug_console_ && !debug_console_->FilterPointerEvent(type, event)) { return; } #endif // defined(ENABLE_DEBUGGER) @@ -1214,7 +1225,7 @@ void BrowserModule::OnWheelEventProduced(base_token::Token type, } #if defined(ENABLE_DEBUGGER) - if (!debug_console_->FilterWheelEvent(type, event)) { + if (debug_console_ && !debug_console_->FilterWheelEvent(type, event)) { return; } #endif // defined(ENABLE_DEBUGGER) @@ -1348,7 +1359,7 @@ bool BrowserModule::FilterKeyEvent(base_token::Token type, } #if defined(ENABLE_DEBUGGER) - if (!debug_console_->FilterKeyEvent(type, event)) { + if (debug_console_ && !debug_console_->FilterKeyEvent(type, event)) { return false; } #endif // defined(ENABLE_DEBUGGER) @@ -1359,8 +1370,9 @@ bool BrowserModule::FilterKeyEvent(base_token::Token type, bool BrowserModule::FilterKeyEventForHotkeys( base_token::Token type, const dom::KeyboardEventInit& event) { #if defined(ENABLE_DEBUGGER) - if (event.key_code() == dom::keycode::kF1 || - (event.ctrl_key() && event.key_code() == dom::keycode::kO)) { + if (debug_console_ && + (event.key_code() == dom::keycode::kF1 || + (event.ctrl_key() && event.key_code() == dom::keycode::kO))) { if (type == base::Tokens::keydown()) { // F1 or Ctrl+O cycles the debug console display. debug_console_->CycleMode(); @@ -1754,7 +1766,9 @@ void BrowserModule::ResetResources() { main_web_module_layer_->Reset(); splash_screen_layer_->Reset(); #if defined(ENABLE_DEBUGGER) - debug_console_layer_->Reset(); + if (debug_console_layer_) { + debug_console_layer_->Reset(); + } #endif // defined(ENABLE_DEBUGGER) if (qr_overlay_info_layer_) { qr_overlay_info_layer_->Reset(); diff --git a/cobalt/browser/debug_console.cc b/cobalt/browser/debug_console.cc index 42c73aecc1aa..4c6b50c1c4dc 100644 --- a/cobalt/browser/debug_console.cc +++ b/cobalt/browser/debug_console.cc @@ -157,6 +157,18 @@ DebugConsole::DebugConsole( DebugConsole::~DebugConsole() {} +// static +bool DebugConsole::IsEnabled() { +#if defined(ENABLE_DEBUGGER) + // The debug console is not enabled when it's turned off from the + // command-line. + return GetDebugConsoleModeFromCommandLine() != + debug::console::kDebugConsoleModeOff; +#else + return false; +#endif +} + bool DebugConsole::ShouldInjectInputEvents() { switch (GetMode()) { case debug::console::kDebugConsoleModeOff: diff --git a/cobalt/browser/debug_console.h b/cobalt/browser/debug_console.h index 075dbfe12715..265d46d7d2f1 100644 --- a/cobalt/browser/debug_console.h +++ b/cobalt/browser/debug_console.h @@ -88,6 +88,9 @@ class DebugConsole : public LifecycleObserver { // Cycles through each different possible debug console visibility mode. void CycleMode(); + // Returns true if the debug console is enabled. + static bool IsEnabled(); + // Returns true iff the console is in a mode that is visible. bool IsVisible() { return (GetMode() != debug::console::kDebugConsoleModeOff); From 2a9a01cbe29b8fbb8b3b884f9e22fce7269486f2 Mon Sep 17 00:00:00 2001 From: xiaomings Date: Thu, 15 Aug 2024 10:07:51 -0700 Subject: [PATCH 4/4] [android] Move files in dev/cobalt/media to .../coat (#3988) Move platform related source code (e.g. CaptionSettings.java, CobaltMediaSession.java) from dev/cobalt/media to dev/cobalt/coat. There are no functional changes otherwise. Some features are mostly used during video playback, like the MediaSession where the playback control and status is displayed during playback, are really platform features. Their implementations were placed in the media/ folder due to legacy reasons. This PR move them back to the coat folder, where other platform implementations stay. b/345542000 --- starboard/android/apk/apk_sources.gni | 12 ++++++------ .../src/app/java/dev/cobalt/app/MainActivity.java | 2 +- .../cobalt/{media => coat}/ArtworkDownloader.java | 2 +- .../{media => coat}/ArtworkDownloaderDefault.java | 4 ++-- .../dev/cobalt/{media => coat}/ArtworkLoader.java | 2 +- .../dev/cobalt/{media => coat}/CaptionSettings.java | 2 +- .../cobalt/{media => coat}/CobaltMediaSession.java | 6 +++--- .../java/dev/cobalt/{media => coat}/MediaImage.java | 2 +- .../main/java/dev/cobalt/coat/StarboardBridge.java | 4 ---- .../java/dev/cobalt/media/AudioOutputManager.java | 1 + .../shared/accessibility_get_caption_settings.cc | 2 +- .../android/shared/android_media_session_client.cc | 12 ++++++------ 12 files changed, 24 insertions(+), 27 deletions(-) rename starboard/android/apk/app/src/main/java/dev/cobalt/{media => coat}/ArtworkDownloader.java (96%) rename starboard/android/apk/app/src/main/java/dev/cobalt/{media => coat}/ArtworkDownloaderDefault.java (96%) rename starboard/android/apk/app/src/main/java/dev/cobalt/{media => coat}/ArtworkLoader.java (99%) rename starboard/android/apk/app/src/main/java/dev/cobalt/{media => coat}/CaptionSettings.java (98%) rename starboard/android/apk/app/src/main/java/dev/cobalt/{media => coat}/CobaltMediaSession.java (99%) rename starboard/android/apk/app/src/main/java/dev/cobalt/{media => coat}/MediaImage.java (97%) diff --git a/starboard/android/apk/apk_sources.gni b/starboard/android/apk/apk_sources.gni index f5b796ad01ea..dd4e91c8413f 100644 --- a/starboard/android/apk/apk_sources.gni +++ b/starboard/android/apk/apk_sources.gni @@ -18,15 +18,21 @@ apk_sources = [ "//starboard/android/apk/app/src/app/java/dev/cobalt/app/CobaltApplication.java", "//starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java", + "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkDownloader.java", + "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkDownloaderDefault.java", + "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkLoader.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/AudioPermissionRequester.java", + "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CaptionSettings.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltA11yHelper.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltHttpHelper.java", + "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltMediaSession.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltService.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltSystemConfigChangeReceiver.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltTextToSpeechHelper.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CrashContextUpdateHandler.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/ErrorDialog.java", + "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/MediaImage.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/NetworkStatus.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/NullCobaltFactory.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/PlatformError.java", @@ -34,13 +40,8 @@ apk_sources = [ "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfo.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfoModule.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloader.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloaderDefault.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkLoader.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/media/CaptionSettings.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/media/CobaltMediaSession.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/Log.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridge.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridgeBuilder.java", @@ -48,7 +49,6 @@ apk_sources = [ "//starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecUtil.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaDrmBridge.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaFormatBuilder.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaImage.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoFrameReleaseTimeHelper.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceTexture.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceView.java", diff --git a/starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java b/starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java index 680eb4674dd0..20fbcdf4b4a9 100644 --- a/starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java +++ b/starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java @@ -16,11 +16,11 @@ import android.app.Activity; import android.app.Service; +import dev.cobalt.coat.ArtworkDownloaderDefault; import dev.cobalt.coat.CobaltActivity; import dev.cobalt.coat.CobaltService; import dev.cobalt.coat.StarboardBridge; import dev.cobalt.libraries.services.clientloginfo.ClientLogInfoModule; -import dev.cobalt.media.ArtworkDownloaderDefault; import dev.cobalt.util.Holder; /** diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloader.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkDownloader.java similarity index 96% rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloader.java rename to starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkDownloader.java index 7bb294d3c025..6b2f0132b165 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloader.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkDownloader.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dev.cobalt.media; +package dev.cobalt.coat; /** * Interface to download artwork (Bitmap) from a URL, intended for use in media session metadata. diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloaderDefault.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkDownloaderDefault.java similarity index 96% rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloaderDefault.java rename to starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkDownloaderDefault.java index 8cc99c22a1a8..023ec05ce6eb 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkDownloaderDefault.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkDownloaderDefault.java @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dev.cobalt.media; +package dev.cobalt.coat; -import static dev.cobalt.media.Log.TAG; +import static dev.cobalt.util.Log.TAG; import android.graphics.Bitmap; import android.graphics.BitmapFactory; diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkLoader.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkLoader.java similarity index 99% rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkLoader.java rename to starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkLoader.java index 1742a435fe37..c2c52b9f928f 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/ArtworkLoader.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ArtworkLoader.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dev.cobalt.media; +package dev.cobalt.coat; import android.graphics.Bitmap; import android.os.Handler; diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/CaptionSettings.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CaptionSettings.java similarity index 98% rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/CaptionSettings.java rename to starboard/android/apk/app/src/main/java/dev/cobalt/coat/CaptionSettings.java index 81ed4ee77e88..6f5a473879d7 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/CaptionSettings.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CaptionSettings.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dev.cobalt.media; +package dev.cobalt.coat; import android.view.accessibility.CaptioningManager; import dev.cobalt.util.UsedByNative; diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/CobaltMediaSession.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltMediaSession.java similarity index 99% rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/CobaltMediaSession.java rename to starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltMediaSession.java index e3541b56f989..c10d19798cb1 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/CobaltMediaSession.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltMediaSession.java @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dev.cobalt.media; +package dev.cobalt.coat; -import static dev.cobalt.media.Log.TAG; +import static dev.cobalt.util.Log.TAG; import android.app.Activity; import android.content.Context; @@ -50,7 +50,7 @@ public class CobaltMediaSession private AudioFocusRequest audioFocusRequest; - interface UpdateVolumeListener { + public interface UpdateVolumeListener { /** Called when there is a change in audio focus. */ void onUpdateVolume(float gain); } diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaImage.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/MediaImage.java similarity index 97% rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaImage.java rename to starboard/android/apk/app/src/main/java/dev/cobalt/coat/MediaImage.java index 899dc224ab2b..70322593b8da 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaImage.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/MediaImage.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dev.cobalt.media; +package dev.cobalt.coat; import dev.cobalt.util.UsedByNative; diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java index fe7f9c80a9ad..c0b7b209695b 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java @@ -38,11 +38,7 @@ import android.view.accessibility.AccessibilityManager; import android.view.accessibility.CaptioningManager; import androidx.annotation.Nullable; -import dev.cobalt.media.ArtworkDownloader; import dev.cobalt.media.AudioOutputManager; -import dev.cobalt.media.CaptionSettings; -import dev.cobalt.media.CobaltMediaSession; -import dev.cobalt.media.MediaImage; import dev.cobalt.util.DisplayUtil; import dev.cobalt.util.Holder; import dev.cobalt.util.Log; diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java b/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java index 9aba9c3ab797..13fdf700a525 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java @@ -25,6 +25,7 @@ import android.media.AudioTrack; import android.os.Build; import androidx.annotation.RequiresApi; +import dev.cobalt.coat.CobaltMediaSession; import dev.cobalt.util.Log; import dev.cobalt.util.UsedByNative; import java.util.ArrayList; diff --git a/starboard/android/shared/accessibility_get_caption_settings.cc b/starboard/android/shared/accessibility_get_caption_settings.cc index f5f9fe493771..3057366d1ae5 100644 --- a/starboard/android/shared/accessibility_get_caption_settings.cc +++ b/starboard/android/shared/accessibility_get_caption_settings.cc @@ -118,7 +118,7 @@ bool GetCaptionSettings(SbAccessibilityCaptionSettings* caption_settings) { ScopedLocalJavaRef j_caption_settings( env->CallStarboardObjectMethodOrAbort( - "getCaptionSettings", "()Ldev/cobalt/media/CaptionSettings;")); + "getCaptionSettings", "()Ldev/cobalt/coat/CaptionSettings;")); jfloat font_scale = env->GetFloatFieldOrAbort(j_caption_settings.Get(), "fontScale", "F"); diff --git a/starboard/android/shared/android_media_session_client.cc b/starboard/android/shared/android_media_session_client.cc index 35631b616a14..9b5f470a058b 100644 --- a/starboard/android/shared/android_media_session_client.cc +++ b/starboard/android/shared/android_media_session_client.cc @@ -191,7 +191,7 @@ void OnMediaSessionStateChanged( if (artwork_count > 0) { CobaltExtensionMediaImage* artwork(media_metadata->artwork); ScopedLocalJavaRef media_image_class( - env->FindClassExtOrAbort("dev/cobalt/media/MediaImage")); + env->FindClassExtOrAbort("dev/cobalt/coat/MediaImage")); jmethodID media_image_constructor = env->GetMethodID( media_image_class.Get(), "", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); @@ -234,7 +234,7 @@ void OnMediaSessionStateChanged( env->CallStarboardVoidMethodOrAbort( "updateMediaSession", "(IJJFLjava/lang/String;Ljava/lang/String;Ljava/lang/String;" - "[Ldev/cobalt/media/MediaImage;J)V", + "[Ldev/cobalt/coat/MediaImage;J)V", playback_state, playback_state_actions, session_state.current_playback_position / 1000, static_cast(session_state.actual_playback_rate), j_title.Get(), @@ -290,9 +290,9 @@ const void* GetMediaSessionApi() { } // namespace starboard extern "C" SB_EXPORT_PLATFORM void -Java_dev_cobalt_media_CobaltMediaSession_nativeInvokeAction(JNIEnv* env, - jclass unused_clazz, - jlong action, - jlong seek_ms) { +Java_dev_cobalt_coat_CobaltMediaSession_nativeInvokeAction(JNIEnv* env, + jclass unused_clazz, + jlong action, + jlong seek_ms) { starboard::android::shared::NativeInvokeAction(action, seek_ms); }