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

18211 Коммитов

Автор SHA1 Сообщение Дата
Razvan Maries 6ad7ee6c29 Backed out 7 changesets (bug 1670917) for multiple GTest perma failures. CLOSED TREE
Backed out changeset 635942af8244 (bug 1670917)
Backed out changeset b0825300e78d (bug 1670917)
Backed out changeset 881fac72e13c (bug 1670917)
Backed out changeset 0285b2ab6d50 (bug 1670917)
Backed out changeset b58d65b96f2d (bug 1670917)
Backed out changeset 6ad13b34f08d (bug 1670917)
Backed out changeset 426aa6482835 (bug 1670917)
2020-10-20 22:55:47 +03:00
Paul Adenot fded7de4b4 Bug 1670917 - Add a pref to allow using raw WASAPI streams. Make it default to input-only raw streams. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D93363
2020-10-20 13:08:27 +00:00
Paul Adenot 96b78da32a Bug 1670917 - Upstream build system and other bits from freebsd-ports. r=cubeb-reviewers,chunmin
This is the first two chunks in ed3dd55916/www/firefox/files/patch-cubeb-oss, from From: jbeich <jbeich@FreeBSD.org>. The rest of this patch file is now upstream.

This allows OSS users to drop a patch downstream.

Differential Revision: https://phabricator.services.mozilla.com/D93362
2020-10-20 13:08:22 +00:00
Dan Minor f55f5accb0 Bug 1667319 - Move duplicate payload type checking to JsepCodecDescription; r=bwc
This moves most of the JsepTrack functionality for dealing with duplicate
payload types to a new EnsurePayloadTypeNotDuplicate method in
JsepCodecDescription. It also adds a virtual EnsureNoDuplicatePayloadTypes
method that checks the appropriate payload types for each codec type.

Differential Revision: https://phabricator.services.mozilla.com/D92112
2020-10-20 13:54:20 +00:00
Dan Minor 9db8c73a93 Bug 1667319 - Store RED and ULPFEC payload types as strings; r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D92111
2020-10-20 13:55:04 +00:00
Andreas Pehrson ce0e1a41eb Bug 1671931 - Remove some `using` keywords and set up typedefs in VideoOutput.h. r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D94055
2020-10-19 23:14:41 +00:00
Andreas Pehrson 648a59a37c Bug 1671931 - Let VideoOutput roll its own FrameID generator. r=bwc
There is a case where two VideoOutputs are feeding the same VideoFrameContainer
with data: VideoStreamTrack::AddVideoOutput(VideoFrameContainer) and
VideoStreamTrack::AddVideoOutput(FirstFrameVideoOutput) in HTMLMediaElement.
This is racy since they both call VideoFrameContainer::NewFrameID().

These VideoOutputs use different ProducerIDs however, so it makes sense for them
to also use separate FrameID generators.

Differential Revision: https://phabricator.services.mozilla.com/D94054
2020-10-19 23:14:34 +00:00
Mihai Alexandru Michis 25d5a4443a Backed out changeset 08f400e9b07d (bug 1671535) for causing reftest failures in image-10bits-rendering-90-video.html
CLOSED TREE
2020-10-20 10:29:53 +03:00
Jean-Yves Avenard 8d26b4c087 Bug 1671888 - Add VP9 HDR refrest. r=mattwoodrow
The purpose for those reftest at present isn't to verify that our image conversion is correct (it isn't), just that decoding produce something not completely broken

Differential Revision: https://phabricator.services.mozilla.com/D94065
2020-10-20 04:19:10 +00:00
Jean-Yves Avenard 59304c981e Bug 1671535 - Add 10 bits reftest with filter applied. r=mattwoodrow
This allows to test our readback implementation across platforms.

Differential Revision: https://phabricator.services.mozilla.com/D93716
2020-10-20 04:24:58 +00:00
Cosmin Sabou 9057e3c41b Backed out changeset 7a41ed3a5447 (bug 1671535) as requested by jya for pushing the wrong version. 2020-10-20 07:22:21 +03:00
Jean-Yves Avenard de1260940f Bug 1671535 - Add 10 bits reftest with filter applied. r=mattwoodrow
This allows to test our readback implementation across platforms.

Differential Revision: https://phabricator.services.mozilla.com/D93716
2020-10-20 01:25:59 +00:00
Jean-Yves Avenard 383d41acab Bug 1671863 - Skip reftest on mingw platform. r=heycam
The RDD doesn't start on MinGW and so the AV1 decoder isn't available.

Differential Revision: https://phabricator.services.mozilla.com/D93909
2020-10-20 02:46:28 +00:00
Narcis Beleuzu d54df1cd36 Backed out 12 changesets (bug 1626278) for mochitest leakchecks . CLOSED TREE
Backed out changeset eeed6ebfc444 (bug 1626278)
Backed out changeset cc2023032191 (bug 1626278)
Backed out changeset 15f89d2c5981 (bug 1626278)
Backed out changeset 1227d9db743d (bug 1626278)
Backed out changeset d91d9eb46983 (bug 1626278)
Backed out changeset 5861d6340ee8 (bug 1626278)
Backed out changeset 1cf19408d522 (bug 1626278)
Backed out changeset 90cf750aba51 (bug 1626278)
Backed out changeset 991bc13ae061 (bug 1626278)
Backed out changeset 8432bc08676e (bug 1626278)
Backed out changeset 5c0c76832287 (bug 1626278)
Backed out changeset 2f57fa13df7e (bug 1626278)
2020-10-19 22:58:59 +03:00
Bryce Seager van Dyk 8449f6d2b3 Bug 1671477 - Add profile markers and logs to help diagnose failures in WMF decoding. r=alwu
We have reports of VPx WMF failures in the wild causing performance issues, but
it can be hard to detect these failures. Having explicit markers in the profiler
with more information will make it easier to see if users are running into these
issues if they can provide profiles. I've also added logs to enrich cases where
we will use logging to debug.

Driveby fix a comment that says we're asserting when we no longer are.

Differential Revision: https://phabricator.services.mozilla.com/D93672
2020-10-19 14:41:11 +00:00
Dorel Luca b77a4cd190 Backed out changeset b64cb312c05b (bug 1671477) for Build bustage on Android. CLOSED TREE 2020-10-19 19:23:29 +03:00
Andreas Pehrson d5227f851c Bug 1582294 - Set up HTMLMediaElement to convey video track alpha channel when playing a MediaStream. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D92898
2020-10-19 15:35:13 +00:00
Byron Campen [:bwc] 7c4942b547 Bug 1626278: Shutdown MediaTransportHandlerSTS on profile-change-net-teardown. Also add some logging. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D93655
2020-10-19 15:13:55 +00:00
Byron Campen [:bwc] c3182f0329 Bug 1626278: Remove transports from main, just like we do under normal circumstances. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D93262
2020-10-15 20:31:13 +00:00
Byron Campen [:bwc] f6dd76e473 Bug 1626278: Ensure that pcid is unique. r=mjf
This fixes a failure in browser_WebrtcGlobalInformation.js on windows opt.

Differential Revision: https://phabricator.services.mozilla.com/D93261
2020-10-15 20:31:10 +00:00
Byron Campen [:bwc] e6969a8105 Bug 1626278: Move sigslot stuff to STS, and ensure we disconnect before releasing our ref to the MediaTransportHandler. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D90626
2020-10-15 20:27:35 +00:00
Byron Campen [:bwc] caa58b2223 Bug 1626278: Stash for ICE logs, and move log filtering into a single place. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D89677
2020-10-15 20:27:53 +00:00
Byron Campen [:bwc] 789c175c1a Bug 1626278: Filter stats for closed PeerConnections the same way we do for live ones. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D88498
2020-10-15 20:18:10 +00:00
Byron Campen [:bwc] 02a62e624e Bug 1626278: Add a stats stash to WebrtcGlobalInformation, to avoid stats from being lost when a content process goes away. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D88497
2020-10-15 20:15:48 +00:00
Byron Campen [:bwc] 6fabb4ea9d Bug 1626278: Simplify/promisify PWebrtcGlobal. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D88496
2020-10-15 20:18:08 +00:00
Byron Campen [:bwc] ba4aa19c91 Bug 1626278: Use NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_DESTROY to ensure that MediaTransportHandler stays around long enough to finish pending stats queries. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D87180
2020-10-15 20:08:05 +00:00
Bryce Seager van Dyk 76c3e94c96 Bug 1671477 - Add profile markers and logs to help diagnose failures in WMF decoding. r=alwu
We have reports of VPx WMF failures in the wild causing performance issues, but
it can be hard to detect these failures. Having explicit markers in the profiler
with more information will make it easier to see if users are running into these
issues if they can provide profiles. I've also added logs to enrich cases where
we will use logging to debug.

Driveby fix a comment that says we're asserting when we no longer are.

Differential Revision: https://phabricator.services.mozilla.com/D93672
2020-10-19 14:41:11 +00:00
smolnar eba1c00fcf Backed out 2 changesets (bug 1346880) for causing audio failures. CLOSED TREE
Backed out changeset 7c0018c583b5 (bug 1346880)
Backed out changeset 4e7a614b30f8 (bug 1346880)
2020-10-19 13:07:51 +03:00
Paul Adenot 307c6e1733 Bug 1346880 - Test that a muted tab that plays audio via the Web Audio API is really muted using PulseAudio monitoring devices. r=pehrsons,alwu
Differential Revision: https://phabricator.services.mozilla.com/D93653
2020-10-19 08:45:04 +00:00
Paul Adenot fb3387d796 Bug 1346880 - Always initialize an AudioChannelAgent when initializing an AudioContext. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D92644
2020-10-19 08:45:04 +00:00
Dorel Luca 2aec5b3017 Backed out changeset ebe668f9d3dd (bug 1671477) for Build bustages. CLOSED TREE 2020-10-16 23:33:54 +03:00
Bryce Seager van Dyk cc05c909ab Bug 1671477 - Add profile markers and logs to help diagnose failures in WMF decoding. r=alwu
We have reports of VPx WMF failures in the wild causing performance issues, but
it can be hard to detect these failures. Having explicit markers in the profiler
with more information will make it easier to see if users are running into these
issues if they can provide profiles. I've also added logs to enrich cases where
we will use logging to debug.

Driveby fix a comment that says we're asserting when we no longer are.

Differential Revision: https://phabricator.services.mozilla.com/D93672
2020-10-16 19:28:36 +00:00
Jean-Yves Avenard c161e47a80 Bug 1671266 - Skip reftest on Windows for ARM. r=mattwoodrow
the AV1 decoder isn't available on this platform due to the lack of RDD support.

Differential Revision: https://phabricator.services.mozilla.com/D93713
2020-10-16 03:11:02 +00:00
alwu 58719da6a9 Bug 1668139 - part2 : add a telemetry probe to know how many actions are handled by default handler or media session handler. r=chunmin
It would be good for us to know how many websites actually use MediaSession API to control (play/pause/stop) their media playback, an how many websites use our default handler.

Differential Revision: https://phabricator.services.mozilla.com/D93283
2020-10-14 20:04:31 +00:00
alwu 96dfcf1376 Bug 1668139 - part1 : add a telemetry probe to record the usage on each different platform. r=chunmin
Each platform has different ways to allow users to use media control, adding a telemetry probe to detect that would be good for us to know the usage among different platforms.

Differential Revision: https://phabricator.services.mozilla.com/D93282
2020-10-14 20:04:34 +00:00
Razvan Maries a1a77c09cd Backed out 4 changesets (bug 1667454, bug 1668139) for perma failures on browser_media_control.js. CLOSED TREE
Backed out changeset 302032fe6d64 (bug 1668139)
Backed out changeset 859ee72e9e57 (bug 1668139)
Backed out changeset fe7de882fcbf (bug 1667454)
Backed out changeset dfd0308f5ab7 (bug 1667454)
2020-10-14 22:59:00 +03:00
alwu 873f48060e Bug 1668139 - part2 : add a telemetry probe to know how many actions are handled by default handler or media session handler. r=chunmin
It would be good for us to know how many websites actually use MediaSession API to control (play/pause/stop) their media playback, an how many websites use our default handler.

Differential Revision: https://phabricator.services.mozilla.com/D93283
2020-10-13 22:42:59 +00:00
alwu 32fa7ff7fb Bug 1668139 - part1 : add a telemetry probe to record the usage on each different platform. r=chunmin
Each platform has different ways to allow users to use media control, adding a telemetry probe to detect that would be good for us to know the usage among different platforms.

Differential Revision: https://phabricator.services.mozilla.com/D93282
2020-10-13 22:42:59 +00:00
Jean-Yves Avenard 950d6f18ca Bug 1670560 - Don't use the same thread pool for both decoding and waiting for the decode to complete. r=mattwoodrow
Unlikely to happen, but we could have exhausted all our thread in the decoder thread pool and be deadlock.

Differential Revision: https://phabricator.services.mozilla.com/D93202
2020-10-14 09:32:49 +00:00
Jean-Yves Avenard 6a0aeae0a5 Bug 1660727 - Add reftest. r=mattwoodrow
PNG file was generated with ffmpeg -i av1hdr2020.mp4 av1hdr2020.png

Differential Revision: https://phabricator.services.mozilla.com/D93456
2020-10-14 08:07:30 +00:00
Matt Woodrow 5487b02f9e Bug 1666055 - Remove RenderTextureHostOGL. r=lsalzman
This interface is never used directly, and the only consumers of the virtual functions are by the derived classes themselves.

Differential Revision: https://phabricator.services.mozilla.com/D93180
2020-10-14 07:58:18 +00:00
Bogdan Tara 09263ac198 Backed out 11 changesets (bug 1626278) for leaks and WebrtcGlobalInformation related failures CLOSED TREE
Backed out changeset 59228ee9d9e0 (bug 1626278)
Backed out changeset 59da0d11510e (bug 1626278)
Backed out changeset cd2e50c8af34 (bug 1626278)
Backed out changeset afdb75a17ac9 (bug 1626278)
Backed out changeset 5f453c8df70b (bug 1626278)
Backed out changeset 9b612ea670d4 (bug 1626278)
Backed out changeset 387a53fd83f3 (bug 1626278)
Backed out changeset 5870625073f6 (bug 1626278)
Backed out changeset 25c03ac56306 (bug 1626278)
Backed out changeset 3239d49be3ee (bug 1626278)
Backed out changeset 82ed327e71ed (bug 1626278)
2020-10-14 02:34:48 +03:00
Byron Campen [:bwc] faf7b39a92 Bug 1626278: Remove transports from main, just like we do under normal circumstances. r=mjf
Just in case.

Differential Revision: https://phabricator.services.mozilla.com/D93262
2020-10-12 20:09:28 +00:00
Byron Campen [:bwc] 2409f9b07e Bug 1626278: Ensure that pcid is unique. r=mjf
This fixes a failure in browser_WebrtcGlobalInformation.js on windows opt.

Differential Revision: https://phabricator.services.mozilla.com/D93261
2020-10-12 20:06:40 +00:00
Byron Campen [:bwc] 414ee0525d Bug 1626278: Move sigslot stuff to STS, and ensure we disconnect before releasing our ref to the MediaTransportHandler. r=mjf
This patch fixes an intermittent crash in pre-existing mochitests/wpt.

Differential Revision: https://phabricator.services.mozilla.com/D90626
2020-10-12 20:02:53 +00:00
Byron Campen [:bwc] 4e17277690 Bug 1626278: Stash for ICE logs, and move log filtering into a single place. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D89677
2020-10-12 20:06:51 +00:00
Byron Campen [:bwc] 181a475af9 Bug 1626278: Filter stats for closed PeerConnections the same way we do for live ones. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D88498
2020-10-12 20:04:07 +00:00
Byron Campen [:bwc] 2e5c449c07 Bug 1626278: Add a stats stash to WebrtcGlobalInformation, to avoid stats from being lost when a content process goes away. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D88497
2020-10-12 20:21:48 +00:00
Byron Campen [:bwc] 89cd7c2768 Bug 1626278: Simplify/promisify PWebrtcGlobal. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D88496
2020-10-12 19:57:12 +00:00
Byron Campen [:bwc] 0126e3fca7 Bug 1626278: Use NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_DESTROY to ensure that MediaTransportHandler stays around long enough to finish pending stats queries. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D87180
2020-10-12 19:56:44 +00:00
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