Commit Graph

12914 Commits

Author SHA1 Message Date
Andreas Pehrson
f3cc4b74af Bug 1299515 - Fix bustage on a CLOSED TREE. r=me
--HG--
extra : rebase_source : 5312eaeec727b4cc9ced77fc2adbbff19ab6cc26
extra : histedit_source : c6638f1b1df9af06b30412e774c4a6f782d45c8c
2018-01-31 16:08:13 +01:00
Andreas Pehrson
943436bfbe Bug 1426718 - Assert that we append at most once per stream per iteration. r=padenot
MozReview-Commit-ID: 3bNTZRhv839

--HG--
extra : rebase_source : b7da2412b89bf79c72344509847ff54853adcbbe
2017-11-22 14:30:00 +01:00
Andreas Pehrson
63cdbabafe Bug 1299515 - Make LocalTrackSource hold a WeakPtr to SourceListener. r=jib
MozReview-Commit-ID: 93jKsK5JfqG

--HG--
extra : rebase_source : f75b7e53760be63123f22ef1f7981c7d8e38132c
2018-01-23 11:31:22 +01:00
Andreas Pehrson
09669c4432 Bug 1299515 - Don't assert that tracks must be ended in forced shutdown. r=padenot
I hit this during local tests. It's a fine invariant but it doesn't hold in
forced shutdown.

MozReview-Commit-ID: HtoiGwf7IMI

--HG--
extra : rebase_source : 707de2fe08ccad99a06dab00969e2f140e63abad
2018-01-03 15:13:36 +01:00
Andreas Pehrson
2b25cd7258 Bug 1299515 - Signal SetPullEnabled with a message. r=padenot
With the added invariant that NotifyPull() needs a MediaStreamListener present
to not underrun, we need SetPullEnabled() and AddListener() to stay in sync by
using the same signaling mechanism.

MozReview-Commit-ID: 49KWdiTOG98

--HG--
extra : rebase_source : d0ad44d7ce431aa792c4908f96baf0c0920dbe90
2018-01-03 11:59:41 +01:00
Andreas Pehrson
1eb21f16e5 Bug 1299515 - Replace a rawptr handoff with generalized lambda capture. r=jib
MozReview-Commit-ID: A1hbcpdHygY

--HG--
extra : rebase_source : 97ac2f1fe6da2596754f3ade1a59ceae582294da
2017-12-20 21:54:16 +01:00
Andreas Pehrson
66a566c5e7 Bug 1299515 - Set track stop_on_disable prefs to act immediately in test. r=jib
MozReview-Commit-ID: ALEbQpVm68t

--HG--
extra : rebase_source : 5a9566ada8e710e4cf51de66e131c0015e787351
2017-11-28 11:17:17 +01:00
Andreas Pehrson
cfef991f4a Bug 1299515 - Modernize tests that disable tracks to prime for coming patches. r=jib
MozReview-Commit-ID: 9rzaZimjpm9

--HG--
extra : rebase_source : ea1a1684d8cec7671b8f627ce79c41ae5016639c
2017-11-28 11:15:44 +01:00
Andreas Pehrson
b8ef7b60f9 Bug 1299515 - Put pushPrefs in head.js. r=jib
MozReview-Commit-ID: F770g5cjH0k

--HG--
extra : rebase_source : 94464257153c814a32f2838b79124dbaf1fab3df
2017-11-23 17:28:40 +01:00
Andreas Pehrson
d09d284893 Bug 1299515 - Drive by touchups in MediaTrackConstraints. r=jib
MozReview-Commit-ID: EBztQ99CKQ4

--HG--
extra : rebase_source : 3ca504ada622a7db9a6e97dc23ff88558a66795d
2017-11-21 15:53:02 +01:00
Andreas Pehrson
09f130fe44 Bug 1299515 - Wire up track-disabling logic to frontend APIs. r=jib, r=johannh
This modifies mediaCaptureWindowState() to say whether a camera or microphone is
actively captured or not. Note that this is not the same as the device being
on or off. If we disallow a device from being off while disabled, we still
notify chrome that we're not actively capturing.

MozReview-Commit-ID: B1taormqc3j

--HG--
extra : rebase_source : 292d323c4b9711cc242170f5c5c139bb87658c44
2017-11-17 20:13:06 +01:00
Andreas Pehrson
a9436d8f79 Bug 1299515 - Stop Camera and Microphone device when tracks become disabled. r=jib
This wires up the disabling of a track with actually stopping the device if we
allow it.

This is possible for:
- Camera (enabled by default, controlled by pref
  "media.getusermedia.camera.off_while_disabled.enabled")
- Microphone (disabled by default, controlled by pref
  "media.getusermedia.microphone.off_while_disabled.enabled")

Screen-, app-, or windowsharing is not supported at this time.

On disabling, there's a delay before the device is ordered to stop. This is
now defaulting to 3 seconds but can be overriden by prefs
"media.getusermedia.camera.off_while_disabled.delay_ms" and
"media.getusermedia.microphone.off_while_disabled.delay_ms".

The delay is in place to prevent misuse by malicious sites. If a track is
re-enabled before the delay has passed, the device will not be touched until
another disable followed by the full delay happens.

MozReview-Commit-ID: D4nZWzrYZGm

--HG--
extra : rebase_source : 6a54fa450bd435ed65de2a30b66d25f4a5e8241e
2017-11-17 19:56:00 +01:00
Andreas Pehrson
60544370ea Bug 1299515 - Implement MediaTimer::Cancel to allow for rejecting timer promises. r=jya
MozReview-Commit-ID: ESLlbIS8XHa

--HG--
extra : rebase_source : 2382f6ba2582363c6663ec5b925684ab18b73abe
2017-12-20 10:02:31 +01:00
Andreas Pehrson
568e0a7bf4 Bug 1299515 - Implement MediaTimer::WaitFor for convenience. r=jya
MozReview-Commit-ID: VpHxUKn3hO

--HG--
extra : rebase_source : 2346c317f9819c01056baaa2c8fb50fe8a2bfad0
2017-12-20 10:01:47 +01:00
Andreas Pehrson
abde2fb147 Bug 1299516 - Allow MediaEngines to Start() and Stop() without affecting tracks. r=jib, r=padenot
This is the larger change for this bug. In order to turn off a device on
disabling we want to Stop() it without ending the attached track.

To allow this, this patch breaks out track-creation from Start() to SetTrack()
and moves track-ending logic from Stop() to Deallocate().

It is a programming error to Start() or Stop() a MediaEngineSource that hasn't
seen a SetTrack().

MozReview-Commit-ID: 3KzmuDjCAH0

--HG--
extra : rebase_source : 361d9b9c2a818ce51fa90d88950d5992c51407c6
2017-12-18 16:19:33 +01:00
Andreas Pehrson
3ceaba23ab Bug 1299515 - Flatten MediaEngineSource class hierarchy. r=jib
The scope of flattening this hierarchy quickly grows large, so this patch does
a couple more things:
- Creates a pure interface MediaEngineSourceInterface and a base class
  MediaEngineSource with common defaults and refcount support (no state!)
- Breaks out some of the helper classes to dedicated files, e.g.,
  AllocationHandle, MediaEnginePrefs.
- Clarifies the threading model (written on one thread *and* under lock,
  read under either)
- Fixes style, indentation, include-sorting in the affected files
- Adds comments, especially for clarifying what responsibilities methods have,
  and thread usage of class members
- Changes Monitors to Mutexes since we only use them as Mutexes anyhow
- Makes MediaEngineRemoteVideoSource no longer a shared source since we now
  support scaling in this source and CamerasChild can act as a broker of frames.
  This greatly simplifies it. The only shared source is now
  MediaEngineWebRTCMicrophoneSource, so the sharing specific common methods have
  been moved to that source.

MozReview-Commit-ID: KeVZQo6gLm2

--HG--
rename : dom/media/webrtc/MediaEngine.h => dom/media/webrtc/MediaEnginePrefs.h
extra : rebase_source : c785a5feb896312912170475d6b8d997e712e48f
2018-01-24 16:49:13 +01:00
Andreas Pehrson
176f6fa9fc Bug 1299515 - Only notify of enabled state if it actually changed. r=jib
MozReview-Commit-ID: 4pGYXb9onJO

--HG--
extra : rebase_source : 8ce242a5566a0eeeb8aba0cbf223ec1c4402ced3
2017-11-15 18:41:28 +01:00
Andreas Pehrson
b938a74c42 Bug 1299515 - Remove special handling for releasing callbacks on main thread. r=jib
MozReview-Commit-ID: 1JtVdbkL1DK

--HG--
extra : rebase_source : 2b6ddaef9c44cf0a6a7e044f088ee5818ad1b725
2017-11-15 18:40:35 +01:00
Andreas Pehrson
a734f9b29e Bug 1299515 - Remove superfluous include in MediaStreamTrack.h. r=jib
MozReview-Commit-ID: DTLQyiX8PtG

--HG--
extra : rebase_source : e75b3e92e749c2f8f9165174bfd088ca5d8da6ab
2017-11-14 11:54:18 +01:00
Andreas Pehrson
85f30b0b5b Bug 1299515 - Remove ReleaseMediaOperationResource. r=jib
MozReview-Commit-ID: 184hG8rMCmc

--HG--
extra : rebase_source : e4ac7637254baff5ac2cb093c263d5bcd681a37e
2017-11-14 11:53:52 +01:00
Andreas Pehrson
c7709bb25d Bug 1299515 - Remove GetUserMediaNotificationEvent. r=jib
MozReview-Commit-ID: 3ecH5vCce17

--HG--
extra : rebase_source : 37843f4438a61e2415296d608a2506eba100b5b9
2017-11-14 11:50:07 +01:00
Andreas Pehrson
85ded5b958 Bug 1299515 - Plumb MediaStreamTrack enabled state to sources. r=jib
MozReview-Commit-ID: Eg1g9JtLmOz

--HG--
extra : rebase_source : 73057e1093d487736f69addca346b05c48d8d280
2017-11-10 15:55:42 +01:00
Andreas Pehrson
aa75f0c28e Bug 1408294 - Don't assume there is always a listener feeding a SourceMediaStream. r=padenot
There are legit cases when a SourceMediaStream gets pulled without a listener
present.

A clear example (though a corner case and easily overlooked) that I've hit is
when the last track is ended and the only stream listener is removed at the same
time. This leads to a pull on the next iteration where the track-end has not
yet been picked up. And thus, a false positive error saying that a live track
doesn't have listeners.

The real error here will now instead be caught by the new assert for when a
pulled stream underruns (which is now illegal).

MozReview-Commit-ID: 3e8FcCZfhYJ

--HG--
extra : rebase_source : ada823dbab07c8ca50429cd854b0c4b1df688fbb
2018-01-04 10:32:30 +01:00
Andreas Pehrson
87f1066788 Bug 1408294 - Append null audio data when audio input underruns. r=padenot
MozReview-Commit-ID: KEP3J41BEmJ

--HG--
extra : rebase_source : f8b5fb4e331e29f28e1d421b145201e811e20f7b
2017-12-21 19:01:17 +01:00
Andreas Pehrson
c09c157cde Bug 1408294 - Assert that we don't underrun globally. r=padenot
MozReview-Commit-ID: 1vEN1K1TK5n

--HG--
extra : rebase_source : e2bcc28d52b28e741e8a114db4cee9880abf6562
2017-12-01 15:37:54 +01:00
Andreas Pehrson
5ca6b2a31c Bug 1408294 - Make the SourceMediaStream used with AudioCapture produce silence. r=padenot
This SourceMediaStream is an existing hack to fit AudioCapture into
MediaManager's gUM flow. With the invariant that NotifyPull must produce data
we need to produce silence here.

Best of all would be if this SourceMediaStream was not needed at all, but let's
look at that another time.

MozReview-Commit-ID: J3EeIut1fgy

--HG--
extra : rebase_source : 8b84d8cf0f8d359d3b1c054146b28d494ed12053
2017-12-05 14:37:11 +01:00
Andreas Pehrson
ee75d2b969 Bug 1408294 - Assert that NotifyPull produces data. r=padenot
MozReview-Commit-ID: CtC8A83iJgg

--HG--
extra : rebase_source : ada5a771164fafe35d22589956ced6f54545ee73
2017-12-05 14:34:08 +01:00
Andreas Pehrson
0ac2875a3d Bug 1408294 - Set iteration state before calling NotifyInputData. r=padenot
In the MediaEngine for microphone capture we want to fall back on feeding
silence when the device is stopped. To ensure this doesn't go haywire we check
that the invariant that at most one of NotifyInputData and NotifyPull get
called in the same iteration.

For them to be aligned on which iteration they're in however, the graph needs
to report a consistent IterationEnd() to both. This patch fixes this by only
calling into NotifyInputData() *after* setting iteration state, which will then
be consistent also across OneIteration (which calls into NotifyPull).

MozReview-Commit-ID: 4lD4OcdGtM6

--HG--
extra : rebase_source : 397ee320b83b23ac21961b67341b774f18e8b51b
2017-11-28 13:32:21 +01:00
John Smith
c533c96627 Bug 1411857 - Set a custom time-based keyframe interval on VideoTrackEncoder. r=pehrsons
This allows MediaRecorder to pass non-empty blobs to content since our
blob gathering code waits for a new keyframe before writing to the blob.

--HG--
extra : rebase_source : be52d34df5c6b4d40d4b445c6d3ae0036e1c6904
extra : histedit_source : 43b2cf01b335a37f04032545fc9965bf574657ee
2018-01-31 10:19:39 +01:00
Andreas Pehrson
eabcca543c Bug 1433062 - Unit test VP8TrackEncoder with dynamic keyframe interval changes. r=bryce
MozReview-Commit-ID: 2OW5Gvy5UUl

--HG--
extra : rebase_source : a390104b85b9545a8bd2b3aee2401c755ffac35a
extra : histedit_source : 9f3c8e1dfc1ca9aff72c58be93e13aa05ea7311c
2018-01-25 16:22:08 +01:00
Andreas Pehrson
79f10e5ecb Bug 1433062 - Unit test VP8TrackEncoder with default keyframe interval. r=bryce
MozReview-Commit-ID: 2kptTt5TC1i

--HG--
extra : rebase_source : 7d1b5f60b7a97676067811cd62e077c44b8b09c7
extra : histedit_source : e744aeebde13248b6ff618446585d7caf9c5bc57
2018-01-25 16:21:25 +01:00
Andreas Pehrson
8d91fba6c0 Bug 1433062 - Unit test VP8TrackEncoder with longer-than-default keyframe interval. r=bryce
MozReview-Commit-ID: I8cYJooILlS

--HG--
extra : rebase_source : 5812f353d3db3a85ae24e9e7790dd69eebb8707f
extra : histedit_source : 10f9f8649b875d9f69304b7b950310234953219e
2018-01-25 16:20:16 +01:00
Andreas Pehrson
43e3eabe7e Bug 1433062 - Unit test VP8TrackEncoder with shorter-than-default keyframe interval. r=bryce
MozReview-Commit-ID: 3rEvmMyHsry

--HG--
extra : rebase_source : 8e26ee5cec97b62b7d120d91eb6df25fb2bb9da8
extra : histedit_source : 35c04e3b8d24620f8405fc3163924af9a32bc1e5
2018-01-25 16:19:11 +01:00
Kris Maglione
19a956c2c6 Bug 1431533: Part 5b - Fix ESLint errors left over after rewrite. r=florian
MozReview-Commit-ID: 7bVI1iM6hor

--HG--
extra : source : 0b97a30cadb1a96d3cafae6b79ef0d3ec26770cf
extra : amend_source : 09a90b29837e339eec7bdf8504f86c28e74ca3dd
extra : intermediate-source : a1eca62826a1341ca24d4d2a93d4884d4fc7ad51
extra : histedit_source : eb26e73b531f9a34d3401d39f60b533b27b78540
2018-01-18 16:27:26 -08:00
Kris Maglione
918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Csoregi Natalia
1d557a2997 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-01-30 18:24:05 +02:00
Andreas Pehrson
5b9398382d Bug 1430993 - Clean up minor issues in CamerasParent. r=jib
This cleans up:
- Superfluous namespaces
- Warnings from static-analysis
- Raw pointer usage

MozReview-Commit-ID: 4oJ5MiBwhmn

--HG--
extra : rebase_source : eea99c58c528a19facb5c70c3d2ea95fc9804367
extra : histedit_source : a01aa7ba5ecd7dd302952ddd9e9ae19d656a51c7
2018-01-25 10:41:20 +01:00
Bryce Van Dyk
37dd875199 Bug 1432869 - Update usage of cubeb_stream_params to set newly exposed prefs member. r=achronop
The changes to the cubeb API mean that the new prefs member on
cubeb_stream_params should be explicitly set. This changeset does so.

MozReview-Commit-ID: 1hwjLTriaBP

--HG--
extra : rebase_source : f32c4a0a945ed7a048ca40c7286024da1fb93473
2018-01-22 13:20:29 -05:00
Munro Mengjue Chiang
025c7d6993 Bug 1430993 - Replace RefPtr with StaticRefPtr to avoid the static constructor. r=jib
MozReview-Commit-ID: 9xqP5QFlbZJ

--HG--
extra : rebase_source : a2fd3ef926d0ab2c207ec5ebac7026fc1a8e1fb8
extra : histedit_source : 15493a5c43d2cdcd9c86fa3d79e4196beb36ca9d
2018-01-17 16:21:14 +08:00
Gurzau Raul
c380dfe905 Merge inbound to mozilla-central. a=merge 2018-01-30 12:01:49 +02:00
Cosmin Sabou
9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Chris Pearce
b69a154521 Bug 1433309 - Annotate createMediaKeys promise reject with whether failure occurred due to pending shutdown. r=gerald
Around every Firefox update, Netflix see a spike in
MediaKeySystemAccess.createMediaKeys() promise rejects. I am wondering whether
this is caused by the browser restarting to apply a Firefox update while
Netflix's player is loading.  So add more detail to the promise reject as to
the state of the system, to try to validate that theory.

MozReview-Commit-ID: 4IDPsFwKCtq

--HG--
extra : rebase_source : 0a53acb623f895e598845c281edc73b926c74c28
2018-01-26 12:20:35 +13:00
Kris Maglione
e050496c59 Bug 1431533: Part 5b - Fix ESLint errors left over after rewrite. r=florian
MozReview-Commit-ID: 7bVI1iM6hor

--HG--
extra : source : 0b97a30cadb1a96d3cafae6b79ef0d3ec26770cf
extra : amend_source : d0515fe4eb13b59cc490ca9d964ad9ee15ef3cd3
extra : intermediate-source : 6e56f4c8843ed134b2dba34fb007298fd55be966
extra : histedit_source : 88abf9f4ea4e740a9391278625ef07395205c3f5%2Cc14bc7a71eb413fcb573ed0d030fd7f99a1468f0
2018-01-18 16:27:26 -08:00
Kris Maglione
6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Chris Pearce
2833f14652 Bug 1416667 - Backed out changeset 22453f19f050. r=backout
MozReview-Commit-ID: 3kaRtZtCQru
2018-01-30 15:02:01 +13:00
Brindusan Cristian
af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
e70d01a9e9 Bug 1431533: Part 5b - Fix ESLint errors left over after rewrite. r=florian
MozReview-Commit-ID: 7bVI1iM6hor

--HG--
extra : rebase_source : 6286dcfd1a7c970272ac6befaccd3e47e90d2f6b
extra : intermediate-source : d48657228a0b84cf3a37a35227ca3b3d0bd2a017
extra : source : 0b97a30cadb1a96d3cafae6b79ef0d3ec26770cf
2018-01-18 16:27:26 -08:00
Kris Maglione
c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Nico Grunbaum
c4a0cebf58 Bug 1433576 - bring rtp sources js timestamp and timebase up to spec r=jib
MozReview-Commit-ID: 2joFQ41NaMp

--HG--
extra : rebase_source : e424cbbeb00d0b152609a4390d43d5ca6e4aceb7
2018-01-26 13:40:30 -08:00
arthur.iakab
39d63fc827 Merge mozilla-central to autoland 2018-01-26 02:31:18 +02:00