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

18211 Коммитов

Автор SHA1 Сообщение Дата
Aaron Klotz 865e038207 Bug 1668376: Part 1 - Rename GeckoProcessManager::MarkAsDead to GeckoProcessManager::ShutdownProcess; r=geckoview-reviewers,necko-reviewers,agi,dragana
Since the semantics of `ContentParent::MarkAsDead` are significantly different
from `GeckoProcessManager::MarkAsDead`, let's rename the latter to better
reflect what it actually does.

Differential Revision: https://phabricator.services.mozilla.com/D92649
2020-10-06 20:25:02 +00:00
Kartikaya Gupta 6d47eac4ee Bug 1666802 - Remove LayersLogging.*. r=mattwoodrow
The remaining functions are moved to be with their brethren in xpcom.

Differential Revision: https://phabricator.services.mozilla.com/D93146
2020-10-11 21:20:46 +00:00
Chun-Min Chang 156825631e Bug 1646719 - P2: Queue a suspended status check when cloning a cache-stream r=jya
- What this patch does:

Send a "download-suspended-by-cache" signal to the media-element paired
with a cloned cache-stream right after the cache-stream is cloned. That
signal help the media-element to decide if it's ready to enter the
HAVE_ENOUGH_DATA state and fire a "canplaythrough" event.

- Why this patch is needed:

It solves a WPT timeout issue. That WPT test waits a "canplaythrough"
event.

- What problem this patch solves is:

This patch addresses the problem mentioned in [1].

Each media-element pairs with a cache-stream downloading the data it
needs. When the data-download of a cache-stream gets suspended, the
media-element paired with the cache-stream should be notified. This
notification is one of the factor to move the ready-state of the
media-element to HAVE_ENOUGH_DATA. However, the media-element paired
with a cloned cache-stream may never receive this notification. And the
worst is that it may never have a chance to download enough data it
needs to move the ready-state to HAVE_ENOUGH_DATA as well at the same
time, in the case mentioned below.

This can happen when a media-element paired with a cloned cache-stream
is created after the cache is full, and all of the cache-streams are
suspended. (Cloned cache-stream is a cache-stream cloned from another
cache-stream that shares the same underlying data with it since their
paired media-elements have the same `src` (of `HTMLMediaElement`)).

"canplaythrough" event is fired when the ready-state is transited to
HAVE_ENOUGH_DATA. As a result, it will never be fired in this case.

In usual case, if the cache-stream gets suspended from non-suspended, it
will send a "download-suspended-by-cache=true" signal to its paired
media-element when running `MediaCache::Update()`. In fact, all other
cache-streams sharing the same underlying data will send this signal at
the same time if necessary. (Later, once the cache-stream is resumed
from suspended to non-suspended it will send a
"download-suspended-by-cache=false" signal to its paired media-element.
All other cache-streams sharing the same underlying data will do the
same if necessary.) The media-element keeps tracking that signal it
receives. After the first-frame of the media-element is loaded, the
ready-state of the media-element will be transited to HAVE_ENOUGH_DATA
by force if the signal is true. (Otherwise, the ready-state will be
inferred by other information.)

When cloning a cache-stream from another one, the cloned cache-stream is
suspended by default. If it's added to a jammed cache that all of the
cache-streams are suspended since the cache is full, then it never has a
chance to fire the "download-suspended-by-cache" signal. Both its
source-stream and itself have no status-change between suspended and
non-suspended, so `MediaCache::Update` is unable to send the signal.

In this case, we should force the media-element paired with the newly
cloned cache-stream transits its ready-state to HAVE_ENOUGH_DATA, which
follows the existing mechanism, by queueing a status-change-update when
cloning the stream. The status-change-update will be run in the
`MediaCache::Update` and it will check what the signal should be sent.
Once the "download-suspended-by-cache=true" is sent, the
"canplaythrough" event of the media-element can be dispatched after
its first-frame is loaded. (The event listeners can possibly make the
media-element starts playing, which is likely to cause a cache-seek that
can revitalize the cache eventually.)

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1646719#c5

Differential Revision: https://phabricator.services.mozilla.com/D92125
2020-10-09 23:07:05 +00:00
Chun-Min Chang 9d1970b6ea Bug 1646719 - P1: Add more debugging logs r=gerald
Add some logs that can help us to check how many cache-streams are
suspended and the working status in `MediaCache::Update`

Differential Revision: https://phabricator.services.mozilla.com/D92124
2020-10-04 07:19:18 +00:00
Andreas Pehrson e050f5fb8c Bug 1667728 - Simplify capping logic in OpusTrackEncoder. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91958
2020-10-07 21:59:32 +00:00
Andreas Pehrson 018bbad6a7 Bug 1667728 - Make FrameEncode gtest pass EOS for completion. r=bryce
Without this patch, the FrameEncode gtest encoder won't encode the last bit of
data, making the total duration 20ms too short.

When passing EOS we encode the lookahead worth of silence, so this patch also
accounts for that.

Differential Revision: https://phabricator.services.mozilla.com/D91957
2020-10-07 21:59:22 +00:00
Andreas Pehrson d2bc5556a6 Bug 1667728 - Always round up framesToFetch when using a resampler. r=bryce
Without this patch, there could be an input rate leading to the use of a
resampler *and* framesLeft being 0 (not rounding up). Then we end up with too
little data to feed the resampler, and we fail an assert.

Differential Revision: https://phabricator.services.mozilla.com/D91956
2020-10-08 15:35:33 +00:00
Andreas Pehrson 7c84dcf8dc Bug 1667728 - Add lookahead silence after resampling. r=bryce
Without this patch, the lookahead silence would be added to the source segment,
which is sampled at the input rate.

The lookahead is in the output rate.

Converting the lookahead to the input rate, and letting our regular encoding
logic convert it back to the output rate can lead to a rounding error for some
input rates. A rounding error here would lead to the last packet being too
short.

Differential Revision: https://phabricator.services.mozilla.com/D91725
2020-10-08 15:43:17 +00:00
Andreas Pehrson 6473127af5 Bug 1667728 - Keep track of the output time by counting frames rather than accumulating packets durations in microseconds. r=bryce
There should be no accumulating rounding error here since packet durations are
exactly 200ms which does not lead to a rounding error when converting to
microseconds.

But this is for sanity, since the behavior prior to this patch is exactly how
you get an accumulating rounding error.

Differential Revision: https://phabricator.services.mozilla.com/D91955
2020-10-08 15:40:58 +00:00
Andreas Pehrson f0d67db160 Bug 1667728 - Test that encoding with opus at various input rates produces the expected number of frames. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91954
2020-10-07 21:58:55 +00:00
Andreas Pehrson 59bacb5f29 Bug 1667728 - Decide the need for a resampler, and the output rate, at construction. r=bryce
Certain logic, like AudioOutputFramesPerPacket(), is hinged off whether a
resampler exists. The resampler is destroyed when encoding is completed, making
such logic flawed from that point. To avoid this potential footgun we can decide
the output rate at construction time, since the input rate is known then.

Differential Revision: https://phabricator.services.mozilla.com/D91953
2020-10-07 21:58:57 +00:00
Andreas Pehrson 810d0f98b6 Bug 1667728 - Define sample rate for GetPacketDuration(). r=bryce
AudioTrackEncoder uses GetPacketDuration() for signaling upwards that data is
available to be encoded. Data to be encoded is sampled at the input rate while
GetPacketDuration() is the duration in the output rate.

Meanwhile, OpusTrackEncoder uses GetPacketDuration() internally for deciding how
much data to encode. This is after resampling so correctly in the output rate.

To support both these cases, this patch adds NumOutputFramesPerPacket(), modeled
on GetOutputSampleRate(), denoting the packet duration in the output rate.
GetPacketDuration() is renamed to NumInputFramesPerPacket() and changed to be
the packet duration in the input rate.

Differential Revision: https://phabricator.services.mozilla.com/D91952
2020-10-08 15:24:34 +00:00
Andreas Pehrson ec3a23c754 Bug 1667728 - Use only one notion of sample rate for AudioTrackEncoder. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91951
2020-10-07 22:19:37 +00:00
Andreas Pehrson 335693edce Bug 1667728 - Use TimeUnit where applicable in MediaRecorder's EncodedFrame. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91728
2020-09-30 16:18:18 +00:00
Andreas Pehrson dce93bb60b Bug 1667728 - Add duration base asserts to EncodedFrame for sanity. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91727
2020-09-30 16:17:58 +00:00
Andreas Pehrson a37ba69f3d Bug 1667728 - Ensure the Muxer doesn't have metadata set more than once. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91726
2020-09-30 16:17:51 +00:00
Andreas Pehrson 0c7e9d79f3 Bug 1667728 - Make MediaRecorder's EncodedFrame immutable. r=bryce
Without this patch there was a gap between the default-ctor and when real values
got set. If setting a member was forgotten, it would have needed an audit to be
found. With this patch the compiler will make sure all values have been
explicitly handed to the ctor.

mFrameData (nsTArray) becomes Refcountable to allow VP8TrackEncoder to extend
the duration of an EncodedFrame by copying the last frame's ref and constructing
a new EncodedFrame with a longer duration than the last one's.

Differential Revision: https://phabricator.services.mozilla.com/D91724
2020-09-30 16:17:43 +00:00
Andreas Pehrson 5dcb49142e Bug 1667728 - Shift responsibility of adjusting packets with opus codec delay to opus encoder. r=bryce
This was originally handled by EbmlComposer. Since bug 1014393 this was handled
by MediaEncoder. By doing it in OpusTrackEncoder we can avoid reading hardcoded
fields in the opus metadata to get the codec delay value.

Differential Revision: https://phabricator.services.mozilla.com/D91723
2020-09-30 16:17:36 +00:00
alwu 17ff21b7c5 Bug 1663128 - part3 : the event source should do the cleanup when it closes. r=chunmin
When close the event source, it should be responsible to clear up and reset the virtual control interface, rather than doing so by `Media Control Server` via setting some empty results.

Differential Revision: https://phabricator.services.mozilla.com/D92116
2020-10-07 09:23:08 +00:00
alwu bce9062dc0 Bug 1663128 - part2 : let MediaControlService determine when we should open/close the event source. r=chunmin
The old way to open/close the event source, which is triggered by controller amount change event, is less intuitive, and we do the extra clean up when close the event source by assigning some parameters [1] that causes an issue on Windows where the control interface can't be clear up completely.

Each platform has its own way to clean the interface. For example, on Windows, we can simply call `ISystemMediaTransportControlsDisplayUpdater::ClearAll()`. So calling those functions actually helps nothing. The best way to do that is to ask the event source to do the clean up, rathering than setting those unnecessary parameters.

Therefore, we make it happen closer to when we determine or clear main controller and ask the event source to take a responsible to clean up when it closes.

