Commit Graph

1306 Commits

Author SHA1 Message Date
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Karl Tomlinson
35faeb0880 bug 1558123 call AudioWorkletProcessor.process() r=padenot,bzbarsky
https://heycam.github.io/webidl/#call-a-user-objects-operation may be a
simpler option here, but there are some small optimizations possible with
using JS::Call() directly:
JS::ExposeObjectToActiveJS() is not necessary because parameters are
PersistentRooted and so won't be gray.  MaybeWrapObjectValue() is not
necessary because parameters are already in the appropriate compartment.

See also https://github.com/WebAudio/web-audio-api/issues/1967 and
https://github.com/WebAudio/web-audio-api/issues/1933

Microtask support is tracked in
https://bugzilla.mozilla.org/show_bug.cgi?id=1566312

Differential Revision: https://phabricator.services.mozilla.com/D34838

--HG--
extra : moz-landing-system : lando
2019-07-17 08:20:45 +00:00
Karl Tomlinson
87d828f979 Bug 1558123 copy audio samples to/from JS arrays r=padenot
Direct use of aInput buffers for ArrayBuffer elements is not possible in
general.  aInput buffers are const because they may be used elsewhere but
ArrayBuffer elements may be modified by script.  If necessary, it would be
possible to later add a mechanism to mix inputs directly into the ArrayBuffer,
but often no mixing is required.

Direct use of output ArrayBuffer elements would require DetachArrayBuffer to
ensure the elements are not modified by script, but that would require
creation of a new ArrayBuffer JS object on each call.

https://github.com/WebAudio/web-audio-api/issues/1932 tracks specification of
making output data available for reading (for downstream node input).

Differential Revision: https://phabricator.services.mozilla.com/D34837

--HG--
extra : moz-landing-system : lando
2019-07-17 06:36:43 +00:00
Karl Tomlinson
44690447a6 bug 1558123 create JSObjects for inputs/outputs AudioWorkletProcessor.process() parameters r=padenot,bzbarsky
Objects are retained for re-use so as to reduce garbage generation and other
performance benefits.  This is currently unspecified.

https://github.com/WebAudio/web-audio-api/issues/1934
https://github.com/WebAudio/web-audio-api/issues/1933

https://github.com/WebAudio/web-audio-api/issues/1935 tracks specification of
zero-channels of input when inputs are not actively processing.

Differential Revision: https://phabricator.services.mozilla.com/D34836

--HG--
extra : moz-landing-system : lando
2019-07-16 20:27:39 +00:00
Karl Tomlinson
46486e57c9 bug 1558123 set AudioWorkletNode output channel counts r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D34835

--HG--
extra : moz-landing-system : lando
2019-07-16 04:40:33 +00:00
Karl Tomlinson
442e4282a1 Bug 1558123 Pass spans to ProcessBlocksOnPorts to facilitate forwarding from ProcessBlock() r=padenot
It is easier to make a span than an nsTArray.

This also clarifies that the output array lengths are not modified.

Depends on D34833

Differential Revision: https://phabricator.services.mozilla.com/D34834

--HG--
extra : moz-landing-system : lando
2019-06-14 16:06:22 +00:00
Karl Tomlinson
2f7457ad55 Bug 1542931 Construct AudioWorkletProcessor for each AudioWorkletNode r=padenot,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D34482

--HG--
extra : moz-landing-system : lando
2019-07-17 18:58:57 +00:00
Karl Tomlinson
ff940f743d Bug 1542931 add a mechanism to notify engine on graph thread of forced shutdown r=padenot
This will be used to release the AudioWorkletProcessor on the correct thread.

Depends on D34480

Differential Revision: https://phabricator.services.mozilla.com/D34481

--HG--
extra : moz-landing-system : lando
2019-06-14 15:04:48 +00:00
Karl Tomlinson
64d6bd309f Bug 1542931 add WorkletNodeEngine and send control message for processor construction r=padenot
Depends on D34479

Differential Revision: https://phabricator.services.mozilla.com/D34480

