Commit Graph

18742 Commits

Author SHA1 Message Date
Karl Tomlinson
43ddd69d46 Bug 1693724 Add initial memory reporting for MediaManager aggregate members r=pehrsons
Depends on D106249

Differential Revision: https://phabricator.services.mozilla.com/D106250
2021-02-24 22:38:00 +00:00
Karl Tomlinson
3b23978f8d Bug 1693724 move mDeviceIDs to among other main-thread-only aggregates r=pehrsons
This provides better documentation and perhaps less cache coherency contention.

Differential Revision: https://phabricator.services.mozilla.com/D106249
2021-02-24 22:38:00 +00:00
Andrew Osmond
a4745549bc Bug 1693383 - Part 3. Disable mochitests currently broken with Software WebRender and Linux. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D105664
2021-02-24 18:47:24 +00:00
Simon Giesecke
eeedc67ff4 Bug 1693002 - Remove redundant nullptr checks of return value of infallible new in dom/media. r=bryce
Depends on D105290

Differential Revision: https://phabricator.services.mozilla.com/D105291
2021-02-24 12:44:08 +00:00
Byron Campen [:bwc]
5573fc71ec Bug 1684994: Simplify this. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D105637
2021-02-23 14:02:44 +00:00
Mihai Alexandru Michis
969e1a7cda Bug 1662614 - Disable browser_stop_control_after_media_reaches_to_end.js on Linux for frequent failures. r=intermittent-reviewers,jmaher
Differential Revision: https://phabricator.services.mozilla.com/D105862
2021-02-22 18:14:08 +00:00
Bryce Seager van Dyk
0f87524737 Bug 1693811 - Remove dead blocklisting code. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D105784
2021-02-22 15:37:34 +00:00
Simon Giesecke
7c931c97c4 Bug 1689218 - Rename nsBaseHashtable::GetAndRemove to Extract. r=necko-reviewers,dragana
First, it should be called "Lookup" rather than "Get" because it returns
DataType (rather than UserDataType), but that would still be confusing,
since as opposed to other Lookup* methods, it does not return a DataType&
(and obviously, it can't). So "Extract" seems to be a better name, cf.
mozilla::Maybe::extract.

Differential Revision: https://phabricator.services.mozilla.com/D105471
2021-02-22 12:07:48 +00:00
Simon Giesecke
c5f7800f35 Bug 1691913 - Rename nsClassHashtable::LookupOrAdd to GetOrInsertNew. r=xpcom-reviewers,nika
It should be called "Get" rather than "Lookup" because it returns
UserDataType. "Add" is called "Insert" in the other methods.

Differential Revision: https://phabricator.services.mozilla.com/D105470
2021-02-22 12:07:47 +00:00
Simon Giesecke
d2caea36fa Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika
Differential Revision: https://phabricator.services.mozilla.com/D104676
2021-02-22 12:07:46 +00:00
Karl Tomlinson
43c550087c Bug 1692385 move SourceListener logic needed for testing window existence into EnumerateDevicesImpl() r=pehrsons
so that EnumerateDevicesImpl() callers don't need to care about this.

This also provides a SourceListener::Stop() call to fix a leak from the logic
in GetSinkDevice().

Differential Revision: https://phabricator.services.mozilla.com/D105252
2021-02-19 05:24:24 +00:00
Karl Tomlinson
5a800090cb Bug 1692385 Remove repetition of IsWindowStillActive() test in same task r=pehrsons
The task is main-thread, so the second IsWindowStillActive() call always
returned true.

This became obsolete with
https://hg.mozilla.org/mozilla-central/rev/69b1d1c5e010097cfd7c10c9a373f72ea6873e2c#l1.587

Depends on D105250

Differential Revision: https://phabricator.services.mozilla.com/D105251
2021-02-19 04:00:45 +00:00
Karl Tomlinson
4f3448549f Bug 1692385 Add and use a helper method to create a GetUserMediaWindowListener on demand r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D105250
2021-02-19 04:00:45 +00:00
Karl Tomlinson
01891fd90a Bug 1692385 Let SourceListeners identify the GetUserMediaWindowListener from which to remove themselves r=pehrsons
This was already happening to some extent due to the recursive relationship of
SourceListener::Stop() and GetUserMediaWindowListener::Remove(), but being
direct about it saves a parameter.

Depends on D105248

Differential Revision: https://phabricator.services.mozilla.com/D105249
2021-02-19 04:00:45 +00:00
Karl Tomlinson
d3248bfd2b Bug 1692385 Remove unnecessary extra active window check in EnumerateDevices() r=pehrsons
The only caller of MediaManager::EnumerateDevices() checks that the inner
window is [current] after the returned MozPromise settles and
Document::CanSavePresentation() says [no] if
MediaManager::Get()->IsWindowStillActive(win->WindowID()) so there should be
no observable difference in depending on MediaDevices::EnumerateDevices() for
the active window check.

[current]
https://searchfox.org/mozilla-central/rev/4dac9993b609fccc87e82682614faf2a44cda306/dom/media/MediaDevices.cpp#121,149
[no]
https://searchfox.org/mozilla-central/rev/d3343662ce0aced933b30e053b33c93f759292eb/dom/base/Document.cpp#10738

Depends on D105247

Differential Revision: https://phabricator.services.mozilla.com/D105248
2021-02-19 04:00:44 +00:00
Karl Tomlinson
025359ca8b Bug 1692385 remove unnecessary separate RemoveWindowID() path r=pehrsons
If GetInnerWindowWithId() returns false then RemoveWindowID() does nothing
but remove the window id from mActiveWindows if present.
https://searchfox.org/mozilla-central/rev/d3343662ce0aced933b30e053b33c93f759292eb/dom/media/MediaManager.cpp#3351,3357
GetUserMediaWindowListener::RemoveAll() is sufficient to call RemoveWindowID()
to do the same if the window id is present in mActiveWindows.
If the window id is not present, then GetWindowListener() returns false and
there is nothing to do.

The additional code path was added because IterateWindowListeners() needed a
nsPIDOMWindow,
https://hg.mozilla.org/mozilla-central/rev/786737c759d771029d393d793dff207d86f18faf#l1.60
but IterateWindowListeners() is no longer used.
https://hg.mozilla.org/mozilla-central/rev/ec16fb789a045e6d644d32bf269ff48944637c2b#l1.21

The "safe" comment is not necessary because `mActiveWindows` is clearly
documented as main-thread-only and there are plenty of main thread assertions.
https://searchfox.org/mozilla-central/rev/d3343662ce0aced933b30e053b33c93f759292eb/dom/media/MediaManager.h#332-333

Differential Revision: https://phabricator.services.mozilla.com/D105247
2021-02-19 04:00:44 +00:00
Alexis Beingessner
07f2f659c6 Bug 1686616 - make StringBundle use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105531
2021-02-18 13:26:32 +00:00
Alexis Beingessner
8fea71cdd5 Bug 1686616 - make PermissionManager use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105528
2021-02-18 13:26:31 +00:00
Alexis Beingessner
ade0725530 Bug 1686616 - make GfxInfo use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105522
2021-02-18 13:26:29 +00:00
Kershaw Chang
67fbb1e79d Bug 1692120 - Avoid accessing nsSocketTransport::mCondition on main thread r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D105596
2021-02-18 10:52:59 +00:00
Gerald Squelart
96f3fabfcb Bug 1693037 - Fix non-MOZ_GECKO_PROFILER builds - r=florian
No code changes.

Build issues were found by renaming `MOZ_GECKO_PROFILER` to something else in toolkit/moz.configure, in both unified and non-unified builds, on all supported platforms.

Also updated some profiler-related comments.

Differential Revision: https://phabricator.services.mozilla.com/D105375
2021-02-17 22:36:28 +00:00
Andreas Pehrson
f0d20add62 Bug 1692903 - Set mLiveFramesAppended in NotifyInputData instead of the first Pull. r=padenot
In a case where the packetizer is used and NotifyInputData receives less than a
full packet on the first notification, the first Pull of input data will not
happen during the same iteration.

During the iteration where the first Pull of input data happens, commonly the
following iteration, the appropriate amount of buffering will be calculated.
This calculation will fail to accomodate the silence added in the Pulls since
input data was added to the packetizer but where no input data was pulled.

Thus when input data is pulled we get more than expected out of the packetizer,
and this sets off an assert.

In practice on a non-debug build this patch means that latency is consistently
low (10ms + 128 frames with the packetizer, 128 frames without). Without this
patch it could be up to a packet (10ms) higher when using the packetizer.

Differential Revision: https://phabricator.services.mozilla.com/D105302
2021-02-17 21:48:33 +00:00
Andreas Pehrson
04f4cf76f7 Bug 1692903 - Add gtest. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D105301
2021-02-17 21:48:33 +00:00
Bryce Seager van Dyk
2013fbe962 Bug 1530897 - Detect and avoid a couple of potential overflows when parsing WebMs. r=kinetik
This adds 2 checks to deal with overflow related issues when parsing webms.
- Detect uint64 overflows when calculating buffered ranges. This is unlikely,
  but appears like something that could conceptually happen given the data types
  involved. This isn't strictly needed to fix the bug, but figured I'd guard
  against it while I'm in the code.
- Detect issues from uint64 -> int64 conversion when calculating TimeUnits in
  the WebM parser. This is needed to fix the bug, as while we do some checks
  that start <= end, we were not guarding against this following TimeUnit
  conversion. My understanding is we should never encounter negative TimeUnits
  for the code in question, so the added check bails if any negative values are
  encountered.

Differential Revision: https://phabricator.services.mozilla.com/D105506
2021-02-17 21:09:49 +00:00
Bryce Seager van Dyk
375ad7646f Bug 1530897 - Add fuzzed file as crashtest. r=kinetik
This file tickles some asserts due to it containing fuzzed data that leads to
our WebM parser getting extremely large timestamps.

Differential Revision: https://phabricator.services.mozilla.com/D105505
2021-02-17 21:09:48 +00:00
Mihai Alexandru Michis
a5f06b8fda Bug 1693270 - Fix lint black error in dom/media/moz.build
CLOSED TREE
2021-02-17 23:00:39 +02:00
Matthew Gregan
2220e66486 Bug 1693270 - Switch audioipc-2 to vendored code - remove old linting paths. a=lint-fix
CLOSED TREE

Build fix - remove obsolete media/audioipc path from linting exclusions.

Differential Revision: https://phabricator.services.mozilla.com/D105510
2021-02-17 20:40:57 +00:00
Matthew Gregan
00a601715e Bug 1693270 - Switch audioipc-2 to vendored code. r=cubeb-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D105453
2021-02-17 20:23:46 +00:00
Andreas Pehrson
6985c6d68d Bug 1692823 - Only end AudioInputProcessing if it has been set. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D105447
2021-02-17 14:02:42 +00:00
Csoregi Natalia
e80429c32b Backed out 2 changesets (bug 1692903) for mingw bustage on MediaEngineWebRTC.h. CLOSED TREE
Backed out changeset 3d4360e021fa (bug 1692903)
Backed out changeset 5d4c56143e3a (bug 1692903)
2021-02-17 15:49:26 +02:00
Andreas Pehrson
7909bb6091 Bug 1692903 - Set mLiveFramesAppended in NotifyInputData instead of the first Pull. r=padenot
In a case where the packetizer is used and NotifyInputData receives less than a
full packet on the first notification, the first Pull of input data will not
happen during the same iteration.

During the iteration where the first Pull of input data happens, commonly the
following iteration, the appropriate amount of buffering will be calculated.
This calculation will fail to accomodate the silence added in the Pulls since
input data was added to the packetizer but where no input data was pulled.

Thus when input data is pulled we get more than expected out of the packetizer,
and this sets off an assert.

In practice on a non-debug build this patch means that latency is consistently
low (10ms + 128 frames with the packetizer, 128 frames without). Without this
patch it could be up to a packet (10ms) higher when using the packetizer.

Differential Revision: https://phabricator.services.mozilla.com/D105302
2021-02-17 12:59:32 +00:00
Andreas Pehrson
38f4c1fa3a Bug 1692903 - Add gtest. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D105301
2021-02-17 12:59:31 +00:00
alwu
6f21141c39 Bug 1690372 - part2 : add Telemetry probe for WMF usage. r=bryce
Depends on D103836

Differential Revision: https://phabricator.services.mozilla.com/D103837
2021-02-16 23:53:45 +00:00
alwu
8cdda9e6f3 Bug 1690372 - part1 : always use WMFDecoderModule::Create() to get a new decoder module. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D103836
2021-02-16 23:53:45 +00:00
Markus Stange
56051da2d0 Bug 1692391 - Replace the NS_OBJC_BEGIN/END_TRY_ABORT_BLOCK_NSRESULT macros with the functionally identical NS_OBJC_BEGIN/END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE). r=haik
This patch was generated with the commands:

