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

Use cobalt_sandbox packages. #722

Merged
merged 5 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading