Commit Graph

279 Commits

Author SHA1 Message Date
Karl Tomlinson
da9d3d3591 bug 916387 remove workarounds in tests r=padenot
Zero output channels are used on ScriptProcessorNodes to improve efficiency in
tests when output is not required.

--HG--
extra : rebase_source : f3ddee8031d772bdcedbd482d80d3259a095e0ea
2015-08-06 16:04:23 +12:00
Karl Tomlinson
3a15b165c6 bug 916387 keep ScriptProcessorNode alive after input is GCed r=padenot
--HG--
extra : rebase_source : a9f5d8f4c33845d1548c2daf53d7aced6d6e668b
2015-08-06 17:56:06 +12:00
Karl Tomlinson
fda85fcc8b bug 916387 add a notification of garbage collected input node r=padenot
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
2015-08-06 14:15:40 +12:00
Karl Tomlinson
487efc8f27 bug 1191649 determine ScriptProcessor connected status on main thread r=padenot
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
2015-08-06 16:22:56 +12:00
Karl Tomlinson
e35277a491 bug 1191649 add notification of input node changes r=padenot
--HG--
extra : rebase_source : 71b101935ef10b5fa01008234897c0bb2c6979ba
2015-08-06 19:25:53 +12:00
Karl Tomlinson
b78f6f2712 bug 1191648 don't create audioprocess event when there is no listener r=padenot
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
2015-08-10 12:51:37 +12:00
Karl Tomlinson
d03299a57a bug 1191648 don't keep ScriptProcessorNode alive when it has no audioprocess listener r=padenot
--HG--
extra : rebase_source : 49b8c338a3cd645a67937a7584cba666512b31b6
2015-08-06 19:28:10 +12:00
Ehsan Akhgari
f22dea9a72 Bug 1190040 - Part 2: Teach the audio channel service how to not notify audio-playback, and do that when a media element has no audio track; r=padenot 2015-08-06 10:26:27 -04:00
Aryeh Gregor
2311382621 Bug 1191305 - Alphabetize some includes; r=froydnj 2015-08-06 15:45:21 +03:00
Aryeh Gregor
80ea0a3e53 Bug 1190823 - Move OwningNonNull.h to xpcom/base/; r=froydnj
--HG--
rename : dom/bindings/OwningNonNull.h => xpcom/base/OwningNonNull.h
2015-08-05 15:28:27 +03:00
Karl Tomlinson
0f7fc2c09c bug 1184801 Test output of AnalyserNode with GainNode
--HG--
extra : rebase_source : 2158db1151e6b4dd3c862635c1bec4e0498a9135
2015-07-28 11:03:31 +12:00
Karl Tomlinson
d149f45532 bug 1189168 avoid main thread assertion accessing mNode in SizeOfIncludingThis() r=padenot
because the main thread is blocked during the call.

--HG--
extra : rebase_source : 5ab42bd4d8a14e66e34781456ad11c6b48dc6227
2015-07-31 12:49:07 +12:00
Nicholas Nethercote
1059c1de13 Bug 1189156 (part 2) - Don't use enumeration style for nsTHashtable::SizeOf{In,Ex}cludingThis(). r=erahm.
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
2015-07-29 01:50:52 -07:00
Jan-Ivar Bruaroey
0ccb51ddc8 Bug 1175523 - Update most (but not all) tests to use elem.srcObject over .mozSrcObject. r=pehrsons
--HG--
extra : rebase_source : bac0027f4bf5d75b8730c44a10141c114002633b
2015-07-14 10:12:31 -04:00
Karl Tomlinson
66f210c5b0 bug 1188704 remove now unused PerformInverseFFT() variation r=rillian
--HG--
extra : rebase_source : 13b3cfce3054fce463d0e2407bd48e343952830e
2015-07-30 12:51:48 +12:00
Karl Tomlinson
a4757ceda3 bug 1188704 use existing FFTBlock arrays instead of allocating and copying and scaling r=rillian
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
2015-08-03 09:28:32 +12:00
Karl Tomlinson
e8e61ee28e bug 1188704 add accessor functions for setting frequency components for inverse FFT r=rillian
--HG--
extra : rebase_source : cfd4b300d5437793dc60f4e0630fa393cc234b9d
2015-07-30 12:33:04 +12:00
Karl Tomlinson
6ca6918802 bug 1188704 combine scaling with copying r=rillian
--HG--
extra : rebase_source : f30aed44b66cca842a752a207ab9536e3cb395b2
2015-07-28 15:58:06 +12:00
Karl Tomlinson
893dc9cca8 bug 1188704 simplify culling of partials r=rillian
avoiding copying and scaling components that will be zeroed.