--HG--
extra : moz-landing-system : lando
2019-06-14 15:04:12 +00:00
Karl Tomlinson
4891262c8d Bug 1542931 serialize AudioWorkletNodeOptions r=padenot
Depends on D34478

Differential Revision: https://phabricator.services.mozilla.com/D34479

--HG--
extra : moz-landing-system : lando
2019-06-14 13:23:57 +00:00
Karl Tomlinson
0d0c740557 Bug 1542931 Add AudioWorkletProcessorConstructor r=bzbarsky
https://github.com/WebAudio/web-audio-api/issues/1839

Depends on D34476

Differential Revision: https://phabricator.services.mozilla.com/D34477

--HG--
extra : moz-landing-system : lando
2019-06-11 15:45:45 +00:00
Karl Tomlinson
f94d893bf3 Bug 1542931 move forward declarations to appropriate namespaces r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D34476

--HG--
extra : moz-landing-system : lando
2019-06-14 13:23:29 +00:00
Karl Tomlinson
3a7eaf6860 Bug 1558123 don't set outputs array length in ProcessBlocksOnPorts r=padenot
This is set in the AudioNodeStream constructor and does not change.

Differential Revision: https://phabricator.services.mozilla.com/D34833

--HG--
extra : moz-landing-system : lando
2019-06-14 15:40:00 +00:00
Paul Adenot
c74b95c375 Bug 1350973 - Implement new attributes MediaStreamAudioSourceNode.mediaStream and MediaElementAudioSourceNode.mediaElement. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D37283

--HG--
extra : moz-landing-system : lando
2019-07-11 20:09:58 +00:00
Paul Adenot
6d8671ebb8 Bug 1564422 - Change outputLatency and getOutputTimestamp when resistFingerPrinting is enabled. r=tjr
When Firefox is configured to resist fingerprinting, the latency figure returned
is the most commonly found on a particular OS.

For Android, I got data from [0], roughly copy/pasted the table into a file and
did:

```
cat file | cut -d $'\t' -f4 | grep "^[[:digit:]]" | cut -d ' ' -f 1 | sort -h
| uniq -c | sort -h
```

which indicated that 40ms was a good number for round trip latency (input to
output). Since this is for output latency only and the audio path
is roughly symmetrical in terms of duration, we report 20ms.

For OSX, 512 is always used with the default hardware in Firefox, with this
patch, it's always 512 regardless of the setup.

On Linux/Pulse, we use 25ms [1] always, and this is adjusted by PulseAudio. This
makes it always return 25ms.

On Windows, there is a wide variety of configurations, but it's common to be in
the ballpark of 80ms output (this is very empirical, by testing a bunch of
hardware over the years).

For other OSes, we use 2048 frames (adjusted to the sample-rate).

[0]: https://superpowered.com/latency
[1]: https://searchfox.org/mozilla-central/source/media/libcubeb/src/cubeb_pulse.c#725

Differential Revision: https://phabricator.services.mozilla.com/D37723

--HG--
extra : moz-landing-system : lando
2019-07-12 11:27:25 +00:00
Paul Adenot
553f80fde6 Bug 1324545 - Implement AudioContext getOutputTimestamp(). r=baku
Differential Revision: https://phabricator.services.mozilla.com/D37281

--HG--
extra : moz-landing-system : lando
2019-07-12 11:27:25 +00:00
Paul Adenot
8c692f2f23 Bug 1324552 - Implement AudioContext baseLatency and outputLatency attributes. r=pehrsons,baku
Differential Revision: https://phabricator.services.mozilla.com/D37280

--HG--
extra : moz-landing-system : lando
2019-07-12 11:28:03 +00:00
shindli
883c6619a6 Backed out 3 changesets (bug 1324552, bug 1324545, bug 1350973) for causing perma mda leakcheck failures CLOSED TREE
Backed out changeset db14e59c7e6e (bug 1324545)
Backed out changeset 088e13476d39 (bug 1324552)
Backed out changeset e79a64fc49e7 (bug 1350973)
2019-07-11 18:55:03 +03:00
Paul Adenot
e66a2c4316 Bug 1324545 - Implement AudioContext getOutputTimestamp(). r=baku
Differential Revision: https://phabricator.services.mozilla.com/D37281

