Upgrade to latest servo-media

This commit is contained in:
Manish Goregaokar 2018-08-23 13:33:40 -07:00
parent 66a9677538
commit 4b48cfa3ec
5 changed files with 26 additions and 15 deletions

View file

@ -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,

View file

@ -36,17 +36,26 @@ pub struct AudioNode {
channel_interpretation: Cell<ChannelInterpretation>,
}
impl AudioNode {
pub fn new_inherited(
node_type: AudioNodeInit,
node_id: Option<NodeId>,
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,

View file

@ -34,7 +34,6 @@ impl AudioScheduledSourceNode {
AudioScheduledSourceNode {
node: AudioNode::new_inherited(
node_type,
None, /* node_id */
context,
options,
number_of_inputs,

View file

@ -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