servo: Merge #19225 - Shut down the media stack when shutting down the constellation (from servo:media); r=jdm
authorAnthony Ramine <n.oxyde@gmail.com>
Tue, 21 Nov 2017 10:13:02 -0600
changeset 392962 d27b88d59fb3a580b6213e5fb0e229ea8ca7453a
parent 392961 4a35428990925d014a83d267fd1fdab696eb0aea
child 392963 7f456008a2a7f7c597f8f4557d837235ec37ae58
push id32947
push useraciure@mozilla.com
push dateWed, 22 Nov 2017 09:57:59 +0000
treeherdermozilla-central@5378dcb45044 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #19225 - Shut down the media stack when shutting down the constellation (from servo:media); r=jdm Source-Repo: https://github.com/servo/servo Source-Revision: b13107a31864b24463d112aca4e94c93d597243c
servo/Cargo.lock
servo/components/constellation/Cargo.toml
servo/components/constellation/constellation.rs
servo/components/constellation/lib.rs
--- a/servo/Cargo.lock
+++ b/servo/Cargo.lock
@@ -490,16 +490,17 @@ dependencies = [
  "canvas 0.0.1",
  "canvas_traits 0.0.1",
  "clipboard 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "compositing 0.0.1",
  "debugger 0.0.1",
  "devtools_traits 0.0.1",
  "euclid 0.15.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "gaol 0.0.1 (git+https://github.com/servo/gaol)",
+ "gecko-media 0.1.0 (git+https://github.com/servo/gecko-media.git)",
  "gfx 0.0.1",
  "gfx_traits 0.0.1",
  "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "layout_traits 0.0.1",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "metrics 0.0.1",
@@ -1009,23 +1010,22 @@ source = "registry+https://github.com/ru
 dependencies = [
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "gecko-media"
 version = "0.1.0"
-source = "git+https://github.com/servo/gecko-media.git#47e030fd5670c7bf16108647f6ee07fd83175401"
+source = "git+https://github.com/servo/gecko-media.git#4417372d89a52ce1c5c1bde5bb216407fd41ecc7"
 dependencies = [
  "bindgen 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "cmake 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)",
  "cubeb-pulse 0.0.2 (git+https://github.com/djg/cubeb-pulse-rs?branch=dev)",
  "encoding_c 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
  "mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "mp4parse 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "mp4parse_capi 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
  "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
--- a/servo/components/constellation/Cargo.toml
+++ b/servo/components/constellation/Cargo.toml
@@ -38,8 +38,11 @@ servo_config = {path = "../config"}
 servo_rand = {path = "../rand"}
 servo_remutex = {path = "../remutex"}
 servo_url = {path = "../url"}
 webvr_traits = {path = "../webvr_traits"}
 webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
 
 [target.'cfg(all(not(target_os = "windows"), not(target_os = "ios")))'.dependencies]
 gaol = {git = "https://github.com/servo/gaol"}
+
+[target.'cfg(all(any(target_os = "macos", target_os = "linux"), not(any(target_arch = "arm", target_arch = "aarch64"))))'.dependencies]
+gecko-media = {git = "https://github.com/servo/gecko-media.git"}
--- a/servo/components/constellation/constellation.rs
+++ b/servo/components/constellation/constellation.rs
@@ -103,16 +103,18 @@ use canvas_traits::canvas::CanvasMsg;
 use clipboard::{ClipboardContext, ClipboardProvider};
 use compositing::SendableFrameTree;
 use compositing::compositor_thread::{CompositorProxy, EmbedderMsg, EmbedderProxy};
 use compositing::compositor_thread::Msg as ToCompositorMsg;
 use debugger;
 use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
 use euclid::{Size2D, TypedSize2D, ScaleFactor};
 use event_loop::EventLoop;
+#[cfg(all(any(target_os = "macos", target_os = "linux"), not(any(target_arch = "arm", target_arch = "aarch64"))))]
+use gecko_media::GeckoMedia;
 use gfx::font_cache_thread::FontCacheThread;
 use gfx_traits::Epoch;
 use ipc_channel::{Error as IpcError};
 use ipc_channel::ipc::{self, IpcSender, IpcReceiver};
 use ipc_channel::router::ROUTER;
 use itertools::Itertools;
 use layout_traits::LayoutThreadFactory;
 use log::{Log, LogLevel, LogLevelFilter, LogMetadata, LogRecord};
@@ -1476,16 +1478,26 @@ impl<Message, LTF, STF> Constellation<Me
             warn!("Exit resource thread failed ({})", e);
         }
         if let Err(e) = storage_receiver.recv() {
             warn!("Exit storage thread failed ({})", e);
         }
 
         debug!("Asking compositor to complete shutdown.");
         self.compositor_proxy.send(ToCompositorMsg::ShutdownComplete);
+
+        #[cfg(all(
+            any(target_os = "macos", target_os = "linux"),
+            not(any(target_arch = "arm", target_arch = "aarch64")),
+        ))]
+        {
+            if let Err(()) = GeckoMedia::shutdown() {
+                warn!("Media stack shutdown failed.");
+            }
+        }
     }
 
     fn handle_pipeline_exited(&mut self, pipeline_id: PipelineId) {
         debug!("Pipeline {:?} exited.", pipeline_id);
         self.pipelines.remove(&pipeline_id);
     }
 
     fn handle_send_error(&mut self, pipeline_id: PipelineId, err: IpcError) {
--- a/servo/components/constellation/lib.rs
+++ b/servo/components/constellation/lib.rs
@@ -12,16 +12,18 @@ extern crate canvas;
 extern crate canvas_traits;
 extern crate clipboard;
 extern crate compositing;
 extern crate debugger;
 extern crate devtools_traits;
 extern crate euclid;
 #[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
 extern crate gaol;
+#[cfg(all(any(target_os = "macos", target_os = "linux"), not(any(target_arch = "arm", target_arch = "aarch64"))))]
+extern crate gecko_media;
 extern crate gfx;
 extern crate gfx_traits;
 extern crate hyper;
 extern crate ipc_channel;
 extern crate itertools;
 extern crate layout_traits;
 #[macro_use]
 extern crate log;