```
rg -l 'NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT' . | xargs sed -i '' -e 's/NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT/NS_OBJC_BEGIN_TRY_BLOCK_RETURN/g'
rg -l 'NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT' . | xargs sed -i '' -e 's/NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT/NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)/g'
```

Differential Revision: https://phabricator.services.mozilla.com/D104957
2021-02-16 22:55:20 +00:00
Lee Salzman
ba5d757a8a Bug 1692731 - Accelerate YUV 422 compositing in SWGL. r=jrmuizel
For YUV 422 video, when we are sampling UV planes at half the resolution of the
Y plane, we can interpolate from 2 samples for the UV planes as an approximation
of the 4 samples, allowing us to better pack the math into SIMD vectors and
substantially reduce the number of multiplications.

Differential Revision: https://phabricator.services.mozilla.com/D105137
2021-02-16 21:17:45 +00:00
alwu
03e5d18219 Bug 1688128 - update last dispatched time after dispatching timeupdate event. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D105064
2021-02-16 16:59:11 +00:00
alwu
48746a65c2 Bug 1691634 - reset decode for both tracks to avoid using a disconnected promise in media format reader. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D104569
2021-02-16 16:40:14 +00:00
Simon Giesecke
661e25bf09 Bug 1692880 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-16 15:53:33 +00:00
Gerald Squelart
2416d881e2 Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian
There are no code changes, only #include changes.
It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".

Differential Revision: https://phabricator.services.mozilla.com/D104588
2021-02-16 04:44:19 +00:00
Simon Giesecke
780a1636a9 Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 15:12:17 +00:00
smolnar
1afbbe67e1 Backed out 5 changesets (bug 1691894) for causing hazard failures in nsXULPrototypeCache. CLOSED TREE
Backed out changeset 22dc870ee609 (bug 1691894)
Backed out changeset 58c31e9d6ae3 (bug 1691894)
Backed out changeset 7483e84149d8 (bug 1691894)
Backed out changeset f977d6cfa973 (bug 1691894)
Backed out changeset db4503476f34 (bug 1691894)
2021-02-15 16:43:23 +02:00
Simon Giesecke
3c29a68440 Bug 1691894 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-15 10:04:46 +00:00
Simon Giesecke
8973094ec1 Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 10:04:45 +00:00
Sylvestre Ledru
b4f9be25d4 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers
Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D105158
2021-02-15 08:49:20 +00:00
Simon Giesecke
f701c44a5c Bug 1691894 - Fix EntryHandle to only work with DataType rather than wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika,jonco,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104810
2021-02-12 15:25:40 +00:00
Dragana Damjanovic
efa5705d23 Bug 1690615 - Move DNS lookup into DnsAndConnectSocket r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104464
2021-02-12 14:57:09 +00:00
Michael Froman
fdd214ab79 Bug 1677046 - apply outgoing port restrictions in addNrIceServer. r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D104767
2021-02-11 21:12:30 +00:00
alwu
b248bcd4ac Bug 1686696 - part5 : remove nsSyncSection. r=bryce
`nsSyncSection` is not related with media event, so that's not proper ot put it in `MediaElementEventRunners.h`.

In addition, that can simply be implemented by `NS_NewRunnableFunction` so we don't need `nsSyncSection` anymore.

Differential Revision: https://phabricator.services.mozilla.com/D104115
2021-02-11 20:19:25 +00:00
alwu
1b37ad6843 Bug 1686696 - part4 : add test. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D102250
2021-02-11 20:19:25 +00:00