[1] https://searchfox.org/mozilla-central/rev/35245411b9e8a911fe3f5adb0632c3394f8b4ccb/dom/media/mediacontrol/MediaControlService.cpp#410-413

Differential Revision: https://phabricator.services.mozilla.com/D92115
2020-10-08 00:06:21 +00:00
alwu 1a34753bd6 Bug 1663128 - part1 : remove unused function 'SetControlledTabBrowsingContextId()'. r=chunmin
As we've chosen another way for GeckoView implementation, so `SetControlledTabBrowsingContextId` is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D92114
2020-10-07 09:23:18 +00:00
Jon Bauman 3532affb49 Bug 1651239 - Merge GeckoMediaPluginServiceChild::GetContentParent methods. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D92341
2020-10-07 19:40:40 +00:00
Nico Grunbaum 2248f8b080 Bug 1669406 - add pref to blocklist codecs for WebRTC testing;r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D92540
2020-10-07 14:26:37 +00:00
Andreas Pehrson c5e3e23059 Bug 1662760 - Add dedicated setup method to audio and video receivers. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D92448
2020-10-06 12:51:16 +00:00
Razvan Maries 98e7259515 Backed out 4 changesets (bug 1663128) for perma failures on browser_control_page_with_audible_and_inaudible_media.js. CLOSED TREE
Backed out changeset c9bd215fdafa (bug 1663128)
Backed out changeset 0ea9bcad0ff8 (bug 1663128)
Backed out changeset 6791eacd4868 (bug 1663128)
Backed out changeset 1f6e8e343055 (bug 1663128)
2020-10-07 12:14:56 +03:00
alwu d81f601202 Bug 1663128 - part3 : the event source should do the cleanup when it closes. r=chunmin
When close the event source, it should be responsible to clear up and reset the virtual control interface, rather than doing so by `Media Control Server` via setting some empty results.

Differential Revision: https://phabricator.services.mozilla.com/D92116
2020-10-06 21:43:25 +00:00
alwu 8fa7fe5499 Bug 1663128 - part2 : let MediaControlService determine when we should open/close the event source. r=chunmin
The old way to open/close the event source, which is triggered by controller amount change event, is less intuitive, and we do the extra clean up when close the event source by assigning some parameters [1] that causes an issue on Windows where the control interface can't be clear up completely.

Each platform has its own way to clean the interface. For example, on Windows, we can simply call `ISystemMediaTransportControlsDisplayUpdater::ClearAll()`. So calling those functions actually helps nothing. The best way to do that is to ask the event source to do the clean up, rathering than setting those unnecessary parameters.

Therefore, we make it happen closer to when we determine or clear main controller and ask the event source to take a responsible to clean up when it closes.

[1] https://searchfox.org/mozilla-central/rev/35245411b9e8a911fe3f5adb0632c3394f8b4ccb/dom/media/mediacontrol/MediaControlService.cpp#410-413

Differential Revision: https://phabricator.services.mozilla.com/D92115
2020-10-07 02:51:43 +00:00
alwu c4860628a6 Bug 1663128 - part1 : remove unused function 'SetControlledTabBrowsingContextId()'. r=chunmin
As we've chosen another way for GeckoView implementation, so `SetControlledTabBrowsingContextId` is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D92114
2020-10-07 02:51:53 +00:00
Paul Adenot 78d06fb142 Bug 1668598 - Don't use the word 'size' to mean a number of elements in MediaData.h. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D92429
2020-10-06 10:24:00 +00:00
Nico Grunbaum 9a0ceb7126 Bug 1668359 - Add call bandwidth estimation to about:webrtc r=dminor,emilio
Differential Revision: https://phabricator.services.mozilla.com/D92038
2020-10-06 04:04:12 +00:00
Dan Minor 4051f6c414 Bug 1668862 - Add script to extract local modifications to libwebrtc for upstream; r=ng DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D92271
2020-10-05 20:32:08 +00:00
Bryce Seager van Dyk 6e2d1d8482 Bug 1618529 - Store clear crypto subsample info in uint32 rather than uint16. r=jolin
This avoids us risking an overflow when we convert encrypted media with
subsamples to AnnexB (since that conversion can grow the clear sizes of the
sample). See the test in the preceding patch for an example of how and why this
happens.

Differential Revision: https://phabricator.services.mozilla.com/D92300
2020-10-05 18:17:06 +00:00
Bryce Seager van Dyk 9dbc3391a2 Bug 1618529 - Add gtest coverage for AnnexB conversions. r=jolin
Add test code to ensure AnnexB conversions behave as we expect. This adds some
coverage for non-encrypted conversions that we only tested with broader tests
until now. It also adds a test to ensure we don't overflow our subsample sizes
when dealing with encrypted media with very large subsamples. This latter test
covers the issue seen in bug 1618529.

Differential Revision: https://phabricator.services.mozilla.com/D92299
2020-10-05 18:22:08 +00:00
Chun-Min Chang e0a1f1aaec Bug 1666805 - P6: Remove the comment for AsyncBlockWriter r=jya
`AsyncBlockWriter` was removed long time ago. Its comment should be
removed as well.

Depends on D92107

Differential Revision: https://phabricator.services.mozilla.com/D92108
2020-10-03 00:36:40 +00:00
Chun-Min Chang 5d0898f7ae Bug 1666805 - P5: Remove `mBlockOwnersWatermark` r=jya
`mBlockOwnersWatermark` is introduced in bug 1366936 for telemetry `MEDIACACHE_BLOCKOWNERS_WATERMARK` but `MEDIACACHE_BLOCKOWNERS_WATERMARK` is removed in bug 1356046

Depends on D92106

Differential Revision: https://phabricator.services.mozilla.com/D92107
2020-10-03 10:39:40 +00:00
Chun-Min Chang 243f94d2ed Bug 1666805 - P4: Remove `mIndexWatermark` r=jya
`mIndexWatermark` was introduced in bug 1366929 for telemetry `MEDIACACHE_WATERMARK_KB` but `MEDIACACHE_WATERMARK_KB` was removed in bug 1356046

Depends on D92105

Differential Revision: https://phabricator.services.mozilla.com/D92106
2020-10-03 00:34:10 +00:00
Chun-Min Chang 39d95b1db5 Bug 1666805 - P3: Replace `mReentrantMonitor` by `mMonitor` in comment r=jya
In bug 1420798, the `mReentrantMonitor` is renamed to `mMonitor`.

Depends on D92104

Differential Revision: https://phabricator.services.mozilla.com/D92105
2020-10-03 00:32:53 +00:00
Chun-Min Chang dec01a31e5 Bug 1666805 - P2: Fix the wrong comment r=jya
`mCurrentMode` is initialized to MODE_METADATA [1,2]

[1]: https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/media/MediaCache.h#527
[2]: Bug 1421134

Depends on D92103

Differential Revision: https://phabricator.services.mozilla.com/D92104
2020-10-03 00:31:19 +00:00
Chun-Min Chang 641663f60c Bug 1666805 - P1: Replace `aNotify` by `aNotifyAll` to align with the comment r=jya
Differential Revision: https://phabricator.services.mozilla.com/D92103
2020-10-03 00:29:29 +00:00
Paul Adenot c8239595d2 Bug 1566389 - Test that various mp3 files have exactly the correct duration. r=jya
Depends on D91773

Differential Revision: https://phabricator.services.mozilla.com/D91774
2020-10-05 15:43:50 +00:00
Paul Adenot bc85c0b003 Bug 1566389 - Trim the beginning and end of mp3 files, r=jya
Depends on D91772

Differential Revision: https://phabricator.services.mozilla.com/D91773
2020-10-05 15:43:40 +00:00
Paul Adenot d1ddf42f65 Bug 1566389 - Send encoder delay and padding info to the mp3 decoder. r=jya
Depends on D91771

Differential Revision: https://phabricator.services.mozilla.com/D91772
2020-10-05 15:43:30 +00:00
Paul Adenot 025cb49a2b Bug 1566389 - Tag compressed mp3 frames as EOS when it's the case. r=jya
Depends on D91770

Differential Revision: https://phabricator.services.mozilla.com/D91771
2020-10-05 15:43:16 +00:00
Paul Adenot 4460bb2aaf Bug 1566389 - Store the parsed encoder delay and padding when demuxing an mp3 file. r=jya,bryce
Depends on D91769

Differential Revision: https://phabricator.services.mozilla.com/D91770
2020-10-05 15:43:03 +00:00
Paul Adenot a8aac7aef6 Bug 1566389 - Parse lame encoder delay and padding when demuxing MP3s. r=bryce,jya
Depends on D91776

Differential Revision: https://phabricator.services.mozilla.com/D91769
2020-10-05 15:42:57 +00:00
Paul Adenot bbc8ba8d2b Bug 1566389 - Allow removing elements at the end of an AlignedAudioBuffer. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91776
2020-10-05 15:42:55 +00:00
Kershaw Chang 71089ed718 Bug 1652677 - P2: Implement necko part of echconfig r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D89455
2020-10-05 15:16:46 +00:00
Noemi Erli d5e42c4c4e Backed out 7 changesets (bug 1566389) for causing bustages in FFmpegAudioDecoder.cpp
Backed out changeset 748e0d854d86 (bug 1566389)
Backed out changeset dd68ca2ed329 (bug 1566389)
Backed out changeset 820744dbc7d1 (bug 1566389)
Backed out changeset 89378e240d00 (bug 1566389)
Backed out changeset 6d36dae2ca8f (bug 1566389)
Backed out changeset ec4e0024ab8d (bug 1566389)
Backed out changeset 0fe64b836e24 (bug 1566389)
2020-10-05 18:23:37 +03:00
Paul Adenot efda27b066 Bug 1566389 - Test that various mp3 files have exactly the correct duration. r=jya
Depends on D91773

Differential Revision: https://phabricator.services.mozilla.com/D91774
2020-10-05 13:12:35 +00:00
Paul Adenot ec196fafb6 Bug 1566389 - Trim the beginning and end of mp3 files, r=jya
Depends on D91772

Differential Revision: https://phabricator.services.mozilla.com/D91773
2020-10-05 13:12:12 +00:00
Paul Adenot 54b72ff408 Bug 1566389 - Send encoder delay and padding info to the mp3 decoder. r=jya
Depends on D91771

Differential Revision: https://phabricator.services.mozilla.com/D91772
2020-10-05 13:11:54 +00:00
Paul Adenot 21f50884ec Bug 1566389 - Tag compressed mp3 frames as EOS when it's the case. r=jya
Depends on D91770

Differential Revision: https://phabricator.services.mozilla.com/D91771
2020-10-05 13:11:36 +00:00
Paul Adenot a6ed3c2f7e Bug 1566389 - Store the parsed encoder delay and padding when demuxing an mp3 file. r=jya,bryce
Depends on D91769

Differential Revision: https://phabricator.services.mozilla.com/D91770
2020-10-05 13:11:16 +00:00
Paul Adenot 4a2bcc5c2a Bug 1566389 - Parse lame encoder delay and padding when demuxing MP3s. r=bryce,jya
Depends on D91776

Differential Revision: https://phabricator.services.mozilla.com/D91769
2020-10-05 13:10:51 +00:00
Paul Adenot 685a360493 Bug 1566389 - Allow removing elements at the end of an AlignedAudioBuffer. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91776
2020-10-05 13:10:39 +00:00
Paul Adenot 065d1d7e84 Bug 1668824 - On macOS and Windows, prefer ffmpeg to decode mp3s. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D92235
2020-10-05 07:46:32 +00:00
Michael Froman 8dee5264c4 Bug 1665713 - pt2 - fix reviewbot whitespace issues. r=ng
These were originally masked due to an exception in
tools/lint/file-whitespace.html for the directory dom/media/tests, but we
don't need an exception for our new location (dom/media/webrtc/tests/mochitests)
if we fix these 3 files.

2 files had bad line endings (Windows vs Unix):
dom/media/webrtc/tests/mochitests/test_getUserMedia_cubebDisabled.html
dom/media/webrtc/tests/mochitests/test_getUserMedia_cubebDisabledFakeStreams.html

1 file had trailing whitespace:
dom/media/webrtc/tests/mochitests/test_peerConnection_threeUnbundledConnections.html

Differential Revision: https://phabricator.services.mozilla.com/D90630
2020-10-02 16:30:53 +00:00
Michael Froman 98d5678d09 Bug 1665713 - pt1 - move dom/media/tests/mochitest to dom/media/webrtc/tests/mochitests. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D90614
2020-10-02 16:30:58 +00:00
Csoregi Natalia 9a15f04386 Backed out changeset 2834ef721441 (bug 1668824) for build bustages on AppleDecoderModule.cpp. CLOSED TREE 2020-10-02 20:25:45 +03:00
Paul Adenot e6da0db2a2 Bug 1656068 - Backout first patch in 1656068 for breaking bluetooth audio input on Linux/Pulse. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D92247
2020-10-02 15:51:46 +00:00
Paul Adenot 0e5d4a42a3 Bug 1668248 - Test that DataChannel.send fails gracefully when the argument is too big. r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D91930
2020-10-02 12:42:14 +00:00
Paul Adenot 9c766cc22e Bug 1668824 - On macOS and Windows, prefer ffmpeg to decode mp3s. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D92235
2020-10-02 14:23:56 +00:00
Bryce Van Dyk 6b7522e2fc Bug 1551615 - Have GeckoMediaPluginServiceChild use async shutdown blocker. r=jbauman
Differential Revision: https://phabricator.services.mozilla.com/D75180
2020-10-02 13:32:41 +00:00
Bryce Seager van Dyk 4abf2b993c Bug 1551615 - Make PGMPService protocol refcounted. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D75178
2020-10-02 13:32:10 +00:00
Bryce Seager van Dyk 24bf867f09 Bug 1551615 - Make PGMPContent protocol refcounted. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D68904
2020-10-02 13:31:40 +00:00
Tom Schuster 10fcf4e476 Bug 1657701 - Localize the media control Firefox is now playing fallback text r=alwu,zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D91514
2020-10-02 10:02:00 +00:00
alwu ebdd91d082 Bug 1668122 - allow switching media control pref on runtime take effect. r=chunmin
Currently changing the pref `media.hardwaremediakeys.enabled` would only take effect after restarting Firefox, this patch would make it possible to do so during runtime.

Differential Revision: https://phabricator.services.mozilla.com/D91841
2020-10-01 23:43:53 +00:00
Matt Woodrow a63466e44e Bug 1668302 - Expose SWGL state to TextureFactoryIdentifier. r=jrmuizel
This is mostly preparing for the future state where we might have SWGL WR mixed with real hardware webrender, and want a way to lookup the state per-compositor.

Differential Revision: https://phabricator.services.mozilla.com/D92009
2020-10-01 22:19:15 +00:00
Dan Minor a4a09f25f7 Bug 1654152 - Create a vendor script to import libwebrtc; r=ng DONTBUILD
This adds a script to vendor libwebrtc and chromium/src/build from upstream
Google or GitHub repositories as well as from local repositories.

Differential Revision: https://phabricator.services.mozilla.com/D91611
2020-10-01 18:49:57 +00:00
Dorel Luca bf02570c59 Backed out changeset 305a050902fe (bug 1657701) for Browser-chrome failure in unreferenced file: resource://gre/localization/en-US/dom/media.ftl. CLOSED TREE 2020-10-02 02:33:06 +03:00
Butkovits Atila 4f41db1dfa Backed out 7 changesets (bug 1566389) for bustage at FFmpegAudioDecoder.cpp. CLOSED TREE
Backed out changeset 116644341a76 (bug 1566389)
Backed out changeset a3bedd49288d (bug 1566389)
Backed out changeset 8db398c91c5a (bug 1566389)
Backed out changeset 498a7c9cbc5f (bug 1566389)
Backed out changeset 19a04bdb5344 (bug 1566389)
Backed out changeset 8390ea4677a1 (bug 1566389)
Backed out changeset 085b748cfbaf (bug 1566389)
2020-10-01 22:43:04 +03:00
Tom Schuster 8deee697e3 Bug 1657701 - Localize the media control Firefox is now playing fallback text r=alwu,zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D91514
2020-10-01 16:17:30 +00:00
Dorel Luca def16b8152 Backed out 3 changesets (bug 1668248) for Devtools failures in devtools/shared/resources/tests/browser_resources_websocket.js. CLOSED TREE
Backed out changeset 3097e934187b (bug 1668248)
Backed out changeset 9f6b8aa11110 (bug 1668248)
Backed out changeset eaa857f4564d (bug 1668248)
2020-10-01 21:24:48 +03:00
Paul Adenot 1b5b47d6c2 Bug 1668248 - Test that DataChannel.send fails gracefully when the argument is too big. r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D91930
2020-09-30 17:40:18 +00:00
Paul Adenot c019efba43 Bug 1566389 - Test that various mp3 files have exactly the correct duration. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91774
2020-10-01 13:58:18 +00:00
Paul Adenot 5c64110c03 Bug 1566389 - Trim the beginning and end of mp3 files, r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91773
2020-10-01 13:58:16 +00:00
Paul Adenot 6814c5cd18 Bug 1566389 - Send encoder delay and padding info to the mp3 decoder. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91772
2020-10-01 13:58:08 +00:00
Paul Adenot 92ff33f4b2 Bug 1566389 - Tag compressed mp3 frames as EOS when it's the case. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91771
2020-10-01 13:58:06 +00:00
Paul Adenot 5f704f19d4 Bug 1566389 - Store the parsed encoder delay and padding when demuxing an mp3 file. r=jya,bryce
Differential Revision: https://phabricator.services.mozilla.com/D91770
2020-10-01 13:58:03 +00:00
Paul Adenot 7d47c493a4 Bug 1566389 - Parse lame encoder delay and padding when demuxing MP3s. r=bryce,jya
Differential Revision: https://phabricator.services.mozilla.com/D91769
2020-10-01 13:57:57 +00:00
Paul Adenot c7bf74d2f1 Bug 1566389 - Allow removing elements at the end of an AlignedAudioBuffer. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91776
2020-10-01 13:57:55 +00:00
Bogdan Tara 3de7cdb1ac Backed out 2 changesets (bug 1668302) for swr reftest failures CLOSED TREE
Backed out changeset 8434906c98c4 (bug 1668302)
Backed out changeset ea6160902594 (bug 1668302)
2020-10-01 16:06:19 +03:00
Matt Woodrow 6609271d81 Bug 1668302 - Expose SWGL state to TextureFactoryIdentifier. r=jrmuizel
This is mostly preparing for the future state where we might have SWGL WR mixed with real hardware webrender, and want a way to lookup the state per-compositor.

Depends on D92008

Differential Revision: https://phabricator.services.mozilla.com/D92009
2020-10-01 02:56:31 +00:00
Bryce Seager van Dyk 8f3d740b92 Bug 1668099 - Fix symbols that rely on unified build order in media gtests. r=jolin
Fix up includes so AnnexB.h and TestMediaDataEncoder.cpp don't rely on unified
build order. Reformat include lists to match style guide. Rework #include guard
on AnnexB.h to reflect style guide.

Differential Revision: https://phabricator.services.mozilla.com/D91825
2020-09-30 20:19:26 +00:00
Sebastian Hengst a34f36ddbd Backed out 2 changesets (bug 1652677) on request from kershaw for causing bug 1667801
Backed out changeset 4a66e4016c18 (bug 1652677)
Backed out changeset df6bdf8157b1 (bug 1652677)
2020-09-30 13:14:00 +02:00
Andreas Pehrson a8d5921fad Bug 1631769 - Clear SourceMediaTracks' MediaSegment on forced shutdown. r=padenot
To avoid leaking graphics resources (Images) past thread-shutdown.

Differential Revision: https://phabricator.services.mozilla.com/D90277
2020-09-29 15:08:42 +00:00
Jean-Yves Avenard f5d2605aa7 Bug 1648309 - P4. Add ArrayOfRemoteAudioData and use it. r=mjf,padenot
An ArrayOfRemoteAudioData pack all its AudioData objects into a single Shmem.
This Shmem will be-reused by the remote decoder over and over.
When used with webaudio, this reduces the number of memory allocation from 100 to 1 for each remote decoder.

Differential Revision: https://phabricator.services.mozilla.com/D91539
2020-09-29 05:02:40 +00:00
Jean-Yves Avenard 8f76bc3fd0 Bug 1648309 - P3. Use ArrayOfRemoteMediaRawData inplace of an actual array. r=padenot,mjf
The reduce the amount of shmem allocations to 1 instead of 100 when used with webaudio.

We also fix the AudioTrimmer for remote decoders as the trimming information was lost over the IPC serialization.
Another issue corrected is that we no longer crash if the first MediaRawData decoded had an empty size.

Differential Revision: https://phabricator.services.mozilla.com/D91538
2020-09-29 04:39:21 +00:00
Jean-Yves Avenard 2c63e2e5b0 Bug 1648309 - P2. Add RemoteArrayOfByteBuffer and ArrayOfRemoteMediaRawData objects. r=padenot,mjf
Those two objects can be used to pack multiple array of objects into a minimal amount of shmem.

An ArrayOfRemoteByteBuffer will take at most a single shmem and perform a single memory allocation..
Similarly, an ArrayOfMediaRawData will pack multiple MediaRawData in at most 3 shmems (one for each array of bytes a MediaRawData contains).

They are designed to work in combination with a ShmemPool which will own each of the allocated Shmem and so can be re-used over and over.

Differential Revision: https://phabricator.services.mozilla.com/D91537
2020-09-29 04:39:14 +00:00
Jean-Yves Avenard da79b617d7 Bug 1648309 - P1. Add ShmemRecycleAllocator class. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D91536
2020-09-29 04:39:06 +00:00
alwu 79b39e496d Bug 1667480 - part2 : add a crash test. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91638
2020-09-29 01:38:08 +00:00
alwu 3c0ed0530e Bug 1667480 - part1 : return empty slice if range is empty. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91637
2020-09-29 01:37:51 +00:00
Dan Minor fb29f2a137 Bug 1665166 - Fix include in RtpRtcpConfig.h; r=ng
Depends on D91322

Differential Revision: https://phabricator.services.mozilla.com/D91323
2020-09-24 18:50:56 +00:00
Dan Minor 45562522d9 Bug 1665166 - Updates to moz.build files; r=ng
Depends on D91318

Differential Revision: https://phabricator.services.mozilla.com/D91319
2020-09-24 18:40:21 +00:00
Dan Minor e800fc9506 Bug 1665166 - Move media/webrtc build files to dom/media/webrtc/third_party_build; r=ng
Depends on D91317

Differential Revision: https://phabricator.services.mozilla.com/D91318
2020-09-24 18:20:26 +00:00
Kershaw Chang 93e628b4ae Bug 1652677 - P2: Implement necko part of echconfig r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D89455
2020-09-25 07:35:04 +00:00
Mike Hommey 48e8e82173 Bug 1667007 - Fix AsyncLogger::TracePayload's mName size calculation. r=padenot
such that it accounts for alignment of TracePayload itself in MPSCQueue
correctly.

Differential Revision: https://phabricator.services.mozilla.com/D91238
2020-09-24 08:20:17 +00:00
Jan-Ivar Bruaroey e3827b1882 Bug 1654430 - Fix mDeviceIDs to only track real devices and not be overwritten by other enumerateDevices requests. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D89231
2020-09-24 23:32:00 +00:00
Jan-Ivar Bruaroey 4c69b0ebaa Bug 1654430 - Update waitForRtpFlow() mochitest helper to use sender/receiver.getStats. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D89082
2020-09-23 16:09:04 +00:00
Jan-Ivar Bruaroey fb585eddf0 Bug 1654430 - Reorder devicechange event tests in test_ondevicechange.html r=pehrsons
to test event, no event, event.

Differential Revision: https://phabricator.services.mozilla.com/D89081
2020-09-23 16:08:56 +00:00
Jan-Ivar Bruaroey 0ae206585d Bug 1654430 - Replace 200ms mainthread sleep on inserting/removing USB/bluetooth cam/mic/speaker with WaitFor() promise. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D84458
2020-09-23 16:08:58 +00:00
Razvan Maries 887634a649 Backed out 3 changesets (bug 1665713) for perma failures on test_peerConnection_capturedVideo.html. CLOSED TREE
Backed out changeset 296d5facd7bd (bug 1665713)
Backed out changeset 770d63754715 (bug 1665713)
Backed out changeset 433d8f92b482 (bug 1665713)
2020-09-25 02:58:57 +03:00
alwu 25b9d83ca8 Bug 1652108 - part3 : remove relevant codes for 'autoplay_would_be_allowed_count' and 'autoplay_would_not_be_allowed_count'. r=bryce
We don't need `autoplay_would_be_allowed_count` and `autoplay_would_not_be_allowed_count`, so we can remove all related codes.

Differential Revision: https://phabricator.services.mozilla.com/D83227
2020-09-23 22:35:26 +00:00
Michael Froman 1d099767d3 Bug 1665713 - pt2 - fix reviewbot whitespace issues. r=ng
These were originally masked due to an exception in
tools/lint/file-whitespace.html for the directory dom/media/tests, but we
don't need an exception for our new location (dom/media/webrtc/tests/mochitests)
if we fix these 3 files.

2 files had bad line endings (Windows vs Unix):
dom/media/webrtc/tests/mochitests/test_getUserMedia_cubebDisabled.html
dom/media/webrtc/tests/mochitests/test_getUserMedia_cubebDisabledFakeStreams.html

1 file had trailing whitespace:
dom/media/webrtc/tests/mochitests/test_peerConnection_threeUnbundledConnections.html

Differential Revision: https://phabricator.services.mozilla.com/D90630
2020-09-24 21:10:35 +00:00
Michael Froman 8bece4651b Bug 1665713 - pt1 - move dom/media/tests/mochitest to dom/media/webrtc/tests/mochitests. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D90614
2020-09-24 21:10:07 +00:00
Razvan Maries 717d9a23ba Backed out 2 changesets (bug 1665713) for Lint failure on NetworkPreparationChromeScript.js. CLOSED TREE
Backed out changeset e926364f5d4f (bug 1665713)
Backed out changeset ad03f6f54321 (bug 1665713)
2020-09-24 22:59:53 +03:00
Michael Froman 4b7556eb55 Bug 1665713 - pt2 - fix reviewbot whitespace issues. r=ng
These were originally masked due to an exception in
tools/lint/file-whitespace.html for the directory dom/media/tests, but we
don't need an exception for our new location (dom/media/webrtc/tests/mochitests)
if we fix these 3 files.

2 files had bad line endings (Windows vs Unix):
dom/media/webrtc/tests/mochitests/test_getUserMedia_cubebDisabled.html
dom/media/webrtc/tests/mochitests/test_getUserMedia_cubebDisabledFakeStreams.html

1 file had trailing whitespace:
dom/media/webrtc/tests/mochitests/test_peerConnection_threeUnbundledConnections.html

Differential Revision: https://phabricator.services.mozilla.com/D90630
2020-09-24 19:13:04 +00:00
Michael Froman a1fe394b53 Bug 1665713 - pt1 - move dom/media/tests/mochitest to dom/media/webrtc/tests/mochitests. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D90614
2020-09-24 19:12:30 +00:00
Razvan Maries e761feff33 Backed out 2 changesets (bug 1652677) for build bustages on nsHttpConnection.cpp. CLOSED TREE
Backed out changeset 7df7bfbfbc6e (bug 1652677)
Backed out changeset 435ff20fa8c6 (bug 1652677)
2020-09-24 22:01:09 +03:00
Bryce Seager van Dyk 46b2ead3a9 Bug 1667121 - Set Cbcs encryption scheme correctly when initializing CDM. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D91286
2020-09-24 16:55:01 +00:00
Kershaw Chang d12fbcdc43 Bug 1652677 - P2: Implement necko part of echconfig r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D89455
2020-09-24 16:20:04 +00:00
Andreas Pehrson 51ef39e1d8 Bug 1664010 - Increase the wait time before default-initing in AudioTrackEncoder. r=bryce
One second is a bit short given that starting bluetooth input devices takes
several seconds on some platforms. Bug 1586370 may have worsened this since we
now process silence while waiting for an input to give us data.

Differential Revision: https://phabricator.services.mozilla.com/D91140
2020-09-24 14:17:03 +00:00
Andreas Pehrson b3c3ba9d4e Bug 1663662 - Fix some Muxer logs to use the correct time base for audio. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91139
2020-09-24 13:43:59 +00:00
Andreas Pehrson ce274e63a2 Bug 1663662 - Pass the samplerate to EncodedFrame. r=bryce
Without this, EncodedFrame is relying on hardcoded values based on frame type.
That doesn't scale well.

Differential Revision: https://phabricator.services.mozilla.com/D91138
2020-09-24 13:43:52 +00:00
Andreas Pehrson beb9fe2e9a Bug 1663662 - Use the actual samplerate when OpusTrackEncoder init fails. r=bryce
Null data has already been appended, and is clocked in the track rate.

Differential Revision: https://phabricator.services.mozilla.com/D91137
2020-09-24 13:43:50 +00:00
Andreas Pehrson 584611dfef Bug 1663662 - Add unittest. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91136
2020-09-24 14:18:12 +00:00
Jean-Yves Avenard a684544a0d Bug 1666698 - Only synchronise textures after a copy serially. r=mattwoodrow
Attempt to lock textures from the same D3D11 devices on multiple threads at once can lead to deadlocks as observed with AMD cards.

Differential Revision: https://phabricator.services.mozilla.com/D91098
2020-09-23 21:34:47 +00:00
alwu e424a6f2de Bug 1665527 - part4 : add new testcase for 'browser_stop_control_after_media_reaches_to_end.js'. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D90773
2020-09-23 12:12:03 +00:00
alwu 7816c86ee1 Bug 1665527 - part3 : add a test. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D90772
2020-09-23 12:12:05 +00:00
alwu 18f0229b8f Bug 1665527 - part2 : notify media session status based on its document's activity state. r=chunmin
Because of D90771, we need media session to notifty its status correctly in order to deactivate the controller. Therefore, when its document becomes inactive (in bfcahce), we should treat media session as inactive and notify it to `MediaStatusManager` in order to clear the active media session if needed.

In addition, add some assertions to ensure we won't modify or set any attributes on media session when its document is inactive.

Differential Revision: https://phabricator.services.mozilla.com/D90926
2020-09-23 19:43:46 +00:00
alwu f03e8c1822 Bug 1665527 - part1 : deactivate a controller only when it doesn't have controlled media and active media session. r=chunmin
Currently, we only keep controller active when it has controlled media. That strategy works well for non-media session situation because only controlled media need to listen to media keys.

However, when having media session, thing goes slightly different. When we don't have any controlled media, active media session may still listen to media keys and do the corresponding operation. Therefore, we should keep the active media session being able to receive media keys even if the controlled media has gone and deactivate a controller when it doesn't have controlled media and no active media session.

Example, play a audible media first, then press `next track`, if media session is going to play an inaudible media (which is not a controllable media, so no controlled media is existing), we still want media session to receive and handle media keys for users.

