Auto merge of #23764 - jdm:hl-startup, r=paulrouget

Adjust gstreamer plugins for UWP.

This excludes a set of plugins and dependencies that are currently built with MinGW and will therefore cause WACK errors. The resulting set of plugins loaded by the UWP app are still not UWP-clean, but this makes it much easier to switch over to UWP-clean binaries in the future.

These changes also allow the HoloLens 2 app to start and load again after #23712.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23757
- [x] These changes do not require tests because no tests for windows or UWP.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23764)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-07-13 11:31:26 -04:00 committed by GitHub
commit 8328763ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 76 additions and 462 deletions

View file

@ -137,7 +137,7 @@ mod media_platform {
let mut plugin_dir = std::env::current_exe().unwrap();
plugin_dir.pop();
let plugins = &[
let uwp_plugins = [
"gstapp.dll",
"gstaudioconvert.dll",
"gstaudiofx.dll",
@ -146,31 +146,49 @@ mod media_platform {
"gstautodetect.dll",
"gstcoreelements.dll",
"gstdeinterlace.dll",
"gstplayback.dll",
"gstinterleave.dll",
"gstisomp4.dll",
"gstlibav.dll",
"gstnice.dll",
"gstogg.dll",
"gstopengl.dll",
"gstopus.dll",
"gstplayback.dll",
"gstproxy.dll",
"gstrtp.dll",
"gsttheora.dll",
"gsttypefindfunctions.dll",
"gstvideoconvert.dll",
"gstvideofilter.dll",
"gstvideoparsersbad.dll",
"gstvideoscale.dll",
"gstvolume.dll",
"gstwasapi.dll",
];
let non_uwp_plugins = [
"gstnice.dll",
"gstogg.dll",
"gstopengl.dll",
"gstopus.dll",
"gstrtp.dll",
"gsttheora.dll",
"gstvorbis.dll",
"gstvpx.dll",
"gstwasapi.dll",
"gstwebrtc.dll",
];
let backend = GStreamerBackend::init_with_plugins(plugin_dir, plugins)
.expect("Error initializing GStreamer");
let plugins: Vec<_> = if cfg!(feature = "uwp") {
uwp_plugins.to_vec()
} else {
uwp_plugins
.iter()
.map(|&s| s)
.chain(non_uwp_plugins.iter().map(|&s| s))
.collect()
};
let backend = match GStreamerBackend::init_with_plugins(plugin_dir, &plugins) {
Ok(b) => b,
Err(e) => {
error!("Error initializing GStreamer: {:?}", e);
panic!()
},
};
ServoMedia::init_with_backend(backend);
}