Commit Graph

7374 Commits

Author SHA1 Message Date
John Lin
8f1bf15aa3 Bug 1581902 - p5: check H.264 hardware availability. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D46367

--HG--
extra : moz-landing-system : lando
2019-10-08 17:15:52 +00:00
John Lin
3ab45bc445 Bug 1581902 - p1: use MediaDataEncoder on Android. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D46366

--HG--
extra : moz-landing-system : lando
2019-10-08 17:15:15 +00:00
Daniel Varga
27d99ab2df Backed out 6 changesets (bug 1581902) for xpcshell failure at xpcshell/rs-blocklist/test_gfxBlacklist_Equal_DriverNew.js. On a CLOSED TREE
Backed out changeset c900fdf28f82 (bug 1581902)
Backed out changeset 92c9ea70040d (bug 1581902)
Backed out changeset 1f588b5bf019 (bug 1581902)
Backed out changeset f837f2c5224f (bug 1581902)
Backed out changeset 44e248976099 (bug 1581902)
Backed out changeset c7dfff053f71 (bug 1581902)
2019-10-07 23:07:36 +03:00
John Lin
47c168e1bc Bug 1581902 - p6: introduce a pref to enable/disable H.264 for WebRTC. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D46368

--HG--
extra : moz-landing-system : lando
2019-10-01 16:54:50 +00:00
John Lin
854d85bd05 Bug 1581902 - p5: check H.264 hardware availability. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D46367

--HG--
extra : moz-landing-system : lando
2019-10-01 16:54:41 +00:00
John Lin
a93536ca9d Bug 1581902 - p1: use MediaDataEncoder on Android. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D46366

--HG--
extra : moz-landing-system : lando
2019-10-01 16:53:59 +00:00
Dan Minor
5ca5bdf957 Bug 1559011 - Try using PW_RENDERFULLCONTENT for Windows window capture; r=pehrsons
This is a partial cherrypick of https://webrtc.googlesource.com/src/+/f89110d67902e787f6745ad2b52f7f09fc808512.
The cropping changes in that revision are problematic on our version of webrtc.org and
result in distorted video, which looks as though there is a stride problem. This takes
the change to try to use PW_RENDERFULLCONTENT and to fall back to the current code if
that fails. This fixes capturing Chrome windows and allows Firefox to properly capture
its own window.

Using PW_RENDERFULLCONTENT can adversely affect performance. Using the
CroppingWindowCapturer can avoid using the WindowCapturer in some circumstances and so
result in better performance. Bug 1586071 tracks switching to the
CroppingWindowCapturer.

Differential Revision: https://phabricator.services.mozilla.com/D48108

--HG--
extra : moz-landing-system : lando
2019-10-03 19:47:07 +00:00
Byron Campen [:bwc]
9067a09c0a Bug 1470568: Remove the rid= and pt= stuff from our simulcast parsing. Also, handle paused rids correctly. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D47658

--HG--
extra : moz-landing-system : lando
2019-10-02 20:20:07 +00:00
Dorel Luca
46491fb5f0 Backed out changeset 62b78793d12e (bug 1583867) for WPT failures in webrtc/RTCRtpReceiver-getSynchronizationSources.https.html 2019-10-03 02:43:28 +03:00
Nico Grunbaum
6722b1c2c1 Bug 1583867 - add rtpTimestamp field to RTP sync/contrib sources; r=jib,smaug
Differential Revision: https://phabricator.services.mozilla.com/D47096

--HG--
extra : moz-landing-system : lando
2019-10-02 21:55:33 +00:00
Byron Campen [:bwc]
972f1535a0 Bug 1582190: Close DataChannelConnection when datachannel negotiation fails for some reason. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D46357

--HG--
extra : moz-landing-system : lando
2019-09-26 15:35:42 +00:00
Byron Campen [:bwc]
e5f31d7bfb Bug 1582190: Get transport-related parameters for datachannel from the bundle-tag, if bundle is being used. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D46356

--HG--
extra : moz-landing-system : lando
2019-09-26 15:35:22 +00:00
Byron Campen [:bwc]
58744662ec Bug 1581898: Move telephone-event to the back of the codec list, because webrtc.org crashes if we don't. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D46830

--HG--
extra : moz-landing-system : lando
2019-10-02 07:50:16 +00:00
Andreas Pehrson
1bdb34c6ec Bug 1454998 - Rename streams to tracks. r=padenot,karlt,smaug
This renames the following (in alphabetical order, non-exhaustive):

AudioCaptureStream -> AudioCaptureTrack
AudioNodeStream -> AudioNodeTrack
AudioNodeExternalInputStream -> AudioNodeExternalInputTrack
DirectMediaStreamTrackListener -> DirectMediaTrackListener
MediaStream -> MediaTrack
  - Note that there's also dom::MediaTrack. Namespaces differentiate them.
MediaStreamGraph -> MediaTrackGraph
MediaStreamTrackListener -> MediaTrackListener
MSG -> MTG (in comments)
ProcessedMediaStream -> ProcessedMediaTrack
SharedDummyStream -> SharedDummyTrack
SourceMediaStream -> SourceMediaTrack
StreamTime -> TrackTime
TrackUnionStream -> ForwardedInputTrack
  - Because this no longer takes a union of anything, but only a single track
    as input.

Other minor classes, members and comments have been updated to reflect these
name changes.

Differential Revision: https://phabricator.services.mozilla.com/D46146

--HG--
rename : dom/media/AudioCaptureStream.cpp => dom/media/AudioCaptureTrack.cpp
rename : dom/media/AudioCaptureStream.h => dom/media/AudioCaptureTrack.h
rename : dom/media/TrackUnionStream.cpp => dom/media/ForwardedInputTrack.cpp
rename : dom/media/TrackUnionStream.h => dom/media/ForwardedInputTrack.h
rename : dom/media/MediaStreamGraph.cpp => dom/media/MediaTrackGraph.cpp
rename : dom/media/MediaStreamGraph.h => dom/media/MediaTrackGraph.h
rename : dom/media/MediaStreamGraphImpl.h => dom/media/MediaTrackGraphImpl.h
rename : dom/media/MediaStreamListener.cpp => dom/media/MediaTrackListener.cpp
rename : dom/media/MediaStreamListener.h => dom/media/MediaTrackListener.h
rename : dom/media/webaudio/AudioNodeExternalInputStream.cpp => dom/media/webaudio/AudioNodeExternalInputTrack.cpp
rename : dom/media/webaudio/AudioNodeExternalInputStream.h => dom/media/webaudio/AudioNodeExternalInputTrack.h
rename : dom/media/webaudio/AudioNodeStream.cpp => dom/media/webaudio/AudioNodeTrack.cpp
rename : dom/media/webaudio/AudioNodeStream.h => dom/media/webaudio/AudioNodeTrack.h
extra : moz-landing-system : lando
2019-10-02 10:23:02 +00:00
Andreas Pehrson
8028758d0e Bug 1454998 - Remove the notion of streams from MediaStreamGraph. r=padenot,karlt
This change mainly removes the `mTracks` member from MediaStream and moves all
associated members up a level, so that a MediaStream in practice represents a
single track.

Classes will be renamed in a future patch to reflect this.

Other changes include:

The new `mEnded` member of MediaStream changes meaning to only become true when
all data in the stream has been processed. It stems from
StreamTracks::Track::mEnded which used to become true as soon as the last bit of
data had been added to a track, and there could still be data in the track that
would get processed in future iterations. We are moving towards not having any
future data in tracks, which is why this change is ok to make -- keeping the old
behavior will soon not make sense.

TrackUnionStream is changed to no longer take a list of streams as input and
forward the union of their tracks to itself. Instead it's limited to having one
track as input at a time.

The autofinishing functionality that TrackUnionStream had before has been
transformed into an autoending functionality to allow it to defer ending until
its been told that it's ok to end through the control API. This lets a single
TrackUnionStream span the lifetime of multiple inputs, which will be useful for
making DecodedStream spec compliant with HTMLMediaElement::CaptureStream(), and
for implementing the currently discussed MediaRecorder::ReplaceTrack(), to name
a few potential use cases.

AudioNodeStreams used to only have a track (and thus an AudioSegment) if the
EXTERNAL_OUTPUT flag was enabled on them. With all MediaStreams now representing
a track, AudioNodeStreams inherently have an AudioSegment as a member. It is
however only used with data if the EXTERNAL_OUTPUT flag is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D45821

--HG--
extra : moz-landing-system : lando
2019-10-02 10:22:53 +00:00
Gurzau Raul
40dae37e00 Backed out 7 changesets (bug 1454998) for build bustages at MediaTrackGraph.h on a CLOSED TREE.
Backed out changeset 80417bdfa721 (bug 1454998)
Backed out changeset 8ff03f2f4ca2 (bug 1454998)
Backed out changeset ae6056b748d1 (bug 1454998)
Backed out changeset ab721cb2066b (bug 1454998)
Backed out changeset d0e8d413cd1c (bug 1454998)
Backed out changeset 3ce4dc7e9ae2 (bug 1454998)
Backed out changeset 6105a4176729 (bug 1454998)

--HG--
rename : dom/media/AudioCaptureTrack.cpp => dom/media/AudioCaptureStream.cpp
rename : dom/media/AudioCaptureTrack.h => dom/media/AudioCaptureStream.h
rename : dom/media/MediaTrackGraph.cpp => dom/media/MediaStreamGraph.cpp
rename : dom/media/MediaTrackGraph.h => dom/media/MediaStreamGraph.h
rename : dom/media/MediaTrackGraphImpl.h => dom/media/MediaStreamGraphImpl.h
rename : dom/media/MediaTrackListener.cpp => dom/media/MediaStreamListener.cpp
rename : dom/media/MediaTrackListener.h => dom/media/MediaStreamListener.h
rename : dom/media/ForwardedInputTrack.cpp => dom/media/TrackUnionStream.cpp
rename : dom/media/ForwardedInputTrack.h => dom/media/TrackUnionStream.h
rename : dom/media/webaudio/AudioNodeExternalInputTrack.cpp => dom/media/webaudio/AudioNodeExternalInputStream.cpp
rename : dom/media/webaudio/AudioNodeExternalInputTrack.h => dom/media/webaudio/AudioNodeExternalInputStream.h
rename : dom/media/webaudio/AudioNodeTrack.cpp => dom/media/webaudio/AudioNodeStream.cpp
rename : dom/media/webaudio/AudioNodeTrack.h => dom/media/webaudio/AudioNodeStream.h
2019-10-02 11:46:23 +03:00
Andreas Pehrson
36d89d91c8 Bug 1454998 - Rename streams to tracks. r=padenot,karlt,smaug
This renames the following (in alphabetical order, non-exhaustive):

AudioCaptureStream -> AudioCaptureTrack
AudioNodeStream -> AudioNodeTrack
AudioNodeExternalInputStream -> AudioNodeExternalInputTrack
DirectMediaStreamTrackListener -> DirectMediaTrackListener
MediaStream -> MediaTrack
  - Note that there's also dom::MediaTrack. Namespaces differentiate them.
MediaStreamGraph -> MediaTrackGraph
MediaStreamTrackListener -> MediaTrackListener
MSG -> MTG (in comments)
ProcessedMediaStream -> ProcessedMediaTrack
SharedDummyStream -> SharedDummyTrack
SourceMediaStream -> SourceMediaTrack
StreamTime -> TrackTime
TrackUnionStream -> ForwardedInputTrack
  - Because this no longer takes a union of anything, but only a single track
    as input.

Other minor classes, members and comments have been updated to reflect these
name changes.

Differential Revision: https://phabricator.services.mozilla.com/D46146

--HG--
rename : dom/media/AudioCaptureStream.cpp => dom/media/AudioCaptureTrack.cpp
rename : dom/media/AudioCaptureStream.h => dom/media/AudioCaptureTrack.h
rename : dom/media/TrackUnionStream.cpp => dom/media/ForwardedInputTrack.cpp
rename : dom/media/TrackUnionStream.h => dom/media/ForwardedInputTrack.h
rename : dom/media/MediaStreamGraph.cpp => dom/media/MediaTrackGraph.cpp
rename : dom/media/MediaStreamGraph.h => dom/media/MediaTrackGraph.h
rename : dom/media/MediaStreamGraphImpl.h => dom/media/MediaTrackGraphImpl.h
rename : dom/media/MediaStreamListener.cpp => dom/media/MediaTrackListener.cpp
rename : dom/media/MediaStreamListener.h => dom/media/MediaTrackListener.h
rename : dom/media/webaudio/AudioNodeExternalInputStream.cpp => dom/media/webaudio/AudioNodeExternalInputTrack.cpp
rename : dom/media/webaudio/AudioNodeExternalInputStream.h => dom/media/webaudio/AudioNodeExternalInputTrack.h
rename : dom/media/webaudio/AudioNodeStream.cpp => dom/media/webaudio/AudioNodeTrack.cpp
rename : dom/media/webaudio/AudioNodeStream.h => dom/media/webaudio/AudioNodeTrack.h
extra : moz-landing-system : lando
2019-10-02 08:18:16 +00:00
Andreas Pehrson
1bc37d8ea4 Bug 1454998 - Remove the notion of streams from MediaStreamGraph. r=padenot,karlt
This change mainly removes the `mTracks` member from MediaStream and moves all
associated members up a level, so that a MediaStream in practice represents a
single track.

Classes will be renamed in a future patch to reflect this.

Other changes include:

The new `mEnded` member of MediaStream changes meaning to only become true when
all data in the stream has been processed. It stems from
StreamTracks::Track::mEnded which used to become true as soon as the last bit of
data had been added to a track, and there could still be data in the track that
would get processed in future iterations. We are moving towards not having any
future data in tracks, which is why this change is ok to make -- keeping the old
behavior will soon not make sense.

TrackUnionStream is changed to no longer take a list of streams as input and
forward the union of their tracks to itself. Instead it's limited to having one
track as input at a time.

The autofinishing functionality that TrackUnionStream had before has been
transformed into an autoending functionality to allow it to defer ending until
its been told that it's ok to end through the control API. This lets a single
TrackUnionStream span the lifetime of multiple inputs, which will be useful for
making DecodedStream spec compliant with HTMLMediaElement::CaptureStream(), and
for implementing the currently discussed MediaRecorder::ReplaceTrack(), to name
a few potential use cases.

AudioNodeStreams used to only have a track (and thus an AudioSegment) if the
EXTERNAL_OUTPUT flag was enabled on them. With all MediaStreams now representing
a track, AudioNodeStreams inherently have an AudioSegment as a member. It is
however only used with data if the EXTERNAL_OUTPUT flag is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D45821

--HG--
extra : moz-landing-system : lando
2019-10-02 08:17:51 +00:00
Dan Minor
2e0c0c08a2 Bug 1571015 - Improve WebRTC Call Duration Telemetry; r=drno,ng
This adds a reference counted implementation of Telemetry::AutoTimer for use
in timing WebRTC calls. The telemetry is recorded when the reference count goes
from one to zero. This allows capturing the total call duration, rather than
the duration of individual PeerConnections. The timers are stored in a
HashTable, indexed by the Document URI, allowing for call durations to be
calculated individually for separate pages.

This reuses the existing WEBRTC_CALL_DURATION telemetry key. This means we
won't be able to compare telemetry from versions of Firefox with this change
to versions of Firefox without this change. The reason for making this change
is that the telemetry is not very useful in its current form, so I think it
makes sense to do this rather than adding a new key.

Differential Revision: https://phabricator.services.mozilla.com/D47800

--HG--
extra : moz-landing-system : lando
2019-10-01 19:45:02 +00:00
Dan Minor
2ee8d689fe Bug 1567201 - Use Maybe rather than empty string for timedout queries; r=ng
Differential Revision: https://phabricator.services.mozilla.com/D47266

--HG--
extra : moz-landing-system : lando
2019-10-01 12:59:51 +00:00
Dan Minor
440e93cd99 Bug 1567201 - Support multiple queries in a single packet; r=ng
If there are multiple pending queries, this allows up to five of them to be
sent in a single packet. This also adds a check to ensure we don't already have
a pending query for a hostname prior to sending a new query.

Differential Revision: https://phabricator.services.mozilla.com/D46983

--HG--
extra : moz-landing-system : lando
2019-10-01 12:59:26 +00:00
Dan Minor
dd9ed3ddc3 Bug 1567201 - Obfuscate server reflex candidates if necessary; r=ng
According to https://tools.ietf.org/html/draft-ietf-rtcweb-mdns-ice-candidates-03#section-3.1.2.1
we need to hide the rel-addr and rel-port attributes for server reflex
candidates in order to avoid leaking local addresses.

Differential Revision: https://phabricator.services.mozilla.com/D46982

--HG--
extra : moz-landing-system : lando
2019-10-01 12:59:14 +00:00
Dan Minor
7e51c599cd Bug 1567201 - Join multicast group on all interfaces; r=mjf
We need to join the multicast group on all network interfaces or we may end up
missing packets. There is a limit on the number of groups joinable by a single
socket (20 on my Linux system) but it doesn't seem worth worrying about
hitting that limit at the moment as it seems unlikely that many users would
have more than 20 network interfaces on a system on which they are running
Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D46981

--HG--
extra : moz-landing-system : lando
2019-10-01 12:59:02 +00:00
Dan Minor
1083dfbb67 Bug 1567201 - Add unit tests for mdns_service; r=ng
This adds Rust unit tests for some of the edge cases in handling queries
like limits and retries.

Differential Revision: https://phabricator.services.mozilla.com/D46980

--HG--
extra : moz-landing-system : lando
2019-10-01 12:58:50 +00:00
Dan Minor
b5473b49ca Bug 1567201 - Limit pending mDNS queries; r=ng
This limits the number of pending mDNS queries to 50, adds support for
retrying queries if they timeout, and support for reporting failure if a query
times out twice in a row.

Differential Revision: https://phabricator.services.mozilla.com/D46979

--HG--
extra : moz-landing-system : lando
2019-10-01 12:58:38 +00:00
Dan Minor
3028caf0cb Bug 1567201 - Validate hostname prior to registration and querying; r=ng
We don't want web content to use mDNS to map out the local network, so
we only support registering and querying hostnames that are valid
UUIDs (followed by .local).

Differential Revision: https://phabricator.services.mozilla.com/D46978

--HG--
extra : moz-landing-system : lando
2019-10-01 12:58:30 +00:00
Dan Minor
90e44f7695 Bug 1567201 - Use mdns_service to handle mDNS queries; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D46977

--HG--
extra : moz-landing-system : lando
2019-10-01 12:58:23 +00:00
Dan Minor
940a75c186 Bug 1567201 - Add mDNS query support to StunAddrsRequest; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D46976

--HG--
extra : moz-landing-system : lando
2019-10-01 12:58:19 +00:00
Dan Minor
340d659b0c Bug 1567201 - Add query support to mdns_service; r=mjf
This adds basic query support to the mdns_service. Support for limiting
the number of pending queries, timeouts and retries is added in
another commit in this series.

Differential Revision: https://phabricator.services.mozilla.com/D46975

--HG--
extra : moz-landing-system : lando
2019-10-01 12:58:18 +00:00
Nico Grunbaum
184e658171 Bug 1560370 - move webrtc-sdp out of tree; r=drno
Differential Revision: https://phabricator.services.mozilla.com/D45930

--HG--
rename : media/webrtc/signaling/src/sdp/rsdparsa/CODE_OF_CONDUCT.md => third_party/rust/webrtc-sdp/CODE_OF_CONDUCT.md
rename : media/webrtc/signaling/src/sdp/rsdparsa/LICENSE => third_party/rust/webrtc-sdp/LICENSE
rename : media/webrtc/signaling/src/sdp/rsdparsa/README.md => third_party/rust/webrtc-sdp/README.md
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/file_parser.rs => third_party/rust/webrtc-sdp/examples/file_parser.rs
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/10.sdp => third_party/rust/webrtc-sdp/examples/sdps/10.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/11.sdp => third_party/rust/webrtc-sdp/examples/sdps/11.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/12.sdp => third_party/rust/webrtc-sdp/examples/sdps/12.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/13.sdp => third_party/rust/webrtc-sdp/examples/sdps/13.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/14.sdp => third_party/rust/webrtc-sdp/examples/sdps/14.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/15.sdp => third_party/rust/webrtc-sdp/examples/sdps/15.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/16.sdp => third_party/rust/webrtc-sdp/examples/sdps/16.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/17.sdp => third_party/rust/webrtc-sdp/examples/sdps/17.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/18.sdp => third_party/rust/webrtc-sdp/examples/sdps/18.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/19.sdp => third_party/rust/webrtc-sdp/examples/sdps/19.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/2.sdp => third_party/rust/webrtc-sdp/examples/sdps/2.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/20.sdp => third_party/rust/webrtc-sdp/examples/sdps/20.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/21.sdp => third_party/rust/webrtc-sdp/examples/sdps/21.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/22.sdp => third_party/rust/webrtc-sdp/examples/sdps/22.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/23.sdp => third_party/rust/webrtc-sdp/examples/sdps/23.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/24.sdp => third_party/rust/webrtc-sdp/examples/sdps/24.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/25.sdp => third_party/rust/webrtc-sdp/examples/sdps/25.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/26.sdp => third_party/rust/webrtc-sdp/examples/sdps/26.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/27.sdp => third_party/rust/webrtc-sdp/examples/sdps/27.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/28.sdp => third_party/rust/webrtc-sdp/examples/sdps/28.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/29.sdp => third_party/rust/webrtc-sdp/examples/sdps/29.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/3.sdp => third_party/rust/webrtc-sdp/examples/sdps/3.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/30.sdp => third_party/rust/webrtc-sdp/examples/sdps/30.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/31.sdp => third_party/rust/webrtc-sdp/examples/sdps/31.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/32.sdp => third_party/rust/webrtc-sdp/examples/sdps/32.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/33.sdp => third_party/rust/webrtc-sdp/examples/sdps/33.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/34.sdp => third_party/rust/webrtc-sdp/examples/sdps/34.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/34.sdp => third_party/rust/webrtc-sdp/examples/sdps/35.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/34.sdp => third_party/rust/webrtc-sdp/examples/sdps/36.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/37.sdp => third_party/rust/webrtc-sdp/examples/sdps/37.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/38.sdp => third_party/rust/webrtc-sdp/examples/sdps/38.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/39.sdp => third_party/rust/webrtc-sdp/examples/sdps/39.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/4.sdp => third_party/rust/webrtc-sdp/examples/sdps/4.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/39.sdp => third_party/rust/webrtc-sdp/examples/sdps/40.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/41.sdp => third_party/rust/webrtc-sdp/examples/sdps/41.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/5.sdp => third_party/rust/webrtc-sdp/examples/sdps/5.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/6.sdp => third_party/rust/webrtc-sdp/examples/sdps/6.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/7.sdp => third_party/rust/webrtc-sdp/examples/sdps/7.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/8.sdp => third_party/rust/webrtc-sdp/examples/sdps/8.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/9.sdp => third_party/rust/webrtc-sdp/examples/sdps/9.sdp
rename : media/webrtc/signaling/src/sdp/rsdparsa/examples/sdps/extract.sh => third_party/rust/webrtc-sdp/examples/sdps/extract.sh
rename : media/webrtc/signaling/src/sdp/rsdparsa/src/address.rs => third_party/rust/webrtc-sdp/src/address.rs
rename : media/webrtc/signaling/src/sdp/rsdparsa/src/anonymizer.rs => third_party/rust/webrtc-sdp/src/anonymizer.rs
rename : media/webrtc/signaling/src/sdp/rsdparsa/src/attribute_type.rs => third_party/rust/webrtc-sdp/src/attribute_type.rs
rename : media/webrtc/signaling/src/sdp/rsdparsa/src/error.rs => third_party/rust/webrtc-sdp/src/error.rs
rename : media/webrtc/signaling/src/sdp/rsdparsa/src/lib.rs => third_party/rust/webrtc-sdp/src/lib.rs
rename : media/webrtc/signaling/src/sdp/rsdparsa/src/media_type.rs => third_party/rust/webrtc-sdp/src/media_type.rs
rename : media/webrtc/signaling/src/sdp/rsdparsa/src/network.rs => third_party/rust/webrtc-sdp/src/network.rs
rename : media/webrtc/signaling/src/sdp/rsdparsa/tests/unit_tests.rs => third_party/rust/webrtc-sdp/tests/unit_tests.rs
extra : moz-landing-system : lando
2019-10-01 01:01:56 +00:00
Bryce Seager van Dyk
a866eb3dd2 Bug 1583861 - Tidy includes in files using new logs. r=alwu
I've reworked the includes in most of the files I've touched since I was adding
GMPLog.h:
- Reordered the includes to better match the Google C++ style.
- Removed includes that are already included from the associated header or
  GMPLog.h. I.e. if Foo.cpp includes Foo.h, and Foo.cpp includes other headers
  already included in Foo.h, these were removed.

Depends on D47194

Differential Revision: https://phabricator.services.mozilla.com/D47373

--HG--
extra : moz-landing-system : lando
2019-09-27 00:14:23 +00:00
Bryce Seager van Dyk
a2dc990c12 Bug 1583861 - Use GMPLog.h macros where applicable. r=alwu
This patch changes instances where the GMP MOZ_LOG is used to prefer using
macros from GMPLog.h:
- Files that don't need their own macros now just directly call
  `GMP_LOG_<LEVEL>` as required.
- Files that use their own macros for formatting have had those macro
  definitions changes so that the macros have unique names and are expressed in
  terms of the macros from GMPLog.h.

I've also made a couple of drive by edits to logs so that they log more than a
couple of words and updated some strings where the incorrect class name was
being logged.

Differential Revision: https://phabricator.services.mozilla.com/D47194

--HG--
extra : moz-landing-system : lando
2019-09-27 00:14:46 +00:00
Byron Campen [:bwc]
68c6661fe1 Bug 1583046: Tighten down threading rules. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D47086

--HG--
extra : moz-landing-system : lando
2019-09-26 15:15:33 +00:00
Wang Qing
b428602d25 Bug 1579834 - [WebRTC] Add mips64 support; r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D45620

--HG--
extra : moz-landing-system : lando
2019-09-25 14:15:23 +00:00
Michael Froman
a32233c9b1 Bug 1582271 - pt4 - add ffvpx mp3 decoding for android32. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D46426

--HG--
extra : moz-landing-system : lando
2019-09-25 14:50:02 +00:00
Michael Froman
456979ca99 Bug 1582271 - pt3 - add ffvpx mp3 decoding for aarch64. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D46425

--HG--
extra : moz-landing-system : lando
2019-09-24 21:02:26 +00:00
Michael Froman
e290922048 Bug 1582271 - pt2 - add ffvpx mp3 decoding for linux/macOS/win. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D46424

--HG--
extra : moz-landing-system : lando
2019-09-24 21:18:24 +00:00
Michael Froman
36adeaea97 Bug 1582271 - pt1 - prep ffvpx files for adding mp3 support. r=jya
- Update README_MOZILLA for adding mp3 support, and add some clarifying text.
 - Clang-format config.h for easier reading since it is our file, not ffmpeg's.
 - Use sort -d -u to produce defaults_disabled.* files so linux and macOS
   produce same files.
 - Change MOZ_FFVPX_FLACONLY to MOZ_FFVPX_AUDIOONLY since it indicates flac
   and mp3 decoders.
 - Rename config_flac.h to config_audio.h

Differential Revision: https://phabricator.services.mozilla.com/D46423

--HG--
rename : media/ffvpx/config_flac.h => media/ffvpx/config_audio.h
extra : moz-landing-system : lando
2019-09-24 21:02:07 +00:00
Paul Adenot
91571117b5 Bug 1582222 - Disable rt threads for Linux for now. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D46570

--HG--
extra : moz-landing-system : lando
2019-09-24 11:23:25 +00:00
Alex Chronopoulos
ac0da8b368 Bug 1582743 - Update dav1d from upstream to commit c0865f3. r=TD-Linux
Differential Revision: https://phabricator.services.mozilla.com/D46762

--HG--
extra : moz-landing-system : lando
2019-09-23 18:02:33 +00:00
Byron Campen [:bwc]
e429b89b10 Bug 1582646: Cancel proxy lookup when socket closes. r=mjf
Also, since OnProxyAvailable always happens on main regardless of the target we
set, don't bother setting the target.

Differential Revision: https://phabricator.services.mozilla.com/D46603

--HG--
extra : moz-landing-system : lando
2019-09-20 15:13:44 +00:00
Byron Campen [:bwc]
c1963a1155 Bug 1581964: Cast this constant (which is just 1) to an unsigned before left-shifting it. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D46478

--HG--
extra : moz-landing-system : lando
2019-09-19 15:38:18 +00:00
Dan Minor
93ca060abc Bug 1578810 - Handle mDNS hostname prior to calling OnCandidateFound; r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D45563

--HG--
extra : moz-landing-system : lando
2019-09-18 22:02:45 +00:00
Alex Chronopoulos
5cb664d73b Bug 1572281 - Remove audio device change notifications from video capture in Windows. r=dminor
Video capture used to provide device change notifications for audio and video devices. From now on, CubebDeviceEnumerator will provide audio device change notifications thus video capture is updated to notify only changes of the video device. This is the windows part.

Differential Revision: https://phabricator.services.mozilla.com/D46274

--HG--
extra : moz-landing-system : lando
2019-09-18 13:12:30 +00:00
Alex Chronopoulos
aa5a82572d Bug 1572281 - Remove audio device change notifications from video capture in OSX. r=dminor
Video capture used to provide device change notifications for audio and video devices. From now on, CubebDeviceEnumerator will provide audio device change notifications thus video capture is updated to notify only changes of the video device. This is the OSX part.

Differential Revision: https://phabricator.services.mozilla.com/D46273

--HG--
extra : moz-landing-system : lando
2019-09-18 13:16:56 +00:00
Alex Chronopoulos
67bc215a66 Bug 1572281 - Remove audio device change notifications from video capture in Linux. r=dminor
Video capture used to provide device change notifications for audio and video devices. From now on, CubebDeviceEnumerator will provide audio device change notifications thus video capture is updated to notify only changes of the video device. This is the Linux part.

Differential Revision: https://phabricator.services.mozilla.com/D46272

--HG--
extra : moz-landing-system : lando
2019-09-18 13:16:57 +00:00
Byron Campen [:bwc]
8184381274 Bug 1581950: Prevent nr_ice_component_insert_pair from leaking. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D46231

--HG--
extra : moz-landing-system : lando
2019-09-18 22:00:13 +00:00
Byron Campen [:bwc]
72bcc87880 Bug 1569183: Simplify how NrSockets specify whether they're proxied or not. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D46032

--HG--
extra : moz-landing-system : lando
2019-09-17 18:19:19 +00:00
Byron Campen [:bwc]
abf0777414 Bug 1569183: Create an ipdl struct called WebrtcProxyConfig, to cut down on the arg count on lots of functions. r=mjf,mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D45562

--HG--
extra : moz-landing-system : lando
2019-09-17 18:19:04 +00:00
Byron Campen [:bwc]
fec8b0d807 Bug 1569183: Stop doing a proxy lookup to determine whether we're configured to use a proxy (for the proxy_only_if_behind_proxy pref), and instead look at whether we loaded the doc using a proxy. r=mjf,mayhemer,jld
Differential Revision: https://phabricator.services.mozilla.com/D45289

--HG--
extra : moz-landing-system : lando
2019-09-18 14:27:42 +00:00
Byron Campen [:bwc]
2fe90843a0 Bug 1569183: Update OnConnected callbacks to specify what type of proxying (if any) is being used, and implement IsProxied based on this information. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45186

--HG--
extra : moz-landing-system : lando
2019-09-17 18:18:33 +00:00
Byron Campen [:bwc]
6c7a8c9a4e Bug 1569183: Remove NrTcpSocketIpc. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45111

--HG--
extra : moz-landing-system : lando
2019-09-17 18:18:08 +00:00
Byron Campen [:bwc]
047fe556a4 Bug 1569183: Make the proxy_only pref disable UDP. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45105

--HG--
extra : moz-landing-system : lando
2019-09-17 18:17:51 +00:00
Byron Campen [:bwc]
fbfb9f6754 Bug 1569183: Make proxy config parameters optional in WebrtcTCPSocket to get the NAT simulator working again. r=mjf,mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D45104

--HG--
extra : moz-landing-system : lando
2019-09-17 18:17:37 +00:00
Byron Campen [:bwc]
493161e6a3 Bug 1569183: Teach WebrtcTCPSocket to use TLS when configured to. r=mjf,mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D45103

--HG--
extra : moz-landing-system : lando
2019-09-17 18:17:24 +00:00
Byron Campen [:bwc]
9e6bcf1480 Bug 1569183: Teach WebrtcTCPSocket to bind to a specific host/port. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45102

--HG--
extra : moz-landing-system : lando
2019-09-17 18:17:18 +00:00
Byron Campen [:bwc]
dbee4e76f5 Bug 1569183: Add a proxy policy argument to NrSocketProxyConfig, and always set this config on the NrIceCtx. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45101

--HG--
extra : moz-landing-system : lando
2019-09-17 18:17:14 +00:00
Byron Campen [:bwc]
8bd10b72d0 Bug 1569183: Rename SetProxyServer to SetProxyConfig to better reflect what is actually going on. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45100

--HG--
extra : moz-landing-system : lando
2019-09-17 18:17:13 +00:00
Byron Campen [:bwc]
c368262621 Bug 1569183: Rename NrSocketProxy to NrTcpSocket, and use NrTcpSocket for TCP on content/socket process. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45099

--HG--
rename : media/mtransport/nr_socket_proxy.cpp => media/mtransport/nr_socket_tcp.cpp
rename : media/mtransport/nr_socket_proxy.h => media/mtransport/nr_socket_tcp.h
extra : moz-landing-system : lando
2019-09-17 18:17:11 +00:00
Byron Campen [:bwc]
ffa09cee72 Bug 1569183: Rename PWebrtcProxyChannel to PWebrtcTCPSocket. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45098

--HG--
rename : media/mtransport/WebrtcProxyChannelWrapper.cpp => media/mtransport/WebrtcTCPSocketWrapper.cpp
rename : media/mtransport/WebrtcProxyChannelWrapper.h => media/mtransport/WebrtcTCPSocketWrapper.h
rename : media/mtransport/ipc/PWebrtcProxyChannel.ipdl => media/mtransport/ipc/PWebrtcTCPSocket.ipdl
rename : media/mtransport/ipc/WebrtcProxyChannel.cpp => media/mtransport/ipc/WebrtcTCPSocket.cpp
rename : media/mtransport/ipc/WebrtcProxyChannel.h => media/mtransport/ipc/WebrtcTCPSocket.h
rename : media/mtransport/ipc/WebrtcProxyChannelCallback.h => media/mtransport/ipc/WebrtcTCPSocketCallback.h
rename : media/mtransport/ipc/WebrtcProxyChannelChild.cpp => media/mtransport/ipc/WebrtcTCPSocketChild.cpp
rename : media/mtransport/ipc/WebrtcProxyChannelChild.h => media/mtransport/ipc/WebrtcTCPSocketChild.h
rename : media/mtransport/ipc/WebrtcProxyLog.cpp => media/mtransport/ipc/WebrtcTCPSocketLog.cpp
rename : media/mtransport/ipc/WebrtcProxyLog.h => media/mtransport/ipc/WebrtcTCPSocketLog.h
rename : media/mtransport/ipc/WebrtcProxyChannelParent.cpp => media/mtransport/ipc/WebrtcTCPSocketParent.cpp
rename : media/mtransport/ipc/WebrtcProxyChannelParent.h => media/mtransport/ipc/WebrtcTCPSocketParent.h
extra : moz-landing-system : lando
2019-09-17 18:15:41 +00:00
Byron Campen [:bwc]
5aea6ddbff Bug 1569183: Teach WebrtcProxyChannel to handle non-proxied TCP connections, and SOCKS proxying because that was easy to do also. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45097

--HG--
extra : moz-landing-system : lando
2019-09-17 18:15:23 +00:00
Byron Campen [:bwc]
663351b2eb Bug 1569183: Add some much-needed logging to this function. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45096

--HG--
extra : moz-landing-system : lando
2019-09-17 18:15:06 +00:00
Alex Chronopoulos
efb44bee9c Bug 1581806 - Trigger devicechange event for audio and video input devices only. r=dminor
After Bug 1581193 devicechange notifications were triggered with any device change, not just video and audio devices. This patch limits down the notifications to only video and audio input devices change.

Differential Revision: https://phabricator.services.mozilla.com/D46147

--HG--
extra : moz-landing-system : lando
2019-09-17 14:31:39 +00:00
Matthew Gregan
25b3f4cfbc Bug 1575131 - Update libcubeb for IAudioClient3 support on Win10. r=padenot
This picks up the work contributed by @ligfx in https://github.com/kinetiknz/cubeb/pull/530.

Differential Revision: https://phabricator.services.mozilla.com/D42590

--HG--
extra : moz-landing-system : lando
2019-08-26 07:52:25 +00:00
Dan Minor
fc594a5197 Bug 1581577 - Fix ICE duration telemetry high value; r=bwc
The Telemetry::AccumulateTimeDelta function reports in milliseconds but I had
assumed seconds when I added the hostname obfuscation ICE duration histogram.
This change adjusts the "high" value accordingly.

With the telemetry we've collected to date, 60% of the values are below 600
milliseconds, so I think that setting a high value of 30 seconds should be
sufficient even if there is a long tail. Since this does not change the data
being collected, no additional data-review is required, but it does require
renaming the key.

Differential Revision: https://phabricator.services.mozilla.com/D46045

--HG--
extra : moz-landing-system : lando
2019-09-16 18:15:28 +00:00
Dan Minor
382ae1bcb5 Bug 1581193 - Fix devicechange event on Windows; r=achronop
This restores the code for generating devicechange events that was
accidentally removed as part of updating the Windows video capture code
in Bug 1552755.

Differential Revision: https://phabricator.services.mozilla.com/D46033

--HG--
extra : moz-landing-system : lando
2019-09-17 06:47:06 +00:00
John Lin
17e9f72cc3 Bug 1580600 - rename setRates() to setBitrate() and pass the value in bps. r=jya
Depends on D45775

Differential Revision: https://phabricator.services.mozilla.com/D45776

--HG--
extra : moz-landing-system : lando
2019-09-13 23:38:32 +00:00
John Lin
d266695db7 Bug 1580597 - p1: pass timestamp values correctly. r=jya
Bug 1568101/D40532 captures the input timestamp and uses it in the resolve
function. However, there could be multiple encoded frames returned (e.g.,
for Drain()), and all of them will get the same captured timestamp. Read
back the timestamp from encoded data makes sure every frame gets the right
value. Also convert it for EncodedImage::_timeStamp uses different unit.

Differential Revision: https://phabricator.services.mozilla.com/D45774

--HG--
extra : moz-landing-system : lando
2019-09-14 00:23:37 +00:00
Byron Campen [:bwc]
6e3f7f6bb1 Bug 1577719: Init r_log in the c'tor, to simplify things. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D45463

--HG--
extra : moz-landing-system : lando
2019-09-11 02:29:15 +00:00
Dan Minor
dafa68a84f Bug 1580524 - Free conduits when transceiver is stopped; r=bwc
Freeing the conduits when the transceiver is stopped releases all of the
associated webrtc.org objects which results in substantial memory savings.

On my system, with an opt+debug build and 200 stopped transceivers, I see
373.17 MB of memory use in the content process without this patch, and
158.93 MB of memory use with this patch applied.

Going further and calling Shutdown_m as part of Stop() reduces the memory
use to 157.98 MB, which seems like a marginal improvement at the cost of
a much larger risk of introducing bugs.

Differential Revision: https://phabricator.services.mozilla.com/D45845

--HG--
extra : moz-landing-system : lando
2019-09-13 17:44:06 +00:00
Ryan Alderete
862aa4197f Bug 1579506 - Remove OpenAES source code and references r=bryce,mhoye
With NSS now being used to do the decryption in the Clearkey CDM, remove the
source and licensing information related to OpenAES.

Differential Revision: https://phabricator.services.mozilla.com/D45205

--HG--
extra : moz-landing-system : lando
2019-09-12 23:27:08 +00:00
Bastien Orivel
59f8fe9fee Bug 1580908 - Part 8: Update rsdparsa. r=ng
I just copied all the files from the upstream repository into the
rsdparsa directory

Differential Revision: https://phabricator.services.mozilla.com/D45717

--HG--
extra : moz-landing-system : lando
2019-09-12 21:46:25 +00:00
Boris Zbarsky
1128b8dee8 Bug 1578173 part 6. Remove remaining uses of [Constructor] from bindings. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D45394

--HG--
extra : moz-landing-system : lando
2019-09-12 11:01:17 +00:00
Mike Shal
f8f5fce637 Bug 1496746 - Remove VPATH; r=glandium
Having a full VPATH for the srcdir sometimes causes make to grab the
wrong prerequisite for a rule, in particular if we have a file in the
srcdir and also generate a file of the same name in the objdir. We don't
really need VPATH anymore though, since most of the information comes
from mozbuild, where we can explicitly list the path to the srcdir or
objdir as necessary.

Differential Revision: https://phabricator.services.mozilla.com/D42968

--HG--
extra : moz-landing-system : lando
2019-09-09 17:44:47 +00:00
Dan Minor
37c64b1005 Bug 1569250 - Add telemetry for mDNS use in WebRTC; r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D44888

--HG--
extra : moz-landing-system : lando
2019-09-09 16:45:02 +00:00
Mihai Alexandru Michis
7e0ca2f5cc Backed out changeset ef18dbaff6c7 (bug 1569250) for causing failures in AccumulateTimeDelta. CLOSED TREE 2019-09-09 17:07:20 +03:00
Dan Minor
54d9433d62 Bug 1569250 - Add telemetry for mDNS use in WebRTC; r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D44888

--HG--
extra : moz-landing-system : lando
2019-09-09 13:21:18 +00:00
Ryan Alderete
2e2b52b880 Bug 1572846 - Update Clearkey to use NSS for decryption instead of OpenAES r=bryce,jld
Clearkey previously relied on OpenAES to do its encryption.  In order to
facilitate future changes and the need for CBC support, switch to NSS, which
should be more flexible and actively maintained.

Differential Revision: https://phabricator.services.mozilla.com/D41993

--HG--
extra : moz-landing-system : lando
2019-09-05 19:19:06 +00:00
Dan Minor
fb8723ba06 Bug 1570669 - Only redact peer reflex candidates if host address obfuscation is enabled; r=mjf
This adds a mObfuscateHostAddresses member and uses it to control whether or
not peer reflex candidates are redacted. It is only necessary to keep track of
signaled addresses to support redacting peer reflex candidates, so there is no
need to store them if host address obfuscation is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D44531

--HG--
extra : moz-landing-system : lando
2019-09-06 15:23:53 +00:00
Dan Minor
f849f9d1b0 Bug 1579076 - Remove expired WebRTC telemetry; r=ng,drno
Differential Revision: https://phabricator.services.mozilla.com/D44884

--HG--
extra : moz-landing-system : lando
2019-09-06 03:52:29 +00:00
Ryan VanderMeulen
15c1a17047 Bug 1508198 - Update libjpeg-turbo to 2.0.3. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D44851

--HG--
extra : moz-landing-system : lando
2019-09-05 16:49:12 +00:00
Christian Holler
d5d628a5fb Bug 1577571 - Add OnUpgradeFailed to nsIHttpUpgradeListener. r=michal
Differential Revision: https://phabricator.services.mozilla.com/D44680

--HG--
extra : moz-landing-system : lando
2019-09-05 12:10:27 +00:00
Andreas Pehrson
528b5f4cd3 Bug 1576771 - Reset VideoFrameConverter's track-enabled state when disconnecting video listeners. r=bwc
Depends on D44675

Differential Revision: https://phabricator.services.mozilla.com/D44676

--HG--
extra : moz-landing-system : lando
2019-09-04 14:53:51 +00:00
Eric Rahm
2f5a215771 Bug 1577885 - Remove using namespace std from GMP ClearKey r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D44269

--HG--
extra : moz-landing-system : lando
2019-09-03 19:10:42 +00:00
Cameron Kaiser
47b9886e70 Bug 1576433 - Enable SIMD in libjpeg for PowerPC. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D43352

--HG--
extra : moz-landing-system : lando
2019-09-03 00:15:52 +00:00
Andreas Pehrson
6319ba4dbc Bug 1573102 - Remove mGraph from MediaStreamTrack::MSGListener. r=karlt
To accomodate this, MediaStreamTrackListener::NotifyEnded/Removed get an
additional aGraph argument. NotifyEnabledStateChanged is getting it too, for
completion.

Differential Revision: https://phabricator.services.mozilla.com/D43667

--HG--
extra : moz-landing-system : lando
2019-08-29 13:32:59 +00:00
Dan Minor
eae489fda9 Bug 1554976 - Use StunAddrs to set interface for mdns_service; r=mjf
The Rust get_if_addrs library previously used does not build on Android with
our build system. Since we're already using nICEr to determine the local
interface addresses, rather than fix the Rust library, we can use those
addresses to set the interface on which mdns_service listens.

Differential Revision: https://phabricator.services.mozilla.com/D42760

--HG--
extra : moz-landing-system : lando
2019-08-28 19:51:18 +00:00
Dan Minor
6e5937318f Bug 1554976 - Move thread assertion inside if statement in OnLookupComplete; r=mjf
Checking this assertion outside of the if statement can result in
a use-after-free in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D42152

--HG--
extra : moz-landing-system : lando
2019-08-28 19:51:06 +00:00
Dan Minor
2511d2ab0c Bug 1554976 - Make mDNS service a singleton; r=mjf
The current code causes one mDNS service to be created for each PeerConnection.
Due to Bug 1569311, the services persist until shutdown, which can lead to a
lot of mDNS threads running on sites which use WebRTC for fingerprinting. This
change makes it so we start at most one mDNS service.

I've filed Bug 1569955 to look at shutting down the mDNS service after the
last hostname is unregistered. As an alternative, if we fix Bug 1569311, we
could also use refcounting and stop the mDNS service after the last
StunAddrsRequestParent is freed.

Differential Revision: https://phabricator.services.mozilla.com/D42151

--HG--
extra : moz-landing-system : lando
2019-08-28 19:50:51 +00:00
Dan Minor
51353ec9f7 Bug 1554976 - Use mdns_service to generate UUIDs; r=mjf
With the move to the socket process, the UUID service is no longer available
in nricectx. This adds a pair of helper functions to mdns_service to generate
UUIDs and uses them to generate hostnames inside nricectx.

Differential Revision: https://phabricator.services.mozilla.com/D42150

--HG--
extra : moz-landing-system : lando
2019-08-28 19:50:44 +00:00
Dan Minor
fc82a0c5d5 Bug 1554976 - Obfuscate default rtp and rtcp candidates if required; r=ng
The default RTP candidate is used to populate the c= line in SDP. Rather than
using the mDNS address, which sipcc can not parse, we use 0.0.0.0:9, which is
what Chromium has chosen as well [1].

For RTCP, the mDNS obfuscated address is used.

[1] https://webrtc.googlesource.com/src.git/+/3ae59d33a310280e2f21ed4c53849950171e48e8

Differential Revision: https://phabricator.services.mozilla.com/D38498

--HG--
extra : moz-landing-system : lando
2019-08-28 19:50:25 +00:00
Dan Minor
6c6b65f876 Bug 1554976 - Add plumbing to enable/disable host address obfuscation; r=mjf
This only enables mDNS on OS X for now. Some versions of Windows lack mDNS
support, there are some oddities with resolving IPv6 addresses on Linux, and
Android has not yet been tested. All of these will be addressed in follow on
bugs.

Differential Revision: https://phabricator.services.mozilla.com/D38496

--HG--
extra : moz-landing-system : lando
2019-08-28 19:50:06 +00:00
Dan Minor
217f23e8b5 Bug 1554976 - Register mDNS hostname if required; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D38495

--HG--
extra : moz-landing-system : lando
2019-08-28 19:49:49 +00:00
Dan Minor
2665020e51 Bug 1554976 - Copy actual address to CandidateInfo in MediaTransportHandler; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D38494

--HG--
extra : moz-landing-system : lando
2019-08-28 19:49:36 +00:00
Dan Minor
6c39c9271f Bug 1554976 - Generate mDNS addresses in nricectx; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D38493

--HG--
extra : moz-landing-system : lando
2019-08-28 19:49:24 +00:00
Dan Minor
6285d788cc Bug 1554976 - Add methods to register/unregister mDNS hostnames to StunAddrsRequestParent; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D38492

--HG--
extra : moz-landing-system : lando
2019-08-28 19:49:12 +00:00
Dan Minor
04580ed952 Bug 1554976 - Add rust mdns library to mtransport; r=ng,dragana
This adds a mdns_service to mtransport to handle responding to mDNS queries.
All hostnames will be generated from UUIDs, so the responder assumes that it
is the only responder for a hostname which is registered with it. Because of
this, the responder does not first make a DNS query itself to see if any other
responder is handling a hostname, and does not wait a random amount of time
before replying, both of which are required by the specification to avoid
collisions with other responders.

Differential Revision: https://phabricator.services.mozilla.com/D38489

--HG--
extra : moz-landing-system : lando
2019-08-28 19:48:50 +00:00
Gurzau Raul
a6c5c5e3ac Backed out 14 changesets (bug 1554976) for Windows build bustages on a CLOSED TREE.
Backed out changeset a9b209d9d880 (bug 1554976)
Backed out changeset 27b4dddf9597 (bug 1554976)
Backed out changeset 3e16c10bb966 (bug 1554976)
Backed out changeset 6a404fca61dc (bug 1554976)
Backed out changeset 77c4e76c8130 (bug 1554976)
Backed out changeset 24f146b86cc4 (bug 1554976)
Backed out changeset b49b4326dcfd (bug 1554976)
Backed out changeset e2c837d1e0a0 (bug 1554976)
Backed out changeset 24728144c263 (bug 1554976)
Backed out changeset a099e69241a0 (bug 1554976)
Backed out changeset 0e34595c2680 (bug 1554976)
Backed out changeset a506bb40047e (bug 1554976)
Backed out changeset 513026415092 (bug 1554976)
Backed out changeset e0fc6a1d4332 (bug 1554976)
2019-08-28 18:10:11 +03:00
Dan Minor
a81f8d6f24 Bug 1554976 - Use StunAddrs to set interface for mdns_service; r=mjf
The Rust get_if_addrs library previously used does not build on Android with
our build system. Since we're already using nICEr to determine the local
interface addresses, rather than fix the Rust library, we can use those
addresses to set the interface on which mdns_service listens.

Differential Revision: https://phabricator.services.mozilla.com/D42760

--HG--
extra : moz-landing-system : lando
2019-08-28 13:12:26 +00:00
Dan Minor
2507ef392a Bug 1554976 - Move thread assertion inside if statement in OnLookupComplete; r=mjf
Checking this assertion outside of the if statement can result in
a use-after-free in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D42152

--HG--
extra : moz-landing-system : lando
2019-08-28 13:12:13 +00:00
Dan Minor
c3d8942d0f Bug 1554976 - Make mDNS service a singleton; r=mjf
The current code causes one mDNS service to be created for each PeerConnection.
Due to Bug 1569311, the services persist until shutdown, which can lead to a
lot of mDNS threads running on sites which use WebRTC for fingerprinting. This
change makes it so we start at most one mDNS service.

I've filed Bug 1569955 to look at shutting down the mDNS service after the
last hostname is unregistered. As an alternative, if we fix Bug 1569311, we
could also use refcounting and stop the mDNS service after the last
StunAddrsRequestParent is freed.

Differential Revision: https://phabricator.services.mozilla.com/D42151

--HG--
extra : moz-landing-system : lando
2019-08-28 13:12:01 +00:00
Dan Minor
d54770d4a5 Bug 1554976 - Use mdns_service to generate UUIDs; r=mjf
With the move to the socket process, the UUID service is no longer available
in nricectx. This adds a pair of helper functions to mdns_service to generate
UUIDs and uses them to generate hostnames inside nricectx.

Differential Revision: https://phabricator.services.mozilla.com/D42150

--HG--
extra : moz-landing-system : lando
2019-08-28 13:11:49 +00:00
Dan Minor
b07a76f4bd Bug 1554976 - Obfuscate default rtp and rtcp candidates if required; r=ng
The default RTP candidate is used to populate the c= line in SDP. Rather than
using the mDNS address, which sipcc can not parse, we use 0.0.0.0:9, which is
what Chromium has chosen as well [1].

For RTCP, the mDNS obfuscated address is used.

[1] https://webrtc.googlesource.com/src.git/+/3ae59d33a310280e2f21ed4c53849950171e48e8

Differential Revision: https://phabricator.services.mozilla.com/D38498

--HG--
extra : moz-landing-system : lando
2019-08-28 13:11:42 +00:00
Dan Minor
2da923ff0b Bug 1554976 - Add plumbing to enable/disable host address obfuscation; r=mjf
This only enables mDNS on OS X for now. Some versions of Windows lack mDNS
support, there are some oddities with resolving IPv6 addresses on Linux, and
Android has not yet been tested. All of these will be addressed in follow on
bugs.

Differential Revision: https://phabricator.services.mozilla.com/D38496

--HG--
extra : moz-landing-system : lando
2019-08-28 13:11:33 +00:00
Dan Minor
d467f3a90a Bug 1554976 - Register mDNS hostname if required; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D38495

--HG--
extra : moz-landing-system : lando
2019-08-28 13:11:24 +00:00
Dan Minor
717793ab02 Bug 1554976 - Copy actual address to CandidateInfo in MediaTransportHandler; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D38494

--HG--
extra : moz-landing-system : lando
2019-08-28 13:11:20 +00:00
Dan Minor
9fa62a0a55 Bug 1554976 - Generate mDNS addresses in nricectx; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D38493

--HG--
extra : moz-landing-system : lando
2019-08-28 13:11:14 +00:00
Dan Minor
6803a86c10 Bug 1554976 - Add methods to register/unregister mDNS hostnames to StunAddrsRequestParent; r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D38492

--HG--
extra : moz-landing-system : lando
2019-08-28 13:11:11 +00:00
Dan Minor
a17af56ba5 Bug 1554976 - Add rust mdns library to mtransport; r=ng,dragana
This adds a mdns_service to mtransport to handle responding to mDNS queries.
All hostnames will be generated from UUIDs, so the responder assumes that it
is the only responder for a hostname which is registered with it. Because of
this, the responder does not first make a DNS query itself to see if any other
responder is handling a hostname, and does not wait a random amount of time
before replying, both of which are required by the specification to avoid
collisions with other responders.

Differential Revision: https://phabricator.services.mozilla.com/D38489

--HG--
extra : moz-landing-system : lando
2019-08-28 13:09:59 +00:00
Kershaw Chang
5018d39958 Bug 1571987 - Forward proxy check request to parent process r=dragana,bwc
Differential Revision: https://phabricator.services.mozilla.com/D41004

--HG--
extra : moz-landing-system : lando
2019-08-24 05:37:00 +00:00
Sylvestre Ledru
d264b841c9 Bug 1576502 - Fix some wording issues r=mhoye
Differential Revision: https://phabricator.services.mozilla.com/D43363

--HG--
extra : moz-landing-system : lando
2019-08-27 15:38:58 +00:00
Paul Adenot
c23f8dcae9 Bug 1576168 - Update audio_thread_priority to 0.19.1. r=pehrsons
This changes the hard-limit of `RLIMIT_RTTIME` to be the maximum available
(200ms on my system), and keep the soft limit to the same number.

Having different numbers allow catching SIGXCPU before getting SIGKILL.

Differential Revision: https://phabricator.services.mozilla.com/D43402

--HG--
extra : moz-landing-system : lando
2019-08-27 08:00:36 +00:00
Dan Minor
1555cd2006 Bug 1570548 - Check if mDecoder is null in WebrtcMediaDataDecoder::Release; r=bryce
In InitDecode it is possible for mDecoder to be null if the CreateDecoder call
fails, in which case an error code is returned. Release is called by
GenericDecoder::~VCMGenericDecoder regardless of whether InitDecode succeeds, so
we need to check if mDecoder is null in Release.

Differential Revision: https://phabricator.services.mozilla.com/D43469

--HG--
extra : moz-landing-system : lando
2019-08-26 17:50:46 +00:00
Coroiu Cristina
38d7f20baa Backed out 2 changesets (bug 1576168) for build bustages on a CLOSED TREE
Backed out changeset 3ea6795200b1 (bug 1576168)
Backed out changeset 4e8fc76cd529 (bug 1576168)
2019-08-26 19:46:38 +03:00
Paul Adenot
1029a3ce04 Bug 1576168 - Update audio_thread_priority to 0.19.0. r=pehrsons
This changes the hard-limit of `RLIMIT_RTTIME` to be the maximum available
(200ms on my system), and keep the soft limit to the same number.

Having different numbers allow catching SIGXCPU before getting SIGKILL.

Differential Revision: https://phabricator.services.mozilla.com/D43402

--HG--
extra : moz-landing-system : lando
2019-08-26 14:20:22 +00:00
Dan Minor
7c3097eb13 Bug 1565800 - Use local copy of _captureCapability in OnIncomingFrame; r=jolin
In OnIncomingFrame() we check if the capture has started by calling
CaptureStarted() which holds a lock. If StopCapture() is called on the
control thread after we check CaptureStarted() it is possible that
_captureCapability will be zeroed out prior to frame being delivered because
the lock has been released. This would result in an unknown video type in
CalcBufferSize() and trigger an assertion there. This creates a local copy of
_captureCapability with the lock held to ensure it is not zeroed out when the
frame is delivered.

Differential Revision: https://phabricator.services.mozilla.com/D42338

--HG--
extra : moz-landing-system : lando
2019-08-21 15:52:31 +00:00
Tijl Coosemans
9c3421dfef Bug 1575876 - Drop header unused on FreeBSD that breaks with new libc++. r=bwc
--HG--
extra : histedit_source : ef16b712dcd62120d01b902a5f734a8163c907a3
2019-08-24 01:38:05 +03:00
Matthew Gregan
36165906fe Bug 1575679 - Update libnestegg to pick up PR 65. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D42966

--HG--
extra : moz-landing-system : lando
2019-08-21 21:50:42 +00:00
Ryan Alderete
4b595ec1a8 Bug 1570158 - Add proxy information to candidates table in about:webrtc r=bwc,baku
This adds a field to about:webrtc which indicates whether an associated
candidate is behind a proxy or not.

Differential Revision: https://phabricator.services.mozilla.com/D39974

--HG--
extra : moz-landing-system : lando
2019-08-21 10:04:45 +00:00
Ryan Alderete
dccf61abe4 Bug 1574512 - Fix error handling in nr_ice_set_target_for_default_local_address_lookup() r=bwc
If the remote IP address and port number are unable to be converted to a
transport address, the context was incorrectly left with a pointer to zeroed
out memory, which causes nr_ice_get_default_local_address() to abort.  Freeing
the address and setting the pointer to null on failure should allow the
fallback to be used to retrieve the default local address.

Differential Revision: https://phabricator.services.mozilla.com/D42661

--HG--
extra : moz-landing-system : lando
2019-08-20 15:46:59 +00:00
Alastor Wu
0e392d0f13 Bug 1568101 - part7 : rename 'MediaDataDecoderCodec' to 'MediaDataCodec'. r=jolin
As this class is not only used for creating decoder, also for encoder, it's more proper to rename it as `MediaDataCodec`.

Differential Revision: https://phabricator.services.mozilla.com/D41443

--HG--
rename : media/webrtc/signaling/src/media-conduit/MediaDataDecoderCodec.cpp => media/webrtc/signaling/src/media-conduit/MediaDataCodec.cpp
rename : media/webrtc/signaling/src/media-conduit/MediaDataDecoderCodec.h => media/webrtc/signaling/src/media-conduit/MediaDataCodec.h
extra : moz-landing-system : lando
2019-08-19 08:03:55 +00:00
Alastor Wu
e0241d05dc Bug 1568101 - part6 : set bitrate. r=jolin
Use `BitrateAdjuster` to calculate bitrate and prevent to set bitrate too often, because certain hardware encoders tend to consistently overshoot the bitrate that they are configured to encode at.

Differential Revision: https://phabricator.services.mozilla.com/D40533

--HG--
extra : moz-landing-system : lando
2019-08-19 07:34:08 +00:00
Alastor Wu
9bd4a96457 Bug 1568101 - part5 : implement encoding. r=jolin,jya
In order to encode video frame, we have to convert `webrtc::VideoFrame` to gecko's video data, and then send this YUV-based video data to the encoder.

The encoder won't return an encoded frame everytime when we call its `encode()`, so we have to wait until there are valid samples added to `mEncodedFrames`.

Then, convert the `MediaRawData` to `webrtc::EncodedImage` and provide an NAL entries list to indicate where the NALs are in the encoded bytes stream and how large they are. We would send those data back
to the consumer of the encoder via calling a callback function `OnEncodedImage()`.

Differential Revision: https://phabricator.services.mozilla.com/D40532

--HG--
extra : moz-landing-system : lando
2019-08-20 07:41:33 +00:00
Alastor Wu
86b6cfa0eb Bug 1568101 - part4 : implement a generic refcounting encoder interface. r=jya
`RefCountedWebrtcVideoEncoder` is a generic interface which supports refcounting, using that can ensure the encoder is always alive even if using it in an async task.

So now both `WebrtcGmpVideoEncoder` and `WebrtcMediaDataEncoder` would inherit from `RefCountedWebrtcVideoEncoder`.
We can use `WebrtcVideoEncoderProxy` to wrap them and return `WebrtcVideoEncoderProxy` for the use in the WebRTC pineline.

Differential Revision: https://phabricator.services.mozilla.com/D41855

--HG--
extra : moz-landing-system : lando
2019-08-19 08:03:15 +00:00
Alastor Wu
c636eac2d6 Bug 1568101 - part3 : implement initializing and releasing encoder. r=jolin
In this patch, we implement how to create a platform encoder, init an encoder and release it when we don't need it anymore.

In addition, as the encoder factory only supports h264 for now, so all configuration related to encoder would be h264 specific.

Differential Revision: https://phabricator.services.mozilla.com/D40531

--HG--
extra : moz-landing-system : lando
2019-08-19 07:52:11 +00:00
Alastor Wu
58ec457e76 Bug 1568101 - part2 : use a static pref to control the feature. r=jolin
Use a static pref to control this feature and turn it off by default.

Differential Revision: https://phabricator.services.mozilla.com/D40530

--HG--
extra : moz-landing-system : lando
2019-08-08 23:38:21 +00:00
Alastor Wu
9fd259ee61 Bug 1568101 - part1 : implement a basic interface for WebrtcMediaDataEncoderCodec. r=jolin
Implement a basic interface for `WebrtcMediaDataEncoder`, which will only be used on OSX for encoding h264 only.

Differential Revision: https://phabricator.services.mozilla.com/D40529

--HG--
extra : moz-landing-system : lando
2019-08-09 20:58:06 +00:00
Andreas Pehrson
49244b4fad Bug 1571705 - Clarify mInputStream guarantees in MediaStreamTrack. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D41508

--HG--
extra : moz-landing-system : lando
2019-08-19 19:26:25 +00:00
Paul Adenot
5366291789 Bug 1574914 - Bump audio_thread_priority to 0.18. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D42504

--HG--
extra : moz-landing-system : lando
2019-08-19 13:50:08 +00:00
Simon Sapin
c65755ac41 Bug 1568540 - Update the url crate to 2.0 r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D42364

--HG--
extra : moz-landing-system : lando
2019-08-17 16:26:27 +00:00
Chun-Min Chang
4c2709e357 Bug 1574644 - Update cubeb-coreaudio-rs to version 71faddb. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D42382

--HG--
extra : moz-landing-system : lando
2019-08-16 22:20:30 +00:00
Mike Hommey
c53b03de07 Bug 1572986 - Link libmozavutil against libatomic when needed. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D41483

--HG--
extra : moz-landing-system : lando
2019-08-12 16:47:40 +00:00
Sylvestre Ledru
645f2d5773 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D41559

--HG--
extra : moz-landing-system : lando
2019-08-13 07:15:25 +00:00
Tom Schuster
2c4cb96468 Bug 1558915 - Use infallible nsIURI::SchemeIs everywhere. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D41367

--HG--
extra : moz-landing-system : lando
2019-08-09 15:17:06 +00:00
Andreas Pehrson
50628ddd24 Bug 1570673 - Add an active state to VideoFrameConverter and propagate it from MediaPipeline. r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D40598

--HG--
extra : moz-landing-system : lando
2019-08-05 18:00:48 +00:00
Kershaw Chang
18d3f24206 Bug 1570950 - Make sure the IPC channel is closed before destroying r=jld
The stack from crash report suggests that ChildImpl was deleted at the end of function GetOrCreateSocketActorForCurrentThread(). This only happens when SendInitBackground failed, so we have to close the IPC channel before ChildImpl getting destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D40838

--HG--
extra : moz-landing-system : lando
2019-08-06 21:17:40 +00:00
Nicholas Nethercote
2bdd4bbfd0 Bug 1570212 - Convert media.webrtc.net.force_disable_rtcp_reception to a static pref. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D40154

--HG--
extra : moz-landing-system : lando
2019-08-02 12:33:17 +00:00
Ryan Alderete
41872c8747 Bug 1452713 - Update webRTCIPHandlingPolicy to match Chrome r=bwc,mixedpuppy
Previously, the network.webRTCIPHandlingPolicy "disable_non_proxied_udp" only
enabled the use of WebRTC if a proxy was configured and the WebRTC service
supported TURN TCP.

This aims to match Chrome's behavior by forcing the use of a proxy if one is
configured, otherwise falling back to mode 3 (no host candidates and default
route only).

Also, remove some dead code left over from the old way of routing TURN
communications through an HTTP proxy.

Differential Revision: https://phabricator.services.mozilla.com/D37892

--HG--
extra : moz-landing-system : lando
2019-08-02 21:33:46 +00:00
Chun-Min Chang
817f6f88f6 Bug 1570446 - P2: Update cubeb-coreaudio-rs to version ee0f981. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D39979

--HG--
extra : moz-landing-system : lando
2019-08-02 18:29:37 +00:00
Chun-Min Chang
f29bfc124d Bug 1570446 - P1: Update script importing cubeb-coreaudio-rs to gecko. r=padenot
- Don't import the build settings since the settings in gecko is more
complicated.
- Print out the picked commits when running the scripts

Differential Revision: https://phabricator.services.mozilla.com/D40097

--HG--
extra : moz-landing-system : lando
2019-08-02 18:29:25 +00:00
Paul Adenot
6e399961ed Bug 1570948 - Bump audio_thread_priority to 0.17. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D40410

--HG--
extra : moz-landing-system : lando
2019-08-02 12:44:33 +00:00
Dan Minor
97c5db53eb Bug 1561923 - Remove expired WebRTC telemetry; r=drno,bwc
Differential Revision: https://phabricator.services.mozilla.com/D37757

--HG--
extra : moz-landing-system : lando
2019-07-31 19:57:55 +00:00
Andreas Pehrson
4b3fa9c67e Bug 1493613 - Move MediaStream control from DOMMediaStream to MediaStreamTrack. r=padenot
This is inherently large, because modifying these bits of DOMMediaStream and
MediaStreamTrack affects all consumers and producers of all DOMMediaStreams and
MediaStreamTracks.

Things are generally much simpler now.

Producers of tracks now create a MediaStream in the graph, add it to a
MediaStreamTrackSource subclass that takes ownership of it, and add the source
to a MediaStreamTrack. Should the producer need a DOMMediaStream it is now much
simpler to create as the only thing needed is the current window. The stream is
a rather simple wrapper around an array of MediaStreamTracks.

HTMLMediaElement is still not as straight forward as other consumers since it
consumes the DOMMediaStream directly, as opposed to a set of tracks.
The new MediaStreamRenderer helper class helps bridge the gap between this fact
and the new track-based MediaStreamGraph interface, as it needs to juggle
registering multiple audio tracks for audio output. This hooks into existing
HTMLMediaElement logic and brings a welcome simplification to all the glue
previously needed there.

Differential Revision: https://phabricator.services.mozilla.com/D37934

--HG--
extra : moz-landing-system : lando
2019-07-31 07:58:17 +00:00
Andreas Pehrson
719dfe4ede Bug 1493613 - Update muted state through MediaStreamTrackSource. r=bwc,smaug
This ensures all clones of the original track also receives the new muted state.

Differential Revision: https://phabricator.services.mozilla.com/D37933

--HG--
extra : moz-landing-system : lando
2019-07-31 09:35:06 +00:00
Nicholas Nethercote
cd426e3ad2 Bug 1569526 - Remove return values from Add*VarCache(). r=KrisWright
They're infallible in practice and always `NS_OK`. (This stems from
`AddVarCacheNoAssignment()` always returning `NS_OK`.)

As a result, the commit removes lots of unnecessary checks.

Differential Revision: https://phabricator.services.mozilla.com/D39804

--HG--
extra : moz-landing-system : lando
2019-07-30 06:19:46 +00:00
Matthew Gregan
536af4fbf3 Bug 1569460 - Update AudioIPC to f6f56c43. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D39802

--HG--
extra : moz-landing-system : lando
2019-07-29 23:17:56 +00:00
Andrea Marchesini
cef26c06c6 Bug 1567892 - PeerConnectionMedia should use nsIProtocolProxyService on the parent process - PProxyConfigLookup IPC protocol, r=bwc,kershaw,jld
Differential Revision: https://phabricator.services.mozilla.com/D39010

--HG--
extra : moz-landing-system : lando
2019-07-29 12:27:59 +00:00
Mike Hommey
7acef03e16 Bug 1569331 - Use the more traditional way to override dependencies for coreaudio-sys. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D39579

--HG--
extra : moz-landing-system : lando
2019-07-27 00:35:09 +00:00
Matthew Gregan
e0fdf04539 Bug 1569090 - Update audioipc to 177ebd96. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D39453

--HG--
rename : media/audioipc/audioipc/src/async.rs => media/audioipc/audioipc/src/async_msg.rs
extra : moz-landing-system : lando
2019-07-27 13:14:23 +00:00
Daniel Varga
eadf32a8eb Backed out 2 changesets (bug 1569090) for causing debug SM build fail with error: failed to load source for a dependency on mio-named-pipes. On a CLOSED TREE
Backed out changeset 6aa27e77e38f (bug 1569090)
Backed out changeset 5251efcd4ac1 (bug 1569090)

--HG--
rename : media/audioipc/audioipc/src/async_msg.rs => media/audioipc/audioipc/src/async.rs
rename : third_party/rust/tokio-named-pipes/LICENSE-APACHE => third_party/rust/fs2/LICENSE-APACHE
rename : third_party/rust/memmap-0.6.2/LICENSE-APACHE => third_party/rust/memmap-0.5.2/LICENSE-APACHE
rename : third_party/rust/tokio-named-pipes/LICENSE-MIT => third_party/rust/memmap-0.5.2/LICENSE-MIT
rename : third_party/rust/memmap-0.6.2/ci/install.sh => third_party/rust/memmap-0.5.2/ci/install.sh
2019-07-27 12:58:34 +03:00
Matthew Gregan
ae4794f5de Bug 1569090 - Update audioipc to 177ebd96. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D39453

--HG--
rename : media/audioipc/audioipc/src/async.rs => media/audioipc/audioipc/src/async_msg.rs
extra : moz-landing-system : lando
2019-07-26 16:51:29 +00:00
Jean-Yves Avenard
577b826128 Bug 1543359 - P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow
When unknown, we rely on the picture height and assume that anything less than 720p is 601 and 709 otherwise. It's not perfect but it's the best we can do.

Differential Revision: https://phabricator.services.mozilla.com/D39275

--HG--
extra : moz-landing-system : lando
2019-07-26 08:45:39 +00:00
Narcis Beleuzu
e84980d8b1 Backed out 15 changesets (bug 1543359) for wrench bustages on image.rs . CLOSED TREE
Backed out changeset 548006270186 (bug 1543359)
Backed out changeset c9585e9d9f3c (bug 1543359)
Backed out changeset 1c7ca95a2a9b (bug 1543359)
Backed out changeset d742d80b892f (bug 1543359)
Backed out changeset 210eee703fd9 (bug 1543359)
Backed out changeset 4eb933d55d88 (bug 1543359)
Backed out changeset fb9b71ed9f4b (bug 1543359)
Backed out changeset 98b968443458 (bug 1543359)
Backed out changeset a85bd4691bea (bug 1543359)
Backed out changeset b576317853e9 (bug 1543359)
Backed out changeset 095bca5c9b1a (bug 1543359)
Backed out changeset 48eb0ebf9f2e (bug 1543359)
Backed out changeset b22b0eb708b8 (bug 1543359)
Backed out changeset 52187d9320b1 (bug 1543359)
Backed out changeset fa6792c1c2e8 (bug 1543359)
2019-07-26 11:40:33 +03:00
Jean-Yves Avenard
d6adb6b604 Bug 1543359 - P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow
When unknown, we rely on the picture height and assume that anything less than 720p is 601 and 709 otherwise. It's not perfect but it's the best we can do.

Differential Revision: https://phabricator.services.mozilla.com/D39275

--HG--
extra : moz-landing-system : lando
2019-07-26 06:14:30 +00:00
Cosmin Sabou
ae7e8fbf55 Backed out 14 changesets (bug 1543359) for causing build bustages. CLOSED TREE
Backed out changeset 87c99ef85813 (bug 1543359)
Backed out changeset cd0afc5758ba (bug 1543359)
Backed out changeset 101ac87ff017 (bug 1543359)
Backed out changeset 348e748e3451 (bug 1543359)
Backed out changeset d9e937f5caf4 (bug 1543359)
Backed out changeset 2f4eb6501552 (bug 1543359)
Backed out changeset 0d316ef8c668 (bug 1543359)
Backed out changeset bf238b58c694 (bug 1543359)
Backed out changeset 496f206d03d6 (bug 1543359)
Backed out changeset 7c3a1f23baa8 (bug 1543359)
Backed out changeset 90fff717198b (bug 1543359)
Backed out changeset b2ce591ca398 (bug 1543359)
Backed out changeset a63968f077e3 (bug 1543359)
Backed out changeset ca660ab1e0c1 (bug 1543359)
2019-07-26 07:39:11 +03:00
Jean-Yves Avenard
84900ae6ff Bug 1543359 - P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow
When unknown, we rely on the picture height and assume that anything less than 720p is 601 and 709 otherwise. It's not perfect but it's the best we can do.

Differential Revision: https://phabricator.services.mozilla.com/D39275

--HG--
extra : moz-landing-system : lando
2019-07-26 04:26:56 +00:00
Mike Hommey
2919ab6ba3 Bug 1569003 - Disable bindgen when building coreaudio-sys. r=nalexander
This is the most immediate solution to the problem. This is how
automation ends up building things because it's cross-compiling and
cross-compiling falls back to the code path of that feature, and this
solves the immediate problem of builds not working out of the box.

The more long term fix would be to fix the coreaudio-sys crate to do the
right thing.

Differential Revision: https://phabricator.services.mozilla.com/D39447

--HG--
extra : moz-landing-system : lando
2019-07-26 03:54:13 +00:00
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Ryan Alderete
992406dcb2 Bug 1506219 - Use a known remote for applications loaded from file:// URIs r=bwc
Fall back to using Google's DNS server to determine the associated local
addresses for web applications that are not loaded over the network.  This
includes the loopback address, which is frequently used in the unit tests.

Provide a separate function for setting the target for the default local
address lookup.

Differential Revision: https://phabricator.services.mozilla.com/D37331

--HG--
extra : moz-landing-system : lando
2019-07-24 21:58:33 +00:00
Ryan Alderete
cd13ca2e02 Bug 1506219 - Update default route according to latest IETF draft r=bwc
draft-ietf-rtcweb-ip-handling specifies that the default route is the route
used to reach the origin rather than the one used to reach the internet, so
update the IP routing to reflect this.  This addresses issues in which the
wrong IP address is used on machines with multiple network interfaces.

Differential Revision: https://phabricator.services.mozilla.com/D36831

--HG--
extra : moz-landing-system : lando
2019-07-24 19:50:46 +00:00
Andreea Pavel
14071390d5 Backed out 2 changesets (bug 1567892) for build bustages on a CLOSED TREE
Backed out changeset edcdfaa8a2b1 (bug 1567892)
Backed out changeset 3aef1ee02e9b (bug 1567892)
2019-07-25 08:26:29 +03:00
Andrea Marchesini
00f3ae963f Bug 1567892 - PeerConnectionMedia should use nsIProtocolProxyService on the parent process - part 2 - PProxyConfigLookup IPC protocol, r=bwc,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D39010

--HG--
extra : moz-landing-system : lando
2019-07-25 04:51:00 +00:00
Mike Hommey
baf04d4ceb Bug 1567739 - Stop using deprecated rust libc integer types in rsdparsa_capi. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D38939

--HG--
extra : moz-landing-system : lando
2019-07-24 22:15:55 +00:00
Alex Chronopoulos
f8e782919a Bug 1568515 - Import dav1d from upstream to c138435. r=TD-Linux
Differential Revision: https://phabricator.services.mozilla.com/D39184

--HG--
extra : moz-landing-system : lando
2019-07-24 17:03:48 +00:00
Nico Grunbaum
a28afec671 Bug 1566701 - P4 - Adapting the glue code to the new address types - r=drno
Differential Revision: https://phabricator.services.mozilla.com/D38567

--HG--
extra : moz-landing-system : lando
2019-07-23 21:55:24 +00:00
Nico Grunbaum
5a20a4a360 Bug 1566701 - P3 - Update rsdparsa_capi to support FQDNs - r=drno
Differential Revision: https://phabricator.services.mozilla.com/D38566

--HG--
extra : moz-landing-system : lando
2019-07-23 21:55:21 +00:00
Nico Grunbaum
d6d546de5b Bug 1566701 - P1 - Update rsdparsa to HEAD of mozilla/rsdparsa with FQDN support - r=drno
Differential Revision: https://phabricator.services.mozilla.com/D38564

--HG--
extra : moz-landing-system : lando
2019-07-23 21:55:13 +00:00
Bogdan Tara
e50924670e Backed out 2 changesets (bug 1567892) for build bustages complaining about PNecko.ipdl CLOSED TREE
Backed out changeset 18a1d7fe61e0 (bug 1567892)
Backed out changeset b1b922fe6c11 (bug 1567892)
2019-07-24 18:59:39 +03:00
Andrea Marchesini
9876c2f82a Bug 1567892 - PeerConnectionMedia should use nsIProtocolProxyService on the parent process - part 2 - PProxyConfigLookup IPC protocol, r=bwc,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D39010

--HG--
extra : moz-landing-system : lando
2019-07-24 15:28:56 +00:00
Brindusan Cristian
b55b8731f2 Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-07-24 06:58:05 +03:00
Matthew Gregan
cbbdf7fcb4 Bug 1539225 - Update AudioIPC to pick up backend selection & context name support. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D38957

--HG--
extra : moz-landing-system : lando
2019-07-23 19:34:52 +00:00
Noemi Erli
66f9d4def3 Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-07-23 19:02:55 +03:00
David Major
0cf4cb8bae Bug 1489081 followup: remove the now-outdated comment. DONTBUILD 2019-07-23 09:12:57 -04:00
Nils Ohlmeier [:drno]
bb245ddcf0 Bug 1480088: Added length check for uplfec. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D38786

--HG--
extra : moz-landing-system : lando
2019-07-22 10:31:55 +00:00
Paul Adenot
86d1623bc3 Bug 1567457 - Update cubeb-pulse-rs to version ee6666. r=kinetik
Reviewed upstream by :achronop, :kinetik, :chunmin in:
https://github.com/djg/cubeb-pulse-rs/pull/41
https://github.com/djg/cubeb-pulse-rs/pull/42
https://github.com/djg/cubeb-pulse-rs/pull/43
https://github.com/djg/cubeb-pulse-rs/pull/44
https://github.com/djg/cubeb-pulse-rs/pull/45

Differential Revision: https://phabricator.services.mozilla.com/D38661

--HG--
extra : moz-landing-system : lando
2019-07-23 12:03:23 +00:00
Ciure Andrei
24c0d0e47d Backed out 2 changesets (bug 1506219) for causing test_presentation_datachannel_sessiontransport.html to perma fail CLOSED TREE
Backed out changeset 7e39db6e12a5 (bug 1506219)
Backed out changeset ab31fbc14a00 (bug 1506219)
2019-07-22 23:54:45 +03:00
Kershaw Chang
e2c104ab0a Bug 1566033 - Modernize ExportDEREncryptedPrivateKeyInfo and ImportDEREncryptedPrivateKeyInfo r=keeler,bwc
Differential Revision: https://phabricator.services.mozilla.com/D38374

--HG--
extra : moz-landing-system : lando
2019-07-22 17:56:48 +00:00
Ryan Alderete
14e5b45ecc Bug 1506219 - Use a known remote for applications loaded from file:// URIs r=bwc
Fall back to using Google's DNS server to determine the associated local
addresses for web applications that are not loaded over the network.  This
includes the loopback address, which is frequently used in the unit tests.

Provide a separate function for setting the target for the default local
address lookup.

Differential Revision: https://phabricator.services.mozilla.com/D37331

--HG--
extra : moz-landing-system : lando
2019-07-22 15:42:06 +00:00
Ryan Alderete
35bd2662ca Bug 1506219 - Update default route according to latest IETF draft r=bwc
draft-ietf-rtcweb-ip-handling specifies that the default route is the route
used to reach the origin rather than the one used to reach the internet, so
update the IP routing to reflect this.  This addresses issues in which the
wrong IP address is used on machines with multiple network interfaces.

Differential Revision: https://phabricator.services.mozilla.com/D36831

--HG--
extra : moz-landing-system : lando
2019-07-22 15:43:12 +00:00
Jean-Yves Avenard
760c5da868 Bug 1489081 - Remove no longer necessary files. r=bryce
With the move to clang-cl as default compiler on Windows, those are no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D5128

--HG--
extra : moz-landing-system : lando
2019-07-22 07:47:20 +00:00
Paul Adenot
b2b7b7837d Bug 1567480 - Update libcubeb to 0b5b52d. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D38674

--HG--
extra : moz-landing-system : lando
2019-07-19 22:56:19 +00:00
Gurzau Raul
8517586551 Backed out 2 changesets (bug 1567457) for failures at test_getUserMedia_basicAudio_loopback.html on a CLOSED TREE.
Backed out changeset ce5d76c8be1b (bug 1567457)
Backed out changeset 35503df3d3e8 (bug 1567457)
2019-07-19 18:24:05 +03:00
Paul Adenot
be57df7942 Bug 1567457 - Update cubeb-pulse-rs to version 3a748a2. r=kinetik
Reviewed upstream by :achronop, :kinetik, :chunmin in:
https://github.com/djg/cubeb-pulse-rs/pull/41
https://github.com/djg/cubeb-pulse-rs/pull/42

Differential Revision: https://phabricator.services.mozilla.com/D38661

--HG--
extra : moz-landing-system : lando
2019-07-19 13:36:44 +00:00
Narcis Beleuzu
97bc08cce4 Backed out changeset 280e421685cb (bug 1563877) for bustages on context.rs 2019-07-19 07:35:46 +03:00
Matthew Gregan
64d7b75837 Bug 1567359 - Update mp4parse-rust to 201556d3. r=me
--HG--
extra : rebase_source : 16cd0f21753c9c5122ba43868053df18caa41247
2019-07-19 14:32:44 +12:00
Matthew Gregan
a7822d4034 Bug 1563877 - Update cubeb-pulse-rs to 9d1c1292. r=me
--HG--
extra : rebase_source : 397a6c2acafde671d1628c24a4ca626110be90df
2019-07-19 14:08:53 +12:00
Chun-Min Chang
ec036851de Bug 1530715 - P42: Remove unnecessary mutex. r=padenot
There are three potential data-race operations that may run at the same
time:
1. Data callback and stream reinitialization
2. Data callback and stream destroying
3. Stream reinitialization and stream destroying

The case 1 and 2 won't happen as long as the AudioOutputUnitStop is
called at the beginning of stream reinitialization and stream
destorying. The AudioOutputUnitStop requires to lock a mutex inside
CoreAudio framework that is also used by the data callback. Thus, if
there is a running callback, which holds the mutex inside CoreAudio
framework, when AudioOutputUnitStop is called, then the calling will
block the current thread until the data callback ends since it is
waiting for the mutex. By calling AudioOutputUnitStop at the beginning
of the stream reinitialization and stream destroying, the data race of
case 1 and 2 can be avoided.

On the other hand, the case 3 won't happen since the stream
initialization and destroying is run on the same task queue. The two
tasks on the same serial task queue are impossible to be run at the same
time. The mutex in AudioUnitStream is unnecessary because it's used for
the case 3.

Differential Revision: https://phabricator.services.mozilla.com/D34076

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:56 +00:00
Chun-Min Chang
c4f1202ebd Bug 1530715 - P41: Remove OwnedCriticalSection in cubeb stream. r=padenot
The custom mutex, OwnedCriticalSection, in the current code comes with
the C-to-Rust translation work of cubeb_audiouniut.cpp. Its design is in
C style and not fitted well in the Rust. Rust has a better mutex design.

In the previous patches, all the data that may be touched on the
different threads are moved into a struct wrapped by a Rust mutex. Those
data will be touched in the critical sections created by the Rust mutex.
Therefore, this custom mutex becomes redundant. It's time to say goodbye
to it.

Differential Revision: https://phabricator.services.mozilla.com/D34074

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:58 +00:00
Chun-Min Chang
2c4a12e3b6 Bug 1530715 - P40: Move stream setup and close into a struct within a mutex. r=padenot
The core stream data that will be touched on the different threads when
the stream is created, reinitialized, destoryed should be used in the
critical section. Those core data are initialized in stream-setup and
destroyed in stream-close. The stream-setup and stream-close is run in
the critical section so they won't be executed at the same time.
Currently, the critical section is created by our custom mutex. However,
this custom mutex will be removed in the later mutex replacement.

Instead of running these two operations in the critical sections created
by the custom mutex, they should be moved into a struct wrapped by a
standard Rust mutex. As a result, at the end when the custom mutex is
removed, these two operations are still in the critical sections that
are created by the Rust mutex.

Differential Revision: https://phabricator.services.mozilla.com/D34073

--HG--
extra : moz-landing-system : lando
2019-07-10 08:07:00 +00:00
Chun-Min Chang
05ca07cf2a Bug 1530715 - P39: Move listeners (un)registrations into a strcut within a mutex. r=padenot
The listeners will be registered and unregistered on the different threads,
so the listeners should be used in the critical sections. We do create
critical sections by our own mutex. However, this custom mutex will be
gradually replaced by the standard Rust mutex in the following patches.

To replace the custom mutex, we put the listeners to the struct wrapped
by a Rust mutex and register or unregister the listeners in the critical
section created by this struct. At the end when the custom mutex is
removed, those operations are still in the critical sections.

Differential Revision: https://phabricator.services.mozilla.com/D34072

--HG--
extra : moz-landing-system : lando
2019-07-10 08:07:02 +00:00
Chun-Min Chang
36d0185bd8 Bug 1530715 - P38: Merge configure_input into setup. r=padenot
Calling configure_input requires borrowing AudioUnitStream as a
mutable. Merging configure_input into setup will help to avoid a
potential borrowing-twice issue in the later mutex replacement. There
will be a critical section created by a Rust mutex in the setup, which
will borrow the AudioUnitStream as an immutable.

Differential Revision: https://phabricator.services.mozilla.com/D34071

--HG--
extra : moz-landing-system : lando
2019-07-10 08:07:04 +00:00
Chun-Min Chang
49581ca4dc Bug 1530715 - P37: Merge configure_output into setup. r=padenot
Calling configure_output requires borrowing AudioUnitStream as a
mutable. Merging configure_output into setup will help to avoid a
potential borrowing-twice issue in the later mutex replacement. There
will be a critical section created by a Rust mutex in the setup, which
will borrow the AudioUnitStream as an immutable.

Differential Revision: https://phabricator.services.mozilla.com/D34070

--HG--
extra : moz-landing-system : lando
2019-07-10 08:07:06 +00:00
Chun-Min Chang
c02d11403d Bug 1530715 - P36: Move out minimum_resampling_input_frames of output callback. r=padenot
Avoid calling minimum_resampling_input_frames by a borrowing from
AudioUnitStream

Differential Revision: https://phabricator.services.mozilla.com/D34069

--HG--
extra : moz-landing-system : lando
2019-07-10 08:07:08 +00:00
Chun-Min Chang
4f393e66ea Bug 1530715 - P35: Store layout in the stream instead of context. r=padenot
We store global layout info and channels info in the cubeb context.
However, the streams might output to different devices. We should store
the layout info of the output device in the stream directly instead of
in the context. On the other hand, the `channels` value is a duplicate
of `output_desc.mChannelsPerFrame` or `mixer.out_channels` so we don't
need to store this value.

Differential Revision: https://phabricator.services.mozilla.com/D34068

--HG--
extra : moz-landing-system : lando
2019-07-10 08:07:10 +00:00
Chun-Min Chang
6c5d3ff715 Bug 1530715 - P34: Merge layout_init into configure_output. r=padenot
1. Avoid calling layout_init by wrong AudioUnit value

2. Avoid calling layout getting/setting APIs by borrowing the
AudioUnitStream as a mutable. It will help to avoid the potential
borrowing-twice issues in the later mutex replacement.

Differential Revision: https://phabricator.services.mozilla.com/D34067

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:35 +00:00
Chun-Min Chang
93932acf07 Bug 1530715 - P33: Register and unregister the device-changed callbacks when stream setup and close. r=padenot
1. The code readability is slightly better if we can register and
unregister the callbacks in the same places. The device-chaned callbacks
are registered when stream setup and unregistered when stream close.

2. In the later mutex replacement, the core stream variables that may be
touched by different threads when reinitializing or destroying the
stream, including {in, out}_unit, will be wrapped in a Rust mutex.
Moving these callbacks (un)registration into the same places makes it
easier to find where the critical sections are.

Differential Revision: https://phabricator.services.mozilla.com/D34066

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:37 +00:00
Chun-Min Chang
56e7631637 Bug 1530715 - P32: Close the stream if failing in stream reinitialization. r=padenot
Before reporting the error by the state callback, closing the stream to
make sure the data callback and device-changed callback are
unregistered.

Differential Revision: https://phabricator.services.mozilla.com/D34065

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:39 +00:00
Chun-Min Chang
f06595279a Bug 1530715 - P31: Merge render_input into audiounit_input_callback. r=padenot
1. If AudioUnitRender return kAudioUnitErr_CannotDoInCurrentContext
within a input-only stream, the input-only stream will keep feed silence
data into the buffer instead of reporting the error. With this change,
the error will be rendered as the returned value of the data callback to
the underlying CoreAudio framework.

2. By merging the render_input into audiounit_input_callback and adjust
the timing to call reinit_async, now the reinit_async is called at the
line that is out of the main logic for feeding buffer data. In the scope
of the main logic, there will be a critical section created by locking a
Rust mutex within AudioUnitStream in the later mutex replacement.
Without moving the reinit_async, which borrows AudioUnitStream as a
mutable, out of the critical section, there will be a borrowing-twice
issue.

Differential Revision: https://phabricator.services.mozilla.com/D34064

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:41 +00:00
Chun-Min Chang
7a27f19d14 Bug 1530715 - P30: Some clean-up in audiounit_output_callback. r=padenot
- Remove unnecessary mutabilities
- Remove duplicate API calls

Differential Revision: https://phabricator.services.mozilla.com/D34063

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:43 +00:00
Chun-Min Chang
d637d53858 Bug 1530715 - P29: Move mixer to a struct within a mutex. r=padenot
The mixer of the stream will be created, reinitialized, used or
destroyed on different threads, so its operations should be in the
critical sections. We do create critical sections by our custom mutex.
However, this custom mutex will be gradually replaced by the standard
Rust mutex in the following patches.

To replace the custom mutex, we put the mixer to the struct wrapped by a
Rust mutex and do all the mixer operations in the critical section
created by this struct. At the end when the custom mutex is removed,
those operations are still in critical sections.

Calling notify_state_changed needs to borrow AudioUnitStream as a
mutuable. To avoid the borrowing-twice issue, the notify_state_changed
calling is moved out the scope of the critical section created in the
output data callback.

Differential Revision: https://phabricator.services.mozilla.com/D34062

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:45 +00:00
Chun-Min Chang
7efd386b4d Bug 1530715 - P28: Create a Mixer module. r=padenot
Using an Mixer struct to operate all the mixing APIs is a way to make
the code clearer. In addition, we can avoid calling mix function by
borrowing the AudioUnitStream as a mutable. It will help to avoid
potential borrowing-twice issues in the later mutex replacement.

Differential Revision: https://phabricator.services.mozilla.com/D34061

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:47 +00:00
Chun-Min Chang
2ac1419990 Bug 1530715 - P27: Move resampler to a struct within a mutex. r=padenot
The resampler of the stream will be created, reinitialized, used or
destroyed on different threads, so its operations should be in the
critical sections. We do create critical sections by our custom mutex.
However, this custom mutex will be gradually replaced by the standard
mutex in the following patches. To replace the custom mutex, we put the
resampler to the struct wrapped by a Rust mutex and do all the resampler
operations in the critical section created by this struct. At the end
when the custom mutex is removed, those operations are still in critical
sections.

Differential Revision: https://phabricator.services.mozilla.com/D34060

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:48 +00:00
Chun-Min Chang
e8c9106144 Bug 1530715 - P26: Create a Resampler module. r=padenot
Using a resample struct to operate all its related operations will make
the code clearer.

Differential Revision: https://phabricator.services.mozilla.com/D34059

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:50 +00:00
Chun-Min Chang
43dfd443a9 Bug 1530715 - P25: Move aggregate_device to a struct within a mutex. r=padenot
The aggregate device of the stream may be created, reinitialized, or
destroyed on different threads, so its operations should be in the
critical sections. We do create critical sections by our custom mutex.
However, this custom mutex will be gradually replaced by the standard
Rust mutex in the following patches.

To replace the custom mutex, we create a struct wrapped by a Rust mutex
and create critical sections by this Rust mutex to do operations for
aggregate-device settings. At the end, not only aggregate-device
calls, but also other operations that needs to be locked will be
operated in the critical section created by this struct.

This is the beginning patch to replace the custom mutex in
AudioUnitStream.

Differential Revision: https://phabricator.services.mozilla.com/D34058

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:52 +00:00
Chun-Min Chang
3aa1456189 Bug 1530715 - P24: Create an AggregateDevice module. r=padenot
Using an aggregate-device struct to operate all the settings for the
aggregate device is a way to make the code clearer. In addition, we can
avoid calling some aggregate-device APIs by borrowing the
AudioUnitStream as a mutable. It will help to avoid potential
borrowing-twice issues in the later mutex replacement.

Differential Revision: https://phabricator.services.mozilla.com/D34057

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:54 +00:00
Chun-Min Chang
4c2db1a9e9 Bug 1530715 - P23: Avoid poisoning the mutex for device_changed_callback. r=padenot
The mutex is considered poisoned whenever a thread panics while holding
the mutex. Registering a second device changed callback without unregistering
the original callback makes the thread panics while holding the mutex
for the device_changed_callback. This mutex will be used when device
property changed callback. If the mutex is poisoned then a device
property is changed, we will get another panic when firing the callback
because of using a poisoned mutex.

Differential Revision: https://phabricator.services.mozilla.com/D34056

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:14 +00:00
Chun-Min Chang
c53fb628bb Bug 1530715 - P22: Replace device_changed_callback_lock by standard Rust mutex. r=padenot
The registration, unregistration, and notification for the device
property changed is done in a critical section created by locking our
own custom mutex. To replace our own custom mutex by standard Rust
mutex, the critical section should be created by locking a standard Rust
mutex. This can be done by simply merging device_changed_callback and
device_changed_callback_lock into a Rust mutex variable.

Differential Revision: https://phabricator.services.mozilla.com/D34055

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:16 +00:00
Chun-Min Chang
74e3dce58a Bug 1530715 - P21: Replace set_buffer_size by set_buffer_size_sync and its friends. r=padenot
By moving out this API from the AudioUnitStream, we can avoid calling
it by borrowing the AudioUnitStream variable as a mutable. This will
help to avoid the potential borrowing-twice issues in the later mutex
replacement

In addition, the change applies an idiomatic way to wait for the system
callback event without consuming CPU time.

Differential Revision: https://phabricator.services.mozilla.com/D34054

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:18 +00:00
Chun-Min Chang
1edd33e172 Bug 1530715 - P20: Replace init_input_linear_buffer by create_auto_array. r=padenot
This change provides two benefits:

1. Setting variable by the Result value directly is rustier than setting
the variable by a mutual reference with a dummy Result that only
contains an error.

2. By moving out this API from the AudioUnitStream, we can avoid calling
it by borrowing the AudioUnitStream variable as a mutable. This will
help to avoid the potential borrowing-twice issues in the later mutex
replacement.

Differential Revision: https://phabricator.services.mozilla.com/D34053

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:20 +00:00
Chun-Min Chang
9e1bc8c79c Bug 1530715 - P19: Replace audio_stream_desc_init by create_stream_description. r=padenot
Setting variable by the Result value directly is rustier than setting
the variable by a mutual reference with a dummy Result that only
contains an error.

Differential Revision: https://phabricator.services.mozilla.com/D34052

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:22 +00:00
Chun-Min Chang
8c75b216bd Bug 1530715 - P18: Replace audiounit_create_unit by create_audiounit and its friends. r=padenot
Setting variable by the Result value directly is rustier than setting
the variable by a mutual reference with a dummy Result that only
contains an error.

Differential Revision: https://phabricator.services.mozilla.com/D34051

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:23 +00:00
Chun-Min Chang
907cf01736 Bug 1530715 - P17: Move get_volume out of AudioUnitStream. r=padenot
By moving get_volume out of AudioUnitStream, we can avoid unnecessary
borrowing from the AudioUnitStream variable. This change will make the
get_volume become symmetric to the set_volume.

Differential Revision: https://phabricator.services.mozilla.com/D34050

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:25 +00:00
Chun-Min Chang
bd24fd4b75 Bug 1530715 - P16: Implement an internal set_volume API. r=padenot
By narrowing down the parameters that set_volume API needs, we can avoid
the unnecessary mutual borrowing from the AudioUnitStream variable. This
will help to avoid potential borrowing-twice issues in the later mutex
replacement.

Differential Revision: https://phabricator.services.mozilla.com/D34049

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:27 +00:00
Chun-Min Chang
37853f682b Bug 1530715 - P15: Replace set_device_info by create_device_info. r=padenot
Setting variable by the Result value directly is rustier than setting
the variable by a mutual reference with a dummy Result that only
contains the error.

Differential Revision: https://phabricator.services.mozilla.com/D34048

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:29 +00:00
Chun-Min Chang
b2fb383839 Bug 1530715 - P14: Wrap state-callback code into a function. r=padenot
The code will be clearer if we can wrap the state-callback that notify
the state changed into a function. It will hide some details about
rendering the callback to C interface.

Differential Revision: https://phabricator.services.mozilla.com/D34047

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:31 +00:00
Chun-Min Chang
c11a02e48f Bug 1530715 - P13: Remove unnecessary parameter in reinit. r=padenot
When the stream is re-initialized, the input unit and/or output unit
should be reset if they are currently used, no matter what scope (input
or output or in-output) the parameter requests.

Differential Revision: https://phabricator.services.mozilla.com/D34046

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:33 +00:00
Chun-Min Chang
7d493b1809 Bug 1530715 - P12: Remove the unused variable in AudioUnitStream. r=padenot
Removing expected_output_callbacks_in_a_row since it is not being used.

Differential Revision: https://phabricator.services.mozilla.com/D34045

--HG--
extra : moz-landing-system : lando
2019-07-10 08:05:55 +00:00
Chun-Min Chang
05f6e81727 Bug 1530715 - P11: Remove OwnedCriticalSection in cubeb context. r=padenot
The OwnedCriticalSection is a custom mutex directly translated from the
C code of the Cubeb library. Replacing the custom mutex by standard Rust
mutex make the code fit in the Rust design better and make debugging the
code easier. The variables protected by the custom mutex in the cubeb
context is moved to the Rust standard mutex in previous patches. The
custom mutex in the cubeb context is able to be removed since we no
longer rely on it.

Differential Revision: https://phabricator.services.mozilla.com/D29983

--HG--
extra : moz-landing-system : lando
2019-07-10 08:05:57 +00:00
Chun-Min Chang
1fe7bb3763 Bug 1530715 - P10: Avoid poisoning the mutex for device-collection-changed. r=padenot
The mutex is considered poisoned whenever a thread panics while holding
the mutex. Registering a second device-collection-changed callback
without unregistering the original callback makes the thread panics while
holding the mutex for the device-collection-changed variables. This
mutex will be used when the cubeb context is dropped. If the mutex is
poisoned, we will get another panic when dropping the cubeb context
because of using a poisoned mutex.

Differential Revision: https://phabricator.services.mozilla.com/D29982

--HG--
extra : moz-landing-system : lando
2019-07-10 08:05:59 +00:00
Chun-Min Chang
26cd170591 Bug 1530715 - P9: Move device-collection-changed variables to a struct within a mutex. r=padenot
The registration, unregistration, and notification for the device
collection changed is done in a critical section created by locking our
own custom mutex. To replace our own custom mutex by standard Rust
mutex, the critical section should be created by locking a standard Rust
mutex. This can be done by simply putting those varaibles for
device-collection-changed to a struct within a Rust mutex.

Differential Revision: https://phabricator.services.mozilla.com/D29981

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:00 +00:00
Chun-Min Chang
b5c9d13587 Bug 1530715 - P8: Always use global latency frames to initialize the cubeb stream. r=padenot
The global latency frames in the cubeb context is the latency frames of
the first cubeb stream created in that cubeb context. The reason is
because latency frames cannot be changed when there is an active stream
operating in parallel. To make sure the latency won't be changed, the
latency frames of the streams after the first stream will be overwritten
by the global latency frames. Since we always use the global latency
frames, instead of overwritting latency frames of the later streams, we
could, we could simply initialize all the streams with the global
latency frames.

Differential Revision: https://phabricator.services.mozilla.com/D29980

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:02 +00:00
Chun-Min Chang
8fb9376269 Bug 1530715 - P7: Move active_streams to a struct within a mutex. r=padenot
The counting of the active streams in a cubeb context is calculated in a
critical section created by locking our own custom mutex. To replace our
own mutex by standard Rust mutex, the critical section calculating the
active streams should be created by locking a standard Rust mutex. This
can be done by simply putting the active_streams to a struct with a Rust
mutex.

