Commit Graph

187 Commits

Author SHA1 Message Date
Paul Adenot
2f416390fe Bug 1152401 - Augment AudioDeviceInfo with a cubeb device id. r=padenot
MozReview-Commit-ID: 7QOcM5ITrxv

--HG--
extra : rebase_source : 41071cfbccfc22b0c8a3b2d6a5405d4fbf23c16d
2018-07-18 10:38:34 +02:00
Alex Chronopoulos
9e8bb0c379 Bug 1152401 - Update enumerate methods of MediaManager and MediaEngine to accept audio sink type. r=jib
MozReview-Commit-ID: 1RClh9UNQck

--HG--
extra : rebase_source : 23e3f1b9e4ad42f0cff86d3903e2b0c7e5bc6a01
2018-07-16 11:30:46 +02:00
Alex Chronopoulos
5d13851360 Bug 1152401 - Use MediaDevice in MediaEngine to allow enumeration of both sinks and sources. r=jib
MozReview-Commit-ID: 6ntA5YUFSnN

--HG--
extra : rebase_source : d90bc121bc8e4152d76429e2a49f4d4cc1cf439e
2018-07-11 08:59:13 +02:00
Margareta Eliza Balazs
0cf58ddcab Backed out 9 changesets (bug 1152401) for android gv-junit failures org.mozilla.geckoview.test.PermissionDelegateTest.media on a CLOSED TREE
Backed out changeset 987f2e0b2cb1 (bug 1152401)
Backed out changeset e45630a7c7b1 (bug 1152401)
Backed out changeset 95661c6cd914 (bug 1152401)
Backed out changeset d68ab111809f (bug 1152401)
Backed out changeset 10b039210911 (bug 1152401)
Backed out changeset aebabaa96ad3 (bug 1152401)
Backed out changeset 93457990e40f (bug 1152401)
Backed out changeset 1630f67ac197 (bug 1152401)
Backed out changeset aef64bf5b024 (bug 1152401)
2018-07-19 13:35:58 +03:00
Paul Adenot
5dae77130d Bug 1152401 - Augment AudioDeviceInfo with a cubeb device id. r=padenot
MozReview-Commit-ID: 7QOcM5ITrxv

--HG--
extra : rebase_source : 41071cfbccfc22b0c8a3b2d6a5405d4fbf23c16d
2018-07-18 10:38:34 +02:00
Alex Chronopoulos
0a08cf0372 Bug 1152401 - Update enumerate methods of MediaManager and MediaEngine to accept audio sink type. r=jib
MozReview-Commit-ID: 1RClh9UNQck

--HG--
extra : rebase_source : 23e3f1b9e4ad42f0cff86d3903e2b0c7e5bc6a01
2018-07-16 11:30:46 +02:00
Alex Chronopoulos
43ba614cd9 Bug 1152401 - Use MediaDevice in MediaEngine to allow enumeration of both sinks and sources. r=jib
MozReview-Commit-ID: 6ntA5YUFSnN

--HG--
extra : rebase_source : d90bc121bc8e4152d76429e2a49f4d4cc1cf439e
2018-07-11 08:59:13 +02:00
Alex Chronopoulos
d409b4d3b8 Bug 1457427 - Restructure EnumerateDevices method is webrtc engine to improve readability. r=pehrsons
Restructuring of the existing code no functional change.

MozReview-Commit-ID: FARNItrajfD

--HG--
extra : rebase_source : 0887c6546bb43538e32b99950e2febca77a32bfb
2018-05-07 19:33:41 +02:00
Andreas Pehrson
aaf89f2684 Bug 1447982 - Rename mLastPrefs to mNetPrefs and update comment for clarity. r=padenot
MozReview-Commit-ID: CJPSDG5OHBs

--HG--
extra : rebase_source : 4be85639204fb53f02f1f5262fa945b78a97b286
2018-03-26 12:24:17 +02:00
Andreas Pehrson
deb26bcad0 Bug 1447982 - Pass GraphImpl into ApplySettings. r=padenot
MozReview-Commit-ID: GQlRUB3O1em

--HG--
extra : rebase_source : 80f6fc2f599a917f05de5af00103bbbff3f1caf0
2018-03-26 12:18:35 +02:00
Matthew Gregan
3eacaf6b89 Bug 1445546 - Initialize COM on the MediaManager thread. r=padenot
MozReview-Commit-ID: 92FErxjmDE5

--HG--
extra : rebase_source : a1c3c5a1dd08a81fff64c85e7a953052803de64c
2018-03-20 10:31:40 +13: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
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
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
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
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
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
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
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
Paul Adenot
d4aeb652b5 Bug 1397793 - Allow switching processing on/off dynamically. r=pehrsons
MozReview-Commit-ID: G0NJRkKEVeM

--HG--
extra : rebase_source : 0574254dfbfa0965ed4d1c8a07c9f535c390d8a1
extra : source : d12894d7777055463b68b8d9ea7e3d6c0940b4aa
2017-11-23 15:53:25 +01:00
Paul Adenot
14fb321adc Bug 1397793 - Move to APM - Part 2 - Actual processing. r=pehrsons
This also is long, but simple.

First, we switch to floats everywhere. This allows to work with any rate, is
more flexible with channel layout, and is a stable API (see audio_processing.h
in webrtc.org).

Then, 10ms worth of audio (already at the graph rate) are poped from the
lock-free queue (fed on the other end by the MSG mixer), and does the following:
- Down mixing to stereo (if needed)
- De-interleaving into planar buffer
- Prepare input and output config
- Actually make the API call
- Free the data

Now, first, we should use a ring buffer, and not have to free any data. Then we
also should not use a lock-free queue, and synchronously process the
reverse-stream, but this is enough code already.

Then, the actual mic data processing:
- Pop a packet from the packetizer (that gives us 10ms worth of audio, note that
we switch from int16_t to float, i.e. we don't do this conversion anymore).
- We convert to planar buffers, deinterleaving
- Prepare input and output config
- Allocate a SharedBuffer of the right size
- Process the data with the processing algorithm selected in UpdateSingleSource
- Append to the a MediaSegment, and append to the right MediaStreamTrack for the
correct SourceMediaStream (the data is already planar and all well).

MozReview-Commit-ID: 2IjgHP0GAmw

--HG--
extra : rebase_source : 1e08c4a781db8778e0532f9ef1a8e369513a2c66
extra : source : 0107b3feb84bbe0e643f505ec58e303dfd94e1a7
2017-12-04 13:34:14 +01:00
Paul Adenot
49545441d4 Bug 1397793 - Move to APM - Part 1 - UpdateSingleSource. r=pehrsons
This part is about setting on/off audio processing feature. It's long, but
it's mostly mechanichal changes, from the old API to the new one.

This also covers reseting the processing in case of device changes (with
macros).

MozReview-Commit-ID: EI2TxHRicEr

--HG--
extra : rebase_source : 5c389e00019633d371d74cdd2d881dab4d353848
extra : source : 2c7a56648de9125ae1893d54ec011b6cbb181d86
2017-10-31 18:25:41 +01:00
Paul Adenot
17c1d145ae Bug 1397793 - Remove VoEExternalMedia usage in MediaEngineWebRTCAudio and MediaEngineWebRTC. r=pehrsons
This needs the next patches to build fine, but is split out for the review.

A side effect of this patch is to break non-duplex, making the whole
init/cleanup phase much simpler.

MozReview-Commit-ID: Caqc8v7CWwZ

--HG--
extra : rebase_source : 604551cc937ee60064a263ebb5fb1550fa9a9e9f
extra : source : a781b123b252b464f805674144cc01d9dd69c391
2017-10-31 18:11:48 +01:00
Sebastian Hengst
fe440c72a7 Backed out bug 1423923 for crashes, requested by drno. r=backout a=backout
Backed out changesets:
b44e089bcfe7
a3d9aa2649b9
9e92591ba6dc
e92ff1339db1
bf8977e0f440
a781b123b252
2c7a56648de9
0107b3feb84b
d12894d77770
1cf542ff8687
771c95f2963b
16f44ac4978a
ea8d6efcf3ef
a0d519ba5332
81889a72ac45
c02fd9acc634

--HG--
extra : histedit_source : 1cc2bad6f9f291f76d6c2385a5c7fa4512b9c6e3%2C758892ad6f034b39773940602a1399f4e3c8f887
2017-12-11 12:34:23 +02:00
Paul Adenot
de142c0970 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 : cf84d44df1fadd262283946641d7ce67f779b7d2
extra : histedit_source : 71388af2bab6cbfb3d6a4c700b2419899811e680
2017-11-08 14:10:45 +01:00
Paul Adenot
58fc6f439a Bug 1397793 - Refactor the code that sets the processing modes. r=pehrsons
MozReview-Commit-ID: IUgAfHawFIz

--HG--
extra : rebase_source : f80414c0e9048ee5eb9754a0161844b5607addb8
extra : histedit_source : 71375da254afb9764c812ed9ba92689d828c74db
2017-11-07 14:28:06 +01:00
Paul Adenot
965ccaadaa Bug 1397793 - Allow switching processing on/off dynamically. r=pehrsons
MozReview-Commit-ID: G0NJRkKEVeM

--HG--
extra : rebase_source : 16547d0ace0d0d7e791ef60249f94fe3060944b4
extra : histedit_source : 78db64f41f799dec503c36a809cb05713cbd45e4
2017-11-23 15:53:25 +01:00
Paul Adenot
20a31e686f Bug 1397793 - Move to APM - Part 2 - Actual processing. r=pehrsons
This also is long, but simple.

First, we switch to floats everywhere. This allows to work with any rate, is
more flexible with channel layout, and is a stable API (see audio_processing.h
in webrtc.org).

Then, 10ms worth of audio (already at the graph rate) are poped from the
lock-free queue (fed on the other end by the MSG mixer), and does the following:
- Down mixing to stereo (if needed)
- De-interleaving into planar buffer
- Prepare input and output config
- Actually make the API call
- Free the data

Now, first, we should use a ring buffer, and not have to free any data. Then we
also should not use a lock-free queue, and synchronously process the
reverse-stream, but this is enough code already.

Then, the actual mic data processing:
- Pop a packet from the packetizer (that gives us 10ms worth of audio, note that
we switch from int16_t to float, i.e. we don't do this conversion anymore).
- We convert to planar buffers, deinterleaving
- Prepare input and output config
- Allocate a SharedBuffer of the right size
- Process the data with the processing algorithm selected in UpdateSingleSource
- Append to the a MediaSegment, and append to the right MediaStreamTrack for the
correct SourceMediaStream (the data is already planar and all well).

MozReview-Commit-ID: 2IjgHP0GAmw

--HG--
extra : rebase_source : d2245037e8ee7145af7eef528dcee50817b69d83
extra : histedit_source : 79443c35b82d3bc8833d140dd5afc882b85b4c12
2017-12-04 13:34:14 +01:00
Paul Adenot
b76152fc03 Bug 1397793 - Move to APM - Part 1 - UpdateSingleSource. r=pehrsons
This part is about setting on/off audio processing feature. It's long, but
it's mostly mechanichal changes, from the old API to the new one.

This also covers reseting the processing in case of device changes (with
macros).

MozReview-Commit-ID: EI2TxHRicEr

--HG--
extra : rebase_source : 7044c2d1695cdf0d6a69b4faa19349e3261ef204
extra : histedit_source : f5ac61e7b90ab4d5280623095c443529fb36cde5%2C5c969f1833bdc425842f945a5a8a4702ca13cd56
2017-10-31 18:25:41 +01:00
Paul Adenot
0ade31e233 Bug 1397793 - Remove VoEExternalMedia usage in MediaEngineWebRTCAudio and MediaEngineWebRTC. r=pehrsons
This needs the next patches to build fine, but is split out for the review.

A side effect of this patch is to break non-duplex, making the whole
init/cleanup phase much simpler.

MozReview-Commit-ID: Caqc8v7CWwZ

--HG--
extra : rebase_source : 6e7d501ef99f3ea5d755a610238b8f260194bba0
extra : histedit_source : 298c7e95a2bd40e8f9ce014e06faad159fca513e
2017-10-31 18:11:48 +01:00
Munro Mengjue Chiang
e782a0379f Bug 1388219 - add a nsTArray mTargetCapability to record each track target capability. r=jib
MozReview-Commit-ID: E8ZCmXEDxKs

--HG--
extra : rebase_source : 5cab9cdb5cc1a67d6cf4c0b5c5c7caef5cfe7ea0
2017-11-30 15:44:20 +08:00
Ryan VanderMeulen
5395ec18d2 Backed out 3 changesets (bug 1421025, bug 1388219) for causing bug 1421706 on a CLOSED TREE.
Backed out changeset 1a69438ec05f (bug 1421025)
Backed out changeset 213c2c200c08 (bug 1388219)
Backed out changeset 341aaeb4ce69 (bug 1388219)
2017-11-29 17:00:27 -05:00
Munro Mengjue Chiang
f02f21154e Bug 1388219 - add a nsTArray mTargetCapability to record each track target capability. r=jib
MozReview-Commit-ID: 476kNk16VKR

--HG--
extra : rebase_source : c0718f640acdebaad9c314441e217f43377e12de
2017-11-23 15:46:25 +08:00
Tom Ritter
5e81122570 Bug 1411742 Remove the pref media.getusermedia.playout_delay and the field as they are not used anywhere r=jib
MozReview-Commit-ID: Gjbeg0zWtJ1

--HG--
extra : rebase_source : 55ad0e8f5e8ec45e7ed365ea516da9ecbc498253
2017-11-16 21:57:07 -06:00
Randell Jesup
6ccd0752b4 Bug 1407680: Set DelayAgnostic and ExtendedFilter options r=dminor
This was lost due to API changes in the update to upstream v57
2017-10-17 16:27:20 -04:00
Andreas Pehrson
d918302551 Bug 1319446 - DirectMediaStreamListener, you are dead to me. r=padenot
MozReview-Commit-ID: KwztE5ogSj9

--HG--
extra : rebase_source : e8e6bb3548c5697c5db901c0310ea5067a30c895
2017-09-27 12:01:46 +02:00
Alex Chronopoulos
087f9c1689 Bug 1392837 - Support multichannel audio input on gUM. r=padenot
MozReview-Commit-ID: FKCIAo4a8jy

--HG--
extra : rebase_source : 2f72331514909f418580e3c7c8bcc445e74167c8
2017-09-04 17:26:03 +03:00
Dan Minor
dfc22964d2 Bug 1391316 - Remove VoEHardware from MediaEngineWebrtc; r=jesup
The VoEHardware interface has been removed upstream. This replaces it with
calls to the AudioDeviceModule through VoEBase. This code is only used on the
non-full duplex code path.

MozReview-Commit-ID: m5ftmXm3CS

--HG--
extra : rebase_source : ee99440fa6616bc52d42c01b6b264c95e8b2ad89
2017-08-17 13:26:33 -04:00
Carsten "Tomcat" Book
daa67cc9e3 merge mozilla-inbound to mozilla-central a=merge 2017-06-30 12:59:45 +02:00
Paul Adenot
e55c008768 Bug 1372247 - Make the AudioOutputObserver a member of the MediaEngineWebRTCMicrophoneSource so it's not a global singleton anymore. r=jesup
MozReview-Commit-ID: 3yC1PvG3sW7

--HG--
extra : rebase_source : 950c1633d127ee0b6670b112bb31637a8851a583
2017-06-12 17:14:26 +02:00
Alex Chronopoulos
41737dc1af Bug 1213414 - Implement channelCount audio constraint. r=jib,padenot
MozReview-Commit-ID: K95iBYOE1nR

--HG--
extra : rebase_source : 5c73eea4902933faec75e37d90e42a2f38c51b81
2017-06-29 21:01:17 -07:00