Skip to content

Commit

Permalink
Convert various media options into proper declare_args().
Browse files Browse the repository at this point in the history
BUG=none
TEST=gn gen.

Review URL: https://codereview.chromium.org/609293004

Cr-Commit-Position: refs/heads/master@{#297449}
  • Loading branch information
dalecurtis authored and Commit bot committed Sep 30, 2014
1 parent 2c9345e commit a36cfd3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 39 deletions.
2 changes: 1 addition & 1 deletion media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ config("media_config") {
}
if (use_pulseaudio) {
defines += [ "USE_PULSEAUDIO" ]
if (!linux_link_pulseaudio) {
if (!link_pulseaudio) {
defines += [ "DLOPEN_PULSEAUDIO" ]
}
}
Expand Down
4 changes: 2 additions & 2 deletions media/audio/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import("//media/media_options.gni")

# When libpulse is not directly linked, use stubs to allow for dlopening of the
# binary.
if (!linux_link_pulseaudio) {
if (!link_pulseaudio) {
action("pulse_generate_stubs") {
extra_header = "pulse/pulse_stub_header.fragment"

Expand Down Expand Up @@ -219,7 +219,7 @@ source_set("audio") {
"pulse/pulse_util.h",
]

if (linux_link_pulseaudio) {
if (link_pulseaudio) {
pkg_config("libpulse") {
packages = [ "libpulse" ]
}
Expand Down
84 changes: 48 additions & 36 deletions media/media_options.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,56 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# These variables need to be args.

# Override to dynamically link the cras (ChromeOS audio) library.
use_cras = false

# Option e.g. for Linux distributions to link pulseaudio directly
# (DT_NEEDED) instead of using dlopen. This helps with automated
# detection of ABI mismatches and prevents silent errors.
#
# TODO(ajwong): Why is this prefixed "linux_"?
linux_link_pulseaudio = false

# TODO(ajwong): Enable libvpx once that's converted.
media_use_ffmpeg = true
media_use_libvpx = true
if (is_android || is_ios) {
# Android and iOS don't use ffmpeg or libvpx.
media_use_ffmpeg = false
media_use_libvpx = false
}
declare_args() {
# Enables proprietary codecs and demuxers; e.g. H264, MOV, AAC, and MP3.
proprietary_codecs = false

# Allows distributions to link pulseaudio directly (DT_NEEDED) instead of
# using dlopen. This helps with automated detection of ABI mismatches and
# prevents silent errors.
link_pulseaudio = false

# Enable usage of FFmpeg within the media library. Used for most software
# based decoding, demuxing, and sometimes optimized FFTs. If disabled,
# implementors must provide their own demuxers and decoders.
media_use_ffmpeg = true

# Enable usage of libvpx within the media library. Used for software based
# decoding of VP9 and VP8A type content.
media_use_libvpx = true

# Neither Android nor iOS use ffmpeg or libvpx.
if (is_android || is_ios) {
media_use_ffmpeg = false
media_use_libvpx = false
}

# Override to dynamically link the cras (ChromeOS audio) library.
use_cras = false

# Enables runtime selection of PulseAudio library.
use_pulseaudio = false

# TODO(ajwong): how to disable embedded?
# Original conditional: (OS=="linux" or OS=="freebsd" or OS=="solaris") and embedded!=1
use_alsa = false
use_pulseaudio = false
if (is_posix && !is_android && !is_mac) {
use_alsa = true
if (!use_cras) {
use_pulseaudio = true
# Enables runtime selection of ALSA library for audio.
use_alsa = false

# TODO(GYP): How to handled the "embedded" use case?
# Original conditional: (OS=="linux" or OS=="freebsd" or OS=="solaris") and embedded!=1
if (is_posix && !is_android && !is_mac) {
use_alsa = true
if (!use_cras) {
use_pulseaudio = true
}
}
}

# TODO(ajwong): is_openbsd should be a platform define.
is_openbsd = false
# Enables the MPEG2-TS stream parser for use with Media Source. Disabled by
# default since it's not available on the normal Web Platform and costs money.
enable_mpeg2ts_stream_parser = false

# TODO(ajwong): This should be branding controlled?
proprietary_codecs = false
# Enables browser side Content Decryption Modules. Required for android where
# the typical PPAPI based CDM is not available.
enable_browser_cdms = is_android

# TODO(ajwong): Where are these coming from?jk
enable_mpeg2ts_stream_parser = false
enable_browser_cdms = is_android
# TODO(GYP): This should be a platform define.
is_openbsd = false
}

0 comments on commit a36cfd3

Please sign in to comment.