From 45af4fab07aa919324c4e98f814b444ce8e94f7c Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 2 Jul 2020 13:26:32 -0700 Subject: [PATCH 01/10] Update servo-media --- Cargo.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7ad7df10240..71750810f3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4894,7 +4894,7 @@ dependencies = [ [[package]] name = "servo-media" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "servo-media-audio", "servo-media-player", @@ -4906,7 +4906,7 @@ dependencies = [ [[package]] name = "servo-media-audio" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "boxfnonce", "byte-slice-cast", @@ -4928,7 +4928,7 @@ dependencies = [ [[package]] name = "servo-media-dummy" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "boxfnonce", "ipc-channel", @@ -4943,7 +4943,7 @@ dependencies = [ [[package]] name = "servo-media-gstreamer" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "boxfnonce", "byte-slice-cast", @@ -4979,7 +4979,7 @@ dependencies = [ [[package]] name = "servo-media-gstreamer-render" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "gstreamer", "gstreamer-video", @@ -4989,7 +4989,7 @@ dependencies = [ [[package]] name = "servo-media-gstreamer-render-android" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "glib", "gstreamer", @@ -5002,7 +5002,7 @@ dependencies = [ [[package]] name = "servo-media-gstreamer-render-unix" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "glib", "gstreamer", @@ -5015,7 +5015,7 @@ dependencies = [ [[package]] name = "servo-media-player" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "ipc-channel", "serde", @@ -5027,7 +5027,7 @@ dependencies = [ [[package]] name = "servo-media-streams" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "lazy_static", "uuid", @@ -5036,12 +5036,12 @@ dependencies = [ [[package]] name = "servo-media-traits" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" [[package]] name = "servo-media-webrtc" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "boxfnonce", "lazy_static", @@ -5119,7 +5119,7 @@ dependencies = [ [[package]] name = "servo_media_derive" version = "0.1.0" -source = "git+https://github.com/servo/media#18ece081a071b1b6b323f8d7b2684a76a7df203e" +source = "git+https://github.com/servo/media#beb8ce056e438c2166055897a8f21496ba596af7" dependencies = [ "proc-macro2 1.0.17", "quote 1.0.2", From 6a001e7523e321059e915ffd86627a2609c4137c Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 1 Jul 2020 16:01:08 -0700 Subject: [PATCH 02/10] Add MediaStreamAudioDestinationNode --- .../dom/mediastreamaudiodestinationnode.rs | 67 +++++++++++++++++++ components/script/dom/mod.rs | 1 + .../MediaStreamAudioDestinationNode.webidl | 13 ++++ 3 files changed, 81 insertions(+) create mode 100644 components/script/dom/mediastreamaudiodestinationnode.rs create mode 100644 components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl diff --git a/components/script/dom/mediastreamaudiodestinationnode.rs b/components/script/dom/mediastreamaudiodestinationnode.rs new file mode 100644 index 00000000000..88edbf052dd --- /dev/null +++ b/components/script/dom/mediastreamaudiodestinationnode.rs @@ -0,0 +1,67 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use crate::dom::audiocontext::AudioContext; +use crate::dom::audionode::AudioNode; +use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions; +use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{ + ChannelCountMode, ChannelInterpretation, +}; +use crate::dom::bindings::error::Fallible; +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::reflector::reflect_dom_object; +use crate::dom::bindings::root::DomRoot; +use crate::dom::window::Window; +use dom_struct::dom_struct; +use servo_media::audio::node::AudioNodeInit; +use servo_media::streams::MediaStreamType; +use servo_media::ServoMedia; + +#[dom_struct] +pub struct MediaStreamAudioDestinationNode { + node: AudioNode, +} + +impl MediaStreamAudioDestinationNode { + #[allow(unrooted_must_root)] + pub fn new_inherited( + context: &AudioContext, + options: &AudioNodeOptions, + ) -> Fallible { + let media = ServoMedia::get().unwrap(); + let (socket, _id) = media.create_stream_and_socket(MediaStreamType::Audio); + let node_options = options.unwrap_or( + 2, + ChannelCountMode::Explicit, + ChannelInterpretation::Speakers, + ); + let node = AudioNode::new_inherited( + AudioNodeInit::MediaStreamDestinationNode(socket), + &context.upcast(), + node_options, + 1, // inputs + 0, // outputs + )?; + Ok(MediaStreamAudioDestinationNode { node }) + } + + #[allow(unrooted_must_root)] + pub fn new( + window: &Window, + context: &AudioContext, + options: &AudioNodeOptions, + ) -> Fallible> { + let node = MediaStreamAudioDestinationNode::new_inherited(context, options)?; + Ok(reflect_dom_object(Box::new(node), window)) + } + + #[allow(non_snake_case)] + pub fn Constructor( + window: &Window, + context: &AudioContext, + options: &AudioNodeOptions, + ) -> Fallible> { + MediaStreamAudioDestinationNode::new(window, context, options) + } +} diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index ad526e8ee5d..c9f9cf64221 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -435,6 +435,7 @@ pub mod mediaquerylist; pub mod mediaquerylistevent; pub mod mediasession; pub mod mediastream; +pub mod mediastreamaudiodestinationnode; pub mod mediastreamtrack; pub mod messagechannel; pub mod messageevent; diff --git a/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl b/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl new file mode 100644 index 00000000000..87a656a7111 --- /dev/null +++ b/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl @@ -0,0 +1,13 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#mediastreamaudiodestinationnode + */ + +[Exposed=Window] +interface MediaStreamAudioDestinationNode : AudioNode { + [Throws] constructor (AudioContext context, optional AudioNodeOptions options = {}); + // readonly attribute MediaStream stream; +}; \ No newline at end of file From bf9614edf77c4e7aa0a74a5a98923b3d2f77821b Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 1 Jul 2020 16:01:19 -0700 Subject: [PATCH 03/10] Add MediaStream::new_single() --- components/script/dom/mediastream.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/script/dom/mediastream.rs b/components/script/dom/mediastream.rs index 1c9c7646939..ff2c8f3a990 100644 --- a/components/script/dom/mediastream.rs +++ b/components/script/dom/mediastream.rs @@ -13,6 +13,7 @@ use crate::dom::globalscope::GlobalScope; use crate::dom::mediastreamtrack::MediaStreamTrack; use crate::dom::window::Window; use dom_struct::dom_struct; +use servo_media::streams::registry::MediaStreamId; use servo_media::streams::MediaStreamType; #[dom_struct] @@ -34,6 +35,17 @@ impl MediaStream { reflect_dom_object(Box::new(MediaStream::new_inherited()), global) } + pub fn new_single( + global: &GlobalScope, + id: MediaStreamId, + ty: MediaStreamType, + ) -> DomRoot { + let this = Self::new(global); + let track = MediaStreamTrack::new(global, id, ty); + this.AddTrack(&track); + this + } + pub fn Constructor(global: &Window) -> Fallible> { Ok(MediaStream::new(&global.global())) } From 2a838d935bdb3ac2d74be619a183cacb3fd17bcd Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 1 Jul 2020 16:10:13 -0700 Subject: [PATCH 04/10] Add MedaStreamAudioDestinationNode::stream --- .../dom/mediastreamaudiodestinationnode.rs | 22 +++++++++++++++---- .../MediaStreamAudioDestinationNode.webidl | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/components/script/dom/mediastreamaudiodestinationnode.rs b/components/script/dom/mediastreamaudiodestinationnode.rs index 88edbf052dd..d402f07b590 100644 --- a/components/script/dom/mediastreamaudiodestinationnode.rs +++ b/components/script/dom/mediastreamaudiodestinationnode.rs @@ -8,10 +8,12 @@ use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions; use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{ ChannelCountMode, ChannelInterpretation, }; +use crate::dom::bindings::codegen::Bindings::MediaStreamAudioDestinationNodeBinding::MediaStreamAudioDestinationNodeMethods; use crate::dom::bindings::error::Fallible; use crate::dom::bindings::inheritance::Castable; -use crate::dom::bindings::reflector::reflect_dom_object; -use crate::dom::bindings::root::DomRoot; +use crate::dom::bindings::reflector::{reflect_dom_object, DomObject}; +use crate::dom::bindings::root::{Dom, DomRoot}; +use crate::dom::mediastream::MediaStream; use crate::dom::window::Window; use dom_struct::dom_struct; use servo_media::audio::node::AudioNodeInit; @@ -21,6 +23,7 @@ use servo_media::ServoMedia; #[dom_struct] pub struct MediaStreamAudioDestinationNode { node: AudioNode, + stream: Dom, } impl MediaStreamAudioDestinationNode { @@ -30,7 +33,8 @@ impl MediaStreamAudioDestinationNode { options: &AudioNodeOptions, ) -> Fallible { let media = ServoMedia::get().unwrap(); - let (socket, _id) = media.create_stream_and_socket(MediaStreamType::Audio); + let (socket, id) = media.create_stream_and_socket(MediaStreamType::Audio); + let stream = MediaStream::new_single(&context.global(), id, MediaStreamType::Audio); let node_options = options.unwrap_or( 2, ChannelCountMode::Explicit, @@ -43,7 +47,10 @@ impl MediaStreamAudioDestinationNode { 1, // inputs 0, // outputs )?; - Ok(MediaStreamAudioDestinationNode { node }) + Ok(MediaStreamAudioDestinationNode { + node, + stream: Dom::from_ref(&stream), + }) } #[allow(unrooted_must_root)] @@ -65,3 +72,10 @@ impl MediaStreamAudioDestinationNode { MediaStreamAudioDestinationNode::new(window, context, options) } } + +impl MediaStreamAudioDestinationNodeMethods for MediaStreamAudioDestinationNode { + /// https://webaudio.github.io/web-audio-api/#dom-mediastreamaudiodestinationnode-stream + fn Stream(&self) -> DomRoot { + DomRoot::from_ref(&self.stream) + } +} diff --git a/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl b/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl index 87a656a7111..93d5f86ebc5 100644 --- a/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl +++ b/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl @@ -9,5 +9,5 @@ [Exposed=Window] interface MediaStreamAudioDestinationNode : AudioNode { [Throws] constructor (AudioContext context, optional AudioNodeOptions options = {}); - // readonly attribute MediaStream stream; -}; \ No newline at end of file + readonly attribute MediaStream stream; +}; From bc2267fb7769e2a52a5518af97a26f39274744fa Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 1 Jul 2020 17:52:57 -0700 Subject: [PATCH 05/10] Add MediaStreamAudioSourceNode --- .../script/dom/mediastreamaudiosourcenode.rs | 77 +++++++++++++++++++ components/script/dom/mod.rs | 1 + .../webidls/MediaStreamAudioSourceNode.webidl | 17 ++++ 3 files changed, 95 insertions(+) create mode 100644 components/script/dom/mediastreamaudiosourcenode.rs create mode 100644 components/script/dom/webidls/MediaStreamAudioSourceNode.webidl diff --git a/components/script/dom/mediastreamaudiosourcenode.rs b/components/script/dom/mediastreamaudiosourcenode.rs new file mode 100644 index 00000000000..dc0803adec3 --- /dev/null +++ b/components/script/dom/mediastreamaudiosourcenode.rs @@ -0,0 +1,77 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use crate::dom::audiocontext::AudioContext; +use crate::dom::audionode::AudioNode; +use crate::dom::bindings::codegen::Bindings::MediaStreamAudioSourceNodeBinding::{ + MediaStreamAudioSourceNodeMethods, MediaStreamAudioSourceOptions, +}; +use crate::dom::bindings::error::{Error, Fallible}; +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::reflector::reflect_dom_object; +use crate::dom::bindings::root::{Dom, DomRoot}; +use crate::dom::mediastream::MediaStream; +use crate::dom::window::Window; +use dom_struct::dom_struct; +use servo_media::audio::node::AudioNodeInit; +use servo_media::streams::MediaStreamType; + +#[dom_struct] +pub struct MediaStreamAudioSourceNode { + node: AudioNode, + stream: Dom, +} + +impl MediaStreamAudioSourceNode { + #[allow(unrooted_must_root)] + pub fn new_inherited( + context: &AudioContext, + options: &MediaStreamAudioSourceOptions, + ) -> Fallible { + let track = options + .mediaStream + .get_tracks() + .iter() + .find(|t| t.ty() == MediaStreamType::Audio) + .ok_or(Error::InvalidState)? + .id(); + let node = AudioNode::new_inherited( + AudioNodeInit::MediaStreamSourceNode(track), + &context.upcast(), + Default::default(), + 0, // inputs + 1, // outputs + )?; + Ok(MediaStreamAudioSourceNode { + node, + stream: Dom::from_ref(&options.mediaStream), + }) + } + + #[allow(unrooted_must_root)] + pub fn new( + window: &Window, + context: &AudioContext, + options: &MediaStreamAudioSourceOptions, + ) -> Fallible> { + let node = MediaStreamAudioSourceNode::new_inherited(context, options)?; + Ok(reflect_dom_object(Box::new(node), window)) + } + + #[allow(non_snake_case)] + pub fn Constructor( + window: &Window, + context: &AudioContext, + options: &MediaStreamAudioSourceOptions, + ) -> Fallible> { + MediaStreamAudioSourceNode::new(window, context, options) + } +} + +impl MediaStreamAudioSourceNodeMethods for MediaStreamAudioSourceNode { + /// https://webaudio.github.io/web-audio-api/#dom-MediaStreamAudioSourceNode-stream + fn MediaStream(&self) -> DomRoot { + DomRoot::from_ref(&self.stream) + } +} diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index c9f9cf64221..7b814df775f 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -436,6 +436,7 @@ pub mod mediaquerylistevent; pub mod mediasession; pub mod mediastream; pub mod mediastreamaudiodestinationnode; +pub mod mediastreamaudiosourcenode; pub mod mediastreamtrack; pub mod messagechannel; pub mod messageevent; diff --git a/components/script/dom/webidls/MediaStreamAudioSourceNode.webidl b/components/script/dom/webidls/MediaStreamAudioSourceNode.webidl new file mode 100644 index 00000000000..655e2443081 --- /dev/null +++ b/components/script/dom/webidls/MediaStreamAudioSourceNode.webidl @@ -0,0 +1,17 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#mediastreamaudiosourcenode + */ + +dictionary MediaStreamAudioSourceOptions { + required MediaStream mediaStream; +}; + +[Exposed=Window] +interface MediaStreamAudioSourceNode : AudioNode { + [Throws] constructor (AudioContext context, MediaStreamAudioSourceOptions options); + [SameObject] readonly attribute MediaStream mediaStream; +}; From 61431738583de7f0a08bb9c409e37812d4b07a61 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 1 Jul 2020 18:17:38 -0700 Subject: [PATCH 06/10] Add MediaStreamTrackAudioSourceNode --- .../dom/mediastreamtrackaudiosourcenode.rs | 61 +++++++++++++++++++ components/script/dom/mod.rs | 1 + .../MediaStreamTrackAudioSourceNode.webidl | 16 +++++ 3 files changed, 78 insertions(+) create mode 100644 components/script/dom/mediastreamtrackaudiosourcenode.rs create mode 100644 components/script/dom/webidls/MediaStreamTrackAudioSourceNode.webidl diff --git a/components/script/dom/mediastreamtrackaudiosourcenode.rs b/components/script/dom/mediastreamtrackaudiosourcenode.rs new file mode 100644 index 00000000000..14cc99df056 --- /dev/null +++ b/components/script/dom/mediastreamtrackaudiosourcenode.rs @@ -0,0 +1,61 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use crate::dom::audiocontext::AudioContext; +use crate::dom::audionode::AudioNode; +use crate::dom::bindings::codegen::Bindings::MediaStreamTrackAudioSourceNodeBinding::MediaStreamTrackAudioSourceOptions; +use crate::dom::bindings::error::Fallible; +use crate::dom::bindings::inheritance::Castable; +use crate::dom::bindings::reflector::reflect_dom_object; +use crate::dom::bindings::root::{Dom, DomRoot}; +use crate::dom::mediastreamtrack::MediaStreamTrack; +use crate::dom::window::Window; +use dom_struct::dom_struct; +use servo_media::audio::node::AudioNodeInit; + +#[dom_struct] +pub struct MediaStreamTrackAudioSourceNode { + node: AudioNode, + track: Dom, +} + +impl MediaStreamTrackAudioSourceNode { + #[allow(unrooted_must_root)] + pub fn new_inherited( + context: &AudioContext, + options: &MediaStreamTrackAudioSourceOptions, + ) -> Fallible { + let track = options.mediaStreamTrack.id(); + let node = AudioNode::new_inherited( + AudioNodeInit::MediaStreamSourceNode(track), + &context.upcast(), + Default::default(), + 0, // inputs + 1, // outputs + )?; + Ok(MediaStreamTrackAudioSourceNode { + node, + track: Dom::from_ref(&options.mediaStreamTrack), + }) + } + + #[allow(unrooted_must_root)] + pub fn new( + window: &Window, + context: &AudioContext, + options: &MediaStreamTrackAudioSourceOptions, + ) -> Fallible> { + let node = MediaStreamTrackAudioSourceNode::new_inherited(context, options)?; + Ok(reflect_dom_object(Box::new(node), window)) + } + + #[allow(non_snake_case)] + pub fn Constructor( + window: &Window, + context: &AudioContext, + options: &MediaStreamTrackAudioSourceOptions, + ) -> Fallible> { + MediaStreamTrackAudioSourceNode::new(window, context, options) + } +} diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index 7b814df775f..33a6d9e1bdc 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -438,6 +438,7 @@ pub mod mediastream; pub mod mediastreamaudiodestinationnode; pub mod mediastreamaudiosourcenode; pub mod mediastreamtrack; +pub mod mediastreamtrackaudiosourcenode; pub mod messagechannel; pub mod messageevent; pub mod messageport; diff --git a/components/script/dom/webidls/MediaStreamTrackAudioSourceNode.webidl b/components/script/dom/webidls/MediaStreamTrackAudioSourceNode.webidl new file mode 100644 index 00000000000..354b8fa8c85 --- /dev/null +++ b/components/script/dom/webidls/MediaStreamTrackAudioSourceNode.webidl @@ -0,0 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#mediastreamtrackaudiosourcenode + */ + +dictionary MediaStreamTrackAudioSourceOptions { + required MediaStreamTrack mediaStreamTrack; +}; + +[Exposed=Window] +interface MediaStreamTrackAudioSourceNode : AudioNode { + [Throws] constructor (AudioContext context, MediaStreamTrackAudioSourceOptions options); +}; From 0b998a1d1c8add7e0392a3561cea9e138f7fd910 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 2 Jul 2020 11:44:56 -0700 Subject: [PATCH 07/10] Unpref MediaStream and MediaStreamTrack --- components/script/dom/webidls/MediaStream.webidl | 3 +-- components/script/dom/webidls/MediaStreamTrack.webidl | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/components/script/dom/webidls/MediaStream.webidl b/components/script/dom/webidls/MediaStream.webidl index 2129f999f95..3df07a22454 100644 --- a/components/script/dom/webidls/MediaStream.webidl +++ b/components/script/dom/webidls/MediaStream.webidl @@ -4,8 +4,7 @@ // https://w3c.github.io/mediacapture-main/#dom-mediastream -[Exposed=Window, - Pref="dom.webrtc.enabled"] +[Exposed=Window] interface MediaStream : EventTarget { [Throws] constructor(); [Throws] constructor(MediaStream stream); diff --git a/components/script/dom/webidls/MediaStreamTrack.webidl b/components/script/dom/webidls/MediaStreamTrack.webidl index 2f8bfb0bbec..b514360622a 100644 --- a/components/script/dom/webidls/MediaStreamTrack.webidl +++ b/components/script/dom/webidls/MediaStreamTrack.webidl @@ -4,7 +4,7 @@ // https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack -[Exposed=Window, Pref="dom.webrtc.enabled"] +[Exposed=Window] interface MediaStreamTrack : EventTarget { readonly attribute DOMString kind; readonly attribute DOMString id; From 718304709e6be8d8dce3b3a4b20ddd2e0c3b64f2 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 2 Jul 2020 12:02:03 -0700 Subject: [PATCH 08/10] Add AudioContext constructors for media stream nodes --- components/script/dom/audiocontext.rs | 33 +++++++++++++++++++ .../script/dom/mediastreamaudiosourcenode.rs | 13 ++++---- .../dom/mediastreamtrackaudiosourcenode.rs | 13 ++++---- .../script/dom/webidls/AudioContext.webidl | 6 ++-- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/components/script/dom/audiocontext.rs b/components/script/dom/audiocontext.rs index f7fb005f18d..9a5160773f9 100644 --- a/components/script/dom/audiocontext.rs +++ b/components/script/dom/audiocontext.rs @@ -9,6 +9,7 @@ use crate::dom::bindings::codegen::Bindings::AudioContextBinding::{ use crate::dom::bindings::codegen::Bindings::AudioContextBinding::{ AudioContextOptions, AudioTimestamp, }; +use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions; use crate::dom::bindings::codegen::Bindings::BaseAudioContextBinding::AudioContextState; use crate::dom::bindings::codegen::Bindings::BaseAudioContextBinding::BaseAudioContextBinding::BaseAudioContextMethods; use crate::dom::bindings::codegen::UnionTypes::AudioContextLatencyCategoryOrDouble; @@ -20,6 +21,11 @@ use crate::dom::bindings::reflector::{reflect_dom_object, DomObject}; use crate::dom::bindings::root::DomRoot; use crate::dom::htmlmediaelement::HTMLMediaElement; use crate::dom::mediaelementaudiosourcenode::MediaElementAudioSourceNode; +use crate::dom::mediastream::MediaStream; +use crate::dom::mediastreamaudiodestinationnode::MediaStreamAudioDestinationNode; +use crate::dom::mediastreamaudiosourcenode::MediaStreamAudioSourceNode; +use crate::dom::mediastreamtrack::MediaStreamTrack; +use crate::dom::mediastreamtrackaudiosourcenode::MediaStreamTrackAudioSourceNode; use crate::dom::promise::Promise; use crate::dom::window::Window; use crate::realms::InRealm; @@ -254,6 +260,33 @@ impl AudioContextMethods for AudioContext { let window = global.as_window(); MediaElementAudioSourceNode::new(window, self, media_element) } + + /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-createmediastreamsource + fn CreateMediaStreamSource( + &self, + stream: &MediaStream, + ) -> Fallible> { + let global = self.global(); + let window = global.as_window(); + MediaStreamAudioSourceNode::new(window, self, stream) + } + + /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-createmediastreamtracksource + fn CreateMediaStreamTrackSource( + &self, + track: &MediaStreamTrack, + ) -> Fallible> { + let global = self.global(); + let window = global.as_window(); + MediaStreamTrackAudioSourceNode::new(window, self, track) + } + + /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-createmediastreamdestination + fn CreateMediaStreamDestination(&self) -> Fallible> { + let global = self.global(); + let window = global.as_window(); + MediaStreamAudioDestinationNode::new(window, self, &AudioNodeOptions::empty()) + } } impl From for LatencyCategory { diff --git a/components/script/dom/mediastreamaudiosourcenode.rs b/components/script/dom/mediastreamaudiosourcenode.rs index dc0803adec3..f6925af75c3 100644 --- a/components/script/dom/mediastreamaudiosourcenode.rs +++ b/components/script/dom/mediastreamaudiosourcenode.rs @@ -27,10 +27,9 @@ impl MediaStreamAudioSourceNode { #[allow(unrooted_must_root)] pub fn new_inherited( context: &AudioContext, - options: &MediaStreamAudioSourceOptions, + stream: &MediaStream, ) -> Fallible { - let track = options - .mediaStream + let track = stream .get_tracks() .iter() .find(|t| t.ty() == MediaStreamType::Audio) @@ -45,7 +44,7 @@ impl MediaStreamAudioSourceNode { )?; Ok(MediaStreamAudioSourceNode { node, - stream: Dom::from_ref(&options.mediaStream), + stream: Dom::from_ref(&stream), }) } @@ -53,9 +52,9 @@ impl MediaStreamAudioSourceNode { pub fn new( window: &Window, context: &AudioContext, - options: &MediaStreamAudioSourceOptions, + stream: &MediaStream, ) -> Fallible> { - let node = MediaStreamAudioSourceNode::new_inherited(context, options)?; + let node = MediaStreamAudioSourceNode::new_inherited(context, stream)?; Ok(reflect_dom_object(Box::new(node), window)) } @@ -65,7 +64,7 @@ impl MediaStreamAudioSourceNode { context: &AudioContext, options: &MediaStreamAudioSourceOptions, ) -> Fallible> { - MediaStreamAudioSourceNode::new(window, context, options) + MediaStreamAudioSourceNode::new(window, context, &options.mediaStream) } } diff --git a/components/script/dom/mediastreamtrackaudiosourcenode.rs b/components/script/dom/mediastreamtrackaudiosourcenode.rs index 14cc99df056..6399ee5f6a4 100644 --- a/components/script/dom/mediastreamtrackaudiosourcenode.rs +++ b/components/script/dom/mediastreamtrackaudiosourcenode.rs @@ -24,11 +24,10 @@ impl MediaStreamTrackAudioSourceNode { #[allow(unrooted_must_root)] pub fn new_inherited( context: &AudioContext, - options: &MediaStreamTrackAudioSourceOptions, + track: &MediaStreamTrack, ) -> Fallible { - let track = options.mediaStreamTrack.id(); let node = AudioNode::new_inherited( - AudioNodeInit::MediaStreamSourceNode(track), + AudioNodeInit::MediaStreamSourceNode(track.id()), &context.upcast(), Default::default(), 0, // inputs @@ -36,7 +35,7 @@ impl MediaStreamTrackAudioSourceNode { )?; Ok(MediaStreamTrackAudioSourceNode { node, - track: Dom::from_ref(&options.mediaStreamTrack), + track: Dom::from_ref(&track), }) } @@ -44,9 +43,9 @@ impl MediaStreamTrackAudioSourceNode { pub fn new( window: &Window, context: &AudioContext, - options: &MediaStreamTrackAudioSourceOptions, + track: &MediaStreamTrack, ) -> Fallible> { - let node = MediaStreamTrackAudioSourceNode::new_inherited(context, options)?; + let node = MediaStreamTrackAudioSourceNode::new_inherited(context, track)?; Ok(reflect_dom_object(Box::new(node), window)) } @@ -56,6 +55,6 @@ impl MediaStreamTrackAudioSourceNode { context: &AudioContext, options: &MediaStreamTrackAudioSourceOptions, ) -> Fallible> { - MediaStreamTrackAudioSourceNode::new(window, context, options) + MediaStreamTrackAudioSourceNode::new(window, context, &options.mediaStreamTrack) } } diff --git a/components/script/dom/webidls/AudioContext.webidl b/components/script/dom/webidls/AudioContext.webidl index cd9e18edfa0..09d6693b690 100644 --- a/components/script/dom/webidls/AudioContext.webidl +++ b/components/script/dom/webidls/AudioContext.webidl @@ -34,7 +34,7 @@ interface AudioContext : BaseAudioContext { Promise close(); [Throws] MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); - // MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream); - // MediaStreamTrackAudioSourceNode createMediaStreamTrackSource(MediaStreamTrack mediaStreamTrack); - // MediaStreamAudioDestinationNode createMediaStreamDestination(); + [Throws] MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream); + [Throws] MediaStreamTrackAudioSourceNode createMediaStreamTrackSource(MediaStreamTrack mediaStreamTrack); + [Throws] MediaStreamAudioDestinationNode createMediaStreamDestination(); }; From 19f5edf194cda6c03f58d959ac407883c411733d Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 2 Jul 2020 11:40:58 -0700 Subject: [PATCH 09/10] Update WPT --- .../webaudio/idlharness.https.window.js.ini | 162 ------------------ ...audionode-connect-method-chaining.html.ini | 3 - .../ctor-mediastreamaudiodestination.html.ini | 25 --- .../mediastreamaudiosourcenode-ctor.html.ini | 3 - ...ediastreamaudiosourcenode-routing.html.ini | 3 +- tests/wpt/mozilla/meta/MANIFEST.json | 2 +- .../wpt/mozilla/tests/mozilla/interfaces.html | 5 + 7 files changed, 8 insertions(+), 195 deletions(-) delete mode 100644 tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiodestinationnode-interface/ctor-mediastreamaudiodestination.html.ini diff --git a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini index 92e7bc1149e..35ea2279233 100644 --- a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini +++ b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini @@ -20,9 +20,6 @@ [AudioProcessingEvent interface: new AudioProcessingEvent('', {\n playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer\n }) must inherit property "outputBuffer" with the proper type] expected: FAIL - [AudioContext interface: context must inherit property "createMediaStreamSource(MediaStream)" with the proper type] - expected: FAIL - [AudioWorkletNode interface: worklet_node must inherit property "port" with the proper type] expected: FAIL @@ -56,9 +53,6 @@ [AudioNode interface: context.createScriptProcessor() must inherit property "disconnect()" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "context" with the proper type] - expected: FAIL - [Stringification of context.audioWorklet] expected: FAIL @@ -83,12 +77,6 @@ [AudioWorkletNode interface: attribute onprocessorerror] expected: FAIL - [AudioContext interface: context must inherit property "createMediaStreamDestination()" with the proper type] - expected: FAIL - - [MediaStreamAudioSourceNode interface: attribute mediaStream] - expected: FAIL - [ScriptProcessorNode must be primary interface of context.createScriptProcessor()] expected: FAIL @@ -98,9 +86,6 @@ [AudioNode interface: calling connect(AudioParam, unsigned long) on new DynamicsCompressorNode(context) with too few arguments must throw TypeError] expected: FAIL - [MediaStreamAudioDestinationNode interface: attribute stream] - expected: FAIL - [AudioNode interface: calling connect(AudioParam, unsigned long) on new ConvolverNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -116,9 +101,6 @@ [idl_test setup] expected: FAIL - [AudioContext interface: calling createMediaStreamSource(MediaStream) on context with too few arguments must throw TypeError] - expected: FAIL - [DynamicsCompressorNode must be primary interface of new DynamicsCompressorNode(context)] expected: FAIL @@ -143,9 +125,6 @@ [AudioNode interface: context.createScriptProcessor() must inherit property "connect(AudioNode, unsigned long, unsigned long)" with the proper type] expected: FAIL - [MediaStreamAudioSourceNode interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "context" with the proper type] expected: FAIL @@ -215,12 +194,6 @@ [AudioNode interface: new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) must inherit property "connect(AudioNode, unsigned long, unsigned long)" with the proper type] expected: FAIL - [MediaStreamAudioSourceNode interface object name] - expected: FAIL - - [AudioContext interface: context must inherit property "createMediaStreamTrackSource(MediaStreamTrack)" with the proper type] - expected: FAIL - [AudioNode interface: new ConvolverNode(context) must inherit property "channelInterpretation" with the proper type] expected: FAIL @@ -239,9 +212,6 @@ [AudioNode interface: new ConvolverNode(context) must inherit property "disconnect(unsigned long)" with the proper type] expected: FAIL - [MediaStreamAudioDestinationNode interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [AudioParamMap interface: existence and properties of interface object] expected: FAIL @@ -269,12 +239,6 @@ [AudioNode interface: calling disconnect(unsigned long) on new DelayNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioContext interface: operation createMediaStreamSource(MediaStream)] - expected: FAIL - - [MediaStreamAudioSourceNode interface object length] - expected: FAIL - [AudioWorklet interface object name] expected: FAIL @@ -299,9 +263,6 @@ [StereoPannerNode interface: existence and properties of interface object] expected: FAIL - [MediaStreamAudioSourceNode interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - [WaveShaperNode interface object length] expected: FAIL @@ -320,24 +281,15 @@ [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type] - expected: FAIL - [BaseAudioContext interface: context must inherit property "createIIRFilter([object Object\], [object Object\])" with the proper type] expected: FAIL [AudioNode interface: calling disconnect(unsigned long) on new ConvolverNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: calling disconnect(AudioNode) on new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) with too few arguments must throw TypeError] expected: FAIL - [MediaStreamTrackAudioSourceNode interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [AudioNode interface: calling connect(AudioParam, unsigned long) on worklet_node with too few arguments must throw TypeError] expected: FAIL @@ -368,9 +320,6 @@ [AudioParamMap interface object length] expected: FAIL - [AudioContext interface: operation createMediaStreamTrackSource(MediaStreamTrack)] - expected: FAIL - [AudioNode interface: worklet_node must inherit property "disconnect()" with the proper type] expected: FAIL @@ -386,9 +335,6 @@ [DelayNode interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL - [MediaStreamAudioDestinationNode interface: existence and properties of interface prototype object] - expected: FAIL - [AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioNode, unsigned long, unsigned long)" with the proper type] expected: FAIL @@ -410,18 +356,12 @@ [DynamicsCompressorNode interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL - [MediaStreamAudioSourceNode interface: existence and properties of interface object] - expected: FAIL - [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type] expected: FAIL [AudioNode interface: context.createScriptProcessor() must inherit property "channelCount" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "channelCountMode" with the proper type] - expected: FAIL - [AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type] expected: FAIL @@ -509,9 +449,6 @@ [AudioNode interface: worklet_node must inherit property "channelCount" with the proper type] expected: FAIL - [MediaStreamAudioDestinationNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "stream" with the proper type] - expected: FAIL - [DynamicsCompressorNode interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL @@ -539,9 +476,6 @@ [AudioNode interface: worklet_node must inherit property "connect(AudioParam, unsigned long)" with the proper type] expected: FAIL - [MediaStreamAudioDestinationNode interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - [BaseAudioContext interface: operation createIIRFilter([object Object\], [object Object\])] expected: FAIL @@ -578,9 +512,6 @@ [WaveShaperNode interface: existence and properties of interface object] expected: FAIL - [MediaStreamAudioDestinationNode interface: existence and properties of interface object] - expected: FAIL - [OfflineAudioContext interface: operation suspend(double)] expected: FAIL @@ -590,15 +521,6 @@ [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new DelayNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect()" with the proper type] - expected: FAIL - - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect(unsigned long)" with the proper type] - expected: FAIL - - [MediaStreamAudioDestinationNode must be primary interface of new MediaStreamAudioDestinationNode(context)] - expected: FAIL - [WaveShaperNode interface: new WaveShaperNode(context) must inherit property "curve" with the proper type] expected: FAIL @@ -623,9 +545,6 @@ [DynamicsCompressorNode interface: new DynamicsCompressorNode(context) must inherit property "ratio" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "numberOfOutputs" with the proper type] - expected: FAIL - [AudioNode interface: new ConvolverNode(context) must inherit property "connect(AudioNode, unsigned long, unsigned long)" with the proper type] expected: FAIL @@ -695,9 +614,6 @@ [ScriptProcessorNode interface: attribute bufferSize] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long) on new MediaStreamAudioDestinationNode(context) with too few arguments must throw TypeError] - expected: FAIL - [ScriptProcessorNode interface: attribute onaudioprocess] expected: FAIL @@ -716,9 +632,6 @@ [BaseAudioContext interface: context must inherit property "createDynamicsCompressor()" with the proper type] expected: FAIL - [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new MediaStreamAudioDestinationNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioParamMap interface object name] expected: FAIL @@ -743,9 +656,6 @@ [AudioNode interface: new ConvolverNode(context) must inherit property "numberOfInputs" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "channelCount" with the proper type] - expected: FAIL - [AudioProcessingEvent interface object name] expected: FAIL @@ -779,9 +689,6 @@ [AudioNode interface: calling disconnect(AudioNode, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError] expected: FAIL - [MediaStreamTrackAudioSourceNode interface: existence and properties of interface prototype object] - expected: FAIL - [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "channelInterpretation" with the proper type] expected: FAIL @@ -800,9 +707,6 @@ [DynamicsCompressorNode interface: attribute attack] expected: FAIL - [AudioContext interface: calling createMediaStreamTrackSource(MediaStreamTrack) on context with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: calling disconnect(AudioParam, unsigned long) on context.createScriptProcessor() with too few arguments must throw TypeError] expected: FAIL @@ -815,15 +719,9 @@ [AudioNode interface: calling disconnect(AudioParam) on new WaveShaperNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioContext interface: operation createMediaStreamDestination()] - expected: FAIL - [WaveShaperNode must be primary interface of new WaveShaperNode(context)] expected: FAIL - [AudioNode interface: calling disconnect(unsigned long) on new MediaStreamAudioDestinationNode(context) with too few arguments must throw TypeError] - expected: FAIL - [BaseAudioContext interface: calling createScriptProcessor(unsigned long, unsigned long, unsigned long) on context with too few arguments must throw TypeError] expected: FAIL @@ -836,27 +734,15 @@ [AudioProcessingEvent must be primary interface of new AudioProcessingEvent('', {\n playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer\n })] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode) on new MediaStreamAudioDestinationNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: new WaveShaperNode(context) must inherit property "channelInterpretation" with the proper type] expected: FAIL [IIRFilterNode interface object length] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "channelInterpretation" with the proper type] - expected: FAIL - [AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioParam, unsigned long)" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect(AudioNode)" with the proper type] - expected: FAIL - - [AudioNode interface: calling disconnect(AudioParam) on new MediaStreamAudioDestinationNode(context) with too few arguments must throw TypeError] - expected: FAIL - [Stringification of new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]})] expected: FAIL @@ -905,9 +791,6 @@ [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "connect(AudioParam, unsigned long)" with the proper type] expected: FAIL - [MediaStreamTrackAudioSourceNode interface object name] - expected: FAIL - [Stringification of context.createScriptProcessor()] expected: FAIL @@ -950,18 +833,12 @@ [AudioNode interface: new DelayNode(context) must inherit property "numberOfOutputs" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect(AudioParam)" with the proper type] - expected: FAIL - [AudioNode interface: new DelayNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type] expected: FAIL [DynamicsCompressorNode interface: new DynamicsCompressorNode(context) must inherit property "knee" with the proper type] expected: FAIL - [MediaStreamAudioDestinationNode interface object name] - expected: FAIL - [DelayNode interface object name] expected: FAIL @@ -974,9 +851,6 @@ [ConvolverNode interface: existence and properties of interface object] expected: FAIL - [MediaStreamAudioDestinationNode interface object length] - expected: FAIL - [AudioNode interface: new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type] expected: FAIL @@ -1007,9 +881,6 @@ [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "connect(AudioParam, unsigned long)" with the proper type] expected: FAIL - [Stringification of new MediaStreamAudioDestinationNode(context)] - expected: FAIL - [AudioNode interface: new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) must inherit property "disconnect(AudioParam)" with the proper type] expected: FAIL @@ -1037,24 +908,15 @@ [AudioWorkletNode interface object length] expected: FAIL - [MediaStreamTrackAudioSourceNode interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - [DelayNode must be primary interface of new DelayNode(context)] expected: FAIL [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createWaveShaper()" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type] - expected: FAIL - [DynamicsCompressorNode interface: attribute reduction] expected: FAIL - [MediaStreamAudioSourceNode interface: existence and properties of interface prototype object] - expected: FAIL - [AudioNode interface: calling connect(AudioNode, unsigned long, unsigned long) on new DelayNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -1067,15 +929,9 @@ [BaseAudioContext interface: operation createDelay(double)] expected: FAIL - [MediaStreamTrackAudioSourceNode interface: existence and properties of interface object] - expected: FAIL - [DynamicsCompressorNode interface: new DynamicsCompressorNode(context) must inherit property "release" with the proper type] expected: FAIL - [MediaStreamTrackAudioSourceNode interface object length] - expected: FAIL - [BaseAudioContext interface: context must inherit property "createConvolver()" with the proper type] expected: FAIL @@ -1097,9 +953,6 @@ [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on context.createScriptProcessor() with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new MediaStreamAudioDestinationNode(context) with too few arguments must throw TypeError] - expected: FAIL - [ScriptProcessorNode interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL @@ -1136,9 +989,6 @@ [DelayNode interface: attribute delayTime] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "numberOfInputs" with the proper type] - expected: FAIL - [AudioContext interface: operation resume()] expected: FAIL @@ -1217,9 +1067,6 @@ [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type] - expected: FAIL - [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createIIRFilter(sequence, sequence)" with the proper type] expected: FAIL @@ -1232,9 +1079,6 @@ [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type] expected: FAIL - [AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new MediaStreamAudioDestinationNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on worklet_node with too few arguments must throw TypeError] expected: FAIL @@ -1265,9 +1109,6 @@ [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createPeriodicWave(sequence, sequence, optional PeriodicWaveConstraints)" with the proper type] expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: calling connect(AudioParam, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -1307,9 +1148,6 @@ [AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: calling connect(AudioParam, optional unsigned long) on new MediaStreamAudioDestinationNode(context) with too few arguments must throw TypeError] - expected: FAIL - [BaseAudioContext interface: context must inherit property "createPeriodicWave(sequence, sequence, optional PeriodicWaveConstraints)" with the proper type] expected: FAIL diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html.ini index ba34af314d3..86101d8a823 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html.ini @@ -2,6 +2,3 @@ [Executing "from-dictionary"] expected: FAIL - [Executing "media-group"] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiodestinationnode-interface/ctor-mediastreamaudiodestination.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiodestinationnode-interface/ctor-mediastreamaudiodestination.html.ini deleted file mode 100644 index 5bbdd821c80..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiodestinationnode-interface/ctor-mediastreamaudiodestination.html.ini +++ /dev/null @@ -1,25 +0,0 @@ -[ctor-mediastreamaudiodestination.html] - [X node0 = new MediaStreamAudioDestinationNode(context) incorrectly threw TypeError: "window[name\] is not a constructor".] - expected: FAIL - - [< [test AudioNodeOptions\] 1 out of 1 assertions were failed.] - expected: FAIL - - [Executing "default constructor"] - expected: FAIL - - [X new MediaStreamAudioDestinationNode(c, {channelCount: 7}} incorrectly threw TypeError: "window[nodeName\] is not a constructor".] - expected: FAIL - - [< [default constructor\] 1 out of 1 assertions were failed.] - expected: FAIL - - [Executing "test AudioNodeOptions"] - expected: FAIL - - [# AUDIT TASK RUNNER FINISHED: 2 out of 4 tasks were failed.] - expected: FAIL - - [X new MediaStreamAudioDestinationNode(c, {channelCount: 7}) incorrectly threw TypeError: "window[nodeName\] is not a constructor".] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor.html.ini index 701f6dc4718..b20e4392e03 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor.html.ini @@ -1,5 +1,2 @@ [mediastreamaudiosourcenode-ctor.html] expected: ERROR - [MediaStreamAudioSourceNode] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-routing.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-routing.html.ini index 6fbfc5ecb1d..fc8bd9ac25c 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-routing.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-routing.html.ini @@ -1,4 +1,5 @@ [mediastreamaudiosourcenode-routing.html] + expected: TIMEOUT [MediaStreamAudioSourceNode captures the right track.] - expected: FAIL + expected: TIMEOUT diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 9e38fdaca6f..6685ed3c6ff 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -13952,7 +13952,7 @@ ] ], "interfaces.html": [ - "145c902ff033ba1de46b41dec07992fae4fd2f13", + "d988b7939f83cef16a51a4ae5502ed029f31df99", [ null, {} diff --git a/tests/wpt/mozilla/tests/mozilla/interfaces.html b/tests/wpt/mozilla/tests/mozilla/interfaces.html index 145c902ff03..d988b7939f8 100644 --- a/tests/wpt/mozilla/tests/mozilla/interfaces.html +++ b/tests/wpt/mozilla/tests/mozilla/interfaces.html @@ -173,6 +173,11 @@ test_interfaces([ "MediaQueryList", "MediaQueryListEvent", "MediaSession", + "MediaStream", + "MediaStreamAudioDestinationNode", + "MediaStreamAudioSourceNode", + "MediaStreamTrack", + "MediaStreamTrackAudioSourceNode", "MessageChannel", "MessageEvent", "MessagePort", From 3b3e2e0e389798418670db8ada992f00d5cc15f7 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 2 Jul 2020 13:37:33 -0700 Subject: [PATCH 10/10] Add loopback html test --- tests/html/media_stream_audio_nodes_loopback.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/html/media_stream_audio_nodes_loopback.html diff --git a/tests/html/media_stream_audio_nodes_loopback.html b/tests/html/media_stream_audio_nodes_loopback.html new file mode 100644 index 00000000000..4ac6f500fa8 --- /dev/null +++ b/tests/html/media_stream_audio_nodes_loopback.html @@ -0,0 +1,12 @@ +