mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Allow mach build to explicitly set the media stack
You can select the media backend by building as follows: $ ./mach build -d --media-stack=dummy or $ ./mach build -d --media-stack=gstreamer
This commit is contained in:
parent
91b612f8df
commit
4e3f164f7b
4 changed files with 24 additions and 7 deletions
|
@ -71,6 +71,8 @@ script_traits = {path = "../script_traits"}
|
||||||
servo_config = {path = "../config"}
|
servo_config = {path = "../config"}
|
||||||
servo_geometry = {path = "../geometry"}
|
servo_geometry = {path = "../geometry"}
|
||||||
servo-media = {git = "https://github.com/servo/media"}
|
servo-media = {git = "https://github.com/servo/media"}
|
||||||
|
servo-media-dummy = {git = "https://github.com/servo/media", optional = true}
|
||||||
|
servo-media-gstreamer = {git = "https://github.com/servo/media", optional = true}
|
||||||
servo_url = {path = "../url"}
|
servo_url = {path = "../url"}
|
||||||
sparkle = "0.1"
|
sparkle = "0.1"
|
||||||
style = {path = "../style", features = ["servo"]}
|
style = {path = "../style", features = ["servo"]}
|
||||||
|
@ -90,10 +92,6 @@ gaol = "0.2.1"
|
||||||
|
|
||||||
[target.'cfg(any(target_os = "android", target_arch = "x86_64", target_os = "windows"))'.dependencies]
|
[target.'cfg(any(target_os = "android", target_arch = "x86_64", target_os = "windows"))'.dependencies]
|
||||||
gstreamer = "0.14.5"
|
gstreamer = "0.14.5"
|
||||||
servo-media-gstreamer= {git = "https://github.com/servo/media"}
|
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_arch = "x86_64", target_os = "windows")))'.dependencies.servo-media-dummy]
|
|
||||||
git = "https://github.com/servo/media"
|
|
||||||
|
|
||||||
[target.'cfg(target_os = "windows")'.dependencies]
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
mozangle = {version = "0.2"}
|
mozangle = {version = "0.2"}
|
||||||
|
|
|
@ -135,7 +135,7 @@ pub use msg::constellation_msg::TopLevelBrowsingContextId as BrowserId;
|
||||||
pub use servo_config as config;
|
pub use servo_config as config;
|
||||||
pub use servo_url as url;
|
pub use servo_url as url;
|
||||||
|
|
||||||
#[cfg(any(target_os = "android", target_arch = "x86_64", target_os = "windows",))]
|
#[cfg(feature = "servo-media-gstreamer")]
|
||||||
mod media_platform {
|
mod media_platform {
|
||||||
use super::ServoMedia;
|
use super::ServoMedia;
|
||||||
use servo_media_gstreamer::GStreamerBackend;
|
use servo_media_gstreamer::GStreamerBackend;
|
||||||
|
@ -245,7 +245,7 @@ mod media_platform {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(target_os = "android", target_arch = "x86_64", target_os = "windows",)))]
|
#[cfg(feature = "servo-media-dummy")]
|
||||||
mod media_platform {
|
mod media_platform {
|
||||||
use super::ServoMedia;
|
use super::ServoMedia;
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
|
|
|
@ -33,6 +33,8 @@ default = ["webdriver", "max_log_level"]
|
||||||
egl = ["libservo/egl"]
|
egl = ["libservo/egl"]
|
||||||
energy-profiling = ["libservo/energy-profiling"]
|
energy-profiling = ["libservo/energy-profiling"]
|
||||||
debugmozjs = ["libservo/debugmozjs"]
|
debugmozjs = ["libservo/debugmozjs"]
|
||||||
|
media-dummy = ["libservo/servo-media-dummy"]
|
||||||
|
media-gstreamer = ["libservo/servo-media-gstreamer"]
|
||||||
js_backtrace = ["libservo/js_backtrace"]
|
js_backtrace = ["libservo/js_backtrace"]
|
||||||
layout-2013 = ["libservo/layout-2013"]
|
layout-2013 = ["libservo/layout-2013"]
|
||||||
layout-2020 = ["libservo/layout-2020"]
|
layout-2020 = ["libservo/layout-2020"]
|
||||||
|
|
|
@ -155,6 +155,10 @@ class MachCommands(CommandBase):
|
||||||
@CommandArgument('--jobs', '-j',
|
@CommandArgument('--jobs', '-j',
|
||||||
default=None,
|
default=None,
|
||||||
help='Number of jobs to run in parallel')
|
help='Number of jobs to run in parallel')
|
||||||
|
@CommandArgument('--media-stack',
|
||||||
|
default=None,
|
||||||
|
choices=["gstreamer", "dummy"],
|
||||||
|
help='Which media stack to use')
|
||||||
@CommandArgument('--no-package',
|
@CommandArgument('--no-package',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='For Android, disable packaging into a .apk after building')
|
help='For Android, disable packaging into a .apk after building')
|
||||||
|
@ -171,7 +175,7 @@ class MachCommands(CommandBase):
|
||||||
@CommandArgument('params', nargs='...',
|
@CommandArgument('params', nargs='...',
|
||||||
help="Command-line arguments to be passed through to Cargo")
|
help="Command-line arguments to be passed through to Cargo")
|
||||||
@CommandBase.build_like_command_arguments
|
@CommandBase.build_like_command_arguments
|
||||||
def build(self, release=False, dev=False, jobs=None, params=None,
|
def build(self, release=False, dev=False, jobs=None, params=None, media_stack=None,
|
||||||
no_package=False, verbose=False, very_verbose=False,
|
no_package=False, verbose=False, very_verbose=False,
|
||||||
target=None, android=False, magicleap=False, libsimpleservo=False,
|
target=None, android=False, magicleap=False, libsimpleservo=False,
|
||||||
features=None, uwp=False, win_arm64=False, **kwargs):
|
features=None, uwp=False, win_arm64=False, **kwargs):
|
||||||
|
@ -191,6 +195,19 @@ class MachCommands(CommandBase):
|
||||||
if not uwp:
|
if not uwp:
|
||||||
uwp = target and 'uwp' in target
|
uwp = target and 'uwp' in target
|
||||||
|
|
||||||
|
# A guess about which platforms should use the gstreamer media stack
|
||||||
|
if not(media_stack):
|
||||||
|
if (
|
||||||
|
not(target) or
|
||||||
|
("armv7" in target and "android" in target) or
|
||||||
|
("x86_64" in target)
|
||||||
|
):
|
||||||
|
media_stack = "gstreamer"
|
||||||
|
else:
|
||||||
|
media_stack = "dummy"
|
||||||
|
|
||||||
|
features += ["media-" + media_stack]
|
||||||
|
|
||||||
target_path = base_path = self.get_target_dir()
|
target_path = base_path = self.get_target_dir()
|
||||||
if android:
|
if android:
|
||||||
target_path = path.join(target_path, "android")
|
target_path = path.join(target_path, "android")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue