Skip to content

Commit

Permalink
Use cobalt_sandbox packages. (#722)
Browse files Browse the repository at this point in the history
* Disable Vulkan for Cobalt (#4552)

b/371272304

* Enable nplb on Linux. (#4543)

b/378879686

* [media] Change local and remote audio write durations (#4501)

This change sets the audio write ahead duration for local audio sinks to
0.5s, and the audio write ahead duration for remote audio sinks to 10s.

b/326652276

* derp

* fix docker compose

---------

Co-authored-by: Tyler Holcombe <[email protected]>
Co-authored-by: Yavor Goulishev <[email protected]>
Co-authored-by: Austin Osagie <[email protected]>
  • Loading branch information
4 people authored Dec 11, 2024
1 parent 7c2e059 commit 594daa6
Show file tree
Hide file tree
Showing 14 changed files with 300 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ runs:
run: |
set -x
cd src
tar cvf - out/${{ matrix.platform }}_${{ matrix.config }}/*tests out/${{ matrix.platform }}_${{ matrix.config }}/*.so out/${{ matrix.platform }}_${{ matrix.config }}/*.so.* out/${{ matrix.platform }}_${{ matrix.config }}/starboard/*.so.* | xz -T0 -1 -z - > test_artifacts.tar.xz
tar cvf - out/${{ matrix.platform }}_${{ matrix.config }}/*tests out/${{ matrix.platform }}_${{ matrix.config }}/nplb out/${{ matrix.platform }}_${{ matrix.config }}/*.so out/${{ matrix.platform }}_${{ matrix.config }}/*.so.* out/${{ matrix.platform }}_${{ matrix.config }}/starboard/*.so.* out/${{ matrix.platform }}_${{ matrix.config }}/content/test | xz -T0 -1 -z - > test_artifacts.tar.xz
shell: bash
- name: Upload Test artifacts
if: startsWith(matrix.platform, 'linux') && matrix.config == 'devel'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/on_host_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:
export LD_LIBRARY_PATH="${GITHUB_WORKSPACE}"/unit_test/out/${{ matrix.platform }}_${{ matrix.config }}/starboard:"${GITHUB_WORKSPACE}"/unit_test/out/${{ matrix.platform }}_${{ matrix.config }}
cd ${GITHUB_WORKSPACE}/unit_test
for test_binary in $(ls -d out/**/*tests); do
for test_binary in $(ls -d out/**/*tests out/**/nplb); do
# TODO(b/372303096): Need dedicated xvfb runner.
echo "Running tests for suite: ${test_binary}"
Expand Down
4 changes: 2 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ vars = {
# Fetch configuration files required for the 'use_remoteexec' gn arg
'download_remoteexec_cfg': False,
# RBE instance to use for running remote builds
'rbe_instance': Str('projects/rbe-chrome-untrusted/instances/default_instance'),
'rbe_instance': Str('projects/cobalt-actions-devel/instances/default_instance'),
# RBE project to download rewrapper config files for. Only needed if
# different from the project used in 'rbe_instance'
'rewrapper_cfg_project': Str(''),
'rewrapper_cfg_project': Str('rbe-chrome-untrusted'),
# reclient CIPD package
'reclient_package': 'infra/rbe/client/',
# reclient CIPD package version
Expand Down
5 changes: 0 additions & 5 deletions cobalt/build/configs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ config("cobalt_config") {
if (current_toolchain == starboard_toolchain) {
configs += [ "//${starboard_path}/platform_configuration" ]
}

defines = [
"ENABLE_BUILDFLAG_IS_COBALT",
"OS_STARBOARD",
]
}

config("default_includes") {
Expand Down
33 changes: 17 additions & 16 deletions cobalt/cobalt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,23 @@ int main(int argc, const char** argv) {

// TODO: (cobalt b/375241103) Reimplement this in a clean way.

constexpr auto cobalt_args = std::to_array<const char*>({
// Disable first run experience, kiosk, etc.
"--disable-fre", "--no-first-run", "--kiosk",
// Enable Blink to work in overlay video mode
"--force-video-overlays",
// Disable multiprocess mode.
"--single-process",
// TODO(mcasas): Add "--ozone-platform=starboard".
// Enable remote Devtools access.
"--remote-debugging-port=9222",
"--remote-allow-origins=http://localhost:9222",
// This flag is added specifically for m114 and should be removed after
// rebasing to m120+
"--user-level-memory-pressure-signal-params",
"https://www.youtube.com/tv"
});
constexpr auto cobalt_args = std::to_array<const char*>(
{// Disable first run experience, kiosk, etc.
"--disable-fre", "--no-first-run", "--kiosk",
// Enable Blink to work in overlay video mode
"--force-video-overlays",
// Disable multiprocess mode.
"--single-process",
// Disable Vulkan.
"--disable-features=Vulkan",
// TODO(mcasas): Add "--ozone-platform=starboard".
// Enable remote Devtools access.
"--remote-debugging-port=9222",
"--remote-allow-origins=http://localhost:9222",
// This flag is added specifically for m114 and should be removed after
// rebasing to m120+
"--user-level-memory-pressure-signal-params",
"https://www.youtube.com/tv"});
std::vector<const char*> args(argv, argv + argc);
args.insert(args.end(), cobalt_args.begin(), cobalt_args.end());

Expand Down
13 changes: 13 additions & 0 deletions cobalt/testing/linux/nplb_filter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"failing_tests": [
"SbDrmTest.AnySupportedKeySystems",
"SbMediaCanPlayMimeAndKeySystem.AnySupportedKeySystems",
"SbSystemGetLocaleIdTest.SunnyDay",
"SbMediaSetAudioWriteDurationTests/SbMediaSetAudioWriteDurationTest.*",
"MultiplePlayerTests/MultiplePlayerTest.*",
"SbPlayerGetAudioConfigurationTests/SbPlayerGetAudioConfigurationTest.*",
"SbPlayerGetMediaTimeTests/SbPlayerGetMediaTimeTest.*",
"SbPlayerWriteSampleTests/SbPlayerWriteSampleTest.*",
"VerticalVideoTests/VerticalVideoTest.*"
]
}
16 changes: 15 additions & 1 deletion content/renderer/media/media_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ namespace {
// to be many of those. See http://crbug.com/1232649
constexpr size_t kDefaultMaxWebMediaPlayers = 1000;

#if BUILDFLAG(USE_STARBOARD_MEDIA)
// The following variables match |kSbPlayerWriteDurationLocal|
// and |kSbplayerWriteDurationRemote| in //starboard/player.h.
//
// The audio write duration when all the audio connectors are local.
const base::TimeDelta kWriteDurationLocal = base::Milliseconds(500);
// The audio write duration when at least one of the audio connectors are
// remote.
const base::TimeDelta kWriteDurationRemote = base::Seconds(10);
#endif // BUILDFLAG(USE_STARBOARD_MEDIA)

size_t GetMaxWebMediaPlayers() {
static const size_t kMaxWebMediaPlayers = []() {
auto* command_line = base::CommandLine::ForCurrentProcess();
Expand Down Expand Up @@ -752,7 +763,10 @@ MediaFactory::CreateRendererFactorySelector(
// TODO(b/326827007): Revisit renderer to support secondary videos.
factory_selector->AddFactory(
RendererType::kStarboard,
std::make_unique<media::StarboardRendererFactory>(media_log));
std::make_unique<media::StarboardRendererFactory>(
media_log,
// TODO: b/383327725 - Cobalt: Inject these values from the web app.
kWriteDurationLocal, kWriteDurationRemote));
factory_selector->SetBaseRendererType(RendererType::kStarboard);
#else // BUILDFLAG(USE_STARBOARD_MEDIA)
auto renderer_impl_factory = CreateRendererImplFactory(
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:
build:
context: cobalt/docker/linux
cache_from:
- ghcr.io/youtube/cobalt/linux:latest
image: ghcr.io/youtube/cobalt/linux:latest
- ghcr.io/youtube/cobalt_sandbox/linux:latest
image: ghcr.io/youtube/cobalt_sandbox/linux:latest
platform: linux/amd64
environment:
- DEPOT_TOOLS_UPDATE=0
3 changes: 0 additions & 3 deletions media/starboard/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ source_set("starboard") {
visibility = [ "//media" ]

defines = [
# TODO(b/326652276): Support audio write ahead
"COBALT_MEDIA_ENABLE_AUDIO_DURATION=0",

# TODO(b/326508279): Revisit background mode
"COBALT_MEDIA_ENABLE_BACKGROUND_MODE=0",

Expand Down
Loading

0 comments on commit 594daa6

Please sign in to comment.