--HG--
extra : moz-landing-system : lando
2019-07-11 13:34:15 +00:00
Paul Adenot
4c99611f32 Bug 1324552 - Implement AudioContext baseLatency and outputLatency attributes. r=pehrsons,baku
Differential Revision: https://phabricator.services.mozilla.com/D37280

--HG--
extra : moz-landing-system : lando
2019-07-11 13:30:07 +00:00
Paul Adenot
03e7bf883c Bug 1350973 - Implement new attributes MediaStreamAudioSourceNode.mediaStream and MediaElementAudioSourceNode.mediaElement. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D37283

--HG--
extra : moz-landing-system : lando
2019-07-11 13:18:51 +00:00
Paul Adenot
7786a2a4d6 Bug 1456263 - Throw appropriate errors in the ChannelMergerNode ctor. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D37433

--HG--
extra : moz-landing-system : lando
2019-07-10 01:31:21 +00:00
Andreas Pehrson
378c51c9f8 Bug 1177793 - Pass principal instead of forcing black when capturing cross-origin media resource. r=jya,jib
Differential Revision: https://phabricator.services.mozilla.com/D36896

--HG--
extra : moz-landing-system : lando
2019-07-08 21:15:10 +00:00
Emilio Cobos Álvarez
1a39c45ae2 Bug 1563728 - Add a return statement to BiquadFilterNode::GetFrequencyResponse to fix bustage. rs=padenot
CLOSED TREE
2019-07-06 10:45:56 +02:00
Paul Adenot
3ffaf1696e Bug 1563728 - Throw when the three parameters of BiquadFilterNode.getFrequencyResponse aren't of the same size. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D37056

--HG--
extra : moz-landing-system : lando
2019-07-05 20:34:47 +00:00
Paul Adenot
f5a83e7113 Bug 893020 - Make AudioParam.value getter return a value based on the AudioContext.currentTime. r=karlt
AudioWG resolution: https://github.com/WebAudio/web-audio-api/issues/1788#issuecomment-468345987

Differential Revision: https://phabricator.services.mozilla.com/D30909

--HG--
extra : moz-landing-system : lando
2019-05-14 05:17:00 +00:00
Victor Porof
0a8ff0ad85 Bug 1561435 - Format dom/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35951

--HG--
extra : source : 62f3501af4bc1c0bd1ee1977a28aee04706a6663
2019-07-05 10:44:55 +02:00
Paul Adenot
1877aafe44 Bug 1563193 - Remove "media.webaudio.audiocontextoptions-samplerate.enabled". r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D36733

--HG--
extra : moz-landing-system : lando
2019-07-03 12:12:15 +00:00
Nicholas Nethercote
d839ef58db Bug 1562331 - Make media.* static prefs follow the naming convention. r=KrisWright
This also removes the following prefs, because they're unused:
- media.autoplay.allow-muted pref
- media.autoplay.blackList-override-default

Differential Revision: https://phabricator.services.mozilla.com/D36396

--HG--
extra : rebase_source : 0570540496302b3efedadf4d5115ee5422d5c279
2019-06-28 14:09:05 +10:00
Paul Adenot
7bcb7bb6a6 Bug 1553215 - Implement the correct behaviour for MediaStreamAudioSource. r=karlt,pehrsons
It should pick and lock to the right track, regardless of if it's still in the
MediaStream.

The test fix is because we don't expose tracks until the HTMLMediaElement has
loaded loading I think.

This alignes with a couple spec changes:
- https://github.com/WebAudio/web-audio-api/issues/264
- https://github.com/WebAudio/web-audio-api/pull/1829/files

and also throws when no valid track are found in the MediaStream, either because
it's all video tracks or because it has no tracks.

Differential Revision: https://phabricator.services.mozilla.com/D32176

--HG--
extra : moz-landing-system : lando
2019-06-19 23:06:33 +00:00
Paul Adenot
266b9570eb Bug 1056706 - Reenable a couple tests on Android. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D35289

