Commit Graph

30 Commits

Author SHA1 Message Date
JW Wang
3636dfe0e3 Bug 927322 - AudioDestinationNode should support weak reference; r=ehsan 2013-10-16 17:27:45 +08:00
Andrea Marchesini
a51331fdcf Bug 924870 - AudioContext.mozAudioChannel attribute, r=ehsan 2013-10-11 13:55:47 +02:00
Andrea Marchesini
5b731001cd Bug 874508 - Web Audio is connected to AudioChannelService, r=ehsan 2013-10-08 20:20:33 +02:00
Carsten "Tomcat" Book
f5d6799f05 Backed out changeset b607cc162c2c (bug 874508) for causing perma orange b2g-crashtest failures 2013-10-04 16:31:02 +02:00
Andrea Marchesini
b8d1c01e56 Bug 874508 - Web Audio is connected to AudioChannelService, r=ehsan 2013-10-04 06:27:49 -04:00
Phil Ringnalda
8459f2486d Backed out changeset 643354059afb (bug 874508) for b2g build bustage
CLOSED TREE
2013-10-03 20:11:58 -07:00
Andrea Marchesini
5635de1215 Bug 874508 - Web Audio is connected to AudioChannelService, r=ehsan 2013-10-03 18:42:04 -04:00
Karl Tomlinson
91b88fa3bd b=914030 keep a self reference on destination while offline context is rendering r=ehsan
--HG--
extra : transplant_source : %FAk%98%E7%CB%2C%C6uf%EE%F4%CFq%3D%A7%D1%D6%E9%F1%29
2013-09-10 17:10:53 +12:00
Karl Tomlinson
7f81f91b49 b=914030 shutdown an OfflineAudioContext when it has completed r=ehsan
This is needed to remove self-references in the graph when no more processing
will take place on the graph.

--HG--
extra : transplant_source : %EC%82%A8s%3D%08%E4%FB%8C%A5%A6%28d/2%89Rz%98s
2013-09-10 17:10:36 +12:00
Karl Tomlinson
7a48a1f657 b=914030 shut down an AudioDestinationNode's graph on destruction, if not already r=ehsan
This means that the graph will be shutdown properly, even if the
AudioDestinationNode is unlinked before AudioContext::Shutdown() is called.

Making MediaStreamGraph::DestroyNonRealtimeInstance() idempotent also makes
AudioContext::Shutdown() idempotent.

--HG--
extra : transplant_source : jZ%86%C5%C2n%17%EF%C2%C0y%ED%14%0E%17_dt%0C%07
2013-09-10 17:05:22 +12:00
Drew Willcoxon
9a245e82e1 Bug 879111 - Mute Web Audio when allowMedia is false on the docshell. r=ehsan 2013-07-03 17:44:32 -07:00
Paul Adenot
7bd9ae8ec4 Bug 865244 - Implement AudioContext.destination.maxChannelCount. r=ehsan 2013-06-10 19:32:28 +02:00
Ehsan Akhgari
2577c23c9a Bug 877125 - Handle the case where the expected number of channels for the offline AudioDestinationNode and the actual input number of channels do not match; r=roc
--HG--
extra : rebase_source : 432c10fe039b24b1aea1d0329ebef37f9e62cd0a
2013-05-29 19:33:14 -04:00
Ehsan Akhgari
d2c63bc836 Bug 836599 - Part 12: Fix the lifetime management of the Web Audio graph in presence of OfflineAudioContexts; r=roc
Here we make the non-realtime graphs to go to sleep until they're shut down
from the main thread.  This allows us to use the common forced shutdown code
path in MediaStreamGraphImpl::RunThread.  We also need to delete the graph
object when the last message is dispatched to it.

