From d30953dfc2e8fcd9663a84c9cef72cd96e823dd8 Mon Sep 17 00:00:00 2001 From: xiaomings Date: Wed, 1 May 2024 13:51:53 -0700 Subject: [PATCH] Remove some Cobalt customizations from //media (#3118) 1. Replace the definition `MEDIA_IMPLEMENTATION` in //media/BUILD.gn with `IS_MEDIA_IMPL`, the latter is used by the Chromium `COMPONENT_EXPORT()` macro. 2. Remove some `#defined(STARBOARD)` guards for code that now built without the guards. b/338100595 Change-Id: I11c23dea33cb05428ce9b2d90e0b595c2851c628 (cherry picked from commit 4550a4e5d3f4ea0514319b0305ffae7798e054d7) --- media/BUILD.gn | 4 +++- media/base/media_switches.h | 2 -- media/base/supported_types.cc | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/media/BUILD.gn b/media/BUILD.gn index fd9cf7bec465..c7b1a87d4d9d 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -30,7 +30,7 @@ config("media_config") { ] } - defines = [ "MEDIA_IMPLEMENTATION" ] + defines = [ "IS_MEDIA_IMPL" ] } config("media_config_public") { @@ -82,6 +82,8 @@ component("media") { "base/encryption_pattern.h", "base/encryption_scheme.cc", "base/encryption_scheme.h", + "base/media_client.cc", + "base/media_client.h", "base/media_log.h", "base/media_resource.cc", "base/media_resource.h", diff --git a/media/base/media_switches.h b/media/base/media_switches.h index 71e1b3716260..43265d6c016d 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h @@ -452,12 +452,10 @@ enum class kCrosGlobalMediaControlsPinOptions { kHeuristic, }; -#if !defined(STARBOARD) // Feature param used to force default pin/unpin for global media controls in // CrOS. MEDIA_EXPORT extern const base::FeatureParam kCrosGlobalMediaControlsPinParam; -#endif // !defined(STARBOARD) // Return bitmask of audio formats supported by EDID. MEDIA_EXPORT uint32_t GetPassthroughAudioFormats(); diff --git a/media/base/supported_types.cc b/media/base/supported_types.cc index e88128d89d40..19bebe621a91 100644 --- a/media/base/supported_types.cc +++ b/media/base/supported_types.cc @@ -326,18 +326,14 @@ bool IsAACSupported(const AudioType& type) { } // namespace bool IsSupportedAudioType(const AudioType& type) { -#if !defined(STARBOARD) if (auto* media_client = GetMediaClient()) return media_client->IsSupportedAudioType(type); -#endif // !defined(STARBOARD) return IsDefaultSupportedAudioType(type); } bool IsSupportedVideoType(const VideoType& type) { -#if !defined(STARBOARD) if (auto* media_client = GetMediaClient()) return media_client->IsSupportedVideoType(type); -#endif // !defined(STARBOARD) return IsDefaultSupportedVideoType(type); }