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

166 Коммитов

Автор SHA1 Сообщение Дата
Andreas Pehrson 1e9929f09f Bug 1666116 - Account for fallback in NotifyWhenGraphStarted. r=padenot
Unittests using GoFaster mode may start iterating the audio driver faster before
its fallback has completed handover to the audio callback. This causes the
preSilenceSamples check to spike and the test fails.

Waiting for the fallback to finish handing over fixes this.

To accomodate this, this patch also constifies some methods as needed to check
InIteration() when const.

Differential Revision: https://phabricator.services.mozilla.com/D97413
2020-11-30 14:16:57 +00:00
Cristina Coroiu 011cf4e1e0 Backed out 21 changesets (bug 1666116, bug 1605134) for build bustage at checkouts/gecko/dom/media/gtest/WaitFor.h on a CLOSED TREE
Backed out changeset fedcb7e94929 (bug 1666116)
Backed out changeset 506522ae896e (bug 1666116)
Backed out changeset 351419be5c0d (bug 1666116)
Backed out changeset 93aef991a475 (bug 1666116)
Backed out changeset 9e2a2c13ef60 (bug 1666116)
Backed out changeset 81d82ce7eecd (bug 1605134)
Backed out changeset 18ca27b07da3 (bug 1605134)
Backed out changeset addf9298c4fe (bug 1605134)
Backed out changeset c3cf634bffb3 (bug 1605134)
Backed out changeset 2747068f6397 (bug 1605134)
Backed out changeset ac23d3b40f2d (bug 1605134)
Backed out changeset c010356d4a48 (bug 1605134)
Backed out changeset ce6924b1f900 (bug 1605134)
Backed out changeset e88bb30c3221 (bug 1605134)
Backed out changeset efa10675b86d (bug 1605134)
Backed out changeset 3c5d3f8baf28 (bug 1605134)
Backed out changeset bffa738ccb6f (bug 1605134)
Backed out changeset c8143eab62d2 (bug 1605134)
Backed out changeset 7dfb915d51ef (bug 1605134)
Backed out changeset 9bce7dcae91c (bug 1605134)
Backed out changeset 3714fa7460ce (bug 1605134)
2020-11-30 16:12:25 +02:00
Andreas Pehrson b46912a84d Bug 1666116 - Account for fallback in NotifyWhenGraphStarted. r=padenot
Unittests using GoFaster mode may start iterating the audio driver faster before
its fallback has completed handover to the audio callback. This causes the
preSilenceSamples check to spike and the test fails.

Waiting for the fallback to finish handing over fixes this.

To accomodate this, this patch also constifies some methods as needed to check
InIteration() when const.

Differential Revision: https://phabricator.services.mozilla.com/D97413
2020-11-21 01:21:23 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Narcis Beleuzu 61193c6032 Backed out 16 changesets (bug 1666116, bug 1605134) for GTest failures on TestAudioTrackGraph . CLOSED TREE
Backed out changeset dba15089f5d3 (bug 1666116)
Backed out changeset c529b6732b08 (bug 1666116)
Backed out changeset 3225cdc96f82 (bug 1666116)
Backed out changeset 06ced7ee7c2c (bug 1666116)
Backed out changeset f65dbe0c4c64 (bug 1605134)
Backed out changeset dda7d98d3da7 (bug 1605134)
Backed out changeset 6fed7e4730c5 (bug 1605134)
Backed out changeset 9859d35abce6 (bug 1605134)
Backed out changeset e5fb448bbadf (bug 1605134)
Backed out changeset 3ef7199a547a (bug 1605134)
Backed out changeset c24bff49f331 (bug 1605134)
Backed out changeset f8612b562aa7 (bug 1605134)
Backed out changeset 0ba16e1f73ae (bug 1605134)
Backed out changeset 0736167ed294 (bug 1605134)
Backed out changeset 56ead9091c47 (bug 1605134)
Backed out changeset 841eedd33424 (bug 1605134)
2020-11-19 22:09:39 +02:00
Andreas Pehrson ea27597884 Bug 1666116 - Account for fallback in NotifyWhenGraphStarted. r=padenot
Unittests using GoFaster mode may start iterating the audio driver faster before
its fallback has completed handover to the audio callback. This causes the
preSilenceSamples check to spike and the test fails.

Waiting for the fallback to finish handing over fixes this.

To accomodate this, this patch also constifies some methods as needed to check
InIteration() when const. It also waits for audio drivers to start per the above
in TestCrossGraphTrack as that test may otherwise exhibit this bug with bug
1605314 applied.

Differential Revision: https://phabricator.services.mozilla.com/D97413
2020-11-19 15:50:24 +00:00
Andreas Pehrson 7d63a92c30 Bug 1651745 - Don't buffer more than necessary in AudioInputProcessing. r=padenot
When opening a second input track, there will already be some data from its
first instantiation in the driver's scratch buffer. If we ignore this data, we
end up buffering too much in AudioInputProcessing::Pull and tripping an assert.

