Граф коммитов

309 Коммитов

Автор SHA1 Сообщение Дата
Ehsan Akhgari e279cd48ad Bug 1180539 - Correctly dispatch media-playback notifications when an AudioContext is closed/suspended/resumed; r=baku
Since navigating away from a page with an active AudioContext will close
it internally, this patch fixes a similar issue to bug 1180535 for Web
Audio too.
2015-07-06 09:10:06 -04:00
Ehsan Akhgari c6f415d397 Bug 1180347 - Split media.useAudioChannelService to support turning the service on without turning the Firefox OS specific APIs on; r=baku
This is going to be needed for us to be able to turn the AudioChannelService
on for desktop without exposing the Firefox OS specific APIs.
2015-07-06 09:05:00 -04:00
Paul Adenot 84707f0892 Bug 1173016 - Bustage fix: mark BasicWaveformCache's ctor as `explicit`, on a CLOSED TREE. 2015-07-06 14:27:18 +02:00
Paul Adenot b1cd8acc4d Bug 1173016 - Properly refcount the inner PeriodicWave object. r=karlt 2015-07-06 13:58:33 +02:00
Paul Adenot 5484d0c363 Bug 1173016 - Cache the basic waveform PeriodicWaves. r=karlt 2015-06-15 18:16:16 +02:00
Ehsan Akhgari 67cd5d7755 Bug 1180350 - Use UseAudioChannelService more; r=baku 2015-07-05 11:02:33 -04:00
Ehsan Akhgari 70caaac6af Bug 1180355 - Initialize the AudioChannelAgent after AudioContext has gained a stable refcount; r=baku 2015-07-04 11:17:51 -04:00
Karl Tomlinson 32603f9d43 bug 1179662 call DisconnectFromGraph once only during unlink r=padenot
--HG--
extra : rebase_source : 4e8fd171367f46cfc3e5e64f4d7e08ceff2e84d3
2015-07-02 18:11:31 +12:00
Karl Tomlinson ee5781b91a bug 1179662 call UnregisterAudioBufferSourceNode only once r=padenot
Because these nodes are only registered on PannerNodes if they have a
stream, they need only be unregistered once after the stream is destroyed.

Previously unregistration happened on finish, unlink, and destructor.

--HG--
extra : rebase_source : 7dab08fe4b5648e2a04495d6f570727684247f51
2015-07-02 18:14:54 +12:00
Karl Tomlinson a0a5e2b547 bug 1179662 handle null AudioNodeStream stream r=padenot
--HG--
extra : rebase_source : 0f0bb303aae42240638513e6d2b8f8c61cb6c1f5
2015-07-02 17:45:11 +12:00
Karl Tomlinson ed5b0e90c4 bug 1179662 rename AudioNode::Stream() to GetStream() as it may return null r=padenot
--HG--
extra : rebase_source : 0279287801ec91efd16fa14135812307926b3c68
2015-07-02 17:30:36 +12:00
Karl Tomlinson 7f8f4121f7 bug 1179662 specify AudioNode::mStream as AudioNodeStream r=padenot
--HG--
extra : rebase_source : 30cbe8f0b513063acf0e1c62078474f8f147a0ae
2015-07-02 17:36:07 +12:00
Karl Tomlinson 2c46294a5d bug 1179662 uninline DestroyMediaStream overrides so that mStream type need not be complete r=padenot
--HG--
extra : rebase_source : 2f9676a2e1c4ce13adfdf109e7e8c9827fb26502
2015-07-02 16:44:31 +12:00
Paul Adenot 724c74bc92 Bug 1175510 - Update the AudioBufferSourceNode <=> PannerNode mapping when destroying AudioNodeStream. r=karlt
--HG--
extra : rebase_source : d02b6c241ca5371b8c53bfea54bf80954ab1725c
2015-07-02 05:43:52 +02:00
Nathan Froyd 974d8120f2 Bug 1161627 - part 2 - machine-convert TemporaryRef<T> to already_AddRefed<T>; r=ehsan
This conversion was done with the script:

  find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl' | \
    egrep -v 'cairo-win32-refptr.h|RefPtr.h|TestRefPtr.cpp' | \
    xargs sed -i -e 's/mozilla::TemporaryRef</already_AddRefed</g' \
                 -e 's/TemporaryRef</already_AddRefed</g'

Manual fixups were performed in the following instances:

- We handled mfbt/RefPtr.h manually so as to not convert TemporaryRef itself
  into already_AddRefed.

- The following files had explicit Move() calls added to make up for the lack
  of a copy constructor on already_AddRefed:

  dom/base/ImageEncoder.cpp
  dom/media/MediaTaskQueue.{h,cpp}
  dom/media/webaudio/PannerNode.cpp

- A redundant overload for MediaTaskQueue::Dispatch was deleted.

- A few manual fixups were required in mfbt/tests/TestRefPtr.cpp.

- Comments, using declarations, and forward declarations relating to
  TemporaryRef in dom/canvas/ and gfx/layers/ were changed to refer to
  already_AddRefed.
