Auto merge of #24668 - tuncer:configure-media-stack-v2, r=asajeffrey

Allow build to explicitly set the media stack

<!-- Please describe your changes on the following line: -->
_[This is based on @asajeffrey's work in #23423, and is a rebase and continuation of that branch]_

This allows `./mach build` to override the media stack, which is currently hard-wired based on the target. To skip gstreamer, run `./mach build -d --media-stack=dummy`.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23050 (GitHub issue number if applicable)
<!-- Either: -->
- [x] These changes do not require tests because it's build infra

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2019-11-22 13:26:07 -05:00 committed by GitHub
commit 10a63cc9d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 60 additions and 18 deletions

View file

@ -36,6 +36,8 @@ webgl_backtrace = [
"canvas_traits/webgl_backtrace",
]
vslatestinstalled = ["script/vslatestinstalled"]
media-dummy = ["servo-media-dummy"]
media-gstreamer = ["servo-media-gstreamer", "gstreamer"]
[dependencies]
background_hang_monitor = {path = "../background_hang_monitor"}
@ -71,6 +73,8 @@ script_traits = {path = "../script_traits"}
servo_config = {path = "../config"}
servo_geometry = {path = "../geometry"}
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"}
sparkle = "0.1"
style = {path = "../style", features = ["servo"]}
@ -84,16 +88,10 @@ webvr_traits = {path = "../webvr_traits"}
webxr-api = {git = "https://github.com/servo/webxr"}
webxr = {git = "https://github.com/servo/webxr"}
surfman = { version = "0.1", features = ["sm-osmesa"] }
gstreamer = { version = "0.14.5", optional = true }
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_arch="arm"), not(target_arch="aarch64")))'.dependencies]
gaol = "0.2.1"
[target.'cfg(any(target_os = "android", target_arch = "x86_64", target_os = "windows"))'.dependencies]
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]
mozangle = {version = "0.2"}

View file

@ -135,7 +135,7 @@ pub use msg::constellation_msg::TopLevelBrowsingContextId as BrowserId;
pub use servo_config as config;
pub use servo_url as url;
#[cfg(any(target_os = "android", target_arch = "x86_64", target_os = "windows",))]
#[cfg(feature = "media-gstreamer")]
mod media_platform {
use super::ServoMedia;
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 = "media-dummy")]
mod media_platform {
use super::ServoMedia;
pub fn init() {