In addition, we need to make sure that the AudioNodes also get released when
they're no longer needed.  To do this, we need for force the SelfReference of
AudioBufferSourceNodes to be released when the context is shut down, and also
trigger the destruction of the graph there.
2013-05-16 19:31:08 -04:00
Ehsan Akhgari
e31cd426d8 Bug 836599 - Part 11: Implement the processing of OfflineAudioContext; r=roc
We use a custom AudioNodeEngine for the destination nodes belonging to
OfflineAudioContexts, and there we record the rendered buffer.  Once the buffer
is full, we resample it if the sampling rate of the OfflineAudioContext is
different than the ideal sampling rate, and then we hand it off to the main
thread in order for the complete event to be dispatched.
2013-05-16 19:30:57 -04:00
Ehsan Akhgari
1428a73574 Bug 836599 - Part 10: Use the non-realtime MediaStreamGraph API and a custom destination node engine for OfflineAudioContext; r=roc
We offload most of the logic for OfflineAudioContext to the destination node,
since that's where the sample recording needs to happen, so doing this will
make the code simpler.
2013-05-16 19:30:42 -04:00
Ehsan Akhgari
b040e0542f Bug 865234 - Part 1: Add DOM bindings for the channel mixing attributes; r=roc 2013-04-27 18:44:50 -04:00
Boris Zbarsky
9c1973b5d2 Bug 864727 part 5. Make all the WrapObject methods take a handle for the scope object. r=ms2ger 2013-04-25 12:29:54 -04:00
Ehsan Akhgari
f25c4a0e7e Bug 834513 - Part 2: Add an AudioNode weak pointer to the AudioNodeEngine class; r=roc 2013-04-20 12:16:28 -04:00
Ehsan Akhgari
ff2971de14 Bug 853298 - Part 1: Switch the ownership model of audio nodes to be based the cycle collector with wrapper caches; r=roc
Here is what this patch does:
 * Got rid of the JSBindingFinalized stuff
 * Made all nodes wrappercached
 * Started to hold a self reference while the AudioBufferSourceNode is playing back
 * Converted the input references to weak references
 * Got rid of all of the SetProduceOwnOutput and UpdateOutputEnded logic

The nodes are now collected by the cycle collector which calls into
DisconnectFromGraph which drops the references to other nodes and destroys the
media stream.  Note that most of the cycles that are now inherent in the
ownership model are between nodes and their AudioParams (that is, the cycles
not created by content.)
2013-04-14 21:52:55 -04:00
Ehsan Akhgari
c704fae974 Bug 851966 - Only store the produced AudioChunks for AudioNodeStreams that will result in playback; r=roc 2013-03-17 20:37:47 -04:00
Masatoshi Kimura
e5e5a90814 Bug 848339 - Remove the vestigial boolean outparam from nsWrapperCache::WrapObject. r=bz 2013-03-12 08:03:47 +09:00
Andrew McCreight
8fb2f37eed Bug 839753 - Fix up CC implementation for AudioDestinationNode. r=smaug 2013-02-12 08:42:59 -08:00
Robert O'Callahan
088271f880 Bug 804387. Part 9: Update WebAudio implementation to integrate with AudioNodeStream. r=ehsan
This is a mega-patch that was too hard to disentangle. Here's what it does:
-- Create infrastructure around AudioNode::UpdateOutputEnded to detect
when a node can no longer produce any output. When that becomes true,
disconnect it from the AudioNode graph.
-- Have AudioNode implement JSBindingFinalized to use as input in
UpdateOutputEnded.
-- Give every AudioNode a MediaStream, and give every connection
a MediaInputPort.
-- Actually play the audio that reaches the AudioContext's destination node.
-- Force AudioContext to use the audio sample rate defined by MediaStreamGraph.
-- Fix AudioBufferSourceNode's start and stop methods to possibly throw and
take default 'when' parameters.
-- Create an AudioNodeStream for AudioBufferSourceNode and give it a
AudioBufferSourceNodeEngine that does what's needed. Set parameters for
this engine in the start() and stop() methods.
-- Create AudioBuffer::GetThreadSharedChannelsForRate, which is responsible
for stealing the contents of any JS array buffers, and bundling them up
into a thread-shared read-only buffer object which can be used as
part of an AudioChunk. This method will also be responsible for
resampling and caching as necessary.