Differential Revision: https://phabricator.services.mozilla.com/D90771
2020-09-23 12:12:08 +00:00
Nicklas Boman eda2c722fa Bug 1308101 - Replace PL_strcpy/PL_strncpy with a safer Gecko string class or function r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D89802
2020-09-23 17:18:53 +00:00
Paul Adenot a90b35f858 Bug 1666490 - Fix channelCount of AnalyserNode. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D91008
2020-09-23 16:58:52 +00:00
Narcis Beleuzu 7cf295e2e9 Backed out changeset 4574fadace05 (bug 1666490) for mda failure on test_analyserNode.html . CLOSED TREE 2020-09-23 19:36:36 +03:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Narcis Beleuzu a2936f5009 Backed out 4 changesets (bug 1654430) for mda failure on test_ondevicechange.html . CLOSED TREE
Backed out changeset 10a70b4fad32 (bug 1654430)
Backed out changeset 495576ebc999 (bug 1654430)
Backed out changeset 0f1db7f155cb (bug 1654430)
Backed out changeset 788a6c7c52f1 (bug 1654430)
2020-09-23 16:52:16 +03:00
Paul Adenot 4683820c98 Bug 1666490 - Fix channelCount of AnalyserNode. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D91008
2020-09-22 16:11:59 +00:00
Paul Adenot a2a4d98d3b Bug 1659244 - Fix two static analysis warnings in AudioDestinationNode.cpp. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D90447
2020-09-23 11:47:05 +00:00
Daniel Le 2ef2841669 Bug 1659244 - Drop the audio wakelock when the AudioDestinationNode is notified that it is not audible. r=pehrsons,alwu
Differential Revision: https://phabricator.services.mozilla.com/D90434
2020-09-23 11:46:59 +00:00
Paul Adenot 7efebc769e Bug 1659244 - Use the AudibilityMonitor in AudioDestinationNode. r=pehrsons,alwu
In particular, this removes the code that was limiting the audibility
notifications spam, because this is handled by the AudibilityMonitor.

Differential Revision: https://phabricator.services.mozilla.com/D90433
2020-09-23 11:46:56 +00:00
Paul Adenot 718b5288e8 Bug 1659244 - Remove audibility code from AudioSegment and AudioBlock. r=pehrsons
Same rationale as for AudioData, the audibility is best computed externally.

Differential Revision: https://phabricator.services.mozilla.com/D90432
2020-09-23 11:46:54 +00:00
Paul Adenot 55b9625c87 Bug 1659244 - Allow processing planar audio in the AudibilityMonitor. r=pehrsons
This is essentially the same code as the interleaved version, but backwards,
since the memory layout is the opposite, we want to take advantage of memory
locality, and only touch audio samples once each.

The `ProcessAudioData` method has been renamed, because of the similarity
between the `AudioData` type and `ProcessAudioData`, since it can now process
`AudioBlock`s.

Differential Revision: https://phabricator.services.mozilla.com/D90431
2020-09-23 11:45:44 +00:00
Jan-Ivar Bruaroey 9dcf1f976c Bug 1654430 - Fix mDeviceIDs to only track real devices and not be overwritten by other enumerateDevices requests. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D89231
2020-09-22 21:28:47 +00:00
Jan-Ivar Bruaroey 199d9e5953 Bug 1654430 - Update waitForRtpFlow() mochitest helper to use sender/receiver.getStats. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D89082
2020-09-22 21:30:14 +00:00
Jan-Ivar Bruaroey 2f42fa11e3 Bug 1654430 - Wait for ended events to have fired on other documents to not disrupt subsequent tests r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D89081
2020-09-22 21:28:22 +00:00
Jan-Ivar Bruaroey 962754db51 Bug 1654430 - Replace 200ms mainthread sleep on inserting/removing USB/bluetooth cam/mic/speaker with WaitFor() promise. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D84458
2020-09-22 21:08:54 +00:00
Narcis Beleuzu 691fd66153 Backed out 4 changesets (bug 1665527) for wpt leakchecks on setactionhandler.html . CLOSED TREE
Backed out changeset 216b96d6a2b3 (bug 1665527)
Backed out changeset a683efbf01c1 (bug 1665527)
Backed out changeset a18103008464 (bug 1665527)
Backed out changeset b97b8759b686 (bug 1665527)
2020-09-23 15:06:17 +03:00
Nico Grunbaum c9ad55f22d Bug 1664900 - P5 - mv peerconnection to jsapi;r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D90951
2020-09-23 04:28:03 +00:00
Nico Grunbaum 97c8100b46 Bug 1664900 - P4 - mv mediapipeline to transportbridge;r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D90950
2020-09-23 04:25:40 +00:00
Nico Grunbaum f8dd90decb Bug 1664900 - P3 - mv media-conduit to libwebrtcglue;r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D90949
2020-09-23 04:25:07 +00:00
Nico Grunbaum dcf9d2412c Bug 1664900 - P2 - unify webrtc subdir include style;r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D90948
2020-09-23 04:23:53 +00:00
Nico Grunbaum 54d899d308 Bug 1664900 - move /media/webrtc/signaling/src to /dom/media/webrtc;r=dminor,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D90179
2020-09-23 04:22:29 +00:00
Michael Froman 5b942915e9 Bug 1664898 - move media/mtransport to media/transport. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D90309
2020-09-22 21:43:49 +00:00
alwu f0457c5e96 Bug 1665527 - part4 : add new testcase for 'browser_stop_control_after_media_reaches_to_end.js'. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D90773
2020-09-22 21:04:41 +00:00
alwu ddadb81a93 Bug 1665527 - part3 : add a test. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D90772
2020-09-22 21:01:20 +00:00
alwu ad52a54195 Bug 1665527 - part2 : notify media session status based on its document's activity state. r=chunmin
Because of D90771, we need media session to notifty its status correctly in order to deactivate the controller. Therefore, when its document becomes inactive (in bfcahce), we should treat media session as inactive and notify it to `MediaStatusManager` in order to clear the active media session if needed.

In addition, add some assertions to ensure we won't modify or set any attributes on media session when its document is inactive.

Differential Revision: https://phabricator.services.mozilla.com/D90926
2020-09-22 21:46:13 +00:00
alwu 2e937ee7bb Bug 1665527 - part1 : deactivate a controller only when it doesn't have controlled media and active media session. r=chunmin
Currently, we only keep controller active when it has controlled media. That strategy works well for non-media session situation because only controlled media need to listen to media keys.

However, when having media session, thing goes slightly different. When we don't have any controlled media, active media session may still listen to media keys and do the corresponding operation. Therefore, we should keep the active media session being able to receive media keys even if the controlled media has gone and deactivate a controller when it doesn't have controlled media and no active media session.

Example, play a audible media first, then press `next track`, if media session is going to play an inaudible media (which is not a controllable media, so no controlled media is existing), we still want media session to receive and handle media keys for users.

Differential Revision: https://phabricator.services.mozilla.com/D90771
2020-09-22 20:21:44 +00:00
Jan-Ivar Bruaroey 8484c7ced8 Bug 1634044 - Downscale getDisplayMedia() correctly with only width or height constraint present. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D76968
2020-09-22 20:09:49 +00:00
Dan Minor 8096de52e6 Bug 1666336 - Remove nsITabSource; r=mjf
This is a leftover from the old tab sharing implementation used in Firefox
Hello and is no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D90986
2020-09-22 16:28:59 +00:00
alwu a1db27e6c9 Bug 1663631 - part2 : add a test. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D90583
2020-09-22 15:56:08 +00:00
alwu 9cb492f930 Bug 1663631 - part1 : disconnect audible listener when we recreate a media sink or shutdown. r=bryce
The audible listener should be kept when the media sink is available. Disconnecting the listener on `StopMediaSink()` would make us not able to receive the audible change after starting the media sink again.

Therefore, we should only disconnect audible listener when we recreate a media sink or shutdown.

Differential Revision: https://phabricator.services.mozilla.com/D90575
2020-09-22 15:56:16 +00:00
Razvan Maries 655ae40b05 Backed out 7 changesets (bug 1659244) for DestinationNodeEngine related crashes. CLOSED TREE
Backed out changeset 50d7aabc075e (bug 1659244)
Backed out changeset da3af45b9195 (bug 1659244)
Backed out changeset 9e748be643e7 (bug 1659244)
Backed out changeset 47a5552dece7 (bug 1659244)
Backed out changeset 9c362f616f93 (bug 1659244)
Backed out changeset 4f1c72021ec9 (bug 1659244)
Backed out changeset 90f3b8edbd8b (bug 1659244)
2020-09-22 18:54:47 +03:00
Andreas Pehrson 72f1573cfe Bug 1665889 - Hide AudioInputProcessing include behind MOZ_WEBRTC. r=padenot
This has busted the MingW build, where webrtc is not supported.
AudioInputProcessing relies on upstream webrtc for audio processing: aec, etc.

Differential Revision: https://phabricator.services.mozilla.com/D90852
2020-09-22 13:36:19 +00:00
Paul Adenot 4f9d9dd0be Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetik
This [0] commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.

[0]: ac3569ef18

Differential Revision: https://phabricator.services.mozilla.com/D89591
2020-09-22 13:44:05 +00:00
Paul Adenot 97350e1d07 Bug 1659244 - Fix two static analysis warnings in AudioDestinationNode.cpp. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D90447
2020-09-21 17:41:50 +00:00
Daniel Le 781fef9c92 Bug 1659244 - Drop the audio wakelock when the AudioDestinationNode is notified that it is not audible. r=pehrsons,alwu
Differential Revision: https://phabricator.services.mozilla.com/D90434
2020-09-21 17:41:26 +00:00
Paul Adenot f7b99a5399 Bug 1659244 - Use the AudibilityMonitor in AudioDestinationNode. r=pehrsons,alwu
In particular, this removes the code that was limiting the audibility
notifications spam, because this is handled by the AudibilityMonitor.

Differential Revision: https://phabricator.services.mozilla.com/D90433
2020-09-21 17:41:12 +00:00
Paul Adenot 9fcb6a67ad Bug 1659244 - Remove audibility code from AudioSegment and AudioBlock. r=pehrsons
Same rationale as for AudioData, the audibility is best computed externally.

Differential Revision: https://phabricator.services.mozilla.com/D90432
2020-09-21 17:40:58 +00:00
Paul Adenot d1415f98f6 Bug 1659244 - Allow processing planar audio in the AudibilityMonitor. r=pehrsons
This is essentially the same code as the interleaved version, but backwards,
since the memory layout is the opposite, we want to take advantage of memory
locality, and only touch audio samples once each.

The `ProcessAudioData` method has been renamed, because of the similarity
between the `AudioData` type and `ProcessAudioData`, since it can now process
`AudioBlock`s.

Differential Revision: https://phabricator.services.mozilla.com/D90431
2020-09-21 17:40:45 +00:00
Andreas Pehrson fd6604f554 Bug 1663368 - Add mochitests for simulcast with custom layer-resolution-order. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D90667
2020-09-22 12:04:57 +00:00
Dan Minor 7df0154098 Bug 1664536 - Call SetPriority after capturer thread started; r=mjf
The platform thread API documentation says that the thread priority must be
set after the thread starts, and checks this with an assertion. I'm guessing
that this behaviour was different at some point in the past, and this code
ended upbeing commented out rather than fixed up during an update.

Differential Revision: https://phabricator.services.mozilla.com/D90869
2020-09-21 16:21:04 +00:00
Dan Minor c65a26145a Bug 1664536 - Add _maxFPSNeeded member; r=mjf
If we make _maxFPSNeeded an atomic member variable, then we can avoid taking
a lock in DesktopCaptureImple::process().

Differential Revision: https://phabricator.services.mozilla.com/D90868
2020-09-21 16:19:18 +00:00
Dan Minor f6ff738200 Bug 1664536 - Add lock to StartCapture; r=mjf
This isn't strictly necessary because the max fps needed calculation is being
moved into an atomic member variable, but for consistently, it would be good
to take the API lock in every API call.

Differential Revision: https://phabricator.services.mozilla.com/D90866
2020-09-21 16:06:52 +00:00
Dan Minor dc2fbf54fa Bug 1664536 - Simplify locking in DesktopCaptureImpl; r=mjf
We have both _apiCs and _callBackCs in DesktopCaptureImpl, presumably for
historical reasons, since one is protected and the other private. Since there
are no subclasses of DesktopCaptureImpl, one private CriticalSection is
sufficient here.

Differential Revision: https://phabricator.services.mozilla.com/D90865
2020-09-21 15:36:26 +00:00
Jean-Yves Avenard 24f0e7c0a9 Bug 1665945 - Fix compilation. r=gerald
Fix ""error: member access into incomplete type 'mozilla::layers::IGPUVideoSurfaceManager" build bustage with --disable-accessibility"
we don't want to fully declare the class in the header as it would require to leak most of gfx headers.

Differential Revision: https://phabricator.services.mozilla.com/D90776
2020-09-19 01:04:27 +00:00
Sebastian Hengst cf7b0b4636 Backed out 3 changesets (bug 1663917) for crashes (bug 1665983).
Crashes with
* [@ arena_dalloc | `anonymous namespace'::setup_wasapi_stream]
* [@ `anonymous namespace'::wasapi_create_device ]

Backed out changeset f08ef676251a (bug 1663917)
Backed out changeset 5bf586f8f81a (bug 1663917)
Backed out changeset 91ff0dad958b (bug 1663917)
2020-09-18 20:07:30 +02:00
Jean-Yves Avenard 66d6c40aa5 Bug 1653060 - P5. Ensure no task gets dispatched after shutdown. r=mattwoodrow
And fix thread-safety access to sRemoteDecoderManagerChildThread static while at it.

Differential Revision: https://phabricator.services.mozilla.com/D90506
2020-09-17 06:35:15 +00:00
Jean-Yves Avenard 298b6203a1 Bug 1653060 - P4. Wait until all MediaRemoteDecoderManagerParent have closed before killing process. r=mattwoodrow.
We unfortunately can't use the AsyncShutdownService in either the GPU or RDD process.

So we add a little utility class AsyncBlockers that will resolve its promise once all services have deregistered from it.

We use it to temporily suspend the RDDParent or GPUParent from killing the process, up to 10s.

This allows for cleaner shutdown as the parent process doesn't guarantee the order in which processes are killed (even though it should).

Differential Revision: https://phabricator.services.mozilla.com/D90487
2020-09-18 11:07:13 +00:00
Jean-Yves Avenard e748bb2d7b Bug 1653060 - P3. Use nsCOMPtr. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D90486
2020-09-18 11:07:15 +00:00
Jean-Yves Avenard f713b4f58e Bug 1653060 - P2. Ensure the RDD process gets shutdown after content processes. r=mjf
The RDD process gets shutdown following a NS_XPCOM_SHUTDOWN_OBSERVER_ID notification.
Notifications are processed in LIFO order, since the RDD process is started on demand it would have typically be registered after a content process.
We must ensure that the RDD get shutdown after all content processes so that it can receive notifications that the RemoteDecoderManagerChilds are shutting down.

Differential Revision: https://phabricator.services.mozilla.com/D90485
2020-09-18 11:07:18 +00:00
Brindusan Cristian 73323efa4b Backed out 4 changesets (bug 1653060) for causing mochitest assertion failures. CLOSED TREE
Backed out changeset d143ac59991f (bug 1653060)
Backed out changeset 6943102ffe2a (bug 1653060)
Backed out changeset a38425c96709 (bug 1653060)
Backed out changeset 68c5b2c56f3f (bug 1653060)
2020-09-18 14:03:48 +03:00
Jean-Yves Avenard 747bda5c42 Bug 1653060 - P4. Wait until all MediaRemoteDecoderManagerParent have closed before killing process. r=mattwoodrow.
We unfortunately can't use the AsyncShutdownService in either the GPU or RDD process.

So we add a little utility class AsyncBlockers that will resolve its promise once all services have deregistered from it.

We use it to temporily suspend the RDDParent or GPUParent from killing the process, up to 10s.

This allows for cleaner shutdown as the parent process doesn't guarantee the order in which processes are killed (even though it should).

Differential Revision: https://phabricator.services.mozilla.com/D90487
2020-09-18 02:51:50 +00:00
Jean-Yves Avenard 4bb1eaa8e6 Bug 1653060 - P3. Use nsCOMPtr. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D90486
2020-09-17 06:57:58 +00:00
Jean-Yves Avenard 04f8c82986 Bug 1653060 - P2. Ensure the RDD process gets shutdown after content processes. r=mjf
The RDD process gets shutdown following a NS_XPCOM_SHUTDOWN_OBSERVER_ID notification.
Notifications are processed in LIFO order, since the RDD process is started on demand it would have typically be registered after a content process.
We must ensure that the RDD get shutdown after all content processes so that it can receive notifications that the RemoteDecoderManagerChilds are shutting down.

Differential Revision: https://phabricator.services.mozilla.com/D90485
2020-09-17 02:21:48 +00:00
Andrew Halberstadt 388ff364cb Bug 1665431 - [ci] Exclusively schedule android when only dom/media/systemservices/android_video_capture is modified, r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D90449
2020-09-17 07:37:39 +00:00
Bryce Seager van Dyk edc49f167b Bug 1615444 - Remove media telem histograms that expired in 74 and related code. r=alwu
Removes
- MEDIACACHESTREAM_LENGTH_KB
- MEDIA_PLAY_PROMISE_RESOLUTION
- AUDIO_TRACK_SILENCE_PROPORTION

and all the code I could find that was specific to reporting these values via
telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D88868
2020-09-17 14:43:26 +00:00
Paul Adenot 56781da2dc Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetik
This [0] commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.

[0]: ac3569ef18

Differential Revision: https://phabricator.services.mozilla.com/D89591
2020-09-17 12:14:22 +00:00
Paul Adenot f8ed2f8b18 Bug 1380795 - On Android, always put the front camera first in the list, as it's more likely to be what users want by default. r=pehrsons,dminor
Differential Revision: https://phabricator.services.mozilla.com/D90380
2020-09-16 17:01:39 +00:00
Bogdan Tara 88a65a9f0d Merge mozilla-central to autoland on a CLOSED TREE 2020-09-17 13:17:04 +03:00
Bogdan Tara b29fcea7fe Merge autoland to mozilla-central a=merge 2020-09-17 13:08:31 +03:00
Bogdan Tara 5efefd3ef2 Backed out 3 changesets (bug 1663917) on jcristau's request, for crashes a=backout
DONTBUILD

Backed out changeset 706c1dc89ab3 (bug 1663917)
Backed out changeset 837d83a0bddd (bug 1663917)
Backed out changeset 18143730ca80 (bug 1663917)
2020-09-17 12:58:50 +03:00
Paul Adenot fb0d032a06 Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetik
This [0] commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.

[0]: ac3569ef18

Differential Revision: https://phabricator.services.mozilla.com/D89591
2020-09-15 15:05:08 +00:00
Jean-Yves Avenard 794c47608e Bug 1663227 - P1. Always process decoded video promise to avoid leaks. r=mattwoodrow
This is a quick & dirty solution designed for easy uplift to beta.

Differential Revision: https://phabricator.services.mozilla.com/D90203
2020-09-15 21:02:21 +00:00
Karl Tomlinson 6cea4e7ccb Bug 1646601 add crashtest with AudioContext after unload r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D84300
2020-09-15 22:13:21 +00:00
Karl Tomlinson 8b05beadc1 Bug 1646601 throw InvalidStateError on (Offline)AudioContext construction when not fully active r=padenot
https://github.com/WebAudio/web-audio-api/pull/1425/files#diff-eacf331f0ffc35d4b482f1d15a887d3bR2245

Differential Revision: https://phabricator.services.mozilla.com/D84302
2020-09-15 22:13:22 +00:00
Karl Tomlinson 9e13b21300 Bug 1646601 move fully active predicate to nsPIDOMWindowInner r=farre
Depends on D90216

Differential Revision: https://phabricator.services.mozilla.com/D90217
2020-09-15 22:13:22 +00:00
Brindusan Cristian 1f72b3f30e Backed out changeset 3895daa47180 (bug 1308101) for linux hazard bustages. CLOSED TREE 2020-09-16 04:01:37 +03:00
stransky 30d5f7b4e5 Bug 1665324 Remove media.ffmpeg.low-latency.enabled preference, r=jya
Differential Revision: https://phabricator.services.mozilla.com/D90373
2020-09-16 13:19:42 +00:00
Nicklas Boman 6f0da98c75 Bug 1308101 - Replace PL_strcpy/PL_strncpy with a safer Gecko string class or function r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D89802
2020-09-15 16:28:04 +00:00
Narcis Beleuzu 84c3cc7574 Backed out 47 changesets (bug 1656438) for bustages on DynamicResampler.cpp . CLOSED TREE
Backed out changeset dc497e6c016d (bug 1656438)
Backed out changeset 780a6b48d876 (bug 1656438)
Backed out changeset a9baeaefbb85 (bug 1656438)
Backed out changeset 297b4dbd2380 (bug 1656438)
Backed out changeset 8c3c64217bf6 (bug 1656438)
Backed out changeset d51cd6827d3b (bug 1656438)
Backed out changeset 1e48be97c8ad (bug 1656438)
Backed out changeset 44d075680b27 (bug 1656438)
Backed out changeset 64c35518d82f (bug 1656438)
Backed out changeset 159e8137d4ad (bug 1656438)
Backed out changeset 0546062cc053 (bug 1656438)
Backed out changeset 18079c579276 (bug 1656438)
Backed out changeset b6f3e65401b4 (bug 1656438)
Backed out changeset cfbc65954235 (bug 1656438)
Backed out changeset d35cf2a0b659 (bug 1656438)
Backed out changeset 5da08b28c7b5 (bug 1656438)
Backed out changeset 8071a5b82a62 (bug 1656438)
Backed out changeset 4f2aeff6e0e4 (bug 1656438)
Backed out changeset 4bb23c108319 (bug 1656438)
Backed out changeset 90c2ec79a8fc (bug 1656438)
Backed out changeset ffb479620b65 (bug 1656438)
Backed out changeset 9e9f40be7bd7 (bug 1656438)
Backed out changeset 664f66d512ff (bug 1656438)
Backed out changeset ce3a1f7b1c79 (bug 1656438)
Backed out changeset 8e59070e92ea (bug 1656438)
Backed out changeset fd84761e9af8 (bug 1656438)
Backed out changeset 50ec7aa8a44a (bug 1656438)
Backed out changeset 338a090e2657 (bug 1656438)
Backed out changeset 1f262745a844 (bug 1656438)
Backed out changeset 3b904a06afd1 (bug 1656438)
Backed out changeset d5c5afc9239f (bug 1656438)
Backed out changeset 9351b87ca40b (bug 1656438)
Backed out changeset 2baecf74521e (bug 1656438)
Backed out changeset 8571622fc9a0 (bug 1656438)
Backed out changeset c4ad7c72bc9c (bug 1656438)
Backed out changeset e505d1d051c4 (bug 1656438)
Backed out changeset a51bb724a78c (bug 1656438)
Backed out changeset 8cacc0e96a3e (bug 1656438)
Backed out changeset 58838694eb67 (bug 1656438)
Backed out changeset 2baa906a480d (bug 1656438)
Backed out changeset 52e1ae3a4fd7 (bug 1656438)
Backed out changeset 1da839e0562d (bug 1656438)
Backed out changeset 55c9c22b0a13 (bug 1656438)
Backed out changeset d116b82ffad9 (bug 1656438)
Backed out changeset b640887eca0e (bug 1656438)
Backed out changeset 5be36600b092 (bug 1656438)
Backed out changeset 7b07bbe610ae (bug 1656438)
2020-09-15 20:15:27 +03:00
Andreas Pehrson d739a3f0fc Bug 1656438 - Fix bustage. r=bustage-fix CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D90282
2020-09-15 15:51:27 +00:00
Andreas Pehrson 0591d5325d Bug 1656438 - Tighten estimated frequency check by accounting for drift factor. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D89987
2020-09-15 14:41:25 +00:00
Andreas Pehrson d88af83716 Bug 1656438 - Make integer types explicit and unsigned in AudioDriftCorrection and friends. r=padenot
In particular, this patch gets rid of signed integers where negative values
don't make sense anyway.

Differential Revision: https://phabricator.services.mozilla.com/D89777
2020-09-15 14:42:28 +00:00
Andreas Pehrson 98fd9bf78d Bug 1656438 - Rework the audio drift correction logic. r=padenot
This patch simplifies the logic by reducing the number of paths, from two to
one method that changes the correction. This method now weighs the calculated
correction by 60% and the previous correction by 40% when setting the new value,
to provide a negative feedback loop that stabilizes around the desired amount of
buffering.

This leads to a smoother output with less noticable changes in the correction
value, while still reaching the desired amount of buffering quickly.

Tests are updated with new expectations accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D89776
2020-09-15 14:42:25 +00:00
Andreas Pehrson 25c51b36e8 Bug 1656438 - Remove logic that ignores correction changes that are too small. r=padenot
The removed logic complicates tests, as the correction code does not always
strive to reach the desired buffering level. If the changes are small enough the
buffer continues to shrink or grow until we get close to the edge and then a
much more abrupt correction change is applied, something noticable by ear.

Differential Revision: https://phabricator.services.mozilla.com/D89775
2020-09-15 14:42:23 +00:00
Andreas Pehrson ad73c3b7a4 Bug 1656438 - Avoid overflowing the internal AudioResampler ring buffer. r=padenot
Depends on D89773

Differential Revision: https://phabricator.services.mozilla.com/D89774
2020-09-15 11:57:14 +00:00
Andreas Pehrson df5c09c288 Bug 1656438 - Handle null chunks in AudioVerifier. r=padenot
Depends on D89772

Differential Revision: https://phabricator.services.mozilla.com/D89773
2020-09-15 11:57:07 +00:00
Andreas Pehrson 6bdac502bc Bug 1656438 - Run all MockCubebStreams off the same fake audio thread to avoid unwanted drift. r=padenot
With this patch, there is a fake audio thread present on a MockCubeb context as
soon as one MockCubebStream is running under that context. When the last running
MockCubebStream is stopped, the fake audio thread is joined and unset.

This adds a tad bit of complexity but results in zero unwanted drift between
MockCubebStreams under the same MockCubeb context. This is essential for stable
CrossGraphTrack tests.

A side effect of this is that the drift factor of a MockCubebStream does not
affect the interval at which data is processed, but rather the amount of data
processed each interval.

This patch also allows us to process data with virtually no wait time between
iterations (as opposed to wall-time 10ms-waits), for (much) speedier tests.

Differential Revision: https://phabricator.services.mozilla.com/D89772
2020-09-15 14:42:20 +00:00
Andreas Pehrson c543f24c3a Bug 1656438 - Remove unused LOG macro from MockCubeb.h. r=padenot
Depends on D89770

Differential Revision: https://phabricator.services.mozilla.com/D89771
2020-09-15 11:56:50 +00:00
Andreas Pehrson ef40851a44 Bug 1656438 - Add license info to MockCubeb.h. r=padenot
Depends on D89769

Differential Revision: https://phabricator.services.mozilla.com/D89770
2020-09-15 11:56:43 +00:00
Andreas Pehrson ab120121e2 Bug 1656438 - Rid MockCubeb.h of `using namespace` lines. r=padenot
Depends on D89768

Differential Revision: https://phabricator.services.mozilla.com/D89769
2020-09-15 11:56:35 +00:00
Andreas Pehrson cb51a3625a Bug 1656438 - Spell check and nits. r=padenot
Depends on D89767

Differential Revision: https://phabricator.services.mozilla.com/D89768
2020-09-15 11:56:28 +00:00
Andreas Pehrson 51f32e0fa7 Bug 1656438 - Test odd rates in TestAudioDriftCorrection. r=padenot
Depends on D89766

Differential Revision: https://phabricator.services.mozilla.com/D89767
2020-09-15 11:56:20 +00:00
Andreas Pehrson ca44745d51 Bug 1656438 - Add a warning when running out of resampler buffer. r=padenot
Depends on D89765

Differential Revision: https://phabricator.services.mozilla.com/D89766
2020-09-15 11:56:12 +00:00
Andreas Pehrson 7d1e1b8572 Bug 1656438 - Guard against making drift worse when the desired buffer is large. r=padenot
The resampled source clock can become negative with a large desired buffer and
a small current buffer. This patch clamps it above 1 so we never drift-correct
in the wrong direction.

Differential Revision: https://phabricator.services.mozilla.com/D89765
2020-09-15 14:42:18 +00:00
Andreas Pehrson e74236a8b6 Bug 1656438 - Verify that the current buffer is close to the desired buffer in length. r=padenot
Depends on D89763

Differential Revision: https://phabricator.services.mozilla.com/D89764
2020-09-15 11:55:57 +00:00
Andreas Pehrson 37067e3c55 Bug 1656438 - Get rid of NUM_OF_FRAMES from MockCubeb. r=padenot
This allows us to configure the number of frames more dynamically, and update it
on the fly to simulate drift.

Differential Revision: https://phabricator.services.mozilla.com/D89763
2020-09-15 14:42:16 +00:00
Andreas Pehrson 482c467669 Bug 1656438 - Update the resampler after a fixed duration instead of a fixed number of iterations. r=padenot
This makes the tests more similar to real-world scenarios, where the duration of
an iteration may vary.

Differential Revision: https://phabricator.services.mozilla.com/D89762
2020-09-15 14:42:13 +00:00
Andreas Pehrson e1b75a875c Bug 1656438 - Fix the unit of the desired buffering. r=padenot
Comments mention 5ms, but code says it's 50ms.

Differential Revision: https://phabricator.services.mozilla.com/D89761
2020-09-15 14:42:11 +00:00
Andreas Pehrson c8c26f0a4d Bug 1656438 - Take the desired buffering as parameter in ClockDrift, AudioResampler, and friends. r=padenot
This makes us able to write tests for different buffer lengths.

Differential Revision: https://phabricator.services.mozilla.com/D89760
2020-09-15 14:42:09 +00:00
Andreas Pehrson 4d7b23d775 Bug 1656438 - Report pre-buffer as current buffer size before receiving data in DynamicResampler. r=padenot
Without this patch we return 0, and that can be misinterpreted by
AudioDriftCorrection so it thinks we have drifted a lot. This becomes more
obvious with a large desired buffer.

Differential Revision: https://phabricator.services.mozilla.com/D89759
2020-09-15 14:42:06 +00:00
Andreas Pehrson 38e987ad7e Bug 1656438 - Make const DynamicResampler members public. r=padenot
Depends on D89757

Differential Revision: https://phabricator.services.mozilla.com/D89758
2020-09-15 11:55:07 +00:00
Andreas Pehrson 7c067607e0 Bug 1656438 - Test CrossGraph ports with a multi-second buffer. r=padenot
The buffer size is exposed as a pref, so it better have a bit of test coverage.

Differential Revision: https://phabricator.services.mozilla.com/D89757
2020-09-15 14:42:04 +00:00
Andreas Pehrson 1346d4bb48 Bug 1656438 - Elaborate on CrossGraphPort tests. r=padenot
This patch lets us pass in a drift factor to allow for testing of the drift
correction code. It also enables output verification for the CrossGraph tests.

Differential Revision: https://phabricator.services.mozilla.com/D89756
2020-09-15 14:42:01 +00:00
Andreas Pehrson 5366c0d06e Bug 1656438 - Prune chunks after 50ms without imagining the samplerate. r=padenot
In a CrossGraphReceiver there is 100ms worth of buffering in AudioChunks.
Without this patch the graph will buffer 2400 frames in each track before
removing data from them. If a graph contains a CrossGraphReceiver and runs at a
sample rate lower than 24000Hz, that CrossGraphReceiver will run out of chunks
and an assertion failure happens at best.

Differential Revision: https://phabricator.services.mozilla.com/D89755
2020-09-15 14:41:58 +00:00
Andreas Pehrson d85a980ee9 Bug 1656438 - Do output verification in the gtest body. r=padenot
Depends on D89753

Differential Revision: https://phabricator.services.mozilla.com/D89754
2020-09-15 11:54:37 +00:00
Andreas Pehrson 9962c2e6af Bug 1656438 - Only raise the FramesProcessedEvent once there is no silence. r=padenot
Because an audio driver starts out with its fallback driver running the graph,
we might use unnecessary amounts of silence for the verification. Especially
with the `GoFaster()` mode turned on, as the fallback driver's thread runs
rarely compared to how often we are feeding the graph audio data from the
MockCubebStream.

Differential Revision: https://phabricator.services.mozilla.com/D89753
2020-09-15 14:41:56 +00:00
Andreas Pehrson 0d8d6e6a2d Bug 1656438 - Remove MockCubeb::GetCurrentStream. r=padenot
It is a fragile and timing-sensitive way of getting the stream.

Differential Revision: https://phabricator.services.mozilla.com/D89752
2020-09-15 14:41:54 +00:00
Andreas Pehrson 4b2a2e6ed7 Bug 1656438 - Remove dependency on GMPTestMonitor in TestAudioTrackGraph.cpp. r=padenot
Depends on D89749

Differential Revision: https://phabricator.services.mozilla.com/D89751
2020-09-15 11:54:14 +00:00
Andreas Pehrson 09e83dfc41 Bug 1656438 - Simplify TestAudioTrackGraph.CrossGraphPort. r=padenot
Depends on D89748

Differential Revision: https://phabricator.services.mozilla.com/D89749
2020-09-15 11:54:06 +00:00
Andreas Pehrson 899f122462 Bug 1656438 - Simplify TestAudioTrackGraph.SourceTrack. r=padenot
Depends on D89747

Differential Revision: https://phabricator.services.mozilla.com/D89748
2020-09-15 11:53:59 +00:00
Andreas Pehrson 102d6e1cc5 Bug 1656438 - Simplify TestAudioTrackGraph.ErrorStateCrash. r=padenot
Depends on D89746

Differential Revision: https://phabricator.services.mozilla.com/D89747
2020-09-15 11:53:52 +00:00
Andreas Pehrson ec3f42e3a3 Bug 1656438 - Simplify TestAudioTrackGraph.NotifyDeviceStarted. r=padenot
Depends on D89745

Differential Revision: https://phabricator.services.mozilla.com/D89746
2020-09-15 11:53:44 +00:00
Andreas Pehrson 61b7d9f063 Bug 1656438 - Simplify TestAudioTrackGraph.SetOutputDeviceID. r=padenot
Depends on D89744

Differential Revision: https://phabricator.services.mozilla.com/D89745
2020-09-15 11:53:37 +00:00
Andreas Pehrson 5ae9f63543 Bug 1656438 - Simplify TestAudioTrackGraph.DifferentDeviceIDs. r=padenot
Depends on D89743

Differential Revision: https://phabricator.services.mozilla.com/D89744
2020-09-15 11:53:29 +00:00
Andreas Pehrson 9eed18e4b6 Bug 1656438 - Add explainer for the need for asyncness in TestAudioTrackGraph.cpp. r=padenot
Depends on D89742

Differential Revision: https://phabricator.services.mozilla.com/D89743
2020-09-15 11:53:22 +00:00
Andreas Pehrson de121769f0 Bug 1656438 - Break out and simplify the StartStop ControlMessage for re-use. r=padenot
Depends on D89741

Differential Revision: https://phabricator.services.mozilla.com/D89742
2020-09-15 11:53:14 +00:00
Andreas Pehrson ae837f3da5 Bug 1656438 - Add async flow helpers to TestAudioTrackGraph. r=padenot
Depends on D89740

Differential Revision: https://phabricator.services.mozilla.com/D89741
2020-09-15 11:53:07 +00:00
Andreas Pehrson 4e26dd626c Bug 1656438 - Speed up MediaTrackGraph gtests. r=padenot
Depends on D85558

Differential Revision: https://phabricator.services.mozilla.com/D89739
2020-09-15 11:52:52 +00:00
Alex Chronopoulos 32917001a5 Bug 1656438 - Create a unittest for CrossGraphTrack. r=padenot
The unittest does not verify that the input is forwarded to the output of the
CrossGraphReceiver because it is not easy to get the corresponding
MockCubebStream. This has been left as future work.

Depends on D85557

Differential Revision: https://phabricator.services.mozilla.com/D85558
2020-09-15 14:41:49 +00:00
Alex Chronopoulos 0d36f710e8 Bug 1656438 - Create a unitest for SourceMediaTrack and AudioInputProcessing. r=padenot
Use the newly added functionality in MockCubeb to verify that the input is
forwarded to the output.

Depends on D85556

Differential Revision: https://phabricator.services.mozilla.com/D85557
2020-09-15 14:43:46 +00:00
Alex Chronopoulos 332eacb86a Bug 1656438 - Simulate audio input and verify audio output in MockCubeb. r=padenot
With this patch, AudioGenerator is used to create a sine tone audio input to a
duplex stream. In parallel, the AudioVerifier is used to verify that this sine
tone exists in the output (on demand).

This is the first approach. Fancier generators/verifiers can be future work.

Depends on D85554

Differential Revision: https://phabricator.services.mozilla.com/D85555
2020-09-15 14:43:41 +00:00
Alex Chronopoulos 3c7681a521 Bug 1656438 - Add interleaved buffer support in AudioGenerator/Verifier. r=padenot
This is useful in order to be used by the low-level part of the stack
(MockCubeb) where the buffers contain interleaved channels.

Depends on D85553

Differential Revision: https://phabricator.services.mozilla.com/D85554
2020-09-15 14:41:42 +00:00
Alex Chronopoulos b856bbadd6 Bug 1656438 - Remove AudioToneGenerator and move AudioToneVerifier to dedicated file. r=padenot
The existing AudioGenerator takes over the job of AudioToneGenerator.
AudioToneVerifier becomes AudioVerifier to match the naming pattern.

In order to reuse the functionality for other tests.

Depends on D85552

Differential Revision: https://phabricator.services.mozilla.com/D85553
2020-09-15 14:42:42 +00:00
Andreas Pehrson 4da0ed94ab Bug 1656438 - Generalize AudioGenerator and SineWaveGenerator to support AudioToneGenerator's use cases. r=padenot
Depends on D85552

Differential Revision: https://phabricator.services.mozilla.com/D89738
2020-09-15 11:52:06 +00:00
Alex Chronopoulos bd90aec1ed Bug 1656438 - Replace dos EOL with unix one. r=padenot
In addition to that remove it from the exclude list of the whitespace sanity check assuming that the dos EOL had made it fail.

Differential Revision: https://phabricator.services.mozilla.com/D85552
2020-09-15 14:42:42 +00:00
Bryce Seager van Dyk 32100f6e2f Bug 1642735 - Suppress exceptions in ChromiumCDMProxy if we don't have MediaKeys. r=jbauman
When rejecting promises in ChromiumCDMProxy we pass an exception to MediaKeys to
represent the error that took place. However, if we do not have a any keys the
exception is not passed anywhere. Since these exceptions will assert on
destruction that they were handled we need to explicitly suppress the exception
when we don't have MediaKeys to avoid firing asserts.

The case we hit this issue in is during browser shutdown, so I think it makes
sense to ignore the exception. This is not a case of simply ignoring an
exception when it can be handled, this is that we're in a state where various
machinery is becoming unavailable and where it makes sense to not try and send
the exception any further.

Differential Revision: https://phabricator.services.mozilla.com/D90156
2020-09-15 13:33:38 +00:00
Csoregi Natalia e572b21ddb Backed out changeset 5f67698e1e52 (bug 1642735) as per request. CLOSED TREE 2020-09-15 16:11:55 +03:00
Bryce Seager van Dyk cd72e6b8ec Bug 1642735 - Suppress exceptions in ChromiumCDMProxy if we don't have MediaKeys. r=jbauman
When rejecting promises in ChromiumCDMProxy we pass an exception to MediaKeys to
represent the error that took place. However, if we do not have a any keys the
exception is not passed anywhere. Since these exceptions will assert on
destruction that they were handled we need to explicitly suppress the exception
when we don't have MediaKeys to avoid firing asserts.

The case we hit this issue in is during browser shutdown, so I think it makes
sense to ignore the exception. This is not a case of simply ignoring an
exception when it can be handled, this is that we're in a state where various
machinery is becoming unavailable and where it makes sense to not try and send
the exception any further.

Differential Revision: https://phabricator.services.mozilla.com/D90156
2020-09-15 12:32:45 +00:00
Paul Adenot f0eeac36f0 Bug 1662805 - Don't consider a stream audible if it has never been audible. r=pehrsons
Depends on D90110

Differential Revision: https://phabricator.services.mozilla.com/D90111
2020-09-15 09:01:42 +00:00
Paul Adenot f94544f988 Bug 1662805 - Make the silence duration before a tab is considered inaudible configurable. r=pehrsons
Depends on D89635

Differential Revision: https://phabricator.services.mozilla.com/D89636
2020-09-15 09:01:16 +00:00
Paul Adenot 2f461c2326 Bug 1662805 - Replace instantaneous audibility decisions for MediaStream and regular playback with the AudibilityMonitor. r=pehrsons
Depends on D89634

Differential Revision: https://phabricator.services.mozilla.com/D89635
2020-09-15 09:00:57 +00:00
Paul Adenot 1db6a3923f Bug 1662805 - Extract the sample-rate decision for an AudioSink to its own function, in the same way it is done for the channel count. r=pehrsons
Depends on D89633

Differential Revision: https://phabricator.services.mozilla.com/D89634
2020-09-15 09:00:33 +00:00
Paul Adenot 1c62900c16 Bug 1662805 - Introduce an AudibilityMonitor to determine if an audio stream is considered audible. r=pehrsons
Depends on D89390

Differential Revision: https://phabricator.services.mozilla.com/D89633
2020-09-15 09:00:15 +00:00
Paul Adenot 5333662fb3 Bug 1664772 - Fix clang-tidy/clang-format/coverity issues in VideoUtils.cpp. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D90083
2020-09-15 08:29:06 +00:00
Paul Adenot 5e645a28b9 Bug 1664755 - Fix typo in dummy android device enumeration code. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D90076
2020-09-14 18:58:04 +00:00
Michael Froman 01b4f3072c Bug 1664519 - move media/webrtc/signaling/fuzztest to dom/media/webrtc/tests/fuzztests. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D90127
2020-09-14 18:47:36 +00:00
Kashav Madan 71ab95351c Bug 1664575 - Null check navigator in ContentPlaybackController::GetMediaSession, r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D89974
2020-09-14 16:23:55 +00:00
Cristina Coroiu d85babf17b Backed out 5 changesets (bug 1662805) for multiple failures, e.g. bc failures at dom/media/mediacontrol/tests/browser_media_control_non_eligible_media.js on a CLOSED TREE
Backed out changeset 820eb655de3d (bug 1662805)
Backed out changeset 23c90dd335b1 (bug 1662805)
Backed out changeset eff66444dc68 (bug 1662805)
Backed out changeset caeffea29d80 (bug 1662805)
Backed out changeset 2f8f9799d1f3 (bug 1662805)
2020-09-14 14:44:34 +03:00
Paul Adenot 3ca6ba96da Bug 1662805 - Make the silence duration before a tab is considered inaudible configurable. r=pehrsons
Depends on D89635

Differential Revision: https://phabricator.services.mozilla.com/D89636
2020-09-14 09:42:31 +00:00