Skip to content

Commit

Permalink
Merge branch 'main' into sourcebuffer-writehead
Browse files Browse the repository at this point in the history
  • Loading branch information
osagie98 authored Jan 7, 2025
2 parents cb3f9f2 + 6c07cf6 commit 6295b6a
Show file tree
Hide file tree
Showing 44 changed files with 198 additions and 206 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,12 @@ 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",
// Disables RGBA_4444 textures which
// causes rendering artifacts when
// low-end-device-mode is enabled.
"--disable-rgba-4444-textures",
};
CommandLine.getInstance().appendSwitchesAndArguments(cobaltCommandLineParams);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ protected void onActivityStop(Activity activity) {
activityHolder.set(null);
}
sysConfigChangeReceiver.setForeground(false);
afterStopped();
}

protected void onActivityDestroy(Activity activity) {
if (applicationStopped) {
// We can't restart the starboard app, so kill the process for a clean start next time.
Log.i(TAG, "Activity destroyed after shutdown; killing app.");
closeNativeStarboard(nativeApp);
closeAllServices();
System.exit(0);
} else {
Log.i(TAG, "Activity destroyed without shutdown; app suspended in background.");
Expand Down Expand Up @@ -233,14 +233,19 @@ protected void beforeSuspend() {
}
}

@SuppressWarnings("unused")
@UsedByNative
protected void afterStopped() {
applicationStopped = true;
private void closeAllServices() {
ttsHelper.shutdown();
for (CobaltService service : cobaltServices.values()) {
service.afterStopped();
}
}

// Warning: "Stopped" refers to Starboard "Stopped" event, it's different from Android's "onStop".
@SuppressWarnings("unused")
@UsedByNative
protected void afterStopped() {
applicationStopped = true;
closeAllServices();
Activity activity = activityHolder.get();
if (activity != null) {
// Wait until the activity is destroyed to exit.
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
6 changes: 0 additions & 6 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 @@ -42,10 +40,6 @@ fi
# Load common routines (we only need run_gn and ninja_build).
. $(dirname "$0")/common.sh

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
4 changes: 0 additions & 4 deletions cobalt/devinfra/kokoro/bin/dind_py/dind_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
# within the inner Docker container.
_INTERNAL_KOKORO_BUILD_SCRIPT = 'cobalt/devinfra/kokoro/bin/dind_build.sh'

_WORKSPACE_COBALT_VAR = 'WORKSPACE_COBALT'

_SERVICE_NOT_FOUND = 'SERVICE_NOT_FOUND'

_PLATFORM_TO_SERVICE_MAP = {
'android-x86': 'linux',
'android-arm': 'linux',
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: 1 addition & 0 deletions cobalt/devinfra/kokoro/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ services:
SCCACHE_GCS_OAUTH_URL: ${SCCACHE_GCS_OAUTH_URL}
SCCACHE_GCS_RW_MODE: ${SCCACHE_GCS_RW_MODE}
SCCACHE_IDLE_TIMEOUT: ${SCCACHE_IDLE_TIMEOUT}
WORKSPACE_COBALT: ${WORKSPACE_COBALT}
# Kokoro Specific Variables to forward:
KOKORO_ARTIFACTS_DIR: ${KOKORO_ARTIFACTS_DIR}
KOKORO_BUILD_ARTIFACTS_SUBDIR: ${KOKORO_BUILD_ARTIFACTS_SUBDIR}
Expand Down
11 changes: 11 additions & 0 deletions cobalt/user_agent/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if (is_android) {
import("//build/config/android/abi.gni")
}

static_library("user_agent") {
sources = [
"user_agent_platform_info.cc",
Expand All @@ -24,4 +28,11 @@ static_library("user_agent") {
"//starboard/common",
"//v8:v8_version",
]

if (is_android) {
defines = [
# Enable compile-time decisions based on the ABI
"ANDROID_ABI=$android_app_abi",
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import("//starboard/android/shared/platform_configuration/configuration.gni")

android_abi = "armeabi-v7a"
arm_float_abi = "softfp"

sb_evergreen_compatible_package = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@

import("//starboard/android/shared/platform_configuration/configuration.gni")

android_abi = "arm64-v8a"
sabi_path = "//starboard/sabi/arm64/sabi-v$sb_api_version.json"
sb_evergreen_compatible_package = true
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 @@ -310,6 +311,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 @@ -27,7 +27,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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import("//starboard/android/shared/platform_configuration/configuration.gni")

android_abi = "x86"
sabi_path = "//starboard/sabi/x86/sabi-v$sb_api_version.json"

sb_enable_opus_sse = false
Loading

0 comments on commit 6295b6a

Please sign in to comment.