--HG--
extra : moz-landing-system : lando
2019-06-19 22:15:25 +00:00
Mark Banner
201255ab84 Bug 1558485 - Turn on ESLint for all of dom/ disabling most of the failing rules. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D34761

--HG--
extra : moz-landing-system : lando
2019-06-13 20:21:46 +00:00
Oana Pop Rus
6a33762809 Backed out 2 changesets (bug 1553215) for Web platform tests failures in mediastreamaudiosourcenode-routing.html
Backed out changeset 992d3dd0cee0 (bug 1553215)
Backed out changeset fad5e3bf0695 (bug 1553215)
2019-06-12 15:51:21 +03:00
Paul Adenot
ed9ef40332 Bug 1553215 - Implement the correct behaviour for MediaStreamAudioSource. r=karlt,pehrsons
It should pick and lock to the right track, regardless of if it's still in the
MediaStream.

The test fix is because we don't expose tracks until the HTMLMediaElement has
loaded loading I think.

This alignes with a couple spec changes:
- https://github.com/WebAudio/web-audio-api/issues/264
- https://github.com/WebAudio/web-audio-api/pull/1829/files

and also throws when no valid track are found in the MediaStream, either because
it's all video tracks or because it has no tracks.

Differential Revision: https://phabricator.services.mozilla.com/D32176

--HG--
extra : moz-landing-system : lando
2019-06-11 09:51:21 +00:00
Cosmin Sabou
a4d22c5fcd Backed out 2 changesets (bug 1553215) for mda failures on test_audioContextSuspendResumeClose.html.
Backed out changeset 71154c8ef814 (bug 1553215)
Backed out changeset 80181b642f81 (bug 1553215)
2019-06-10 20:48:26 +03:00
Paul Adenot
2e2b6d25cb Bug 1553215 - Implement the correct behaviour for MediaStreamAudioSource. r=karlt,pehrsons
It should pick and lock to the right track, regardless of if it's still in the
MediaStream.

The test fix is because we don't expose tracks until the HTMLMediaElement has
loaded loading I think.

This alignes with a couple spec changes:
- https://github.com/WebAudio/web-audio-api/issues/264
- https://github.com/WebAudio/web-audio-api/pull/1829/files

and also throws when no valid track are found in the MediaStream, either because
it's all video tracks or because it has no tracks.

Differential Revision: https://phabricator.services.mozilla.com/D32176

--HG--
extra : moz-landing-system : lando
2019-06-10 15:33:12 +00:00
Boris Zbarsky
328fedf055 Bug 1121623 part 4. Remove AudioScheduledSourceNode::WrapObject. r=padenot
It's dead code, because AudioScheduledSourceNode is an abstract class and all
subclasses override WrapObject.

Differential Revision: https://phabricator.services.mozilla.com/D32202

--HG--
extra : moz-landing-system : lando
2019-05-23 11:40:14 +00:00
Paul Adenot
cadd6ec6ca Bug 1549041 - Destroy the AudioChannelAgent in CloseInternal instead of Close. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D30638

--HG--
extra : moz-landing-system : lando
2019-05-17 09:46:25 +00:00
Karl Tomlinson
562c78800b Bug 1548816 be consistent about number of frames copied r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D30159

--HG--
extra : moz-landing-system : lando
2019-05-07 11:17:54 +00:00
Boris Zbarsky
ff72e84ac1 Bug 1547923 part 4. Add nsIGlobalObject::HasJSGlobal(). r=mccr8
Consumers that just care about this boolean state should use this instead of
getting the JSObject* directly.

Differential Revision: https://phabricator.services.mozilla.com/D29705

--HG--
extra : moz-landing-system : lando
2019-05-02 21:32:17 +00:00
Boris Zbarsky
248fcf067d Bug 1547923 part 1. Remove unused callers of GetGlobalJSObject. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D29702

