Skip to content

Commit

Permalink
Merge branch 'main' into jni-1227
Browse files Browse the repository at this point in the history
  • Loading branch information
haozheng-cobalt authored Jan 6, 2025
2 parents 6944f5e + 7e87947 commit fb25827
Show file tree
Hide file tree
Showing 35 changed files with 156 additions and 190 deletions.
13 changes: 9 additions & 4 deletions .github/actions/process_test_results/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ runs:
name: ${{ inputs.test_results_key }}
path: results/

- name: Publish Test Report
- name: Test Summary action
continue-on-error: true
uses: mikepenz/action-junit-report@992d97d6eb2e5f3de985fbf9df6a04386874114d
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86
with:
report_paths: results/*.xml
skip_annotations: true
paths: "results/*.xml"
output: test-report-summary.md
show: "fail, skip"

- name: Output test summary markdown to github
run: cat test-report-summary.md >> $GITHUB_STEP_SUMMARY
shell: bash

- name: Get Datadog CLI
id: download-dd-cli
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
matrix:
platform: ${{ fromJson(needs.initialize.outputs.platforms) }}
include: ${{ fromJson(needs.initialize.outputs.includes) }}
config: [devel, debug, qa, gold]
config: [devel, qa, gold]
container: ${{ needs.docker-build-image.outputs.docker_tag }}
env:
TEST_ARTIFACTS_KEY: ${{ matrix.platform }}_${{ matrix.name }}_test_artifacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ protected void createContent(final Bundle savedInstanceState) {
if (!CommandLine.isInitialized()) {
((CobaltApplication) getApplication()).initCommandLine();

// Note that appendSwitchesAndArguments excludes cobaltCommandLineParams[0]
// as the program name, and all other arguments SHOULD start with '--'.
String[] cobaltCommandLineParams =
new String[] {
"",
// Disable first run experience.
"--disable-fre",
// Disable user prompts in the first run.
Expand All @@ -125,6 +122,8 @@ protected void createContent(final Bundle savedInstanceState) {
"--enable-features=LogJsConsoleMessages",
// Disable rescaling Webpage.
"--force-device-scale-factor=1",
// Enable low end device mode.
"--enable-low-end-device-mode",
};
CommandLine.getInstance().appendSwitchesAndArguments(cobaltCommandLineParams);

Expand Down
2 changes: 1 addition & 1 deletion cobalt/build/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_build_args(build_args_path):
},
'qa': {
'symbol_level': 1,
'is_debug': 'false'
'is_official_build': 'true'
},
'gold': {
'symbol_level': 0,
Expand Down
6 changes: 2 additions & 4 deletions cobalt/devinfra/kokoro/bin/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
set -x

REPO_ROOT="$(dirname "$0")/../../.."
# After kokoro build finishes, changed files in c:/tmpfs get rsync'ed to a borg executor,
# from where the artifacts and reports are processed.
# Especially on Windows, the rsync can take long time, so we cleanup the cobalt workspace
# after finishing each build.
set +e
pushd $REPO_ROOT
time git clean -fdx
popd
git config --global --add safe.directory "${WORKSPACE_COBALT}"
time git -C "${WORKSPACE_COBALT}" clean -dfx
exit 0
4 changes: 0 additions & 4 deletions cobalt/devinfra/kokoro/bin/dind_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
# Kokoro Instance
# └── Generic DinD Image
# ├── dind_builder_runner.sh
# │ ├── configure_environment (common.sh)
# │ ├── main_build_image_and_run.py
# │ │ └── Specific Cobalt Image
# │ │ └── dind_build.sh <= THIS SCRIPT
# │ └── run_package_release_pipeline (common.sh)
# └── dind_runner.sh
# ├── configure_environment (common.sh)
# ├── main_pull_image_and_run.py
# │ └── Specific Cobalt Image
# │ └── dind_build.sh <= THIS SCRIPT
Expand Down Expand Up @@ -44,8 +42,6 @@ fi

WORKSPACE_COBALT="${KOKORO_ARTIFACTS_DIR}/git/src"

configure_environment

pipeline () {
local out_dir="${WORKSPACE_COBALT}/out/${TARGET_PLATFORM}_${CONFIG}"
local gclient_root="${KOKORO_ARTIFACTS_DIR}/chromium"
Expand Down
4 changes: 0 additions & 4 deletions cobalt/devinfra/kokoro/bin/dind_builder_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
# Kokoro Instance
# └── Generic DinD Image
# ├── dind_builder_runner.sh <== THIS SCRIPT
# │ ├── configure_environment (common.sh)
# │ ├── main_build_image_and_run.py
# │ │ └── Specific Cobalt Image
# │ │ └── dind_build.sh
# │ └── run_package_release_pipeline (common.sh)
# └── dind_runner.sh
# ├── configure_environment (common.sh)
# ├── main_pull_image_and_run.py
# │ └── Specific Cobalt Image
# │ └── dind_build.sh
Expand All @@ -34,8 +32,6 @@ trap "bash ${WORKSPACE_COBALT}/cobalt/devinfra/kokoro/bin/cleanup.sh" EXIT INT T

configure_dind_environment

configure_environment

set -x
# The python script is responsible for running containerized Cobalt builds.
python3 "${WORKSPACE_COBALT}/cobalt/devinfra/kokoro/bin/dind_py/main_build_image_and_run.py"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@
Kokoro Instance
└── Generic DinD Image
├── dind_builder_runner.sh
│ ├── configure_environment (common.sh)
│ ├── main_build_image_and_run.py <= THIS SCRIPT
│ │ └── Specific Cobalt Image
│ │ └── dind_build.sh
│ └── run_package_release_pipeline (common.sh)
└── dind_runner.sh
├── configure_environment (common.sh)
├── main_pull_image_and_run.py
│ └── Specific Cobalt Image
│ └── dind_build.sh
Expand Down
2 changes: 0 additions & 2 deletions cobalt/devinfra/kokoro/bin/dind_py/main_pull_image_and_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@
Kokoro Instance
└── Generic DinD Image
├── dind_builder_runner.sh
│ ├── configure_environment (common.sh)
│ ├── main_build_image_and_run.py
│ │ └── Specific Cobalt Image
│ │ └── dind_build.sh
│ └── run_package_release_pipeline (common.sh)
└── dind_runner.sh
├── configure_environment (common.sh)
├── main_pull_image_and_run.py <= THIS SCRIPT
│ └── Specific Cobalt Image
│ └── dind_build.sh
Expand Down
4 changes: 0 additions & 4 deletions cobalt/devinfra/kokoro/bin/dind_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
# Kokoro Instance
# └── Generic DinD Image
# ├── dind_builder_runner.sh
# │ ├── configure_environment (common.sh)
# │ ├── main_build_image_and_run.py
# │ │ └── Specific Cobalt Image
# │ │ └── dind_build.sh
# │ └── run_package_release_pipeline (common.sh)
# └── dind_runner.sh <== THIS SCRIPT
# ├── configure_environment (common.sh)
# ├── main_pull_image_and_run.py
# │ └── Specific Cobalt Image
# │ └── dind_build.sh
Expand All @@ -34,8 +32,6 @@ trap "bash ${WORKSPACE_COBALT}/cobalt/devinfra/kokoro/bin/cleanup.sh" EXIT INT T

configure_dind_environment

configure_environment

set -x
# The python script is responsible for running containerized Cobalt builds.
python3 "${WORKSPACE_COBALT}/cobalt/devinfra/kokoro/bin/dind_py/main_pull_image_and_run.py"
Expand Down
1 change: 0 additions & 1 deletion starboard/android/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ static_library("starboard_platform") {
"//starboard/shared/starboard/command_line.cc",
"//starboard/shared/starboard/command_line.h",
"//starboard/shared/starboard/decode_target/decode_target_get_info.cc",
"//starboard/shared/starboard/decode_target/decode_target_internal.cc",
"//starboard/shared/starboard/decode_target/decode_target_internal.h",
"//starboard/shared/starboard/decode_target/decode_target_release.cc",
"//starboard/shared/starboard/drm/drm_close_session.cc",
Expand Down
2 changes: 2 additions & 0 deletions starboard/android/shared/android_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "starboard/event.h"
#include "starboard/log.h"
#include "starboard/shared/starboard/command_line.h"
#include "starboard/shared/starboard/log_mutex.h"
#include "starboard/thread.h"
#if SB_IS(EVERGREEN_COMPATIBLE)
#include "starboard/crashpad_wrapper/wrapper.h" // nogncheck
Expand Down Expand Up @@ -283,6 +284,7 @@ Java_dev_cobalt_coat_StarboardBridge_startNativeStarboard(JniEnvExt* env) {
#if SB_IS(EVERGREEN_COMPATIBLE)
StarboardThreadLaunch();
#else
starboard::shared::starboard::GetLoggingMutex();
auto command_line = std::make_unique<CommandLine>(GetArgs());
LogInit(*command_line);
auto* nativeApp = new ApplicationAndroid(std::move(command_line));
Expand Down
2 changes: 1 addition & 1 deletion starboard/android/shared/application_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ApplicationAndroid::ApplicationAndroid(
"getResourceOverlay", "()Ldev/cobalt/coat/ResourceOverlay;");
resource_overlay_ = env->ConvertLocalRefToGlobalRef(local_ref);

SbAudioSinkPrivate::Initialize();
::starboard::shared::starboard::audio_sink::SbAudioSinkImpl::Initialize();

app_start_timestamp_ = starboard_bridge_->GetAppStartTimestamp();

Expand Down
16 changes: 13 additions & 3 deletions starboard/android/shared/audio_track_audio_sink_type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -561,20 +561,30 @@ int AudioTrackAudioSinkType::GetMinBufferSizeInFramesInternal(
} // namespace android
} // namespace starboard

namespace starboard {
namespace shared {
namespace starboard {
namespace audio_sink {

// static
void SbAudioSinkPrivate::PlatformInitialize() {
void SbAudioSinkImpl::PlatformInitialize() {
SB_DCHECK(!audio_track_audio_sink_type_);
audio_track_audio_sink_type_ =
new starboard::android::shared::AudioTrackAudioSinkType;
new ::starboard::android::shared::AudioTrackAudioSinkType;
SetPrimaryType(audio_track_audio_sink_type_);
EnableFallbackToStub();
audio_track_audio_sink_type_->TestMinRequiredFrames();
}

// static
void SbAudioSinkPrivate::PlatformTearDown() {
void SbAudioSinkImpl::PlatformTearDown() {
SB_DCHECK(audio_track_audio_sink_type_ == GetPrimaryType());
SetPrimaryType(NULL);
delete audio_track_audio_sink_type_;
audio_track_audio_sink_type_ = NULL;
}

} // namespace audio_sink
} // namespace starboard
} // namespace shared
} // namespace starboard
3 changes: 2 additions & 1 deletion starboard/android/shared/audio_track_audio_sink_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ class AudioTrackAudioSinkType : public SbAudioSinkPrivate::Type {
bool has_remote_audio_output_ = false;
};

class AudioTrackAudioSink : public SbAudioSinkPrivate {
class AudioTrackAudioSink
: public ::starboard::shared::starboard::audio_sink::SbAudioSinkImpl {
public:
AudioTrackAudioSink(
Type* type,
Expand Down
3 changes: 2 additions & 1 deletion starboard/android/shared/player_components_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class AudioRendererSinkAndroid : public ::starboard::shared::starboard::player::
SbAudioSinkPrivate::ErrorFunc error_func,
void* context) {
auto type = static_cast<AudioTrackAudioSinkType*>(
SbAudioSinkPrivate::GetPreferredType());
::starboard::shared::starboard::audio_sink::SbAudioSinkImpl::
GetPreferredType());

return type->Create(
channels, sampling_frequency_hz, audio_sample_type,
Expand Down
2 changes: 1 addition & 1 deletion starboard/android/shared/starboard_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace android {
namespace shared {

extern "C" SB_EXPORT_PLATFORM void JNI_StarboardBridge_OnStop(JNIEnv* env) {
SbAudioSinkPrivate::TearDown();
::starboard::shared::starboard::audio_sink::SbAudioSinkImpl::TearDown();
SbFileAndroidTeardown();
}

Expand Down
26 changes: 18 additions & 8 deletions starboard/linux/shared/audio_sink_type_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,38 @@
#include "starboard/shared/pulse/pulse_audio_sink_type.h"
#include "starboard/shared/starboard/audio_sink/audio_sink_internal.h"

namespace starboard {
namespace shared {
namespace starboard {
namespace audio_sink {
namespace {
bool is_fallback_to_alsa = false;
}
} // namespace

// static
void SbAudioSinkPrivate::PlatformInitialize() {
starboard::shared::pulse::PlatformInitialize();
void SbAudioSinkImpl::PlatformInitialize() {
::starboard::shared::pulse::PlatformInitialize();
if (GetPrimaryType()) {
SB_LOG(INFO) << "Use PulseAudio";
} else {
SB_LOG(INFO) << "Use ALSA";
starboard::shared::alsa::PlatformInitialize();
::starboard::shared::alsa::PlatformInitialize();
is_fallback_to_alsa = true;
}
SbAudioSinkPrivate::EnableFallbackToStub();
::starboard::shared::starboard::audio_sink::SbAudioSinkImpl::
EnableFallbackToStub();
}

// static
void SbAudioSinkPrivate::PlatformTearDown() {
void SbAudioSinkImpl::PlatformTearDown() {
if (is_fallback_to_alsa) {
starboard::shared::alsa::PlatformTearDown();
::starboard::shared::alsa::PlatformTearDown();
} else {
starboard::shared::pulse::PlatformTearDown();
::starboard::shared::pulse::PlatformTearDown();
}
}

} // namespace audio_sink
} // namespace starboard
} // namespace shared
} // namespace starboard
4 changes: 2 additions & 2 deletions starboard/nplb/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ test("nplb") {
"//starboard/nplb/sabi/struct_alignment_test.cc",
"//starboard/shared/starboard/drm/drm_test_helpers.cc",
"//starboard/shared/starboard/drm/drm_test_helpers.h",
"//starboard/testing/fake_graphics_context_provider.cc",
"//starboard/testing/fake_graphics_context_provider.h",
"align_test.cc",
"audio_sink_create_test.cc",
"audio_sink_destroy_test.cc",
Expand Down Expand Up @@ -219,8 +221,6 @@ test("nplb") {

if (!is_android) {
sources += [
"//starboard/testing/fake_graphics_context_provider.cc",
"//starboard/testing/fake_graphics_context_provider.h",
"maximum_player_configuration_explorer_test.cc",
"media_set_audio_write_duration_test.cc",
"multiple_player_test.cc",
Expand Down
3 changes: 1 addition & 2 deletions starboard/nplb/maximum_player_configuration_explorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
#include "starboard/nplb/player_test_util.h"
#include "starboard/player.h"
#include "starboard/shared/starboard/media/media_util.h"
// TODO(cobalt, b/377295011): remove the nogncheck annotation.
#include "starboard/testing/fake_graphics_context_provider.h" // nogncheck
#include "starboard/testing/fake_graphics_context_provider.h"

namespace starboard {
namespace nplb {
Expand Down
3 changes: 0 additions & 3 deletions starboard/nplb/player_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include "starboard/nplb/maximum_player_configuration_explorer.h"
#include "starboard/nplb/player_creation_param_helpers.h"
#include "starboard/shared/starboard/player/video_dmp_reader.h"
// TODO(cobalt, b/377295011): remove the nogncheck annotation.
#include "starboard/testing/fake_graphics_context_provider.h" // nogncheck
#include "testing/gtest/include/gtest/gtest.h"

namespace starboard {
Expand All @@ -40,7 +38,6 @@ using std::placeholders::_1;
using std::placeholders::_2;
using std::placeholders::_3;
using std::placeholders::_4;
using testing::FakeGraphicsContextProvider;

const char* kAudioTestFiles[] = {
"beneath_the_canopy_aac_stereo.dmp",
Expand Down
4 changes: 2 additions & 2 deletions starboard/raspi/shared/application_dispmanx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ bool ApplicationDispmanx::DestroyWindow(SbWindow window) {
}

void ApplicationDispmanx::Initialize() {
SbAudioSinkPrivate::Initialize();
::starboard::shared::starboard::audio_sink::SbAudioSinkImpl::Initialize();
}

void ApplicationDispmanx::Teardown() {
ShutdownDispmanx();
SbAudioSinkPrivate::TearDown();
::starboard::shared::starboard::audio_sink::SbAudioSinkImpl::TearDown();
}

void ApplicationDispmanx ::OnSuspend() {
Expand Down
Loading

0 comments on commit fb25827

Please sign in to comment.