Storing references on the AudioContext instead of on the AudioNodes will allow
the AudioContext to report them to the cycle collector until offline rendering
starts.
--HG--
extra : transplant_source : %13%87%97%9F%CD%D8V%16%D2%D4%B5%84D%0A%D6%02%9BNj%FC
Storing references on the AudioContext instead of on the AudioNodes will allow
the AudioContext to report them to the cycle collector until offline rendering
starts.
--HG--
extra : transplant_source : %CD%5Els2%7F/%DD%5E%07%08%FE%29%5B%98%95%F3%11G%E6
Storing references on the AudioContext instead of on the AudioNodes will allow
the AudioContext to report them to the cycle collector until offline rendering
starts.
--HG--
extra : transplant_source : %81%83Hp%F6T%E7%9EA%B3%D0%5Dz%EA%1FYv%A2%23%ED
AudioNodes that keep playing or tail-time references need to have these
references cleared when an AudioContext has completed or is shut down by the
window.
Storing references on the AudioContext instead of on the AudioNodes will allow
the AudioContext to report playing references to the cycle collector until
offline rendering starts for bug 914033. This is not necessary for tail-time
references, but it is tidier to use the same code for playing and tail-time
references.
--HG--
extra : transplant_source : %E0%F1%06%BFV%B6XI%9BX%8E%8D7%3FsU%8F%F9%14r
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
Like AudioBufferSourceNode and ScriptProcessorNode, OscillatorNode
holds a self-reference in mPlaying. Keep track of all osc nodes
in the AudioContext and explicitly stop them to make sure this
reference is dropped.
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.
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.
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.