--HG--
extra : rebase_source : a649e78254296945d89f5e03dc75e6af753e56b4
2015-07-28 08:37:21 +12:00
Karl Tomlinson
a4daa97373 bug 1188704 limit number of Fourier coefficients used to halfSize earlier r=rillian
realP[halfSize] was always set to zero because numberOfPartials < halfSize + 1
was always true.

--HG--
extra : rebase_source : 819b04a56032d810231a16fa0dd139cf82ef8ddf
2015-07-30 10:08:15 +12:00
Karl Tomlinson
0ffb72d8eb bug 1188704 trim unnecessary extra basic waveform coeffient r=rillian
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
2015-07-27 23:55:06 +12:00
Karl Tomlinson
0ebb28aa85 bug 1188704 redefine halfSize as fftSize / 2 r=rillian
There are no behavior changes here, just the change in meaning of the variable.

--HG--
extra : rebase_source : 9bae9f29a27430e9074dc0337773313140af9ba2
2015-07-27 22:41:31 +12:00
Nicholas Nethercote
87b80f8c66 Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj.
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
2015-07-28 23:24:24 -07:00
Karl Tomlinson
8b0dccbf5a bug 1188244 throw in SetCurve() on OOM r=padenot
--HG--
extra : rebase_source : 8b8709fb2bb1765eca65248437a9d58232c34fdb
2015-07-27 21:19:27 +12:00
Karl Tomlinson
a905a14a19 bug 1187785 reverse tableInterpolationFactor to make it consistent with documentation r=rillian
tableInterpolationFactor = 0 now means use lowerWaveData, which is
rangeIndex2.