2015-06-17 10:00:52 -04:00
Bobby Holley 3985c88eb7 Bug 1175768 - Throttle NotifyDataArrived. r=jya 2015-06-27 01:19:14 -07:00
Bobby Holley f25ea07acc Bug 1175768 - Dispatch NotifyDataArrived and remove the aBuffer argument. r=jya
It would be nice to remove the argument in a separate patch, but we can't
perform MediaResource reads on the main thread, so the SilentReadAt stuff
needs to happen at the same time as the off-main-thread stuff.
2015-06-27 01:19:10 -07:00
Bobby Holley a269ea96b4 Bug 1175768 - Dispatch UpdateEstimatedMediaDuration. r=jya
NotifyDataArrived will soon run off-main-thread, so the assumptions here won't hold.
2015-06-27 01:19:07 -07:00
JW Wang 13addbc548 Bug 1175786 - Rewrite test_mediaElementAudioSourceNodeCrossOrigin.html. r=padenot
--HG--
extra : rebase_source : 1d754c33cfbc706914ef7f92b80ac7c3250f3423
2015-06-17 19:45:00 +02:00
Matthew Gregan ac2b9444ba Bug 1103824 - Back out changeset for causing regression reported in bug 1176499. 2015-06-23 17:02:51 -07:00
Ryan VanderMeulen d9ca5de3ed Backed out 8 changesets (bug 1175768) for frequent media test failures.
Backed out changeset a369cfb95b59 (bug 1175768)
Backed out changeset e02dd312d622 (bug 1175768)
Backed out changeset 6776ce74b9e5 (bug 1175768)
Backed out changeset 6aa5fa1d318e (bug 1175768)
Backed out changeset a8bd7a0d2aea (bug 1175768)
Backed out changeset 41ffc9a9ac48 (bug 1175768)
Backed out changeset 2d2cefa397dc (bug 1175768)
Backed out changeset 4e06368496d2 (bug 1175768)

CLOSED TREE
2015-06-23 16:20:15 -04:00
Bobby Holley 6925b1f100 Bug 1175768 - Throttle NotifyDataArrived. r=jya 2015-06-22 22:53:09 -07:00
Bobby Holley 23c16e6894 Bug 1175768 - Dispatch NotifyDataArrived and remove the aBuffer argument. r=jya
It would be nice to remove the argument in a separate patch, but we can't
perform MediaResource reads on the main thread, so the SilentReadAt stuff
needs to happen at the same time as the off-main-thread stuff.
2015-06-22 22:53:07 -07:00
Bobby Holley 56422fb439 Bug 1175768 - Dispatch UpdateEstimatedMediaDuration. r=jya
NotifyDataArrived will soon run off-main-thread, so the assumptions here won't hold.
2015-06-22 22:53:06 -07:00
Bobby Holley 56a6ea9edb Bug 1172264 - Mirror duration from the MDSM to the MediaDecoderReader and remove MDSM::GetDuration. r=jww 2015-06-17 09:49:10 -07:00
Matthew Gregan bf4e15de86 Bug 1103824 - Ensure first initialization of IAudioClient happens on STA thread. r=padenot
--HG--
extra : rebase_source : 344380ef08d44983c745bea5cee792140ca7ca66
2015-05-14 18:33:23 +12:00
Karl Tomlinson 70a1be5d33 Bug 974089 - Destroy WebAudio MediaStream when a source finishes. r=padenot
--HG--
extra : rebase_source : 1a6c80ebaf11cf52194774088399040fea4605cd
2015-06-10 13:31:29 +02:00
Karl Tomlinson f8b1474d38 bug 1061220 work around bug 916387
--HG--
extra : rebase_source : 3966cb91ec36ee07621b90b00153e3dafeb9d722
2015-06-12 15:44:19 +12:00
Ryan VanderMeulen 20eb4e1566 Backed out 3 changesets (bug 974089) for causing OSX/Windows test_bug867104.html permafail.
Backed out changeset 1dcfd15bb387 (bug 974089)
Backed out changeset 8c6a7d5efe3a (bug 974089)
Backed out changeset e511c79f2211 (bug 974089)

CLOSED TREE
2015-06-11 15:10:06 -04:00
Paul Adenot 2567778c41 Bug 1118372 - Invert two lines in the mochitest.ini to keep the right text disabled, on a CLOSED TREE. 2015-06-11 18:46:46 +02:00
Paul Adenot 015314f5a6 Bug 974089 - Destroy the streams from the main thread. 2015-06-11 18:46:44 +02:00
Karl Tomlinson 6ad70ef68e Bug 974089 - Destroy WebAudio MediaStream when a source finishes. r=padenot 2015-06-10 13:31:29 +02:00
Yanis Sellami ece36044f6 Bug 1118372 - Properly apply volume in WaveShaperNodeEngine. r=padenot 2015-06-08 10:57:05 +02:00
Karl Tomlinson 1dc7bae7b5 bug 1171785 use nsContentUtils::RunInStableState() r=bholley
--HG--
extra : rebase_source : a26fc43686810f65631b37539c5622631e2fc001
2015-06-11 14:36:12 +12:00
Bobby Holley c2bf6e7564 Bug 1173001 - Fix up some task queue naming to make MediaDecoderReader consistent with MDSM. r=jww 2015-06-10 14:17:26 -07:00
Bobby Holley adc66a3dab Bug 1173001 - Initialize reader task queue in the constructor. r=jww
This is a necessary step towards having mirrored/canonical values, since those
need to know the task queue in their constructor.
2015-06-10 14:17:25 -07:00
JW Wang 85ff952ec4 Bug 1169356 - increase loop count so the test runs more reliably on slow machines like B2G. r=padenot. 2015-06-10 13:55:27 +08:00
Bobby Holley aa6c9ce796 Bug 1160695 - Drop Support for Content-Duration. r=cpearce 2015-06-08 09:22:46 -07:00
Bobby Holley f83f94efbb Bug 1160695 - Track "metadata duration" separately and mirror it to MediaDecoderReader. r=jww 2015-06-08 09:21:22 -07:00
Gabor Krizsanits c5989e232b Bug 1164014 - Shim optimization. r=billm 2015-06-08 09:28:54 +02:00
Paul Adenot 75aeb0a54f Bug 1002513 - Clamp gain to zero in PannerNode to avoid inverting the phase when the distance is greater than maxDistance. r= 2015-01-14 17:11:06 +01:00
JW Wang 486a5586c0 Bug 1170081 - Add a tag to run only mochitests that use HTMLMediaElement::MozCaptureStream. r=cpearce. 2015-06-02 17:31:46 +08:00
Ryan VanderMeulen 1bc8d0eab9 Backed out changesets eebab8b7ea69 and 5b908d656044 (bug 1164014) for e10s OOMs. 2015-06-02 12:23:12 -04:00
Gabor Krizsanits 7a422f317b Bug 1164014 - Shim optimization. r=billm 2015-06-02 16:00:30 +02:00
Andreas Pehrson 23c2c9bf54 Bug 1166659 - Add mochitest tags for webaudio and webrtc. r=jesup, r=padenot 2015-05-20 02:49:00 -04:00
Paul Adenot 776849a603 Bug 1127188 - Null-check the destination in AudioContext::Close, since it can now be called after the graph is dead. r=ehsan 2015-05-20 18:47:48 +02:00
Paul Adenot 0ab779951a Bug 1127188 - Properly handle AudioContext.close() calls right after the creation of an AudioContext. r=ehsan
When the underlying audio stream platform is slow to start, it can take a little
while for the AudioContext to switch from its initial "suspended" state to
"running".

