Zero output channels are used on ScriptProcessorNodes to improve efficiency in
tests when output is not required.
--HG--
extra : rebase_source : f3ddee8031d772bdcedbd482d80d3259a095e0ea
The effects of garbage collection must not be observable. We can collect an
AudioNode if it is not going to cause any further changes, but we must keep
any current effects.
--HG--
extra : rebase_source : f7ce500de2afd4f6cdff79c30c99a0ee8e74ab40
because stream inputs may be removed when only providing null data.
The ScriptProcessor is also kept alive when it has only input nodes so that it
is not garbage collected when its input nodes are collected.
--HG--
extra : rebase_source : ee70db1b3e13b212107e048620880b929c662ad6
Creating the event added a reference to the ScriptProcessorNode, which wasn't
released until the AudioProcessingEvent was destroyed in
nsCycleCollector::FreeSnowWhite().
If another event is dispatched before cycle collection considers the
ScriptProcessorNode, then the node will not be collected.
Also, the reference count of the ScriptProcessorNode is no longer toggled
because this seemed to interfere with the cycle collection process.
--HG--
extra : rebase_source : 41878e716fe3fcc8f46f518be2a50d050b8ed14c
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)
And we still have the existing single-arg SizeOf{In,Ex}cluding() functions,
which work if the entry type itself defines SizeOfExcludingThis().
--HG--
extra : rebase_source : f93de9b789c21b1b148bed9de795f663f77c9dd9
It is now no longer necessary to clear zero bins because these are zeroed
in the FFTBlock constructor.
nsTArray bounds assertions now apply.
--HG--
extra : rebase_source : 18c07ecb51f9cb3c199536fe59110093db2295d4
realP[halfSize] was always set to zero because numberOfPartials < halfSize + 1
was always true.
--HG--
extra : rebase_source : 819b04a56032d810231a16fa0dd139cf82ef8ddf
The built-in waveforms are all odd and so realP[halfSize] was zero, and it
would have been ignored in createBandLimitedTables even if it was non-zero.
imagP[halfSize] was ignored as it was not involved in the inverse FFT.
This returns the code to that prior to
https://hg.mozilla.org/mozilla-central/diff/5377bce3b478/content/media/webaudio/blink/PeriodicWave.cpp#l1.276
--HG--
extra : rebase_source : 1bfa9eefc7dd269a64a98cdfdd4cbf76fa207dc4
There are no behavior changes here, just the change in meaning of the variable.
--HG--
extra : rebase_source : 9bae9f29a27430e9074dc0337773313140af9ba2
This makes it clearer that, unlike how SizeOf*() functions usually work, this
doesn't measure any children hanging off the array.
And do likewise for nsTObserverArray.
--HG--
extra : rebase_source : 6a8c8d8ffb53ad51b5773afea77126cdd767f149
tableInterpolationFactor = 0 now means use lowerWaveData, which is
rangeIndex2.
--HG--
extra : rebase_source : a8e1b64c534cf2e9aea92dd8a06a4eeee8403d73
This moves the application of volume and averaging of channels to the main
thread, performed when required. It avoids a potential allocation on the
graph thread. If doing a full analysis for frequency data, the extra work on
the main thread should be negligible. I assume that repeatedly fetching the
same time domain data with getFloatFrequencyData() is not something we need to
optimize for. If, in rare circumstances, the extra main thread work turns out
to be significant, then the main thread work in getters is self-regulating,
but too much load on the graph thread leads to catastrophic failure in the
audio.
This also fixes some bugs:
Input and output streams for other consumers are not corrupted by in-place
scaling of data intended to be read-only.
When there are additional channels and fftSize < WEBAUDIO_BLOCK_SIZE, the
channels are not written past the current length of a buffer, so there is no
longer a dependency on nsTArray's behavior of never not reducing allocation
size on length changes.
The most recent fftSize samples are now used even when fftSize <
WEBAUDIO_BLOCK_SIZE, instead of the first fftSize samples in the most recent
block.
Enough time domain data is recorded so that getters will work immediately
following a change in fftSize.
--HG--
extra : rebase_source : bbd8a3e705d73781bb838a47261bf7d60cd1a9a7
This is built on top of the AudioChannel infrastructure. This patch does not
actually implement the capture, it just does the plumbing to be able to notify
all HTMLMediaElement/AudioContext for a document.
This is built on top of the AudioChannel infrastructure. This patch does not
actually implement the capture, it just does the plumbing to be able to notify
all HTMLMediaElement/AudioContext for a document.
This is built on top of the AudioChannel infrastructure. This patch does not
actually implement the capture, it just does the plumbing to be able to notify
all HTMLMediaElement/AudioContext for a document.
Otherwise this name will collide with the rename of MediaTaskQueue to TaskQueue.
It's also a better naming convention, because it generalizes to things that are
owned by an AbstractThread that is not a Task Queue.
We rename to Queue() in TestMozPromise, because that's more accurate.
If DestroyMediaStream() has cleared the node on the engine, then it will call
MediaStream::Destroy(). I doubt the additional code and cost of repeatedly
checking this is worth the savings in no-op events dispatched to main thread
between MediaStream::Destroy() on the main thread and destruction on the graph
thread.
Also ScriptProcessorNode should not be potentially ignoring its output buffer
immediately when the ScriptProcessor loses its last reference. At least the
block currently being processed should output the output buffer.
(Deterministically playing the remainder of the output buffer would be best.)
--HG--
extra : rebase_source : 279f08808f4fbdbb41d67da0c3e495b65fdb24de