Skip to content

Commit

Permalink
Remove some Cobalt customizations from //media (#3118)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xiaomings authored May 1, 2024
1 parent f151007 commit 4550a4e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 3 additions & 1 deletion media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ config("media_config") {
]
}

defines = [ "MEDIA_IMPLEMENTATION" ]
defines = [ "IS_MEDIA_IMPL" ]
}

config("media_config_public") {
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions media/base/media_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<kCrosGlobalMediaControlsPinOptions>
kCrosGlobalMediaControlsPinParam;
#endif // !defined(STARBOARD)

// Return bitmask of audio formats supported by EDID.
MEDIA_EXPORT uint32_t GetPassthroughAudioFormats();
Expand Down
4 changes: 0 additions & 4 deletions media/base/supported_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4550a4e

Please sign in to comment.