Differential Revision: https://phabricator.services.mozilla.com/D95939
2020-11-05 16:44:00 +00:00
Andreas Pehrson 124f2d951b Bug 1651745 - Signal AudioInputProcessing on input stream stop instead of driver start. r=padenot
Without this patch, AudioInputProcessing wouldn't be aware of an audio driver
changing to another driver, be it a system driver or an audio driver that starts
on its fallback.

It could fail an assert since neither of those new drivers would append any
input data, so AudioInputProcessing would run out of buffered data but not know
to reset the state doing the bookkeeping for this.

Differential Revision: https://phabricator.services.mozilla.com/D95938
2020-11-05 16:43:24 +00:00
Andreas Pehrson b3df0295ce Bug 1657246 - Back out bug 1632864's fix. r=padenot
This keeps the gtest from bug 1632864, but reverts the fixes for a second take.

Differential Revision: https://phabricator.services.mozilla.com/D94562
2020-10-28 00:58:15 +00:00
Csoregi Natalia 4e9f1c5359 Backed out 6 changesets (bug 1657246) for mingw bustage on TestAudioTrackGraph.cpp. CLOSED TREE
Backed out changeset a7c8f608a2f4 (bug 1657246)
Backed out changeset 9ee3d71303c6 (bug 1657246)
Backed out changeset fbba0ed1f3e9 (bug 1657246)
Backed out changeset e7d0acdef9c3 (bug 1657246)
Backed out changeset 0382b9eb2507 (bug 1657246)
Backed out changeset 28d15a125fed (bug 1657246)
2020-10-28 02:50:05 +02:00
Andreas Pehrson 4fa631b73a Bug 1657246 - Back out bug 1632864's fix. r=padenot
This keeps the gtest from bug 1632864, but reverts the fixes for a second take.

Differential Revision: https://phabricator.services.mozilla.com/D94562
2020-10-27 15:17:14 +00:00
Paul Adenot 6cd89c3d99 Bug 1653113 - Backed out changeset 61336bfc7584. r=achronop
Depends on D83804

Differential Revision: https://phabricator.services.mozilla.com/D83805
2020-07-17 09:50:48 +00:00
Paul Adenot f2a2fb7d24 Bug 1646348 - Use the AudioThreadRegistry in GraphDriver.cpp. r=achronop
This patch changes the type of mAudioThreadId because `std:🧵:id` is
non-memovable and AudioThreadRegistry uses an nsTArray, that needs elements to
be memovable.

Differential Revision: https://phabricator.services.mozilla.com/D80466
2020-06-23 16:43:40 +00:00
Paul Adenot d6a6773f04 Bug 1626918 - Don't register the audio callback thread when using audioipc: it's already registered. r=achronop
Depends on D78510

Differential Revision: https://phabricator.services.mozilla.com/D79460
2020-06-12 13:33:04 +00:00
Paul Adenot 33cf21901b Bug 1626918 - Register the audio callback thread(s) to the Gecko profiler even when it changes. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D78504
2020-06-12 13:32:49 +00:00
Karl Tomlinson 41f6931d73 Bug 1644647 rewrite AudioContextOperation handling using PendingResumeOperation r=padenot
The key change here is that AudioContextOperation promises for the same
AudioContext are resolved in order as long as the graph is running.
There is one remaining case where AudioContextOperation promises can be
resolved out of order, which is when
AudioContextOperationControlMessage::RunDuringShutdown() resolves a Close
operation shortly after Run() has queued its update via mUpdateRunnables.
mUpdateRunnables are run after controlMessagesToRunDuringShutdown.
https://searchfox.org/mozilla-central/rev/ea7f70dac1c5fd18400f6d2a92679777d4b21492/dom/media/MediaTrackGraph.cpp#1793,1803

Pending resume operations are now stored on the graph instead of on
mNextDriver.  This means there is no need to move operations between drivers
when switching from one mNextDriver to another, the code for which was
previously missing.

Suspend operations are performed immediately, because even a callback driver
can render nothing.  Tracks are not resumed until either there is an
AudioCallbackDriver to deliver the rendered audio or the Resume operation is
canceled by a subsequent Suspend.

While the graph is running, DispatchToMainThreadStableState() is used
consistently, whereas previously this was mixed with direct Dispatch() to the
main thread, which could have the runnable Run() before main thread state had
been updated for rendering up to the time of a Suspend.

Differential Revision: https://phabricator.services.mozilla.com/D76806
2020-06-11 08:52:00 +00:00
Karl Tomlinson b46ca09637 Bug 1644647 explicitly initialize mFallbackDriverState r=padenot
There is no change in behavior here because the default constructor is zero initialized
https://searchfox.org/mozilla-central/rev/bc3600def806859c31b2c7ac06e3d69271052a89/mfbt/Atomics.h#287
and None is zero.
https://searchfox.org/mozilla-central/rev/bc3600def806859c31b2c7ac06e3d69271052a89/dom/media/GraphDriver.h#763

