aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo/lib.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-07-13 11:31:26 -0400
committerGitHub <noreply@github.com>2019-07-13 11:31:26 -0400
commit8328763ff277bf6c050c94a91bd4b41ff1518e3c (patch)
treee054343dfa60c9531d0351dcebb065f1bb6225f6 /components/servo/lib.rs
parent938a920b86de09b545949cde7df69cb8188312e8 (diff)
parentce01cd71e21e1740ea23dc52bfc9b0fe1faba3c4 (diff)
downloadservo-8328763ff277bf6c050c94a91bd4b41ff1518e3c.tar.gz
servo-8328763ff277bf6c050c94a91bd4b41ff1518e3c.zip
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 -->
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r--components/servo/lib.rs40
1 files changed, 29 insertions, 11 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index 2f67d563991..ac1cd492a12 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -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);
}