Commit b1a90863 authored by Yuta Hijikata's avatar Yuta Hijikata Committed by Chromium LUCI CQ

LaCrOS: Replace defined(OS_CHROMEOS) with BUILDFLAG(IS_CHROMEOS_ASH)

The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with
is_chromeos_ash with some special cases (For those cases please
refer to http://go/lacros-macros).

The patch is made in preparation to switching lacros build from
target_os=linux to target_os=chromeos. This will prevent lacros from
changing behaviour after the switch.

Bug: 1052397
Change-Id: I7dcde45e914fc89cf122abff35313d084593418f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2596278Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843953}
parent c3c638d1
......@@ -274,7 +274,7 @@ source_set("audio") {
"cras/audio_manager_chromeos.h",
]
deps += [ "//chromeos/audio" ]
} else if (is_linux) {
} else if (is_linux || is_chromeos_lacros) {
sources += [
"cras/audio_manager_cras.cc",
"cras/audio_manager_cras.h",
......
......@@ -60,7 +60,7 @@
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/dbus/audio/fake_cras_audio_client.h"
#include "media/audio/cras/audio_manager_chromeos.h"
#elif defined(USE_CRAS) && defined(OS_LINUX)
#elif defined(USE_CRAS) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#include "media/audio/cras/audio_manager_cras.h"
#endif
......
......@@ -450,12 +450,15 @@ const base::Feature kUseR16Texture{"use-r16-texture",
const base::Feature kUnifiedAutoplay{"UnifiedAutoplay",
base::FEATURE_ENABLED_BY_DEFAULT};
#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || defined(OS_FREEBSD) || BUILDFLAG(IS_CHROMEOS_LACROS)
// Enable vaapi video decoding on linux. This is already enabled by default on
// chromeos, but needs an experiment on linux.
const base::Feature kVaapiVideoDecodeLinux{"VaapiVideoDecoder",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif // (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS)
#endif // defined(OS_LINUX) || defined(OS_FREEBSD) ||
// BUILDFLAG(IS_CHROMEOS_LACROS)
// Enable VA-API hardware decode acceleration for AV1.
const base::Feature kVaapiAV1Decoder{"VaapiAV1Decoder",
......
......@@ -180,9 +180,12 @@ MEDIA_EXPORT extern const base::Feature kUseFakeDeviceForMediaStream;
MEDIA_EXPORT extern const base::Feature kUseMediaHistoryStore;
MEDIA_EXPORT extern const base::Feature kUseR16Texture;
MEDIA_EXPORT extern const base::Feature kUseSodaForLiveCaption;
#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_FREEBSD)
MEDIA_EXPORT extern const base::Feature kVaapiVideoDecodeLinux;
#endif // (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS)
#endif // (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) ||
// defined(OS_FREEBSD)
MEDIA_EXPORT extern const base::Feature kVaapiAV1Decoder;
MEDIA_EXPORT extern const base::Feature kVaapiLowPowerEncoderGen9x;
MEDIA_EXPORT extern const base::Feature kVaapiVP8Encoder;
......
......@@ -117,7 +117,7 @@
DISABLED_UsingRealWebcam_CaptureWithSize
#define MAYBE_UsingRealWebcam_CheckPhotoCallbackRelease \
UsingRealWebcam_CheckPhotoCallbackRelease
#elif defined(OS_LINUX)
#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
// UsingRealWebcam_AllocateBadSize will hang when a real camera is attached and
// if more than one test is trying to use the camera (even across processes). Do
// NOT renable this test without fixing the many bugs associated with it:
......
......@@ -39,7 +39,7 @@ const char kComponentPlatform[] =
"win";
#elif BUILDFLAG(IS_CHROMEOS_ASH)
"cros";
#elif defined(OS_LINUX)
#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
"linux";
#else
"unsupported_platform";
......
......@@ -13,7 +13,7 @@ import("//build/config/chromeos/ui_mode.gni")
# Explicitly define what we use to avoid confusion.
if (is_chromeos_ash) {
component_os = "cros"
} else if (is_linux) {
} else if (is_linux || is_chromeos_lacros) {
component_os = "linux"
} else if (is_win) {
component_os = "win"
......@@ -31,7 +31,7 @@ component_arch = "$current_cpu"
# - |cdm_platform_specific_path| is exported as a BUILDFLAG to cdm_paths.cc.
# - When updating the condition here, also update the condition on the define
# of CDM_USE_PLATFORM_SPECIFIC_PATH in cdm_paths_unittest.cc.
if (is_win || is_mac || is_linux) {
if (is_win || is_mac || is_linux || is_chromeos_lacros) {
cdm_platform_specific_path =
"_platform_specific/$component_os" + "_" + "$component_arch"
......
......@@ -21,8 +21,8 @@ declare_args() {
# is typically the case on x86-based ChromeOS devices.
# VA-API should also be compiled by default on x11-using linux devices
# using x86/x64.
use_vaapi =
is_linux && use_x11 && (current_cpu == "x86" || current_cpu == "x64")
use_vaapi = (is_linux || is_chromeos_lacros) && use_x11 &&
(current_cpu == "x86" || current_cpu == "x64")
# Indicates if ChromeOS protected media support exists. This is used
# to enable the CDM daemon in Chrome OS as well as support for
......
......@@ -4,6 +4,8 @@
#include "media/gpu/vaapi/vaapi_common.h"
#include "build/chromeos_buildflags.h"
namespace media {
VaapiH264Picture::VaapiH264Picture(scoped_refptr<VASurface> va_surface)
......
......@@ -4,6 +4,7 @@
#ifndef MEDIA_GPU_VAAPI_VAAPI_COMMON_H_
#define MEDIA_GPU_VAAPI_VAAPI_COMMON_H_
#include "build/chromeos_buildflags.h"
#include "media/gpu/h264_dpb.h"
#include "media/gpu/vaapi/va_surface.h"
#include "media/gpu/vp8_picture.h"
......
......@@ -15,6 +15,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/trace_event/trace_event.h"
#include "build/chromeos_buildflags.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/format_utils.h"
#include "media/base/media_switches.h"
......
......@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "build/chromeos_buildflags.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/cdm_context.h"
#include "media/gpu/decode_surface_handler.h"
......
......@@ -27,6 +27,7 @@
#include "base/optional.h"
#include "base/synchronization/lock.h"
#include "base/thread_annotations.h"
#include "build/chromeos_buildflags.h"
#include "media/gpu/media_gpu_export.h"
#include "media/gpu/vaapi/va_surface.h"
#include "media/gpu/vaapi/vaapi_utils.h"
......
......@@ -158,8 +158,8 @@ declare_args() {
# will be hosted in the mojo CDM service running in the CDM (utility) process.
# On Fuchsia, this is only enabled to build libclearkeycdm.so, the mojo CDM
# service is not used.
enable_library_cdms = (is_linux && !is_chromecast) || is_chromeos || is_mac ||
is_win || is_fuchsia
enable_library_cdms = (is_linux && !is_chromecast) || is_chromeos_lacros ||
is_chromeos_ash || is_mac || is_win || is_fuchsia
declare_args() {
# When enabled, this feature allows developers to use a runtime flag to
......@@ -206,7 +206,8 @@ if (is_chromecast) {
"video_decoder",
]
_default_mojo_media_host = "gpu"
} else if (is_chromeos_ash || is_mac || is_win || (is_linux && use_vaapi)) {
} else if (is_chromeos_ash || is_mac || is_win ||
((is_linux || is_chromeos_lacros) && use_vaapi)) {
_default_mojo_media_services = [ "video_decoder" ]
_default_mojo_media_host = "gpu"
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment