From 4b48cfa3ecd95298428a2d1d377a5a16020cc65b Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 23 Aug 2018 13:33:40 -0700 Subject: [PATCH] Upgrade to latest servo-media --- Cargo.lock | 18 ++++++++++++------ components/script/dom/audiodestinationnode.rs | 6 ++---- components/script/dom/audionode.rs | 15 ++++++++++++--- .../script/dom/audioscheduledsourcenode.rs | 1 - components/script/dom/gainnode.rs | 1 - 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 04057be5ec1..17f87a0fdb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3197,7 +3197,7 @@ dependencies = [ [[package]] name = "servo-media" version = "0.1.0" -source = "git+https://github.com/servo/media#7a5c334698aa1e8a9cf95c5bd761e4a31489b6db" +source = "git+https://github.com/servo/media#a3d25355acac0fe6f7f8b7af18e6fe1f910431ab" dependencies = [ "servo-media-audio 0.1.0 (git+https://github.com/servo/media)", "servo-media-gstreamer 0.1.0 (git+https://github.com/servo/media)", @@ -3207,9 +3207,10 @@ dependencies = [ [[package]] name = "servo-media-audio" version = "0.1.0" -source = "git+https://github.com/servo/media#7a5c334698aa1e8a9cf95c5bd761e4a31489b6db" +source = "git+https://github.com/servo/media#a3d25355acac0fe6f7f8b7af18e6fe1f910431ab" dependencies = [ "byte-slice-cast 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "petgraph 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "servo_media_derive 0.1.0 (git+https://github.com/servo/media)", @@ -3219,7 +3220,7 @@ dependencies = [ [[package]] name = "servo-media-gstreamer" version = "0.1.0" -source = "git+https://github.com/servo/media#7a5c334698aa1e8a9cf95c5bd761e4a31489b6db" +source = "git+https://github.com/servo/media#a3d25355acac0fe6f7f8b7af18e6fe1f910431ab" dependencies = [ "byte-slice-cast 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3227,7 +3228,7 @@ dependencies = [ "gstreamer-app 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "gstreamer-audio 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", "gstreamer-player 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo-media-audio 0.1.0 (git+https://github.com/servo/media)", "servo-media-player 0.1.0 (git+https://github.com/servo/media)", @@ -3237,7 +3238,12 @@ dependencies = [ [[package]] name = "servo-media-player" version = "0.1.0" -source = "git+https://github.com/servo/media#7a5c334698aa1e8a9cf95c5bd761e4a31489b6db" +source = "git+https://github.com/servo/media#a3d25355acac0fe6f7f8b7af18e6fe1f910431ab" +dependencies = [ + "ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "servo-skia" @@ -3318,7 +3324,7 @@ dependencies = [ [[package]] name = "servo_media_derive" version = "0.1.0" -source = "git+https://github.com/servo/media#7a5c334698aa1e8a9cf95c5bd761e4a31489b6db" +source = "git+https://github.com/servo/media#a3d25355acac0fe6f7f8b7af18e6fe1f910431ab" dependencies = [ "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/components/script/dom/audiodestinationnode.rs b/components/script/dom/audiodestinationnode.rs index 06a871edc5a..f3c0190e193 100644 --- a/components/script/dom/audiodestinationnode.rs +++ b/components/script/dom/audiodestinationnode.rs @@ -10,7 +10,6 @@ use dom::bindings::reflector::reflect_dom_object; use dom::bindings::root::DomRoot; use dom::globalscope::GlobalScope; use dom_struct::dom_struct; -use servo_media::audio::node::AudioNodeInit; #[dom_struct] pub struct AudioDestinationNode { @@ -23,9 +22,8 @@ impl AudioDestinationNode { options: &AudioNodeOptions, ) -> AudioDestinationNode { AudioDestinationNode { - node: AudioNode::new_inherited( - AudioNodeInit::DestinationNode, - Some(context.destination_node()), + node: AudioNode::new_inherited_for_id( + context.destination_node(), context, options, 1, diff --git a/components/script/dom/audionode.rs b/components/script/dom/audionode.rs index d193c9d77d9..88d2314f20f 100644 --- a/components/script/dom/audionode.rs +++ b/components/script/dom/audionode.rs @@ -36,17 +36,26 @@ pub struct AudioNode { channel_interpretation: Cell, } + impl AudioNode { pub fn new_inherited( node_type: AudioNodeInit, - node_id: Option, context: &BaseAudioContext, options: &AudioNodeOptions, number_of_inputs: u32, number_of_outputs: u32, ) -> AudioNode { - let node_id = - node_id.unwrap_or_else(|| context.audio_context_impl().create_node(node_type)); + let node_id = context.audio_context_impl().create_node(node_type); + AudioNode::new_inherited_for_id(node_id, context, options, number_of_inputs, number_of_outputs) + } + + pub fn new_inherited_for_id( + node_id: NodeId, + context: &BaseAudioContext, + options: &AudioNodeOptions, + number_of_inputs: u32, + number_of_outputs: u32, + ) -> AudioNode { AudioNode { eventtarget: EventTarget::new_inherited(), node_id, diff --git a/components/script/dom/audioscheduledsourcenode.rs b/components/script/dom/audioscheduledsourcenode.rs index c8ecf9a8fda..03f1f952102 100644 --- a/components/script/dom/audioscheduledsourcenode.rs +++ b/components/script/dom/audioscheduledsourcenode.rs @@ -34,7 +34,6 @@ impl AudioScheduledSourceNode { AudioScheduledSourceNode { node: AudioNode::new_inherited( node_type, - None, /* node_id */ context, options, number_of_inputs, diff --git a/components/script/dom/gainnode.rs b/components/script/dom/gainnode.rs index fe7ac041bf9..5cdbd8a89c9 100644 --- a/components/script/dom/gainnode.rs +++ b/components/script/dom/gainnode.rs @@ -38,7 +38,6 @@ impl GainNode { node_options.channelInterpretation = Some(ChannelInterpretation::Speakers); let node = AudioNode::new_inherited( AudioNodeInit::GainNode(gain_options.into()), - None, context, &node_options, 1, // inputs