Authors can call AudioContext.close() right after (new AudioContext()),
that was resulting in a bogus "closed" -> "running" transition, that is now
handled properly by bailing out: the context will simply not report a switch to
"running".
2015-05-20 14:30:48 +02:00
Paul Adenot df59990b19 Bug 1127188 - Make test_audioContextSuspendResumeClose.html less flaky. r=ehsan 2015-05-20 14:30:47 +02:00
Paul Adenot 03ac4f75ca Bug 1127188 - Close() AudioContext when Freeing inner window object. r=ehsan 2015-05-20 14:30:47 +02:00
Paul Adenot 78e7f42537 Bug 1166803 - Add an `msg` tag to mochitest.ini in dom/media/*. r=jesup 2015-05-22 10:57:51 +02:00
Baptiste Emmanuel 92defa0014 Bug 1140450 - Lower speex_resampler quality for Web Audio API. r=padenot 2015-05-21 10:12:23 +02:00
Nathan Froyd db188ea282 Bug 1160485 - remove implicit conversion from RefPtr<T> to TemporaryRef<T>; r=ehsan
Having this implicit conversion means that we can silently do extra
refcounting when it's completely unnecessary.  It's also an obstacle to
making RefPtr more nsRefPtr-like, so let's get rid of it.
2015-05-01 09:14:16 -04:00
Bobby Holley d01547fedb Bug 1164977 - Prevent MediaStreamAudioSourceNode from passing null to nsIPrincipal::subsumes. r=padenot 2015-05-18 15:52:32 -07:00
Birunthan Mohanathas 735ccdd101 Bug 968520 - Add mozilla::fallible to Fallible{Auto,}TArray::SetLength calls. r=froydnj 2015-05-18 13:50:35 -07:00
Birunthan Mohanathas 325bfafcd0 Bug 1165735 - Make ThreadSharedFloatArrayBufferList::mContents infallible. r=roc 2015-05-18 13:50:34 -07:00
Jean-Yves Avenard 55b9aa9ddd Bug 1165585: Part1. Use AsyncReadmetadata with web audio. r=cpearce 2015-05-18 16:13:20 +10:00
Jean-Yves Avenard 0b5388926f Bug 1163359: ensure we read updated audio configuration. r=cpearce 2015-05-18 16:13:20 +10:00
Bobby Holley 6fddec8362 Bug 1164567 - Grab the principal when we need it in MediaDecodeTask. r=jww 2015-05-15 11:51:46 -07:00
Eric Rahm 34f99e4b4c Bug 1163201 - Part 1: Remove instances of #ifdef PR_LOGGING in dom/. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
2015-05-14 10:13:23 -07:00
Paul Adenot be71cf7c3a Bug 1122218 - Fix off-by-one error when computing oscillator rendering range. r=karlt 2015-05-13 11:02:27 +02:00
Andrea Marchesini aed237ffe3 Bug 1161946 - MainThreadMediaStreamListener should be notified just when the stream is finished - patch 1, r=padenot 2015-05-11 15:07:24 +01:00
Geoff Brown 4bb32f5282 Bug 1140454 - Skip some tests on Android 4.3 Debug for intermittent failures; r=me,trivial 2015-05-09 20:04:44 -06:00
Paul Adenot aa50589ab8 Bug 926838 - [Part 6] Unbitrot the build system bits. r=gps 2015-05-04 17:19:03 +02:00
JW Wang 235cf09a22 Bug 926838 - [Part 4] Implement AlignedTArray for 32-byte alignment is required by openmax dl. Also modify callers. r=ehsan 2013-11-13 11:07:31 +08:00
Carsten "Tomcat" Book 1084384de1 Backed out changeset 2a08b161b02e (bug 926838) 2015-05-05 15:51:27 +02:00
Carsten "Tomcat" Book db887fe217 Backed out changeset 5b6ef91bfe01 (bug 926838) 2015-05-05 15:51:16 +02:00
Paul Adenot 18d2184244 Bug 926838 - [Part 6] Unbitrot the build system bits. r=gps 2015-05-04 17:19:03 +02:00
JW Wang de10d6d328 Bug 926838 - [Part 4] Implement AlignedTArray for 32-byte alignment is required by openmax dl. Also modify callers. r=ehsan 2013-11-13 11:07:31 +08:00
Andrea Marchesini c1020e6762 Bug 1159290 - "Add final/override to WebAudio classes". r=padenot
--HG--
extra : rebase_source : 85f0d2997fdfefed17456d086c98c6f28d68fa26
2015-04-28 08:42:00 +02:00
Andreas Pehrson 442468bc0f Bug 1157137 - Fix WebAudio ScriptProcessorNode sometimes gaining high latency. r=padenot
--HG--
extra : rebase_source : f709358e82c59e898590cfb788a7c7d800fd5ada
2015-04-22 18:41:04 +08:00
Boris Zbarsky 1e816696de Bug 1157898 part 4. Add ErrorResult::ErrorCodeIs() and use it in various places to get rid of ErrorCode(). r=peterv 2015-04-27 09:18:52 -04:00
Andrew McCreight 0c176ddcff Bug 1062479 - Use static strings for WeakReference type names. r=ehsan 2015-04-24 09:43:01 -07:00
Andrea Marchesini 7a242bbc5d Bug 1027864 - webaudio - Implement AudioChunk::IsSilentOrSubnormal(), r=karlt 2015-04-23 12:25:36 +02:00
Andrea Marchesini ccaa0be578 Bug 1140448 - Improving the performances of how AudioEventTimeline calculates values, r=padenot 2015-04-22 08:53:33 +02:00
Andrea Marchesini e666f02521 Bug 1156632 - Remove unused forward class declarations - patch 2 - dom/media, dom/indexedDB, dom/svg, r=ehsan 2015-04-22 08:29:17 +02:00
Neil Deakin af1ece91c4 Bug 1153248, re-enable a bunch of tests that now work with e10s, r=billm 2015-04-16 15:38:12 -04:00
Paul Adenot e32b404e54 Bug 1094764 - Implement AudioContext.suspend and friends. r=roc,ehsan
- Relevant spec text:
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-suspend-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-resume-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-close-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-state
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-onstatechange

- In a couple words, the behavior we want:
    - Closed context cannot have new nodes created, but can do decodeAudioData,
    and create buffers, and such.
    - OfflineAudioContexts don't support those methods, transitions happen at
    startRendering and at the end of processing. onstatechange is used to make
    this observable.
    - (regular) AudioContexts support those methods. The promises and
    onstatechange should be resolved/called when the operation has actually
    completed on the rendering thread.  Once a context has been closed, it
    cannot transition back to "running". An AudioContext switches to "running"
    when the audio callback start running, this allow authors to know how long
    the audio stack takes to start running.
    - MediaStreams that feed in/go out of a suspended graph should respectively
    not buffer at the graph input, and output silence
    - suspended context should not be doing much on the CPU, and we should try
    to pause audio streams if we can (this behaviour is the main reason we need
    this in the first place, for saving battery on mobile, and CPU on all
    platforms)

- Now, the implementation:
    - AudioNodeStreams are now tagged with a context id, to be able to operate
    on all the streams of a given AudioContext on the Graph thread without
    having to go and lock everytime to touch the AudioContext. This happens in
    the AudioNodeStream ctor. IDs are of course constant for the lifetime of the
    node.
    - When an AudioContext goes into suspended mode, streams for this
    AudioContext are moved out of the mStreams array to a second array,
    mSuspendedStreams. Streams in mSuspendedStream are not ordered, and are not
    processed.
    - The MSG will automatically switch to a SystemClockDriver when it finds
    that there are no more AudioNodeStream/Stream with an audio track. This is
    how pausing the audio subsystem and saving battery works. Subsequently, when
    the MSG finds that there are only streams in mSuspendedStreams, it will go
    to sleep (block on a monitor), so we save CPU, but it does not shut itself
    down. This is mostly not a new behaviour (this is what the MSG does since
    the refactoring), but is important to note.
    - Promises are gripped (addref-ed) on the main thread, and then shepherd
    down other threads and to the GraphDriver, if needed (sometimes we can
    resolve them right away). They move between threads as void* to prevent
    calling methods on them, as they are not thread safe. Then, the driver
    executes the operation, and when it's done (initializing and closing audio
    streams can take some time), we send the promise back to the main thread,
    and resolve it, casting back to Promise* after asserting we're back on the
    main thread. This way, we can send them back on the main thread once an
    operation has complete (suspending an audio stream, starting it again on
    resume(), etc.), without having to do bookkeeping between suspend calls and
    their result. Promises are not thread safe, so we can't move them around
    AddRef-ed.
    - The stream destruction logic now takes into account that a stream can be
    destroyed while not being in mStreams.
    - A graph can now switch GraphDriver twice or more per iteration, for
    example if an author goes suspend()/resume()/suspend() in the same script.
    - Some operation have to be done on suspended stream, so we now use double
    for-loop around mSuspendedStreams and mStreams in some places in
    MediaStreamGraph.cpp.
    - A tricky part was making sure everything worked at AudioContext
    boundaries.  TrackUnionStream that have one of their input stream suspended
    append null ticks instead.
    - The graph ordering algorithm had to be altered to not include suspended
    streams.
    - There are some edge cases (adding a stream on a suspended graph, calling
    suspend/resume when a graph has just been close()d).
2015-02-27 18:22:05 +01:00
Ryan VanderMeulen 5615c15366 Bug 1097721 - Skip test_mozaudiochannel.html on OSX 10.6 due to intermittent crashes. 2015-04-15 14:35:59 -04:00
Ralph Giles 2eb4d219de Bug 1152556 - Add moz.build bugzilla metadata in webaudio. r=padenot 2015-04-08 15:21:00 -07:00
Paul Adenot bc7866deae Bug 1134034 - Add a chrome-only parentId and name on AudioParam for devtools. r=ehsan 2015-04-14 17:03:52 +02:00
Paul Adenot e86047f94a Bug 1153783 - Implement the `detune` AudioParam for the AudioBufferSourceNode. r=ehsan 2015-04-14 17:03:50 +02:00
Carsten "Tomcat" Book 31c4421faf Backed out changeset 7fc52c48e6e3 (bug 1094764) for mulet m-3 perma failure in /test_dataChannel_basicAudioVideo.html 2015-04-09 13:44:27 +02:00
Boris Egorov 7947703867 Bug 1152359 - Fix doppler shift calculation formula. r=padenot 2015-04-08 21:18:54 +06:00
Paul Adenot 70b6a9e143 Bug 1094764 - Implement AudioContext.suspend and friends. r=roc,ehsan
- Relevant spec text:
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-suspend-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-resume-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-close-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-state
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-onstatechange

- In a couple words, the behavior we want:
    - Closed context cannot have new nodes created, but can do decodeAudioData,
    and create buffers, and such.
    - OfflineAudioContexts don't support those methods, transitions happen at
    startRendering and at the end of processing. onstatechange is used to make
    this observable.
    - (regular) AudioContexts support those methods. The promises and
    onstatechange should be resolved/called when the operation has actually
    completed on the rendering thread.  Once a context has been closed, it
    cannot transition back to "running". An AudioContext switches to "running"
    when the audio callback start running, this allow authors to know how long
    the audio stack takes to start running.
    - MediaStreams that feed in/go out of a suspended graph should respectively
    not buffer at the graph input, and output silence
    - suspended context should not be doing much on the CPU, and we should try
    to pause audio streams if we can (this behaviour is the main reason we need
    this in the first place, for saving battery on mobile, and CPU on all
    platforms)

- Now, the implementation:
    - AudioNodeStreams are now tagged with a context id, to be able to operate
    on all the streams of a given AudioContext on the Graph thread without
    having to go and lock everytime to touch the AudioContext. This happens in
    the AudioNodeStream ctor. IDs are of course constant for the lifetime of the
    node.
    - When an AudioContext goes into suspended mode, streams for this
    AudioContext are moved out of the mStreams array to a second array,
    mSuspendedStreams. Streams in mSuspendedStream are not ordered, and are not
    processed.
    - The MSG will automatically switch to a SystemClockDriver when it finds
    that there are no more AudioNodeStream/Stream with an audio track. This is
    how pausing the audio subsystem and saving battery works. Subsequently, when
    the MSG finds that there are only streams in mSuspendedStreams, it will go
    to sleep (block on a monitor), so we save CPU, but it does not shut itself
    down. This is mostly not a new behaviour (this is what the MSG does since
    the refactoring), but is important to note.
    - Promises are gripped (addref-ed) on the main thread, and then shepherd
    down other threads and to the GraphDriver, if needed (sometimes we can
    resolve them right away). They move between threads as void* to prevent
    calling methods on them, as they are not thread safe. Then, the driver
    executes the operation, and when it's done (initializing and closing audio
    streams can take some time), we send the promise back to the main thread,
    and resolve it, casting back to Promise* after asserting we're back on the
    main thread. This way, we can send them back on the main thread once an
    operation has complete (suspending an audio stream, starting it again on
    resume(), etc.), without having to do bookkeeping between suspend calls and
    their result. Promises are not thread safe, so we can't move them around
    AddRef-ed.
    - The stream destruction logic now takes into account that a stream can be
    destroyed while not being in mStreams.
    - A graph can now switch GraphDriver twice or more per iteration, for
    example if an author goes suspend()/resume()/suspend() in the same script.
    - Some operation have to be done on suspended stream, so we now use double
    for-loop around mSuspendedStreams and mStreams in some places in
    MediaStreamGraph.cpp.
    - A tricky part was making sure everything worked at AudioContext
    boundaries.  TrackUnionStream that have one of their input stream suspended
    append null ticks instead.
    - The graph ordering algorithm had to be altered to not include suspended
    streams.
    - There are some edge cases (adding a stream on a suspended graph, calling
    suspend/resume when a graph has just been close()d).
2015-02-27 18:22:05 +01:00
Dragana Damjanovic b658f9d97e Bug 647010 - Limit when HTTP authentication dialog is shown. Block cross-origin http auth prompts with pref. r=mayhemer, r=tanvi 2015-04-01 06:56:00 -04:00
Alastor Wu 5f4ff6530f Bug 1107534 - Using audio channels type to capture different stream. r=roc 2015-03-31 10:14:00 +08:00
Mike Hommey c39e359c7d Bug 1138293 - Use malloc/free/realloc/calloc instead of moz_malloc/moz_free/moz_realloc/moz_calloc. r=njn
The distinction between moz_malloc/moz_free and malloc/free is not
interesting. We are inconsistent in our use of one or the other, and
I wouldn't be surprised if we are mixing them anyways.
2015-03-31 12:32:49 +09:00
Carsten "Tomcat" Book 60382cb6ba Backed out changeset bf22c9e5c5a3 (bug 1094764) for crashtest failures on a CLOSED TREE 2015-03-30 15:14:09 +02:00
Paul Adenot 6ee36e38f6 Bug 1094764 - Implement AudioContext.suspend and friends. r=roc,ehsan
- Relevant spec text:
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-suspend-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-resume-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-close-Promise
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-state
    - http://webaudio.github.io/web-audio-api/#widl-AudioContext-onstatechange

- In a couple words, the behavior we want:
    - Closed context cannot have new nodes created, but can do decodeAudioData,
    and create buffers, and such.
    - OfflineAudioContexts don't support those methods, transitions happen at
    startRendering and at the end of processing. onstatechange is used to make
    this observable.
    - (regular) AudioContexts support those methods. The promises and
    onstatechange should be resolved/called when the operation has actually
    completed on the rendering thread.  Once a context has been closed, it
    cannot transition back to "running". An AudioContext switches to "running"
    when the audio callback start running, this allow authors to know how long
    the audio stack takes to start running.
    - MediaStreams that feed in/go out of a suspended graph should respectively
    not buffer at the graph input, and output silence
    - suspended context should not be doing much on the CPU, and we should try
    to pause audio streams if we can (this behaviour is the main reason we need
    this in the first place, for saving battery on mobile, and CPU on all
    platforms)

- Now, the implementation:
    - AudioNodeStreams are now tagged with a context id, to be able to operate
    on all the streams of a given AudioContext on the Graph thread without
    having to go and lock everytime to touch the AudioContext. This happens in
    the AudioNodeStream ctor. IDs are of course constant for the lifetime of the
    node.
    - When an AudioContext goes into suspended mode, streams for this
    AudioContext are moved out of the mStreams array to a second array,
    mSuspendedStreams. Streams in mSuspendedStream are not ordered, and are not
    processed.
    - The MSG will automatically switch to a SystemClockDriver when it finds
    that there are no more AudioNodeStream/Stream with an audio track. This is
    how pausing the audio subsystem and saving battery works. Subsequently, when
    the MSG finds that there are only streams in mSuspendedStreams, it will go
    to sleep (block on a monitor), so we save CPU, but it does not shut itself
    down. This is mostly not a new behaviour (this is what the MSG does since
    the refactoring), but is important to note.
    - Promises are gripped (addref-ed) on the main thread, and then shepherd
    down other threads and to the GraphDriver, if needed (sometimes we can
    resolve them right away). They move between threads as void* to prevent
    calling methods on them, as they are not thread safe. Then, the driver
    executes the operation, and when it's done (initializing and closing audio
    streams can take some time), we send the promise back to the main thread,
    and resolve it, casting back to Promise* after asserting we're back on the
    main thread. This way, we can send them back on the main thread once an
    operation has complete (suspending an audio stream, starting it again on
    resume(), etc.), without having to do bookkeeping between suspend calls and
    their result. Promises are not thread safe, so we can't move them around
    AddRef-ed.
    - The stream destruction logic now takes into account that a stream can be
    destroyed while not being in mStreams.
    - A graph can now switch GraphDriver twice or more per iteration, for
    example if an author goes suspend()/resume()/suspend() in the same script.
    - Some operation have to be done on suspended stream, so we now use double
    for-loop around mSuspendedStreams and mStreams in some places in
    MediaStreamGraph.cpp.
    - A tricky part was making sure everything worked at AudioContext
    boundaries.  TrackUnionStream that have one of their input stream suspended
    append null ticks instead.
    - The graph ordering algorithm had to be altered to not include suspended
    streams.
    - There are some edge cases (adding a stream on a suspended graph, calling
    suspend/resume when a graph has just been close()d).
2015-02-27 18:22:05 +01:00
Andrea Marchesini e6f385fb3d Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00
Bobby Holley 70685709f1 Bug 1144519 - Rename MediaDecoder::OnDecodeThread to MediaDecoder::OnDecodeTaskQueue. r=jya 2015-03-27 11:50:21 -07:00
Bobby Holley aa048233f5 Bug 1144519 - Rename OnStateMachineThread-like functions to reflect the fact that it's a task queue. r=jya 2015-03-27 11:50:19 -07:00
Geoff Brown 53daff6584 Bug 1140148 - Update mochitest manifests for Android 4.3 emulator; r=dminor 2015-03-26 20:35:35 -06:00
Ehsan Akhgari 55d22e403d Bug 1148230 - Eliminate the duplicate subexpression
This is leftover from bug 815643.  In that bug,
|destinationChannelL->length()| and |destinationChannelR->length()| both
end up being |destinationBus->mDuration| and I forgot to eliminate the
common subexpression.
2015-03-26 20:58:23 -04:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Wes Kocher 5e68488fa0 Bug 1145816 - Disable test_mediaStreamAudioDestinationNode.html as well for frequent timeouts CLOSED TREE 2015-03-20 16:22:05 -07:00
Ryan VanderMeulen edd40992cc Bug 1145816 - Disable test_mediaElementAudioSourceNodePassThrough.html on Android for being nearly perma-timeout.
CLOSED TREE
2015-03-20 17:15:43 -04:00
Boris Zbarsky dc24477d79 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Daniel Holbert 082fd9cd7f Bug 1142841: Convert all nsRefPtr<nsIRunnable> to nsCOMPtr<nsIRunnable>. r=ehsan
This patch was generated by a script.  Here's the source of the script for
future reference:

find . \( -iname "*.cpp" -o -iname "*.h" \) | \
  xargs -n 1 sed -i "s/nsRefPtr<nsIRunnable>/nsCOMPtr<nsIRunnable>/g"
2015-03-17 09:29:17 -07:00
Jonathan Griffin d1c61bc9b6 Bug 1116187 - Disable failing mochitest-chrome tests for B2G, r=gbrown 2015-02-06 16:30:37 -08:00
Paul Adenot 1a25b47c65 Bug 1141282 - Test the type of the attributes of the DynamicCompressoNode, and make sure it returns sane values. r=ehsan 2015-03-12 14:36:40 +01:00
Paul Adenot ada66aa858 Bug 1141282 - DynamicCompressorNode's readonly 'reduction' should be a float. r=ehsan 2015-03-12 14:36:39 +01:00
Andreas Pehrson 35fb84dfd4 Bug 1081819 - Let the output stream itself process input data from MediaStreamAudioDestinationNode::mStream. r=roc 2015-03-02 17:08:40 +08:00
Phil Ringnalda df31a989de Backed out 3 changesets (bug 1081819) for frequent mochitest-e10s failures
Backed out changeset b78fd38002f5 (bug 1081819)
Backed out changeset ff063b9a1ea2 (bug 1081819)
Backed out changeset 322d60fc413e (bug 1081819)
2015-03-07 18:14:05 -08:00
Andreas Pehrson 307e15ba05 Bug 1081819 - Let the output stream itself process input data from MediaStreamAudioDestinationNode::mStream. r=roc 2015-03-02 17:08:40 +08:00
Bobby Holley 845ad750dc Bug 1135170 - Stop updating playback position from Ogg seek and remove MediaDecoder::UpdatePlaybackPosition. r=mattwoodrow
The ogg reader makes two adjustments to the seek time - the first is to clamp it
between start and end time, which MDSM already does. The second is to subtract
SEEK_OPUS_PREROLL from the target. If we wanted to, we could return this as the
resolve value in the seek promise and handle the update in the MDSM. But I think
DropVideoUpToSeekTarget should actually handle this just fine.
2015-03-06 19:17:00 -08:00
Paul Adenot 437014581d Bug 1130077 - Bump the number of iterations to prevent failures on slow machines. r=ehsan 2015-03-05 13:30:12 +01:00
Geoff Brown 46b3719da5 Bug 1138468 - Disable test_audioBufferSourceNodeNeutered.html on android debug; r=trivial 2015-03-05 10:47:41 -07:00
Sotaro Ikeda b3535ec3a6 Bug 1128357 Patch 2: Don't dispatch seeking/seeked events when coming out of dormant mode r=cpearce 2015-03-04 17:33:40 -08:00
Andreas Pehrson 9b19093204 Bug 1129263 - Part 6. Remove DOMMediaStream::TrackTypeHints. r=roc,jesup 2015-02-09 15:23:34 +08:00
Anthony Jones 69c0b09ad3 Bug 1138253 - Count dropped frames directly; r=cpearce 2015-03-03 17:46:48 +13:00
Paul Adenot 052a2913a9 Bug 1118622 - Apply the gain to AnalyserNode data prior to sending on the main thread. r=ehsan 2015-01-29 18:05:23 +01:00
Ankit Goyal 07ae88b846 Bug 1131529 - Update the maximum FFT size in AnalyserNode to be 2^15. r=padenot 2015-02-16 16:03:07 +01:00
Ryan VanderMeulen 51f96dd133 Bug 1127845 - Skip test_audioBufferSourceNodeNeutered.html for being nearly permafail on Windows. 2015-02-05 14:02:21 -05:00
Paul Adenot b40239c553 Bug 1128494 - Change the default panning model of the PannerNode to "equalpower". r=smaug
--HG--
extra : rebase_source : 34877a4b518ac354cf1732a16f70b1659986aabc
2015-02-03 11:25:37 +01:00
Carsten "Tomcat" Book 876bf0ff6a Backed out changeset f9101e882c96 (bug 1128494) for dt-tests regression on a CLOSED TREE 2015-02-03 13:08:53 +01:00
Paul Adenot 8671cd4722 Bug 1128494 - Change the default panning model of the PannerNode to "equalpower". r=smaug 2015-02-03 11:25:37 +01:00
Mike Hommey a35dbaeebf Bug 1126593 - Add a global fallible instance, so that using fallible works directly, everywhere. r=njn
--HG--
rename : memory/mozalloc/fallible.h => memory/fallible/fallible.h
2015-02-02 09:56:13 +09:00
Masatoshi Kimura 6cc5dabbee Bug 1111290 - Part 3: Remove TypedEnum.h and fold TypedEnumInternal.h into TypedEnumBits.h. r=waldo 2015-01-26 07:22:11 +09:00
Masatoshi Kimura be535304d8 Bug 1111290 - Part 1: Remove MOZ_(BEGIN|END)_ENUM_CLASS. r=waldo 2015-01-26 07:22:07 +09:00
Sotaro Ikeda 4f70eb3f49 Bug 1124957 - Fix typo of Dormant r=cpearce 2015-01-23 07:00:39 -08:00
Paul Adenot 96c8cd7b84 Bug 1119266 - Properly wrap the table index in ComputeCustom on ARM. r=karlt
On ARM, casting a negative float to an unsigned integer yields zero, whereas on
x86, it wraps. When the OscillatorNode had a negative frequency, the code would
just interpolate between the first and second value of the wave table, instead
of interpolating backward.
2015-01-12 13:32:11 +01:00
Masatoshi Kimura 9656ec51c3 Bug 895582 - Get rid of MOZ_ENUM_TYPE. r=waldo 2015-01-21 22:35:19 +09:00
Brian Smith 497ba72908 Bug 1119072, Part 5: Work around problem with cmath and M_PI on VS2015, r=ehsan
--HG--
extra : rebase_source : f4973d8a8d1c56a0b843d0258ca739cd4b12f780
2015-01-08 15:27:16 -08:00
Sotaro Ikeda e662668d12 Bug 1110343 - Suppress redundant loadedmetadata event when dormant exit r=cpearce 2015-01-16 07:56:19 -08:00
Ryan VanderMeulen d76cb5ba6d Bug 1061675- Disable test_mozaudiochannel.html on Android 2.3 due to frequent failures. 2015-01-16 09:59:57 -05:00
Chris Peterson 9e23388ca8 Bug 1118076 - Remove MOZ_THIS_IN_INITIALIZER_LIST. r=Waldo 2015-01-06 21:39:46 -08:00
Ehsan Akhgari 4354953b4f Bug 1118486 - Part 1: Use `= delete` instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Paul Adenot 84a2b0acc4 Bug 1119266 - Disable test_oscillatorNodeNegativeFrequency.html for failures on Android, on a CLOSED TREE. 2015-01-08 16:28:08 +01:00
Paul Adenot 373349f693 Bug 916285 - Fix bustage on windows. 2015-01-05 15:30:53 +01:00
Paul Adenot 6e708c08e0 Bug 916285 - Make OscillatorNode handle negative frequencies. r=karlt
--HG--
extra : rebase_source : d45d11150406208e936ac3e78a1cdb1ce22684fb
2014-12-01 16:10:54 -08:00
Paul Adenot 3e1a7b67fc Bug 997870 - Optimize OscillatorNodeEngine::ComputeCustom a little. r=karlt
--HG--
extra : rebase_source : 6d88a2154196c8c34521e246061e9581b98f70a1
2014-12-10 15:34:14 +01:00
Paul Adenot f0c8594900 Bug 1106649 - Use band-limited wave tables to implement basic waveforms. r=karlt
--HG--
extra : rebase_source : c75a338a6887f811727ac068e4d84970a7796367
2014-12-01 16:09:56 -08:00
Ryan VanderMeulen 3d55a15384 Backed out 4 changesets (bug 1106649, bug 916285, bug 997870) for test_periodicWave.html failures.
Backed out changeset 43e2d930ba6f (bug 916285)
Backed out changeset 011c2f2f5899 (bug 916285)
Backed out changeset b7303f56216b (bug 997870)
Backed out changeset a2b0a16b8898 (bug 1106649)

CLOSED TREE
2015-01-05 14:22:29 -05:00
Paul Adenot 7ef3855197 Bug 916285 - Fix bustage on windows, on a CLOSED TREE.
--HG--
extra : rebase_source : 92b14283d4ccabc01e3b6d42f6ea300b84199f5a
2015-01-05 15:30:53 +01:00
Paul Adenot 9d479b3f5f Bug 916285 - Make OscillatorNode handle negative frequencies. r=karlt
--HG--
extra : rebase_source : 8db864efa7d7fcfc02d6c66b8b0f050180968ac9
2014-12-01 16:10:54 -08:00
Paul Adenot dc3fa97c86 Bug 997870 - Optimize OscillatorNodeEngine::ComputeCustom a little. r=karlt
--HG--
extra : rebase_source : 486499c25c863378d7c6c404f2fe00b99f5b86a9
2014-12-10 15:34:14 +01:00
Paul Adenot 28bfeca6e2 Bug 1106649 - Use band-limited wave tables to implement basic waveforms. r=karlt
--HG--
extra : rebase_source : 6ddbabd8d6b5c48659f4f9068cec8b6894f44d9a
2014-12-01 16:09:56 -08:00
Ehsan Akhgari ecf20cc6aa Backed out changeset 4861deb41e66 (bug 1116202) because of test failures 2015-01-05 12:35:17 -05:00
Ehsan Akhgari 9784047afb Bug 1116202 - Destroy the destination node's media stream when XPCOM is being shut down; r=padenot
This will prevent us from needing to rely on the last CC to destroy
the stream for us.  The last CC is too late for destroying streams
properly.
2015-01-05 11:23:29 -05:00
Ehsan Akhgari 251f462ea7 Bug 1117038 - Mark virtual overridden functions as MOZ_OVERRIDE in Web Audio; r=padenot 2015-01-05 11:22:44 -05:00
Paul Adenot 6b6e13a7ce Backed out changeset 3ae2161027a6 (bug 1106649) on a CLOSED TREE 2015-01-05 16:04:36 +01:00
Paul Adenot 0fdb348584 Backed out changeset 187fa323cec6 (bug 997870)
--HG--
extra : rebase_source : afb3581dd9855fcacab840806020617df12d6afd
2015-01-05 16:04:34 +01:00
Paul Adenot 39bd1d3c7d Backed out changeset 99d7aacbdd3b (bug 916285)
--HG--
extra : rebase_source : 51c9b4ded036dc9ef0cb80c878dde663b4d0f3e2
2015-01-05 16:04:33 +01:00
Paul Adenot 4aa4b8d6c7 Backed out changeset f33f5ff9d956 (bug 916285)
--HG--
extra : rebase_source : 2397738b8a357a20967d89158929d6c30d5ccba6
2015-01-05 16:04:23 +01:00
Paul Adenot 7fe3429be3 Bug 916285 - Fix bustage on windows, on a CLOSED TREE. 2015-01-05 15:30:53 +01:00
Paul Adenot 02fe6e9c99 Bug 937718 - Test for MediaElementAudioSourceNode and cross-origin resources. r=roc
--HG--
extra : rebase_source : d5ff27560c2c67361baf6a3e767860060848638e
2014-12-24 13:46:58 +01:00
Paul Adenot 5d125aaa27 Bug 937718 - Output frames to the MediaElementAudioSourceNode when an <audio> has labeled the resource has CORS-cross-origin. r=roc
--HG--
extra : rebase_source : af3473e372f511640e62b47a86a133f0018c9388
2014-12-17 18:03:34 +01:00
Paul Adenot 64983bc928 Bug 1113925 - Don't return null in AudioContext.decodeAudioData. r=bz
--HG--
extra : rebase_source : c3efee1ad98547003d7ea16e068c0bacf2ea9e46
2015-01-05 13:43:00 +01:00
Paul Adenot 566568c711 Bug 916285 - Make OscillatorNode handle negative frequencies. r=karlt
--HG--
extra : rebase_source : 3ceb0506ad4d9f53a15d30d0e6e5a6b7626c6751
2014-12-01 16:10:54 -08:00