Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[media] Add runtime flag to disable StarboardRenderer #4407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

borongc
Copy link
Contributor

@borongc borongc commented Nov 9, 2024

Currently, when use_starboard_media=true, Cobalt.apk uses StarboardRenderer by default. This PR allows Cobalt.apk to select either StarboardRenderer or default Chromium renderer at runtime.

Chromium on android uses Surface Control to manage SurfaceView for overlay video mode, which is different from StarboardRenderer. This enables Cobalt team to profile the performance of different renderers, and develop/debug StarboardRenderer. This will be revisited to support secondary videos.

  1. Allow to disable StarboardRenderer via adb shell am start --esa commandLineArgs "--disable-starboard-renderer".
  2. Add StarboardRendererFactory for MediaFactory to select StarboardRenderer when use_starboard_media=true.
  3. Remove hard code StarboardRenderer in WebMediaPlayerImpl.

b/375278384

@borongc borongc requested a review from a team as a code owner November 9, 2024 02:06
@borongc borongc changed the title [media] Add StarboardRendererFactory [media] Add runtime flags to disable StarboardRenderer Nov 9, 2024
@borongc borongc changed the title [media] Add runtime flags to disable StarboardRenderer [media] Add runtime flag to disable StarboardRenderer Nov 9, 2024
@borongc borongc force-pushed the android_renderer branch 3 times, most recently from bdb50e6 to 1f4d7be Compare November 9, 2024 06:38
@borongc borongc requested review from yell0wd0g, jasonzhangxx and xiaomings and removed request for dahlstrom-g November 11, 2024 17:45
Copy link
Contributor

@yell0wd0g yell0wd0g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits. Is there a strong reason to have this as a
runtime switch and not just as a build flag (i.e. build
and use StarboardRenderer, or not)? I'm saying this
because if we give this option, we should test it, which
in turn means more configuration runs. If there's no
strong reason I'd vote for built-time only, which is
easier to debug by non-cobalt developers.

media/base/media_switches.h Show resolved Hide resolved
media/base/renderer.h Show resolved Hide resolved
1. Add StarboardRendererFactory for MediaFactory to select StarboardRenderer when `use_starboard_media=true`.
2. Remove hard code StarboardRenderer in WebMediaPlayerImpl.

Note RendererType::kStarboard cannot be gated due to mojom files.

b/375278384
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants