Commit Graph

594 Commits

Author SHA1 Message Date
Andreas Pehrson
c2cf44b1d5 Bug 1441145 - Swap width and height in target capability if the frame is rotated. r=jib
MozReview-Commit-ID: 3QO3W0J3b6G

--HG--
extra : rebase_source : 956fe446b34fb797e11a36ab21b9808c23ac8cc1
2018-02-26 15:42:57 +01:00
Andreas Pehrson
edf62f8506 Bug 1440169 - Don't reset mLastNotify in resuming Start(). r=padenot
MozReview-Commit-ID: 6AL8QpSnwwm

--HG--
extra : rebase_source : 1cf74cb4c177fcaca91f923748308e20d6c38136
2018-03-02 12:48:34 +01:00
Andreas Pehrson
624c03aed6 Bug 1440169 - Take TrackTicks samples in SineWaveGenerator::generate. r=achronop,padenot
MediaEngineDefaultAudio uses the SineWaveGenerator and passes a
TrackTicks (int64_t) arg to generate(). It need to take the same type
or bad things can happen.

MozReview-Commit-ID: EoybtTFkWhT

--HG--
extra : rebase_source : c21bbbc2729d092ad78ffe877bf141dbce3a41d3
2018-03-02 11:43:57 +01:00
Andreas Pehrson
ae85e5be40 Bug 1440040 - Improve MediaEngineWebRTCMicrophoneSource logging. r=padenot
MozReview-Commit-ID: 3mB1gZOGfCY

--HG--
extra : rebase_source : 12d0ae852b704717e8c7b4d5f0a3a2ad4f38d50e
2018-02-28 22:46:33 +01:00
Andreas Pehrson
a087cace0d Bug 1440040 - Fix assertion that checks for appending silence in real callback when enabled. r=padenot
MozReview-Commit-ID: IiEQ7fKKz8g

--HG--
extra : rebase_source : d0e0d532fb7cd4223a072502be2097065f4037df
2018-02-28 22:45:40 +01:00
Andreas Pehrson
aecea2a024 Bug 1440040 - Properly apply microphone capture settings. r=padenot
MozReview-Commit-ID: 7TqYvHrltxm

--HG--
extra : rebase_source : 5a6d972c6e07b17737c17cfa4827cbe5352c852a
2018-02-28 22:41:15 +01:00
Andreas Pehrson
c597c8df87 Bug 1440252 - Implement MediaEngineWebRTCMicrophoneSource::GetSettings. r=padenot
MozReview-Commit-ID: IVbax9Xxs8R

--HG--
extra : rebase_source : 6d42af31705860100ba40b0d750ddce2b513467d
2018-02-26 09:41:20 +01:00
Andreas Pehrson
ce1efe51da Bug 1440347 - Lock while modifying mAllocations. r=padenot
--HG--
extra : rebase_source : 2f5c6e13e8f930b82ff26190485bb8eed69592e4
extra : histedit_source : 0b3cfe11cdd16ee5bf42eec68196de9531e2c36b
2018-02-23 10:20:01 +01:00
Andreas Pehrson
f5d34fea0d Bug 1430856 - Default to two default capabilities when a camera can handle anything. r=jib
If a camera returns no capabilities we interpret it as it being able to handle
any capability we throw at it. However, we also end up trying to start it with
the default capability of 0x0@0. This often works, but we can crash when
rescaling it to the chosen target capability 0x0@0.

With this patch we inject up to two default capabilities, one at 640x480@30 and
one at 1280x720@30. With constraints present we'll try to adjust these defaults
so they fit within the constraints while at the same time preserve the
aspect ratio given by prefs.

MozReview-Commit-ID: 3mr7Li5TTbV

--HG--
extra : rebase_source : c525c2fd8d60f5dece548216caefc4976e9afb0b
2018-02-13 20:22:18 +01:00
Andreas Pehrson
7186f8d0f3 Bug 1430856 - Cache CaptureCapability in CapabilityCandidate. r=jib
This will lead to less ipc calls, hopefully speeding up getUserMedia for many
devices.

This also lets us inject any hardcoded capabilities into the candidateSet in
the future (read: next patch).

MozReview-Commit-ID: HjIhRK1nVA1

--HG--
extra : rebase_source : f58e16c45f7bd6738ce0a0527dc86854f804bc7b
2018-02-13 20:13:47 +01:00
Andreas Pehrson
fe7bade6b4 Bug 1434946 - Indentation fix. r=jib
MozReview-Commit-ID: JCQxatbThyI

--HG--
extra : rebase_source : 6d5c7319a69da1b5e93b352be79400ad8fd526f8
2018-02-01 18:35:55 +01:00
Andreas Pehrson
0c896f9aef Bug 1434946 - Set framerate in settings when capabilities are updated. r=jib
This adds back the `framerate` update that was removed in bug 1299515.

It also fixes a threading issue (not really an issue, but it broke the
documented policy) where Start() wrote to mCapability without holding mMutex.

MozReview-Commit-ID: Jda5moNhlkM

--HG--
extra : rebase_source : a8f27f064b9f818eb29aa72a18605786c474631b
2018-02-01 17:00:59 +01:00
Andreas Pehrson
f52aa5b27e Bug 1434946 - Report resolution change in settings already on first frame. r=jib
MozReview-Commit-ID: IzhdiHgVKOc

--HG--
extra : rebase_source : 085308eb966554ed71fb6b758cd59132b43d6ceb
2018-02-01 16:58:35 +01:00
Andreas Pehrson
422d32be88 Bug 1434861 - Simplify rescaling code in MediaEngineRemoteVideoSource::DeliverFrame. r=jib
Most importantly, this reduces the number of copies to 1 in the common case.
In a case where we are rescaling because there are competing gUM requests
this does two copies, where one is the crop-and-scale operation itself.

In the worst case we do two allocations, but with a buffer pool and a recycling
ImageContainer we allocate very rarely in practice.

MozReview-Commit-ID: B0Et4wZol9n

--HG--
extra : rebase_source : e0950a53278336773570c9e989a21392195f8898
2018-02-01 16:06:19 +01:00
Paul Adenot
8413544b59 Bug 1434600 - Add a method to clean up by window ID, on a MediaEngine. r=pehrsons
MozReview-Commit-ID: 12w4StZE2eg

--HG--
extra : rebase_source : 3c3ddf24da24e42e53d9e5352cb83945c97ead99
2018-01-31 19:02:00 +01:00
Paul Adenot
4bf54def7a Bug 1434600 - Plumb the window ID down to Enumerate{Audio,Video}Devices. r=pehrsons
MozReview-Commit-ID: 57d8l89Iq4v

--HG--
extra : rebase_source : a31703dfedadbedfc0dbbb0a4949db672cc16c70
2018-01-31 17:57:59 +01:00
Andreas Pehrson
54d329cb35 Bug 1435673 - Strengthen some MediaEngineWebRTCMicrophoneSource asserts. r=padenot
MozReview-Commit-ID: HtjndNLWZI8

--HG--
extra : rebase_source : e9076defa2bc667d5c96cee3bbccc6d297fc8aab
2018-02-05 10:58:21 +01:00
Andreas Pehrson
06be9533d1 Bug 1435673 - Do some cleanup that was meant to happen earlier. r=padenot
MozReview-Commit-ID: 1v07YH1hKiG

--HG--
extra : rebase_source : c7aab7a7480d8a72b0e312cfe24a7aa212f0cf5d
2018-02-05 10:54:10 +01:00
Andreas Pehrson
c1032b3da7 Bug 1435673 - Inline Alloc/FreeChannel and fix access per threading model. r=padenot
MozReview-Commit-ID: 1hpt8tAFuKW

--HG--
extra : rebase_source : 7ce40c2811b1869f98a7737373f02db7b488b829
2018-02-05 10:50:47 +01:00
Andreas Pehrson
650dcb5d2d Bug 1435673 - Fix calling Deallocate() without SetTrack(). r=padenot
Before bug 1299515 we assigned stream and track id in Allocate(), meaning that
any Deallocate() had a guarantee of them being set.

This changed to require an extra step of SetTrack() to assign stream and
track id. Deallocate() needs to handle this, which it does with this patch.

MozReview-Commit-ID: Js0cXXOR2Bb

--HG--
extra : rebase_source : f90dc1345ae0c034d2237d771630055729180df4
2018-02-05 10:48:23 +01:00
Michael Froman
38bdfba7a2 Bug 1414171 - pt 2 - Sort ICE stats by componentId on about:webrtc. r=drno
- add new component_id field to NrIceCandidatePair
- add the candidate pair component_id to RTCIceCandidatePairStats in
  RecordIceStats_s
- add new column in ice stats table for component id
- sort ice stats by component id first


MozReview-Commit-ID: J89ZIYEUyRk

--HG--
extra : rebase_source : 681a5afa1303b4e377fcc14d099ce0b3d852f22c
2018-01-30 22:23:54 -06:00
David Keeler
087f092867 bug 1421084 - part 4/4 - remove nsNSSShutDown.h and (hopefully) all references to it r=mt,ttaubert
MozReview-Commit-ID: 2mhvHsC5Nil

--HG--
extra : rebase_source : 651c2bcf8655f75756ea2bac788eb8c0781dc90a
2018-01-24 14:44:01 -08:00
David Keeler
ad5cec4768 bug 1421084 - part 3/4 - remove nsNSSShutDownObject::shutdown and virtualDestroyNSSReference r=mt,ttaubert
MozReview-Commit-ID: ErL7ZjAGVVC

--HG--
extra : rebase_source : 2869aafaef729f0ad190f957919e8b9c40700477
2018-01-24 14:29:08 -08:00
David Keeler
a0e34baf27 bug 1421084 - part 2/4 - remove nsNSSShutDownObject::isAlreadyShutDown() r=mt,ttaubert
MozReview-Commit-ID: DlS16pHE0Ik

--HG--
extra : rebase_source : d7596a3571478adefae4ffa5d446ff5234ba9ed7
2018-01-23 12:22:56 -08:00
David Keeler
e8cc0ba1ce bug 1421084 - part 1/4 - remove now-unnecessary nsNSSShutDownPreventionLock r=mt,ttaubert
As of bug 1417680, the NSS shutdown tracking infrastructure is unnecessary (and
does nothing anyway). This series of changesets removes the remaining pieces in
a way that is hopefully easy to confirm is correct.

MozReview-Commit-ID: 8Y5wpsyNlGc

--HG--
extra : rebase_source : ef6b481510d949e404a4ef5615097d66e566c947
2018-01-23 10:37:47 -08:00
Munro Mengjue Chiang
4197e56037 Bug 1423582 - use UniquePtr to wrap frame. r=pehrsons
MozReview-Commit-ID: 2T7RC1tBbOA

--HG--
extra : rebase_source : e964a73844edb7f10fb94442cc855f7922bb886d
2018-02-01 11:42:28 +01:00
Andreas Pehrson
0d112b8fad Bug 1434628 - Unbust --disable-webrtc builds. r=padenot, a=me
MozReview-Commit-ID: Ef8LOr1YymV
2018-01-31 16:59:53 +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
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
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
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
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
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
Paul Adenot
7695c5ac32 Bug 1420162 - Fix warning as errors bustage on a CLOSED TREE.
--HG--
extra : rebase_source : 9cb1cad05e3ea47eac21c30b0c430eaf6c56d947
extra : amend_source : 6722925ea70f0fe97b2d4b5acbb4d62e69e70125
2018-01-16 18:50:35 +01:00
Paul Adenot
652fe3c729 Bug 1420162 - Remove USE_GRAPH_RATE because it's the default now, and we don't support anything else. r=jib
--HG--
extra : rebase_source : 07f87ea85fe2586236c4e5f64aa811a60e81e288
2018-01-16 18:26:29 +01:00
Munro Mengjue Chiang
6da9bf9b27 Bug 1420585 - refine logs. r=jib
MozReview-Commit-ID: KJlFTQALAb4

--HG--
extra : rebase_source : c33ea991c82090741c28d4b8dba092c5e1d7b51c
2018-01-05 15:51:48 +08:00
Chris Peterson
37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Jan-Ivar Bruaroey
313f7a1ac3 Bug 1429536 - Assure even width and hight for fake:true camera, fixing debug crash. r=ng
MozReview-Commit-ID: mxGcTFbEwe

--HG--
extra : rebase_source : 21a66143070dba55d616750a7733a4fa5848254b
2018-01-10 20:02:18 -05:00
Paul Adenot
e3c5088847 Bug 1428392 - Remove AudioOutputObserver, and feed the reverse-stream directly to the AEC. r=pehrsons
MozReview-Commit-ID: EVpH5LUOZ6g

--HG--
extra : rebase_source : d172cd10dffee89ac48b9ec6b6435dcf0c0581d4
2018-01-05 18:10:23 +01:00
Paul Adenot
0b9f42aad6 Bug 1428392 - Remove a leftover VoE pointer in MediaEngineWebRTC.h r=pehrsons
MozReview-Commit-ID: B4SHftYPM7e

--HG--
extra : rebase_source : 1a785c8187918e20644c6162e650639b2f24d141
2018-01-05 17:20:00 +01:00
Paul Adenot
4ee119fb63 Bug 1428392 - Rename the MediaEngineWebRTCMicrophoneSource packetizer to indicate it's packetizing the input data (microphone). r=pehrsons
MozReview-Commit-ID: AcjAeXdN8iA

--HG--
extra : rebase_source : 8c44f92a73857ed2bc1b4a66e3e6b74dcb6d9d21
2018-01-05 17:19:22 +01:00
Michael Froman
e49fa718b2 Bug 1414169 - pt 6 - Add all raw candidates table (local and remote). r=ng
Also remove the unmatched candidates in the candidate pair table since
they are now included in the "all raw candidates" table.

MozReview-Commit-ID: 4ZvhWfmjGJh

--HG--
extra : rebase_source : bf999db83cd49dd454434d2b157023da41b0dbcd
2017-11-29 14:16:12 -06:00
Michael Froman
2383b3776a Bug 1414169 - pt 4 - Trickled ICE candidates are highlighted with a light blue background. r=ng
MozReview-Commit-ID: JEMmf9LjvYd

--HG--
extra : rebase_source : 666559431e08e6671d1590d43bbaa15fe7178c58
2017-11-22 14:28:02 -06:00
Munro Mengjue Chiang
cd5c9af5e7 Bug 1424191 - set mImages[i] to nullptr in MediaEngineRemoteVideoSource::Start(). r=pehrsons
MozReview-Commit-ID: LK3gFynesoE

--HG--
extra : rebase_source : ead4957e39029ae7828654d0f6dc92ab5d11a508
2017-12-12 14:56:52 -06:00
Paul Adenot
087931a5ef Bug 1423923 - Properly feed reverse stream to the AudioProcessingModule. r=pehrsons
We need to feed deinterleaved data, not interleaved data.

MozReview-Commit-ID: 99z8HA7tJgT

--HG--
extra : rebase_source : eb61b602630008683c6afdd2aad1dca0d663db86
extra : intermediate-source : 2d718ca90e07d9dfc71e86434cb04c5580405f9f
extra : source : 3ba7fe1cddec0a3dcaaf526a85b7f34072c3e199
2017-12-07 16:22:28 +01:00
Paul Adenot
68ba9be263 Bug 1397793 - Share SharedBuffer accross SourceMediaStream. r=pehrsons
MozReview-Commit-ID: 4PEjwiA6PR8

--HG--
extra : rebase_source : 8c3d3f15eaa926f35311b66026f4d3aa10ce3ffa
extra : source : 81889a72ac45db0507c38423084f3cfce71d2ecd
2017-11-28 18:43:11 +01:00
Paul Adenot
0866864396 Bug 1397793 - Remove mRate from MediaEngineDefault and use GraphRate(). r=pehrsons
MozReview-Commit-ID: D9x3wICAMNA

--HG--
extra : rebase_source : 1b83343c8a459d8720a6445efbd0d390824325e4
extra : source : ea8d6efcf3efbadab838c3f720d4ad73e7afed2e
2017-11-08 15:16:06 +01:00
Paul Adenot
30d795740b Bug 1397793 - Use a ControlMessage to switch between passthrough and processing mode for microphone input. r=pehsrons
MozReview-Commit-ID: EIvQKZf7oGq

--HG--
extra : rebase_source : 7e7e0cedb7069639cd6dc3d1612c4d75ce71faa3
extra : source : 771c95f2963b64f52f32c9d2770136748bbf943a
2017-11-08 14:10:45 +01:00
Paul Adenot
dce032329a Bug 1397793 - Refactor the code that sets the processing modes. r=pehrsons
MozReview-Commit-ID: IUgAfHawFIz

--HG--
extra : rebase_source : ec99875aaf24954cc93e28d4f0fe6172e6b2f9ce
extra : source : 1cf542ff868736857488fd1f2bc2271b686b5b56
2017-11-07 14:28:06 +01:00