--HG--
rename : content/media/MediaStreamGraph.cpp => content/media/MediaStreamGraphImpl.h
extra : rebase_source : 9fa0ec0efa304acd6513e427103d6339c78efa53
2013-02-05 12:07:25 +13:00
Ehsan Akhgari
631b308649 Backed out 14 changesets (bug 804387) because of Android M2 crashes
Backed out changeset 80e8530f06ea (bug 804387)
Backed out changeset 3de2271ad47f (bug 804387)
Backed out changeset 00f86870931c (bug 804837)
Backed out changeset 0e3f20927c50 (bug 804387)
Backed out changeset e6ef90038007 (bug 804387)
Backed out changeset 0ad6f67a95f9 (bug 804387)
Backed out changeset d0772aba503c (bug 804387)
Backed out changeset 5477b87ff03e (bug 804387)
Backed out changeset 1d7ec5adc49f (bug 804387)
Backed out changeset 11f4d740cd6c (bug 804387)
Backed out changeset e6254d8997ab (bug 804387)
Backed out changeset 372322f3264d (bug 804387)
Backed out changeset 53d5ed687612 (bug 804387)
Backed out changeset 000b88ac40a7 (bug 804387)
2013-02-05 01:29:28 -05:00
Robert O'Callahan
45c5e4a1ad Bug 804837. Part 9: Update WebAudio implementation to integrate with AudioNodeStream. r=ehsan
This is a mega-patch that was too hard to disentangle. Here's what it does:
-- Create infrastructure around AudioNode::UpdateOutputEnded to detect
when a node can no longer produce any output. When that becomes true,
disconnect it from the AudioNode graph.
-- Have AudioNode implement JSBindingFinalized to use as input in
UpdateOutputEnded.
-- Give every AudioNode a MediaStream, and give every connection
a MediaInputPort.
-- Actually play the audio that reaches the AudioContext's destination node.
-- Force AudioContext to use the audio sample rate defined by MediaStreamGraph.
-- Fix AudioBufferSourceNode's start and stop methods to possibly throw and
take default 'when' parameters.
-- Create an AudioNodeStream for AudioBufferSourceNode and give it a
AudioBufferSourceNodeEngine that does what's needed. Set parameters for
this engine in the start() and stop() methods.
-- Create AudioBuffer::GetThreadSharedChannelsForRate, which is responsible
for stealing the contents of any JS array buffers, and bundling them up
into a thread-shared read-only buffer object which can be used as
part of an AudioChunk. This method will also be responsible for
resampling and caching as necessary.
2013-02-05 12:07:25 +13:00
Robert O'Callahan
fc44cd635c Bug 804837. Part 0: Rework the connection and input/output port logic for Web Audio nodes; r=ehsan
Here's what this patch does:
-- Makes AudioNodes mostly not use nsWrapperCache. AudioDestinationNode
still does.
-- Rename MaxNumberOfInputs/Outputs to NumberOfInputs/Outputs, and have them
default to 1 in AudioNode.
-- Allow any number of nodes to be connected to any given input/output port.
2013-01-23 19:50:18 -05:00
Ehsan Akhgari
0a35cb68cb Bug 792646 - Implement the skeleton of Web Audio source and destination nodes; r=bzbarsky
This is the bare minimum that one needs in order to get those interfaces
implemented.  The work to make the simplest of Web Audio test cases
actually pass will be done in bug 792649.
2012-09-21 11:33:03 -04:00
Ehsan Akhgari
bc04fdf9fc Backout changeset 7d0776416955 (bug 792646) because of leaks 2012-09-20 19:47:07 -04:00
Ehsan Akhgari
a26464712e Bug 792646 - Implement the skeleton of Web Audio source and destination nodes; r=bzbarsky
This is the bare minimum that one needs in order to get those interfaces
implemented.  The work to make the simplest of Web Audio test cases
actually pass will be done in bug 792649.
2012-09-20 18:05:38 -04:00