Differential Revision: https://phabricator.services.mozilla.com/D29979

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:04 +00:00
Chun-Min Chang
9099a8f1b1 Bug 1530715 - P6: Fully initialize the aggregate device before using it. r=padenot
In the current implementation, we assume the aggregate device is created
immediately after calling the system API to create it, and we also
assume the sub-devices of the aggregate device are added immediately
upon we call the system API to set the sub-devices. Unfortunately, these
assumptions are not correct. Occasionally these settings are not
executed immediately, especially when they are not called on the main
thread (e.g., we may create an aggregate device off the main thread when
switching devices). Using the listeners monitoring the devices-changed
events can make sure those settings are done.

Differential Revision: https://phabricator.services.mozilla.com/D29978

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:08 +00:00
Chun-Min Chang
f608e7a6f9 Bug 1530715 - P5: Remove the unused code when clamping latency frames. r=padenot
The clamp_latency function is only called when the cubeb context has one
stream only. In that case, clamp_latency will clamp the stream latency
frames in a safe range and then return the clamped value directly. The
code in clamp_latency for more than one streams doesn't be executed
since clamp_latency isn't called when there are more than one streams
within cubeb context. It's easier to read the code if the unused code is
removed.

Differential Revision: https://phabricator.services.mozilla.com/D29011

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:06 +00:00
Chun-Min Chang
0561641171 Bug 1530715 - P3: Build cubeb-coreaudio-rs in libcubeb. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D23432

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:12 +00:00
Chun-Min Chang
f6d72027f3 Bug 1530715 - P2: Import oxidized cubeb_audiounit.cpp. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D23431

--HG--
extra : moz-landing-system : lando
2019-07-17 04:48:25 +00:00
Chun-Min Chang
487c109761 Bug 1530715 - P1: Create an empty cubeb-coreaudio-rs crate in libcubeb. r=kinetik
To import cubeb-coreaudio-rs crate later, creating a dummy folder in
advance in libcubeb. It should be the mirrow of cubeb-coreaudio-rs crate
on github. The information of cubeb-coreaudio-rs is in README_MOZILLA.

Differential Revision: https://phabricator.services.mozilla.com/D23429

--HG--
extra : moz-landing-system : lando
2019-07-10 08:05:53 +00:00
Christian Holler
8cfda79e0d Bug 1465407 - Add media fuzzing targets. r=jya
Depends on D35776

Differential Revision: https://phabricator.services.mozilla.com/D35777

--HG--
extra : moz-landing-system : lando
2019-07-16 14:50:17 +00:00
Christian Holler
af96b9bfe5 Bug 1561256 - Disable CRC checks in ogg framing for FUZZING. r=drno
Depends on D35775

Differential Revision: https://phabricator.services.mozilla.com/D35776

--HG--
extra : moz-landing-system : lando
2019-07-02 02:23:30 +00:00
Sylvestre Ledru
e77bfc655d Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D38057

--HG--
extra : moz-landing-system : lando
2019-07-16 07:33:44 +00:00
Ryan Alderete
790ab483b4 Bug 1520550 - Remove TCP/TLS/RTP/SAVPF from Rust parser r=mjf
This makes the Rust parser's C API consistent with the changes made to sipcc
(i.e., the removal of unregistered transport types).

Differential Revision: https://phabricator.services.mozilla.com/D36203

--HG--
extra : moz-landing-system : lando
2019-07-09 20:55:06 +00:00
Ryan Alderete
4abe2056e8 Bug 1520550 - Remove TCP/TLS/RTP/SAVP and TCP/TLS/RTP/SAVPF from name array r=mjf
The array of transport names is defined in terms of the enum for SDP transport
types, so ensure that the two are consistent.

Differential Revision: https://phabricator.services.mozilla.com/D36043

--HG--
extra : moz-landing-system : lando
2019-07-08 22:19:44 +00:00
Ryan Alderete
8c93dec687 Bug 1520550 - Remove TCP/TLS/RTP/SAVP and TCP/TLS/RTP/SAVPF from SDP parsing r=mjf
TCP/TLS/RTP/SAVP and TCP/TLS/RTP/SAVPF were never registered with IANA and were
not used by Firefox, so remove them.  In the unit tests, replace them with the
registered TCP/DTLS/RTP/SAVPF string.

Differential Revision: https://phabricator.services.mozilla.com/D35836

--HG--
extra : moz-landing-system : lando
2019-07-08 22:19:35 +00:00
Byron Campen [:bwc]
6480f0a928 Bug 1560636: Avoid using main thread with PMediaTransport. r=mjf,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D36818

--HG--
extra : moz-landing-system : lando
2019-07-15 15:49:30 +00:00
Eric Rahm
32038ccad0 Bug 1564647 - Fix sdp ... range patterns are deprecated errors. r!drno r=drno,ng
Differential Revision: https://phabricator.services.mozilla.com/D37510

--HG--
extra : moz-landing-system : lando
2019-07-10 23:03:31 +00:00
Eric Rahm
538ccdbc0e Bug 1564643 - Update to latest mp4parse that fixes rust 1.37 deprecation errors. r!kinetik r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D37511

--HG--
extra : moz-landing-system : lando
2019-07-10 14:39:47 +00:00
John Lin
95099600d5 Bug 1563734 - always sync session ID from remote decoder. r=jya
In bug 1552607/D36382, RemoteDataDecoder always increases session ID but
CodecProxy only performs flush IPC when neccessary. This will cause the
ID numbers out of sync and prevent remote decoder from receiving any
more input. By reading the session ID in dequeued input samples, the
numbers can always be in sync.

Differential Revision: https://phabricator.services.mozilla.com/D37123

--HG--
extra : moz-landing-system : lando
2019-07-11 07:25:30 +00:00
Barret Rennie
cafb5a8bb7 Bug 1289211 - Rename InfallibleTArray to nsTArray in media/ r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D36964

--HG--
extra : moz-landing-system : lando
2019-07-10 05:58:24 +00:00
Byron Campen [:bwc]
ff7e1aeb02 Bug 1558887: Reduce this STUN response delay a little, since on some platforms it seems to be too long. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D37474

--HG--
extra : moz-landing-system : lando
2019-07-10 02:07:19 +00:00
Andreea Pavel
7853764e9d Backed out 42 changesets (bug 1530715) for SM build bustages on a CLOSED TREE
Backed out changeset 88ba94506737 (bug 1530715)
Backed out changeset 586d1b42a31b (bug 1530715)
Backed out changeset 7e7f5b9f2bf6 (bug 1530715)
Backed out changeset 7506b654e92f (bug 1530715)
Backed out changeset 518f85cf84a9 (bug 1530715)
Backed out changeset aca1e6806fc9 (bug 1530715)
Backed out changeset 70e97244daa8 (bug 1530715)
Backed out changeset 7c1e970c84a0 (bug 1530715)
Backed out changeset 9e10aa50ca0e (bug 1530715)
Backed out changeset 2a8d1c6faa33 (bug 1530715)
Backed out changeset bdc3110a40e9 (bug 1530715)
Backed out changeset bd809d3c5fd8 (bug 1530715)
Backed out changeset fe28daa92fc4 (bug 1530715)
Backed out changeset a964627f40c6 (bug 1530715)
Backed out changeset 3f3677f2980f (bug 1530715)
Backed out changeset e527edaabd65 (bug 1530715)
Backed out changeset 421e51bf612b (bug 1530715)
Backed out changeset 8f10a1790557 (bug 1530715)
Backed out changeset 0c5a0ed7203a (bug 1530715)
Backed out changeset 7fe0263794d3 (bug 1530715)
Backed out changeset ecd20933073e (bug 1530715)
Backed out changeset de4e23af5054 (bug 1530715)
Backed out changeset dcd65347e392 (bug 1530715)
Backed out changeset cd0e483df6be (bug 1530715)
Backed out changeset 9acd782f9450 (bug 1530715)
Backed out changeset b4809ada60dd (bug 1530715)
Backed out changeset 3742faad3806 (bug 1530715)
Backed out changeset bf15184c3c63 (bug 1530715)
Backed out changeset b6139a17a5fd (bug 1530715)
Backed out changeset dda297f7755a (bug 1530715)
Backed out changeset e98c1c0d561d (bug 1530715)
Backed out changeset 72c18b15e767 (bug 1530715)
Backed out changeset a8d7741d9134 (bug 1530715)
Backed out changeset 7562f780b687 (bug 1530715)
Backed out changeset 0cec8139038c (bug 1530715)
Backed out changeset 5ebf9b275f10 (bug 1530715)
Backed out changeset 7042c5c9c764 (bug 1530715)
Backed out changeset 4cd64e4037fa (bug 1530715)
Backed out changeset 48719d342b6f (bug 1530715)
Backed out changeset 0500179d3bbf (bug 1530715)
Backed out changeset 4bed62b601c6 (bug 1530715)
Backed out changeset 30f0b9853b0f (bug 1530715)
2019-07-10 10:56:00 +03:00
Chun-Min Chang
97c91ba03d Bug 1530715 - P42: Remove unnecessary mutex. r=padenot
There are three potential data-race operations that may run at the same
time:
1. Data callback and stream reinitialization
2. Data callback and stream destroying
3. Stream reinitialization and stream destroying

The case 1 and 2 won't happen as long as the AudioOutputUnitStop is
called at the beginning of stream reinitialization and stream
destorying. The AudioOutputUnitStop requires to lock a mutex inside
CoreAudio framework that is also used by the data callback. Thus, if
there is a running callback, which holds the mutex inside CoreAudio
framework, when AudioOutputUnitStop is called, then the calling will
block the current thread until the data callback ends since it is
waiting for the mutex. By calling AudioOutputUnitStop at the beginning
of the stream reinitialization and stream destroying, the data race of
case 1 and 2 can be avoided.

On the other hand, the case 3 won't happen since the stream
initialization and destroying is run on the same task queue. The two
tasks on the same serial task queue are impossible to be run at the same
time. The mutex in AudioUnitStream is unnecessary because it's used for
the case 3.

Differential Revision: https://phabricator.services.mozilla.com/D34076

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:07 +00:00
Chun-Min Chang
a97f2bb079 Bug 1530715 - P41: Remove OwnedCriticalSection in cubeb stream. r=padenot
The custom mutex, OwnedCriticalSection, in the current code comes with
the C-to-Rust translation work of cubeb_audiouniut.cpp. Its design is in
C style and not fitted well in the Rust. Rust has a better mutex design.

In the previous patches, all the data that may be touched on the
different threads are moved into a struct wrapped by a Rust mutex. Those
data will be touched in the critical sections created by the Rust mutex.
Therefore, this custom mutex becomes redundant. It's time to say goodbye
to it.

Differential Revision: https://phabricator.services.mozilla.com/D34074

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:07 +00:00
Chun-Min Chang
381a586aed Bug 1530715 - P40: Move stream setup and close into a struct within a mutex. r=padenot
The core stream data that will be touched on the different threads when
the stream is created, reinitialized, destoryed should be used in the
critical section. Those core data are initialized in stream-setup and
destroyed in stream-close. The stream-setup and stream-close is run in
the critical section so they won't be executed at the same time.
Currently, the critical section is created by our custom mutex. However,
this custom mutex will be removed in the later mutex replacement.

Instead of running these two operations in the critical sections created
by the custom mutex, they should be moved into a struct wrapped by a
standard Rust mutex. As a result, at the end when the custom mutex is
removed, these two operations are still in the critical sections that
are created by the Rust mutex.

Differential Revision: https://phabricator.services.mozilla.com/D34073

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:07 +00:00
Chun-Min Chang
12e982f4e9 Bug 1530715 - P39: Move listeners (un)registrations into a strcut within a mutex. r=padenot
The listeners will be registered and unregistered on the different threads,
so the listeners should be used in the critical sections. We do create
critical sections by our own mutex. However, this custom mutex will be
gradually replaced by the standard Rust mutex in the following patches.

To replace the custom mutex, we put the listeners to the struct wrapped
by a Rust mutex and register or unregister the listeners in the critical
section created by this struct. At the end when the custom mutex is
removed, those operations are still in the critical sections.

Differential Revision: https://phabricator.services.mozilla.com/D34072

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:07 +00:00
Chun-Min Chang
59a0d37fb0 Bug 1530715 - P38: Merge configure_input into setup. r=padenot
Calling configure_input requires borrowing AudioUnitStream as a
mutable. Merging configure_input into setup will help to avoid a
potential borrowing-twice issue in the later mutex replacement. There
will be a critical section created by a Rust mutex in the setup, which
will borrow the AudioUnitStream as an immutable.

Differential Revision: https://phabricator.services.mozilla.com/D34071

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:06 +00:00
Chun-Min Chang
ad3d63d477 Bug 1530715 - P37: Merge configure_output into setup. r=padenot
Calling configure_output requires borrowing AudioUnitStream as a
mutable. Merging configure_output into setup will help to avoid a
potential borrowing-twice issue in the later mutex replacement. There
will be a critical section created by a Rust mutex in the setup, which
will borrow the AudioUnitStream as an immutable.

Differential Revision: https://phabricator.services.mozilla.com/D34070

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:06 +00:00
Chun-Min Chang
03fce17902 Bug 1530715 - P36: Move out minimum_resampling_input_frames of output callback. r=padenot
Avoid calling minimum_resampling_input_frames by a borrowing from
AudioUnitStream

Differential Revision: https://phabricator.services.mozilla.com/D34069

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:06 +00:00
Chun-Min Chang
fcb7b1184a Bug 1530715 - P35: Store layout in the stream instead of context. r=padenot
We store global layout info and channels info in the cubeb context.
However, the streams might output to different devices. We should store
the layout info of the output device in the stream directly instead of
in the context. On the other hand, the `channels` value is a duplicate
of `output_desc.mChannelsPerFrame` or `mixer.out_channels` so we don't
need to store this value.

Differential Revision: https://phabricator.services.mozilla.com/D34068

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:06 +00:00
Chun-Min Chang
e20280cfce Bug 1530715 - P34: Merge layout_init into configure_output. r=padenot
1. Avoid calling layout_init by wrong AudioUnit value

2. Avoid calling layout getting/setting APIs by borrowing the
AudioUnitStream as a mutable. It will help to avoid the potential
borrowing-twice issues in the later mutex replacement.

Differential Revision: https://phabricator.services.mozilla.com/D34067

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:06 +00:00
Chun-Min Chang
7392d55799 Bug 1530715 - P33: Register and unregister the device-changed callbacks when stream setup and close. r=padenot
1. The code readability is slightly better if we can register and
unregister the callbacks in the same places. The device-chaned callbacks
are registered when stream setup and unregistered when stream close.

2. In the later mutex replacement, the core stream variables that may be
touched by different threads when reinitializing or destroying the
stream, including {in, out}_unit, will be wrapped in a Rust mutex.
Moving these callbacks (un)registration into the same places makes it
easier to find where the critical sections are.

Differential Revision: https://phabricator.services.mozilla.com/D34066

--HG--
extra : moz-landing-system : lando
2019-07-09 19:57:05 +00:00