forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmedia_options.gni
132 lines (112 loc) · 4.91 KB
/
media_options.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromecast_build.gni")
import("//build/config/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
declare_args() {
# 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
# iOS doesn't use ffmpeg, libvpx.
if (is_ios) {
media_use_ffmpeg = false
media_use_libvpx = false
}
# Override to dynamically link the cras (ChromeOS audio) library.
use_cras = false
# Use low-memory buffers on non-Android builds of Chromecast.
use_low_memory_buffer = is_chromecast && !is_android
# Enables AC3/EAC3 audio demuxing. This is enabled only on Chromecast, since
# it only provides demuxing, and is only useful for AC3/EAC3 audio
# pass-through to HDMI sink on Chromecast.
enable_ac3_eac3_audio_demuxing = proprietary_codecs && is_chromecast
enable_mse_mpeg2ts_stream_parser =
(proprietary_codecs && is_chromecast) || use_libfuzzer || use_afl
# Enable HEVC/H265 demuxing. Actual decoding must be provided by the
# platform. Enable by default for Chromecast.
enable_hevc_demuxing = proprietary_codecs && is_chromecast
}
# Use a second declare_args() to pick up possible overrides of |use_cras|.
declare_args() {
# Enables runtime selection of PulseAudio library.
use_pulseaudio = false
# Enables runtime selection of ALSA library for audio.
use_alsa = false
# Alsa should be used on non-Android, non-Mac POSIX systems.
# Alsa should be used on desktop Chromecast and audio-only Chromecast builds.
if (is_posix && !is_android && !is_mac &&
(!is_chromecast || is_cast_desktop_build || is_cast_audio_only)) {
use_alsa = true
# Pulse is not supported on Chromecast platforms.
if (!use_cras && !is_chromecast) {
use_pulseaudio = true
}
}
}
declare_args() {
# Experiment to enable mojo media services (e.g. "renderer", "cdm", see
# |mojo_media_services|). When enabled, selected mojo paths will be enabled in
# the media pipeline and corresponding services will hosted in the selected
# remote process (e.g. "utility" process, see |mojo_media_host|).
enable_mojo_media = is_android || is_chromecast
# Enable the TestMojoMediaClient to be used in mojo MediaService. This is for
# testing only and will override the default platform MojoMediaClient, if any.
enable_test_mojo_media_client = false
}
# Use a second declare_args() to pick up possible overrides of enable_mojo_media
# from --args command line flags. See "gn help declare_args".
declare_args() {
# A list of mojo media services that should be used in the media pipeline.
# Must not be empty if |enable_mojo_media| is true.
# Valid entries in the list are:
# - "renderer": Use mojo-based media Renderer service.
# - "cdm": Use mojo-based Content Decryption Module.
# - "audio_decoder": Use mojo-based audio decoder in the default media
# Renderer. Cannot be used with the mojo Renderer above.
# - "video_decoder": Use mojo-based video decoder in the default media
# Renderer. Cannot be used with the mojo Renderer above.
mojo_media_services = []
# The process to host the mojo media service.
# Valid options are:
# - "none": Do not use mojo media service.
# - "browser": Use mojo media service hosted in the browser process.
# - "gpu": Use mojo media service hosted in the gpu process.
# - "utility": Use mojo media service hosted in the utility process.
mojo_media_host = "none"
# Default mojo_media_services and mojo_media_host on various platforms.
# Can be overridden by gn build arguments from the --args command line flag
# for local testing.
if (enable_mojo_media) {
if (is_android) {
mojo_media_services = [
"cdm",
"audio_decoder",
]
mojo_media_host = "gpu"
} else if (is_chromecast) {
mojo_media_services = [
"cdm",
"renderer",
]
mojo_media_host = "browser"
} else {
mojo_media_services = [ "video_decoder" ]
mojo_media_host = "gpu"
}
}
}
declare_args() {
# This switch defines whether the Media Remoting implementation will be built.
# When enabled, media is allowed to be renderer and played back on remote
# devices when the tab is being casted and other conditions are met.
enable_media_remoting = !is_chromecast && !is_ios && !is_android
}