Differential Revision: https://phabricator.services.mozilla.com/D79043
2020-06-12 01:02:18 +00:00
Paul Adenot 3eb71b17bf Bug 1628779 - Update the latency periodically on main thread. r=achronop
We're doing it async, triggered during the stable state runnable, and then the
values are cached in atomic variables, so that the rendering thread can have the
info as well, for using during processing.

Differential Revision: https://phabricator.services.mozilla.com/D75331
2020-05-28 09:50:20 +00:00
Alex Chronopoulos ba0acfe03a Bug 1632864 - Handle error state callback in GraphDriver. r=padenot
Till now an AudioCallbackDriver, on error state callback, creates a FallbackDriver, which attempts to start the existing AudioCallbackDriver. If the driver has already started this creates a cr
ash because restart is not allowed.

This patch continues using the FallbackDriver, on cubeb state error but the driver has been enhanced with an error state that will not attempt to restart the driver. The fallback driver will continue advancing the graph similar to a ThreadedDriver until a driver switch takes place.

Depends on D73102

Differential Revision: https://phabricator.services.mozilla.com/D73103
2020-04-29 17:53:08 +00:00
Paul Adenot 0aeec7fcf2 Bug 1627905 - Add uses of WavDumper to AudioCallbackDriver. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D69972

--HG--
extra : moz-landing-system : lando
2020-04-07 14:33:57 +00:00
Paul Adenot 19ff390e1c Bug 1627905 - Rename mOutputChannels to mOutputChannelCount to match the input name. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D69982

--HG--
extra : moz-landing-system : lando
2020-04-07 14:33:57 +00:00
Karl Tomlinson 09a00207a1 Bug 1596655 Wake up MediaTrackGraph thread on MessagePort messages r=padenot
Depends on D65071

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

--HG--
extra : moz-landing-system : lando
2020-03-03 18:16:54 +00:00
Karl Tomlinson bd50df7448 Bug 1596655 Make GraphInterface an nsISupports for safe dynamic cast r=padenot
This will allow OfflineClockDriver to obtain an nsIThreadObserver from the
GraphInterface when it is a MediaGraphTrackImpl.

Depends on D65070

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

--HG--
extra : moz-landing-system : lando
2020-03-03 18:16:21 +00:00
Andreas Pehrson acc3011748 Bug 1605041 - Fix static-analysis warning from bug 1586370. r=padenot
Depends on D57696

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

--HG--
extra : moz-landing-system : lando
2019-12-19 13:48:09 +00:00
Andreas Pehrson b5a333aa74 Bug 1604941 - Don't leave AudioContextOperation::Resume hanging. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D57696

--HG--
extra : moz-landing-system : lando
2019-12-19 13:17:32 +00:00
Andreas Pehrson 00656a6afa Bug 1542321 - Re-init a failed audio driver at increasing intervals. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56086

--HG--
extra : moz-landing-system : lando
2019-12-18 22:53:46 +00:00
Andreas Pehrson 08bd51f92c Bug 1586370 - Signal to AudioInputProcessing when an audio driver starts so it can reset state. r=padenot
Since we now run a fallback driver while an AudioCallbackDriver starts, this has
exposed a path where the double-append-during-iteration assertion fails.

It seems to happen at least when there's an audio->audio driver switch, and a
fallback driver was running in between.

The state for this assertion assumes it's reset when the AudioCallbackDriver
that's feeding it starts, but forgot to account for driver switches and
fallbacks, which could still cause silence to be pulled for the track.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:53:37 +00:00
Andreas Pehrson aab32113c2 Bug 1586370 - Update GraphDriver lifetime docs. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D57036

--HG--
extra : moz-landing-system : lando
2019-12-18 22:53:35 +00:00
Andreas Pehrson f556569fa0 Bug 1586370 - Re-init an AudioCallbackDriver with a fallback driver if it previously failed to start. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56084

--HG--
extra : moz-landing-system : lando
2019-12-18 22:53:28 +00:00
Andreas Pehrson d192bc08fa Bug 1586370 - Fall back to a SystemClockDriver if AudioCallbackDriver fails to start or hits an error. r=padenot
Note that this will only switch to the fallback driver once, and never switch
back. This will improve in future patches.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:52:33 +00:00
Andreas Pehrson a4fbb9b878 Bug 1586370 - Pass IterationEnd up to the graph rather than back-querying the driver. r=padenot
This makes it simpler to maintain state in the GraphDriver in more complex
cases, such as when an AudioCallbackDriver is backed by a fallback driver.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:52:24 +00:00
Andreas Pehrson 638c69d019 Bug 1586370 - Make GraphDriver iterate the Graph through an interface instead of directly. r=padenot
This lets us iterate more things than MediaTrackGraphImpl, e.g., audio drivers
(from the fallback driver) and unit test classes.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:51:57 +00:00
Andreas Pehrson 7502376eec Bug 1586370 - Rename GraphDriver::OnGraphThread to InIteration. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56081

--HG--
extra : moz-landing-system : lando
2019-12-18 22:51:45 +00:00
Andreas Pehrson a8f9785f19 Bug 1586370 - Let MTG handle driver switching through IterationResult. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56078

--HG--
extra : moz-landing-system : lando
2019-12-18 22:51:25 +00:00
Andreas Pehrson 43f3c6a153 Bug 1586370 - Let IterationResult handle SignalMainThreadCleanup. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56077

--HG--
extra : moz-landing-system : lando
2019-12-18 22:51:12 +00:00
Andreas Pehrson a9ee750781 Bug 1586370 - Return a flexible object from OneIteration. r=padenot
This will let us get rid of such GraphDriver dependencies on MediaTrackGraphImpl
as SignalMainThreadCleanup and SetCurrentDriver.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:51:05 +00:00
Andreas Pehrson 1adcbfee14 Bug 1586370 - Use MozPromise for AudioContextOperations and NotifyWhenGraphStarted. r=padenot
This removes a level of indirection where the graph had to call back into
AudioContext. It also removes a dependency on the graph from GraphDriver, where
it can now just resolve a MozPromiseHolder instead.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:50:52 +00:00
Andreas Pehrson 43d5cf8ee3 Bug 1586370 - Give GraphDriver its own time conversion methods. r=padenot
This also removes the ones in MTGImpl that are no longer used.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:50:45 +00:00
Andreas Pehrson c5f908273c Bug 1586370 - Give AudioCallbackDriver its own device ids. r=padenot
One less dependency on MTG from the driver.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:50:25 +00:00
Andreas Pehrson 69e8987ed0 Bug 1586370 - Don't query the graph for AudioCallbackDriver's sample rate. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56071

--HG--
extra : moz-landing-system : lando
2019-12-18 22:50:12 +00:00
Andreas Pehrson 179e64799a Bug 1586370 - Move AudioMixer from MTG to AudioCallbackDriver. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56070

--HG--
extra : moz-landing-system : lando
2019-12-18 22:50:00 +00:00
Andreas Pehrson 71d41e5393 Bug 1586370 - Move EnsureNextIteration logic into ThreadedDriver . r=padenot
This removes some driver-graph interdependencies.

It also changes the logic of EnsureNextIteration() so that it no longer blindly
wakes the driver up, should it be sleeping. Instead it waits until the driver's
next iteration would have occurred anyway, as that seems more expected, and
closer to how an AudioClockDriver works.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 22:49:52 +00:00
Andreas Pehrson 592f4e69ae Bug 1586370 - Remove GraphDriver dependency on GraphImpl()->StateComputedTime(). r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56067

--HG--
extra : moz-landing-system : lando
2019-12-18 22:49:30 +00:00
Andreas Pehrson 0b19596b81 Bug 1586370 - Remove unused GraphDriver::EnsureNextIteration. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56065

--HG--
extra : moz-landing-system : lando
2019-12-18 22:49:10 +00:00
Andreas Pehrson 409caa46dc Bug 1586370 - Move WaitForNextIteration to ThreadedDriver. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56063

--HG--
extra : moz-landing-system : lando
2019-12-18 22:49:03 +00:00
Andreas Pehrson fbee05c898 Bug 1586370 - Make SystemClockDriver::mIsFallback const. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D56062

--HG--
extra : moz-landing-system : lando
2019-12-18 22:48:50 +00:00
Karl Tomlinson 8abe290c87 Bug 1565956 annotate GraphDriver::Shutdown MOZ_CAN_RUN_SCRIPT r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D53127

--HG--
extra : moz-landing-system : lando
2019-11-21 07:33:46 +00:00
Sylvestre Ledru 8d2f0d1b1f Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-11-26 14:35:02 +00:00
Bogdan Tara 23ebd10305 Backed out 3 changesets (bug 1565956) for crashes complaining about MediaTrackGraphImpl CLOSED TREE
Backed out changeset 15e4c2726222 (bug 1565956)
Backed out changeset 4b18de79a6e3 (bug 1565956)
Backed out changeset 1e45f56e21fb (bug 1565956)
2019-11-21 09:19:51 +02:00
Karl Tomlinson 7bc05ba5a5 Bug 1565956 annotate GraphDriver::Shutdown MOZ_CAN_RUN_SCRIPT r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D53127

--HG--
extra : moz-landing-system : lando
2019-11-18 14:52:35 +00:00