--HG--
extra : moz-landing-system : lando
2019-05-02 18:37:52 +00:00
Valentin Millet
d934ec2ff8 Bug 1530178 - copyFromChannel/copyToChannel until end of buffer when destination/source is longer r=padenot,karlt
than available space, as clarified in https://github.com/WebAudio/web-audio-api/issues/1004

Differential Revision: https://phabricator.services.mozilla.com/D25791

--HG--
extra : moz-landing-system : lando
2019-05-02 09:24:57 +00:00
Sylvestre Ledru
e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Jan-Ivar Bruaroey
6b8d3b7ad8 Bug 1335740 - Update wpt & mochitests to work w/[SecureContext] navigator.mediaDevices. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D20425

--HG--
rename : testing/web-platform/meta/mediacapture-streams/MediaDevices-getSupportedConstraints.html.ini => testing/web-platform/meta/mediacapture-streams/MediaDevices-getSupportedConstraints.https.html.ini
rename : testing/web-platform/tests/mediacapture-streams/MediaDevices-getSupportedConstraints.html => testing/web-platform/tests/mediacapture-streams/MediaDevices-getSupportedConstraints.https.html
extra : moz-landing-system : lando
2019-04-30 15:20:53 +00:00
Andreas Pehrson
39580a0cf7 Bug 1536766 - Remove unused MediaStream::HasCurrentData. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D27266

--HG--
extra : moz-landing-system : lando
2019-04-24 10:55:50 +00:00
Alastor Wu
c58212fe27 Bug 1544023 - let AudioNode keep the reference of all AudioParams which belong to itself. r=padenot
When we suspend or resume the `AudioContext`, it should affect ALL media streams which belong to or are related to the `AudioNode` that are created by this `AudioContext`.

As `AudioNode::OutputParams()` can only return the connected AudioParams, it doesn't return the AudioParams which are belong to itself. That means we would miss to apply the suspend/resume operation for those streams, and it would cause imbalancing suspended count.

Therefore, we let `AudioNode` to keep the reference of all its AudioParam, and return them to `AudioContext` in order to do the operation for all streams.

Differential Revision: https://phabricator.services.mozilla.com/D28008

--HG--
extra : moz-landing-system : lando
2019-04-23 17:50:54 +00:00
Ciure Andrei
add7a3fb9e Backed out 14 changesets (bug 1536766) for causing RunWatchdog and mediaElementAudioSource wpt failures CLOSED TREE
Backed out changeset 72d37a08f281 (bug 1536766)
Backed out changeset 63fc85885060 (bug 1536766)
Backed out changeset addbb04415cb (bug 1536766)
Backed out changeset f2923dfcf33c (bug 1536766)
Backed out changeset 25f3a33ec51b (bug 1536766)
Backed out changeset 199efe6aec59 (bug 1536766)
Backed out changeset f9d1f1bfe2b1 (bug 1536766)
Backed out changeset 87616997f160 (bug 1536766)
Backed out changeset 36f99fa3c956 (bug 1536766)
Backed out changeset 000260ba28de (bug 1536766)
Backed out changeset 6386ed1b7d74 (bug 1536766)
Backed out changeset ab27d9f5902a (bug 1536766)
Backed out changeset 4f6d240c210d (bug 1536766)
Backed out changeset 3e0e3030314d (bug 1536766)
2019-04-19 05:55:57 +03:00
Andreas Pehrson
e63ff93e4d Bug 1536766 - Remove unused MediaStream::HasCurrentData. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D27266

--HG--
extra : moz-landing-system : lando
2019-04-18 15:24:12 +00:00
Andreea Pavel
de5960a5f9 Bug 1543496 - disabled test_mediaStreamTrackAudioSourceNode.html on everything except debug r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D27739

--HG--
extra : moz-landing-system : lando
2019-04-16 16:29:45 +00:00
Brian Grinstead
0d460e3432 Bug 1544322 - Part 2.2 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in dom/ r=bzbarsky
This is split from the previous changeset since if we include dom/ the file size is too
large for phabricator to handle.

This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 2` argument.

Differential Revision: https://phabricator.services.mozilla.com/D27457

--HG--
extra : moz-landing-system : lando
2019-04-16 03:53:28 +00:00