--HG--
extra : rebase_source : a8e1b64c534cf2e9aea92dd8a06a4eeee8403d73
2015-07-27 16:59:17 +12:00
Karl Tomlinson
8fa05ce9cd bug 1187785 test periodic wave band limiting
--HG--
extra : rebase_source : 4124c181cbf5eb46e5c4067faf5298947ebcfb33
2015-07-29 11:57:56 +12:00
Drew Willcoxon
e004f2a723 Bug 1183044 - Properly mute AudioContext when there's an attempt to mute it before it has a destination. r=ehsan 2015-07-28 12:34:33 -07:00
Karl Tomlinson
a6cc0725e8 bug 1186781 skip reallocation when audio block is not shared r=padenot
--HG--
extra : rebase_source : d470e7d14716606bf97b06be05637441b4d2a9ef
2015-07-22 18:51:11 +12:00
Karl Tomlinson
639872f1ff bug 1186779 use ChannelFloatsForWrite() instead of const_cast r=padenot
--HG--
extra : rebase_source : 324b2fbf4addbac848b7a74b048d67ba7c461b0c
2015-07-22 17:59:21 +12:00
Karl Tomlinson
63508ac5a4 bug 1186779 add a method to cast AudioChunk data for writing when not shared r=padenot
--HG--
extra : rebase_source : 3c86cdf69877e4e13a2e7b3c208c2ccb3107390f
2015-07-22 18:43:30 +12:00
Karl Tomlinson
e33037127f bug 1184801 process AnalyserNode input only when required r=padenot
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
2015-07-22 19:50:37 +12:00
Karl Tomlinson
15660ce0a3 bug 1184801 Test effect of AnalyserNode on GainNode output
--HG--
extra : rebase_source : 76315743a411d75937dfa85ecfaddce66864bd87
2015-07-17 13:24:54 +12:00
Paul Adenot
2ab300ac7b Bug 1156472 - Part 6 - Connect HTMLMediaElement and AudioContext to the capture stream when capturing is needed. r=roc 2015-07-24 14:28:17 +02:00
Paul Adenot
6187533e7d Bug 1156472 - Part 1 - Allow to capture all HTMLMediaElements and AudioContexts for a document. r=baku,padenot
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.
2015-07-09 16:40:08 +02:00
Wes Kocher
83b4188234 Backed out 14 changesets (bug 1156472) for test_getUserMedia_audioCapture.html failures on b2g emulator
Backed out changeset deec8eb18346 (bug 1156472)
Backed out changeset 0f5bec4c05ba (bug 1156472)
Backed out changeset 2dd83ac00bf9 (bug 1156472)
Backed out changeset abd4e47887f7 (bug 1156472)
Backed out changeset 4824d9874663 (bug 1156472)
Backed out changeset 12805598e6fa (bug 1156472)
Backed out changeset e2f0062a1f67 (bug 1156472)
Backed out changeset 99ef8e436a7f (bug 1156472)
Backed out changeset 65bbfc1546af (bug 1156472)
Backed out changeset 2ab4f16eaf0a (bug 1156472)
Backed out changeset 7f565685e20a (bug 1156472)
Backed out changeset 28c03c98cb2b (bug 1156472)
Backed out changeset d477cfba6e1d (bug 1156472)
Backed out changeset 9819fa56caa1 (bug 1156472)
2015-07-24 13:15:57 -07:00
Paul Adenot
b195db60a7 Bug 1156472 - Part 6 - Connect HTMLMediaElement and AudioContext to the capture stream when capturing is needed. r=roc 2015-07-24 14:28:17 +02:00
Paul Adenot
7c02310414 Bug 1156472 - Part 1 - Allow to capture all HTMLMediaElements and AudioContexts for a document. r=baku,padenot
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.
2015-07-09 16:40:08 +02:00
Carsten "Tomcat" Book
2b73aa4f63 Backed out 14 changesets (bug 1156472) for bustage on a CLOSED TREE
Backed out changeset 2ddbf85a42c0 (bug 1156472)
Backed out changeset 306d02e17081 (bug 1156472)
Backed out changeset 03598139f39a (bug 1156472)
Backed out changeset 4b1e6069b598 (bug 1156472)
Backed out changeset 6c588a5eaaec (bug 1156472)
Backed out changeset 8c98d7beaea7 (bug 1156472)
Backed out changeset fbf59fbb5875 (bug 1156472)
Backed out changeset 66479dd9eed9 (bug 1156472)
Backed out changeset c8502deeed33 (bug 1156472)
Backed out changeset 1a60ff1149a1 (bug 1156472)
Backed out changeset af1638279785 (bug 1156472)
Backed out changeset 8210276a98ca (bug 1156472)
Backed out changeset 13730e7c5997 (bug 1156472)
Backed out changeset 05acb71cf981 (bug 1156472)
2015-07-24 17:08:37 +02:00
Paul Adenot
c1a9ba0ab9 Bug 1156472 - Part 6 - Connect HTMLMediaElement and AudioContext to the capture stream when capturing is needed. r=roc 2015-07-24 14:28:17 +02:00
Paul Adenot
bae1e652bf Bug 1156472 - Part 1 - Allow to capture all HTMLMediaElements and AudioContexts for a document. r=baku,padenot
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.
2015-07-09 16:40:08 +02:00
Paul Adenot
6175cb8a69 Bug 1185176 - Account for the fact that it is possible for nodes to not have streams. r=karlt
We can now destroy a stream earlier than the node for performance reasons.
2015-07-24 15:09:19 +02:00
Benjamin Bouvier
676d79811c Bug 1186343: Throw an InvalidStateError when we set the curve attribute of a WaveShaperNode with a Float32Array of length less than 2; r=padenot,smaug
--HG--
rename : dom/media/webaudio/test/test_waveShaperZeroLengthCurve.html => dom/media/webaudio/test/test_waveShaperInvalidLengthCurve.html
extra : commitid : 6mncD6YlIar
extra : rebase_source : 2522698bcb1e1dcdb4047d8c5ab61f6caba8875e
extra : amend_source : 21cdb3f06b100a5b3a078dbc38ffeecedc675bae
2015-07-22 13:32:12 +02:00
Bobby Holley
04eaf4c167 Bug 1184634 - Move various includes into the mozilla namespace. r=gerald
I did my a quick best-effort pass to fix up the most egregious ordering
problems. I left some big pre-existing messes alone.
2015-07-16 22:23:18 -07:00
Bobby Holley
997543e6ba Bug 1184634 - Rename MediaTaskQueue to TaskQueue. r=gerald 2015-07-16 22:23:06 -07:00
Bobby Holley
78001ffc43 Bug 1184634 - Rename "TaskQueue()" accessor to "OwnerThread()". r=gerald
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.
2015-07-16 22:22:07 -07:00
Karl Tomlinson
7ca1ccc3cc bug 914392 don't check engine's Node existence in ProcessBlock r=padenot
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
2015-07-14 23:11:59 +12:00
Karl Tomlinson
c9fab7e34e bug 914392 move mSharedBuffers ownership to engine r=padenot
so that it is always available.

--HG--
extra : rebase_source : b30ba835c2048a1316f436525fc98b695f7233bc
2015-07-14 22:51:44 +12:00
Karl Tomlinson
d907e81454 bug 914392 use NodeMainThread() to avoid NodeMutex() use on main thread r=padenot
--HG--
extra : rebase_source : 69ba42aeada680ff8d4c7bb3a78cb506551526bb
2015-07-14 21:57:01 +12:00
Ehsan Akhgari
89d446ad7d Bug 1184419 - Part 2: Get rid of HRTFDatabaseLoader::shutdownEnumFunc; r=padenot 2015-07-16 14:47:59 -04:00
Ehsan Akhgari
860198febf Bug 1184419 - Part 1: Get rid of FindConnectedSourcesOn; r=padenot 2015-07-16 14:47:58 -04:00