Skip to content

Commit

Permalink
[Cast Convergence] Remove is_chromecast from //third_party
Browse files Browse the repository at this point in the history
This CL updates the //third_party code to remove is_chromecast and
replace it with new `is_castos`, `is_cast_android` and
`enable_cast_receiver` flags as appropriate, which signify either "a
nest chromecast-hardware device", "an android cast receiving hardware
device", or "a platform which can act as a cast receiver" (such as ATV,
Fuchsia, etc) respectively.

Bug: 1219802
Change-Id: I5dc27cfc66893e26e8d3cf8f356a267620ad247e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3699108
Reviewed-by: Akihiro Ota <akihiroota@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Ryan Keane <rwkeane@google.com>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Ben Wagner <bungeman@chromium.org>
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Reviewed-by: James Zern <jzern@google.com>
Cr-Commit-Position: refs/heads/main@{#1014885}
  • Loading branch information
Ryan Keane authored and Chromium LUCI CQ committed Jun 16, 2022
1 parent 4e275d8 commit e765b04
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion third_party/blink/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ source_set("common") {
deps += [ "//ui/gfx/" ]
}

if (is_chromeos || is_android || is_win || is_chromecast || is_fuchsia) {
if (is_chromeos || is_android || is_win || is_castos || is_fuchsia) {
defines = [ "ENABLE_PROTECTED_MEDIA_IDENTIFIER_PERMISSION" ]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,19 @@ TEST_P(MediaStreamAudioProcessorTestMultichannel, MAYBE_TestAllSampleRates) {
new rtc::RefCountedObject<WebRtcAudioDeviceImpl>());
blink::AudioProcessingProperties properties;

// TODO(crbug.com/1334991): Clarify WebRTC audio processing support for 96 kHz
// input.
static const int kSupportedSampleRates[] = {
8000,
16000,
22050,
32000,
44100,
48000
#if BUILDFLAG(IS_CHROMECAST)
#if BUILDFLAG(IS_CASTOS) || BUILDFLAG(IS_CAST_ANDROID)
,
96000
#endif // BUILDFLAG(IS_CHROMECAST)
#endif // BUILDFLAG(IS_CASTOS) || BUILDFLAG(IS_CAST_ANDROID)
};
for (int sample_rate : kSupportedSampleRates) {
SCOPED_TRACE(testing::Message() << "sample_rate=" << sample_rate);
Expand All @@ -266,12 +268,14 @@ TEST_P(MediaStreamAudioProcessorTestMultichannel, MAYBE_TestAllSampleRates) {
EXPECT_TRUE(audio_processor->has_webrtc_audio_processing());
VerifyDefaultComponents(*audio_processor);

// TODO(crbug.com/1336055): Investigate why chromecast devices need special
// logic here.
int expected_sample_rate =
#if BUILDFLAG(IS_CHROMECAST)
#if BUILDFLAG(IS_CASTOS) || BUILDFLAG(IS_CAST_ANDROID)
std::min(sample_rate, media::kAudioProcessingSampleRateHz);
#else
media::kAudioProcessingSampleRateHz;
#endif // BUILDFLAG(IS_CHROMECAST)
#endif // BUILDFLAG(IS_CASTOS) || BUILDFLAG(IS_CAST_ANDROID)
const int expected_output_channels =
use_multichannel_processing ? params_.channels() : 1;
ProcessDataAndVerifyFormat(*audio_processor, mock_capture_callback_,
Expand Down
2 changes: 1 addition & 1 deletion third_party/chromevox/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import("//build/config/chromeos/ui_mode.gni")
import("//chromecast/chromecast.gni")

assert(is_chromeos_ash || is_chromecast)
assert(is_chromeos_ash || is_castos)

chromevox_out_dir = "$root_out_dir/resources/chromeos/accessibility/chromevox"

Expand Down
2 changes: 1 addition & 1 deletion third_party/expat/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import("//testing/libfuzzer/fuzzer_test.gni")
# let's not pull it in twice.
# Chromecast doesn't ship expat as a system library.
# Libfuzzer and AFL need to build library from sources.
if ((is_linux || is_chromeos) && !is_chromecast && !use_fuzzing_engine) {
if (((is_linux && !is_castos) || is_chromeos) && !use_fuzzing_engine) {
config("expat_config") {
libs = [ "expat" ]
}
Expand Down
4 changes: 2 additions & 2 deletions third_party/freetype-testing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ source_set("freetype_fuzzer_sources") {
"$_src/visitors/glyphvisitor.h",
]

if (is_linux || is_chromeos || is_chromecast) {
if (is_linux || is_chromeos || is_cast_android) {
# These sources depend on FreeType's symbol FT_Get_BDF_Charset_ID which is only built on this
# configuration/platforms, see FreeType's BUILD.gn. In turn they will only be needed by the BDF fuzzer that we built only on this configuration/platforms.
sources += [
Expand Down Expand Up @@ -282,7 +282,7 @@ freetype_fuzzer_test("type1_render") {
dict = "src/fuzzing/settings/oss-fuzz/type1.dict"
}

if (is_linux || is_chromeos || is_chromecast) {
if (is_linux || is_chromeos || is_cast_android) {
# FreeType's symbol FT_Get_BDF_Charset_ID is only built on this
# configuration, see FreeType's BUILD.gn. So build fuzzers that depend on
# this symbol only on this configuration, too.
Expand Down
2 changes: 1 addition & 1 deletion third_party/freetype/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ source_set("freetype_source") {
]
}

if (is_linux || is_chromeos || is_chromecast) {
if (is_linux || is_chromeos || is_cast_android) {
# Needed for content_shell on Linux and Chromecast, since fontconfig
# requires FT_Get_BDF_Property.
sources += [ "src/src/base/ftbdf.c" ]
Expand Down
2 changes: 1 addition & 1 deletion third_party/libaom/options.gni
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import("//build/config/gclient_args.gni")

declare_args() {
# Enable encoding and decoding AV1 video files.
enable_libaom = !is_chromeos_lacros && !is_android && !is_chromecast
enable_libaom = !is_chromeos_lacros && !is_android && !is_castos

# To be deprecated soon.
enable_libaom_decoder = false
Expand Down
2 changes: 1 addition & 1 deletion third_party/liblouis/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ liblouis_library("liblouis") {
dest_dir = "$root_build_dir/resources/chromeos/accessibility/chromevox/background/braille"
}

if (!is_chromecast) {
if (!is_castos) {
chromevox_test_data_dir = "$root_build_dir/chromevox_test_data/braille"

liblouis_library("liblouis_test_data") {
Expand Down
2 changes: 1 addition & 1 deletion third_party/minigbm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare_args() {
# Controls whether the build should use the version of minigbm library shipped
# with the system. In release builds of desktop Linux and Chrome OS we use the
# system version.
use_system_minigbm = (is_linux && !is_chromecast) || is_chromeos_lacros
use_system_minigbm = (is_linux && !is_castos) || is_chromeos_lacros

use_amdgpu_minigbm = false
use_exynos_minigbm = false
Expand Down
2 changes: 1 addition & 1 deletion third_party/wayland/features.gni
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import("//build/config/sanitizers/sanitizers.gni")
declare_args() {
# Controls whether the build should use the version of Wayland
# library shipped with the system or Chromium third_party.
use_system_libwayland = is_linux && !is_chromecast && !is_chromeos_lacros &&
use_system_libwayland = is_linux && !is_castos &&
default_toolchain != "//build/toolchain/cros:target"

# Path to wayland-scanner. Has effect only when the system libwayland is used.
Expand Down
4 changes: 2 additions & 2 deletions third_party/webrtc_overrides/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ webrtc_public_deps = [
if (defined(rtc_exclude_system_time) && rtc_exclude_system_time) {
webrtc_public_deps += [ ":system_time" ]
}
if (is_chromecast) {
if (is_castos || is_cast_android) {
webrtc_public_deps += [
"//third_party/webrtc/api:network_state_predictor_api",
"//third_party/webrtc/api/audio:audio_frame_api",
Expand All @@ -132,7 +132,7 @@ if (is_chromecast) {
"//third_party/webrtc/modules/video_coding:codec_globals_headers",
]
}
if (is_chromecast || is_nacl) {
if (is_castos || is_cast_android || is_nacl) {
# For chromecast and NaCL, provide a default field trial implementation.
webrtc_public_deps += [ "//third_party/webrtc/system_wrappers:field_trial" ]
} else {
Expand Down

0 comments on commit e765b04

Please sign in to comment.