Commit graph

213 commits

Author SHA1 Message Date
Harald Alvestrand
3725d544fa Change PeerConnection error codes
Change error code for "state mismatch" to "State error",
and also change some parameter errors to "Illegal parameter".

Bug: chromium:819629
Change-Id: I9347d4161344b4ff2bcb58ad82fa6d533cd476fb
Reviewed-on: https://webrtc-review.googlesource.com/69815
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22924}
2018-04-18 17:02:24 +00:00
Taylor Brandstetter
cbaa254641 Attempting to fix lingering issues with BUNDLE negotiation.
I found one additional way a crash could occur: "OnRtpTransportChanged"
being called instead of "OnDtlsTransportChanged", due to a mixup of m=
section types. I could reproduce this by:

1. Applying description with RTP data channel m= section.
2. Applying description with both a rejected RTP data channel m=
   section and rejected SCTP m= section.

This is a very strange scenario, but maybe there are other ways to
reproduce that I haven't thought of.

The solution is to combine "OnRtpTransportChanged" and
"OnDtlsTransportChanged", and not do anything with the content type.
This simplifies the code a bit as well.

Bug: chromium:827917
Change-Id: If6818ea0c41573255831534060b30c76a6544e04
Reviewed-on: https://webrtc-review.googlesource.com/70360
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22893}
2018-04-17 01:04:12 +00:00
Qingsi Wang
a2d60679c9 Reland "Add thread checker to PortAllocator and its subclasses and fix a bug causing memory contention by threads."
This is a reland of fc43d11717

Original change's description:
> Add thread checker to PortAllocator and its subclasses and fix a bug
> causing memory contention by threads.
>
> PortAllocator and its subclasses assume all of their methods except the
> constructor must be called on the same thread (the network thread in
> practice). This CL adds a thread checker to PortAllocator and its
> subclasses for thread safety, and fixes bugs of invoking some of their
> methods in PeerConnection on the signaling thread.
>
> Bug: webrtc:9112
> Change-Id: I33ba9bae72ec09a45ec70435962f3f25cd31583c
> Reviewed-on: https://webrtc-review.googlesource.com/66945
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22814}

Bug: webrtc:9112
Change-Id: I5c7377f05c0daccbe469e2fdbdfacabc5c222f4c
Reviewed-on: https://webrtc-review.googlesource.com/69422
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22889}
2018-04-16 21:44:28 +00:00
Zhi Huang
365381fdf1 Replace BundleFilter with RtpDemuxer in RtpTransport.
BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
type-based demuxing. RtpTransport will support MID-based demuxing later.

Each BaseChannel has its own RTP demuxing criteria and when connecting
to the RtpTransport, BaseChannel will register itself as a demuxer sink.

The inheritance model is changed. New inheritance chain:
DtlsSrtpTransport->SrtpTransport->RtpTranpsort

The JsepTransport2 is renamed to JsepTransport.

NOTE:
When RTCP packets are received, Call::DeliverRtcp will be called for
multiple times (webrtc:9035) which is an existing issue. With this CL,
it will become more of a problem and should be fixed.

Bug: webrtc:8587
Change-Id: Ibd880e7b744bd912336a691309950bc18e42cf62
Reviewed-on: https://webrtc-review.googlesource.com/65786
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22867}
2018-04-14 00:57:11 +00:00
Steve Anton
3acffc3b16 Remove SdpSemantics::kDefault
This adds confusion to the native API and is only needed for
Chromium UMA metrics, so the appropriate metrics have been moved
upstream and kDefault option removed.

Bug: chromium:811683
Change-Id: I666d7f7793765b8d6edcd99416c8b6c957766f00
Reviewed-on: https://webrtc-review.googlesource.com/59261
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22864}
2018-04-13 17:03:08 +00:00
Henrik Boström
5d8f8fa0b6 Revert "Adding test for adding ICE candidate before applying answer."
This reverts commit dd59d70491.

Reason for revert: Speculatively reverting this due to chromium test.

The AutoRoller has been turned off for a couple of days due to the M67 branch cut. Did this cause a regression that made it into M67 or are the tests broken?

Failed roll:
https://chromium-review.googlesource.com/c/chromium/src/+/1011676
Example run:
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/mac_chromium_rel_ng/24406
Expected diff:
https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=77d652517595443eea13f6ba9aaff67728305213&as=RTCPeerConnection-addIceCandidate-diff.txt

Original change's description:
> Adding test for adding ICE candidate before applying answer.
> 
> This was working before, but somewhat by accident (because an error
> wasn't being surfaced).
> 
> This CL also starts surfacing that error, from
> JsepTransportController::AddRemoteCandidates to PeerConnection.
> 
> Bug: None
> Change-Id: Ib48c9c00ea2a5baa5f7e3210c5dc7a339498b2d0
> Reviewed-on: https://webrtc-review.googlesource.com/69015
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22830}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: None
Change-Id: I78a1df5d1e38569d02565bf343881420cc171347
Reviewed-on: https://webrtc-review.googlesource.com/69860
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22863}
2018-04-13 16:22:38 +00:00
Taylor Brandstetter
dd59d70491 Adding test for adding ICE candidate before applying answer.
This was working before, but somewhat by accident (because an error
wasn't being surfaced).

This CL also starts surfacing that error, from
JsepTransportController::AddRemoteCandidates to PeerConnection.

Bug: None
Change-Id: Ib48c9c00ea2a5baa5f7e3210c5dc7a339498b2d0
Reviewed-on: https://webrtc-review.googlesource.com/69015
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22830}
2018-04-11 18:59:26 +00:00
Steve Anton
ba42e99f18 Report an error when trying to set complex Plan B SDP on Unified Plan
This changes the PeerConnection when in Unified Plan mode to reject
SDP applied with SetLocalDescription or SetRemoteDescription if the
SDP has multiple "Plan B tracks" (a=ssrc lines) in a media section.
The error is to inform developers that the given SDP will not be
interpreted as they might expect.

Bug: None
Change-Id: I7a0e11282fbf63dac06038cd22a66683517a87d0
Reviewed-on: https://webrtc-review.googlesource.com/68764
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22829}
2018-04-11 18:16:26 +00:00
Patrik Höglund
3dc41069ef Revert "Add thread checker to PortAllocator and its subclasses and fix a bug"
This reverts commit fc43d11717.

Reason for revert: Crashes downstream tests

Original change's description:
> Add thread checker to PortAllocator and its subclasses and fix a bug
> causing memory contention by threads.
> 
> PortAllocator and its subclasses assume all of their methods except the
> constructor must be called on the same thread (the network thread in
> practice). This CL adds a thread checker to PortAllocator and its
> subclasses for thread safety, and fixes bugs of invoking some of their
> methods in PeerConnection on the signaling thread.
> 
> Bug: webrtc:9112
> Change-Id: I33ba9bae72ec09a45ec70435962f3f25cd31583c
> Reviewed-on: https://webrtc-review.googlesource.com/66945
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22814}

TBR=deadbeef@webrtc.org,pthatcher@google.com,pthatcher@webrtc.org,qingsi@google.com,honghaiz@webrtc.org

Change-Id: I2db6561d5d6366d38caa58c3e719d0d48eda70c2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9112
Reviewed-on: https://webrtc-review.googlesource.com/69200
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22818}
2018-04-11 11:15:08 +00:00
Qingsi Wang
fc43d11717 Add thread checker to PortAllocator and its subclasses and fix a bug
causing memory contention by threads.

PortAllocator and its subclasses assume all of their methods except the
constructor must be called on the same thread (the network thread in
practice). This CL adds a thread checker to PortAllocator and its
subclasses for thread safety, and fixes bugs of invoking some of their
methods in PeerConnection on the signaling thread.

Bug: webrtc:9112
Change-Id: I33ba9bae72ec09a45ec70435962f3f25cd31583c
Reviewed-on: https://webrtc-review.googlesource.com/66945
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22814}
2018-04-11 00:06:40 +00:00
Seth Hampson
83d676bd15 Bug fix for applying a remote description twice without stream IDs.
A downstream bug ocurred because of a lack of symmetry when adding and
removing a remote sender in Plan B that specifies SSRCs, but doesn't
specify stream IDs. The issue when the first remote description is
applied "default" for the stream ID on the remote sender, but the
second time it's applied the current remote sender's "default" stream
ID does not match the new remote description's empty stream ID. This
was incorrectly interpreted as a new remote sender (which removed/added
the sender).

Bug: webrtc:7933
Change-Id: I87191b9e887b3450ef15111b5e867023c723a86e
Reviewed-on: https://webrtc-review.googlesource.com/67191
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Noah Richards <noahric@chromium.org>
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22760}
2018-04-06 05:32:24 +00:00
Seth Hampson
5897a6ec6a Adds support for signaling a=msid lines without a=ssrc lines.
Currently in the SDP we require an a=ssrc line in the m= section in
order for a StreamParams object to be created with that
MediaContentDescription. This change creates a StreamParams object
without ssrcs in the case that a=msid lines are signaled, but ssrcs
are not. When the remote description is set, this allows us to store
the "unsignaled" StreamParams object in the media channel to later
be used when the first packet is received and we create the
receive stream.

Bug: webrtc:7932, webrtc:7933
Change-Id: Ib6734abeee62b8ed688a8208722c402134c074ef
Reviewed-on: https://webrtc-review.googlesource.com/63141
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22712}
2018-04-03 21:21:11 +00:00
Zhi Huang
644fde40a9 Add nullptr check in SctpTransport.
In previous implementation, the SctpTransport always assumes the
DtlsTransport underneath is non-null, which is not true after switching
to new JsepTransportController model.

This CL adds nullptr when connecting/disconnecting the SctpTransport with
the DtlsTransport.

The "channel" related methods and variables are also renamed.

Bug: chromium:827917, chromium:828220
Change-Id: I95aa2900d23b0885f45500e2c53def771abdccad
Reviewed-on: https://webrtc-review.googlesource.com/66160
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22700}
2018-04-03 03:04:07 +00:00
Seth Hampson
5b4f075f9c Reland "Reland "Adds support for multiple or no media stream ids.""
This is a reland of f351c3408a

Reland history:
The original CL broke tests in chromium which were manually tested in
the first reland. Another small fix was added to the reland to fix a
downstream bug, which caused separate tests to fail in chromium.
These were not caught because the chromium trybot was down. These
are temporarily disabled in chrome to allow this change to roll in.

Original change's description:
> Reland "Adds support for multiple or no media stream ids."
>
> This is a reland of 1550292efe
>
> Original change's description:
> > Adds support for multiple or no media stream ids.
> >
> > With Unified Plan SDP semantics, this adds support for specifying
> > either no media stream ids or multiple media stream ids for a
> > transceiver/sender/receiver. This includes serializing/deserializing
> > SDPs with multiple a=msid lines in a m section, or an "a=msid:-
> > <appdata>" line to indicate the no stream case. Note that this does
> > not synchronize between multiple streams, this is still just supported
> > based upon the first media stream id.
> >
> > Bug: webrtc:7932, webrtc:7933
> > Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
> > Reviewed-on: https://webrtc-review.googlesource.com/61341
> > Commit-Queue: Seth Hampson <shampson@webrtc.org>
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22611}
>
> Bug: webrtc:7932, webrtc:7933
> Change-Id: Ica272ac18088103e65cccf6b96a6d3ecccb178ed
> Reviewed-on: https://webrtc-review.googlesource.com/65560
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22687}

TBR=deadbeef@webrtc.org

Bug: webrtc:7932, webrtc:7933
Change-Id: Ideb30219b2f952dd51428cd4e8bd43ef49df5b17
Reviewed-on: https://webrtc-review.googlesource.com/66280
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22699}
2018-04-03 01:10:07 +00:00
Steve Anton
3d954a6962 Add log messages for Unified Plan processing
Bug: None
Change-Id: Iab993e24aa87b8363d6ae0313e6361172cab5a39
Reviewed-on: https://webrtc-review.googlesource.com/65883
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22698}
2018-04-02 20:49:55 +00:00
Zhi Huang
e830e683c4 Use new TransportController implementation in PeerConnection.
The TransportController will be replaced by the JsepTransportController
and JsepTransport will be replace be JsepTransport2.

The JsepTransportController will take the entire SessionDescription
and handle the RtcpMux, Sdes and BUNDLE internally.

The ownership model is also changed. The P2P layer transports are not
ref-counted and will be owned by the JsepTransport2.

In ORTC aspect, RtpTransportAdapter is now a wrapper over RtpTransport
or SrtpTransport and it implements the public and internal interface
by calling the transport underneath.

Bug: webrtc:8587
Change-Id: Ia7fa61288a566f211f8560072ea0eecaf19e48df
Reviewed-on: https://webrtc-review.googlesource.com/59586
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22693}
2018-03-30 18:41:19 +00:00
Tomas Gunnarsson
191bf5c653 Revert "Reland "Adds support for multiple or no media stream ids.""
This reverts commit f351c3408a.

Reason for revert: Breaks chromium import

https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/58012

Failin tests:
WebRtcRtpBrowserTest.TrackAddedToSecondStream
WebRtcRtpBrowserTest.TrackSwitchingStream

Original change's description:
> Reland "Adds support for multiple or no media stream ids."
> 
> This is a reland of 1550292efe
> 
> Original change's description:
> > Adds support for multiple or no media stream ids.
> > 
> > With Unified Plan SDP semantics, this adds support for specifying
> > either no media stream ids or multiple media stream ids for a
> > transceiver/sender/receiver. This includes serializing/deserializing
> > SDPs with multiple a=msid lines in a m section, or an "a=msid:-
> > <appdata>" line to indicate the no stream case. Note that this does
> > not synchronize between multiple streams, this is still just supported
> > based upon the first media stream id.
> > 
> > Bug: webrtc:7932, webrtc:7933
> > Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
> > Reviewed-on: https://webrtc-review.googlesource.com/61341
> > Commit-Queue: Seth Hampson <shampson@webrtc.org>
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22611}
> 
> Bug: webrtc:7932, webrtc:7933
> Change-Id: Ica272ac18088103e65cccf6b96a6d3ecccb178ed
> Reviewed-on: https://webrtc-review.googlesource.com/65560
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22687}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,shampson@webrtc.org

Change-Id: I1835419f963762bc308a91d81c423d8e7bf65026
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7932, webrtc:7933
Reviewed-on: https://webrtc-review.googlesource.com/65700
Reviewed-by: Tomas Gunnarsson <tommi@chromium.org>
Commit-Queue: Tomas Gunnarsson <tommi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#22690}
2018-03-30 10:44:53 +00:00
Seth Hampson
f351c3408a Reland "Adds support for multiple or no media stream ids."
This is a reland of 1550292efe

Original change's description:
> Adds support for multiple or no media stream ids.
> 
> With Unified Plan SDP semantics, this adds support for specifying
> either no media stream ids or multiple media stream ids for a
> transceiver/sender/receiver. This includes serializing/deserializing
> SDPs with multiple a=msid lines in a m section, or an "a=msid:-
> <appdata>" line to indicate the no stream case. Note that this does
> not synchronize between multiple streams, this is still just supported
> based upon the first media stream id.
> 
> Bug: webrtc:7932, webrtc:7933
> Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
> Reviewed-on: https://webrtc-review.googlesource.com/61341
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22611}

Bug: webrtc:7932, webrtc:7933
Change-Id: Ica272ac18088103e65cccf6b96a6d3ecccb178ed
Reviewed-on: https://webrtc-review.googlesource.com/65560
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22687}
2018-03-30 01:33:48 +00:00
Zhi Huang
95e7dbb7c7 Revert "Reland "Replace BundleFilter with RtpDemuxer in RtpTransport.""
This reverts commit 27f3bf5128.

Reason for revert: Broken internal project.

Original change's description:
> Reland "Replace BundleFilter with RtpDemuxer in RtpTransport."
> 
> This reverts commit 97d5e5b32c.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Revert "Replace BundleFilter with RtpDemuxer in RtpTransport."
> > 
> > This reverts commit ea8b62a3e7.
> > 
> > Reason for revert: Broke chromium tests.
> > Original change's description:
> > > Replace BundleFilter with RtpDemuxer in RtpTransport.
> > > 
> > > BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
> > > type-based demuxing. RtpTransport will support MID-based demuxing later.
> > > 
> > > Each BaseChannel has its own RTP demuxing criteria and when connecting
> > > to the RtpTransport, BaseChannel will register itself as a demuxer sink.
> > > 
> > > The inheritance model is changed. New inheritance chain:
> > > DtlsSrtpTransport->SrtpTransport->RtpTranpsort
> > > 
> > > NOTE:
> > > When RTCP packets are received, Call::DeliverRtcp will be called for
> > > multiple times (webrtc:9035) which is an existing issue. With this CL,
> > > it will become more of a problem and should be fixed.
> > > 
> > > Bug: webrtc:8587
> > > Change-Id: I1d8a00443bd4bcbacc56e5e19b7294205cdc38f0
> > > Reviewed-on: https://webrtc-review.googlesource.com/61360
> > > Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> > > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#22613}
> > 
> > TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org
> > 
> > Change-Id: If245da9d1ce970ac8dab7f45015e9b268a5dbcbd
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: webrtc:8587
> > Reviewed-on: https://webrtc-review.googlesource.com/64860
> > Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
> > Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22614}
> 
> TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org
> 
> Change-Id: I3c272588ab4388ecadc4edc6786d5195c701855f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8587
> Reviewed-on: https://webrtc-review.googlesource.com/64862
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22615}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:8587
Change-Id: I694ce9a039ed52c5961cdc0cba57587bed4cbde4
Reviewed-on: https://webrtc-review.googlesource.com/65381
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22665}
2018-03-29 02:45:17 +00:00
Qingsi Wang
dea6889ef6 Add sanity checks of IceConfig parameters.
IceConfig contains a set of parameters that affect the behavior of ICE.
Inconsistent or conflicting parameters lead to erroneous or
unpredicatble behavior in the network stack. Sanity checks are now added
to validate IceConfig.

TBR=magjed@webrtc.org

Bug: webrtc:8993
Change-Id: I708bc3f1ef970872754a82a47a509bda15061ca6
Reviewed-on: https://webrtc-review.googlesource.com/60847
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22664}
2018-03-28 22:09:57 +00:00
Emircan Uysaler
bc609eaab1 Revert "Adds support for multiple or no media stream ids."
This reverts commit 1550292efe.

Reason for revert: 

webkit_layout_tests:fast/peerconnection/RTCPeerConnection-sdpSemantics.html is broken, see below. WebRTC roll isn't going through because of it. This CL looks the most suspicious within the 5 in the range. 

https://chromium-review.googlesource.com/c/chromium/src/+/981899
https://webrtc.googlesource.com/src.git/+log/bb50ce5bb6d5..27f3bf512827
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/54616

Original change's description:
> Adds support for multiple or no media stream ids.
> 
> With Unified Plan SDP semantics, this adds support for specifying
> either no media stream ids or multiple media stream ids for a
> transceiver/sender/receiver. This includes serializing/deserializing
> SDPs with multiple a=msid lines in a m section, or an "a=msid:-
> <appdata>" line to indicate the no stream case. Note that this does
> not synchronize between multiple streams, this is still just supported
> based upon the first media stream id.
> 
> Bug: webrtc:7932, webrtc:7933
> Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
> Reviewed-on: https://webrtc-review.googlesource.com/61341
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22611}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,shampson@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:7932, webrtc:7933
Change-Id: I1d4e4332b518ec32b305c8af07679650059d02bb
Reviewed-on: https://webrtc-review.googlesource.com/65000
Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22634}
2018-03-27 23:01:55 +00:00
Zhi Huang
27f3bf5128 Reland "Replace BundleFilter with RtpDemuxer in RtpTransport."
This reverts commit 97d5e5b32c.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Replace BundleFilter with RtpDemuxer in RtpTransport."
> 
> This reverts commit ea8b62a3e7.
> 
> Reason for revert: Broke chromium tests.
> Original change's description:
> > Replace BundleFilter with RtpDemuxer in RtpTransport.
> > 
> > BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
> > type-based demuxing. RtpTransport will support MID-based demuxing later.
> > 
> > Each BaseChannel has its own RTP demuxing criteria and when connecting
> > to the RtpTransport, BaseChannel will register itself as a demuxer sink.
> > 
> > The inheritance model is changed. New inheritance chain:
> > DtlsSrtpTransport->SrtpTransport->RtpTranpsort
> > 
> > NOTE:
> > When RTCP packets are received, Call::DeliverRtcp will be called for
> > multiple times (webrtc:9035) which is an existing issue. With this CL,
> > it will become more of a problem and should be fixed.
> > 
> > Bug: webrtc:8587
> > Change-Id: I1d8a00443bd4bcbacc56e5e19b7294205cdc38f0
> > Reviewed-on: https://webrtc-review.googlesource.com/61360
> > Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22613}
> 
> TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org
> 
> Change-Id: If245da9d1ce970ac8dab7f45015e9b268a5dbcbd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8587
> Reviewed-on: https://webrtc-review.googlesource.com/64860
> Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22614}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org

Change-Id: I3c272588ab4388ecadc4edc6786d5195c701855f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8587
Reviewed-on: https://webrtc-review.googlesource.com/64862
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22615}
2018-03-27 04:39:12 +00:00
Zhi Huang
97d5e5b32c Revert "Replace BundleFilter with RtpDemuxer in RtpTransport."
This reverts commit ea8b62a3e7.

Reason for revert: Broke chromium tests.
Original change's description:
> Replace BundleFilter with RtpDemuxer in RtpTransport.
> 
> BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
> type-based demuxing. RtpTransport will support MID-based demuxing later.
> 
> Each BaseChannel has its own RTP demuxing criteria and when connecting
> to the RtpTransport, BaseChannel will register itself as a demuxer sink.
> 
> The inheritance model is changed. New inheritance chain:
> DtlsSrtpTransport->SrtpTransport->RtpTranpsort
> 
> NOTE:
> When RTCP packets are received, Call::DeliverRtcp will be called for
> multiple times (webrtc:9035) which is an existing issue. With this CL,
> it will become more of a problem and should be fixed.
> 
> Bug: webrtc:8587
> Change-Id: I1d8a00443bd4bcbacc56e5e19b7294205cdc38f0
> Reviewed-on: https://webrtc-review.googlesource.com/61360
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22613}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org

Change-Id: If245da9d1ce970ac8dab7f45015e9b268a5dbcbd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8587
Reviewed-on: https://webrtc-review.googlesource.com/64860
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22614}
2018-03-27 00:09:12 +00:00
Zhi Huang
ea8b62a3e7 Replace BundleFilter with RtpDemuxer in RtpTransport.
BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
type-based demuxing. RtpTransport will support MID-based demuxing later.

Each BaseChannel has its own RTP demuxing criteria and when connecting
to the RtpTransport, BaseChannel will register itself as a demuxer sink.

The inheritance model is changed. New inheritance chain:
DtlsSrtpTransport->SrtpTransport->RtpTranpsort

NOTE:
When RTCP packets are received, Call::DeliverRtcp will be called for
multiple times (webrtc:9035) which is an existing issue. With this CL,
it will become more of a problem and should be fixed.

Bug: webrtc:8587
Change-Id: I1d8a00443bd4bcbacc56e5e19b7294205cdc38f0
Reviewed-on: https://webrtc-review.googlesource.com/61360
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22613}
2018-03-26 22:40:05 +00:00
Seth Hampson
1550292efe Adds support for multiple or no media stream ids.
With Unified Plan SDP semantics, this adds support for specifying
either no media stream ids or multiple media stream ids for a
transceiver/sender/receiver. This includes serializing/deserializing
SDPs with multiple a=msid lines in a m section, or an "a=msid:-
<appdata>" line to indicate the no stream case. Note that this does
not synchronize between multiple streams, this is still just supported
based upon the first media stream id.

Bug: webrtc:7932, webrtc:7933
Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
Reviewed-on: https://webrtc-review.googlesource.com/61341
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22611}
2018-03-26 21:21:50 +00:00
Henrik Boström
1df1bf8551 PeerConnectionInterface::GetStats() with selector argument added.
This exposes the stats selection algorithm[1] on the PeerConnection.

Per-spec, there are four flavors of getStats():
1. RTCPeerConnection.getStats().
2. RTCPeerConnection.getStats(MediaStreamTrack selector).
3. RTCRtpSender.getStats().
4. RTCRtpReceiver.getStats().

1) is the parameterless getStats() which is already shipped.
2) is the same as 3) and 4) except the track is used to look up the
corresponding sender/receiver to use as the selector.
3) and 4) perform stats collection with a filter, which is implemented
in RTCStatsCollector.GetStatsReport(selector).

For technical reasons, it is easier to place GetStats() on the
PeerConnection where the RTCStatsCollector lives than to place it on the
sender/receiver. Passing the selector as an argument or as a "this"
makes little difference other than style. Wiring Chrome up such that the
JavaScript APIs is like the spec is trivial after GetStats() is added to
PeerConnectionInterface.

This CL also adds comments documenting our intent to deprecate and
remove the legacy GetStats() APIs some time in the future.

[1] https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm

Bug: chromium:680172
Change-Id: I09316ba6f20b25d4f9c11785d0a1a1262d6062a1
Reviewed-on: https://webrtc-review.googlesource.com/62900
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22602}
2018-03-26 12:08:20 +00:00
Qingsi Wang
866e08d282 Make rtc::Optional IceConfig parameters interpreted consistently.
The convention is reinforced so that setting a rtc::Optional IceConfig
parameter to null restores the default value. Helper getters are added
to IceConfig to provide either user-defined value or the default.
Shared constants and config defaults used in p2p are moved to
p2pconstants.h/cc for future management with sanity checks.

Bug: webrtc:8993
Change-Id: I976cf1eef5a654b8911f449248bb2f3086279db8
Reviewed-on: https://webrtc-review.googlesource.com/61149
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22575}
2018-03-23 02:10:54 +00:00
Steve Anton
db67ba1c81 Report SRTP error codes to UMA
Bug: webrtc:8996
Change-Id: I75de77ed15c2829425c00f57ebd07109803425db
Reviewed-on: https://webrtc-review.googlesource.com/63122
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22521}
2018-03-20 18:37:49 +00:00
Seth Hampson
13b8bad235 Final name changing of MediaStreamInterface.label() to id().
Downstreams have been updated, and this now updates all uses of label()
to id() within WebRTC code. This change also makes id() pure virtual and
removes label().

Bug: webrtc:8977
Change-Id: Ib045ea4fabba6f14447c64875c7aeba87dc2be24
Reviewed-on: https://webrtc-review.googlesource.com/60382
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22431}
2018-03-14 20:30:52 +00:00
Qingsi Wang
22e623ad68 Add configurable threshold for writability state update.
Add configurable parameters in RTCConfiguration with the default value
given by the constants CONNECTION_WRITE_CONNECT_TIME and
CONNECTION_WRITE_CONNECT_FAILURES in the ICE implementation. These two
parameters define the time period for which a candidate pair must wait
for ping response and the minimum number of connectivity checks that
the pair must send without response before its state becomes unreliable
from writable as defined in the current ICE implementation.

Bug: webrtc:8988
Change-Id: I484599b7d776489a87741ffea8926df766095da9
Reviewed-on: https://webrtc-review.googlesource.com/60704
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22411}
2018-03-13 18:54:03 +00:00
Harald Alvestrand
5081c0cc6d Change error handlers for Set*Description to use RTCError
Needed in order to return error codes to Chromium.

Bug: chromium:819629, chromium:589455
Change-Id: Iab22250db62a348eee21c6d8bfc44020a7380586
Reviewed-on: https://webrtc-review.googlesource.com/60522
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22367}
2018-03-09 15:37:34 +00:00
Qingsi Wang
e6826d2461 Add configurable connectivity check intervals.
The connectivity check intervals for candidate pairs with strong and
weak connectivity are currently constants in the ICE implementation. A
set of suboptimal value of these constants for a given application may
result in undesirable behavior including excessive network switching
latency. This CL adds these intervals to RTCConfiguration that is
available to applications to configure, while maintaining the original
constants as their default value for compatibility with existing
applications.

Bug: webrtc:8988
Change-Id: I804b0f4cf7881be7d3c8aec2776bc9596de72482
Reviewed-on: https://webrtc-review.googlesource.com/60585
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22351}
2018-03-09 08:09:43 +00:00
Harald Alvestrand
2e18061033 Count key protocol for all media sections
This will give accurate stats for the number of calls
that use video that are using SDES.

Bug: chromium:804275
Change-Id: I35b045a2301fb5267b656b424b9b3482b1b72f9a
Reviewed-on: https://webrtc-review.googlesource.com/60481
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22324}
2018-03-07 11:32:55 +00:00
Seth Hampson
513449eab9 Changes name of RtpTransceiverInit's stream_labels to stream_ids.
The naming convention according to the spec is stream id, not stream
labels.Changing things now to be spec compliant, before it is widely
used. This also includes changes to objective C wrapper code to be in
sync with the change.

Bug: webrtc:7932
Change-Id: I5705e6d8a647aaeed860316466a7320132f24b00
Reviewed-on: https://webrtc-review.googlesource.com/59301
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22316}
2018-03-06 23:42:01 +00:00
Steve Anton
8e20f17d1d Report UMA metrics for received SDP format
This change adds UMA stats that record the format of the remote offered
SDP. There are three classifications for the SDP format:
- Simple: No more than one audio and one video. Should be compatible
    with both Plan B and Unified Plan endpoints.
- ComplexPlanB: More than one audio or more than one video in the Plan B
    format (e.g., one audio mline with multiple streams).
- ComplexUnifiedPlan: More than one audio or more than one video in the
    Unified Plan format (e.g., two audio mlines).

Bug: chromium:811683
Change-Id: If46394edfa6a812ef313d632e27ec27516c18867
Reviewed-on: https://webrtc-review.googlesource.com/57220
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22315}
2018-03-06 21:22:51 +00:00
Harald Alvestrand
f9d0f1d215 UMA counters for SDES x media type
These counters will register whether the media sections
used with SDES are for audio, video or data.

Bug: chromium:804275
Change-Id: I1da3bb6625af755c0897bf4cd349655cb283fbb6
Reviewed-on: https://webrtc-review.googlesource.com/59400
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22287}
2018-03-05 13:46:43 +00:00
Seth Hampson
845e87877e Name change from stream label to stream id for spec compliance.
Bug: webrtc:7932
Change-Id: I66f33597342394083256f050cac2a00a68042302
Reviewed-on: https://webrtc-review.googlesource.com/59280
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22276}
2018-03-02 20:44:48 +00:00
Steve Anton
fc8537143f Crash if PeerConnection methods are called with the wrong SdpSemantics.
Bug: None
Change-Id: I111098215ec83fdf97f9a5232efef6a4af329ddf
Reviewed-on: https://webrtc-review.googlesource.com/59262
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22262}
2018-03-02 03:12:49 +00:00
Steve Anton
5a26a3a2cd Remove public sync_label from StreamParams
This change replaces the use of sync_label from StreamParams with
the new stream_labels() and set_stream_labels() getter and setter.

Bug: webrtc:7932
Change-Id: Ibd6d38f7d4efed37ac07963e6fbe377c93a28fd6
Reviewed-on: https://webrtc-review.googlesource.com/58540
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22257}
2018-03-01 18:25:03 +00:00
Steve Anton
0ffaaa26f9 Report negotiated SDP semantics for local answers also
Bug: chromium:811683
Change-Id: I8c51a3a1f58190c9dcd849ef451254ce230ea710
Reviewed-on: https://webrtc-review.googlesource.com/57128
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22216}
2018-02-28 02:47:57 +00:00
Taylor Brandstetter
c392866d86 Implement certificate chain stats.
There was an implementation, but it relied on SSLCertificate::GetChain,
which was never implemented. Except in the fake certificate classes
used by the stats collector tests, hence the tests were passing.

Instead of implementing GetChain, we decided (in
https://webrtc-review.googlesource.com/c/src/+/6500) to add
methods that return a SSLCertChain directly, since it results in a
somewhat cleaner object model.

So this CL switches everything to use the "chain" methods, and gets
rid of the obsolete methods and member variables.

Bug: webrtc:8920
Change-Id: Ie9d7d53654ba859535462521b54c788adec7badf
Reviewed-on: https://webrtc-review.googlesource.com/56961
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22177}
2018-02-24 00:44:06 +00:00
Steve Anton
52d86774c2 Fire OnRenegotiationNeeded when changing transceiver direction
This is specified by the WebRTC specification:
https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-direction

Bug: webrtc:7600
Change-Id: If45ba0383e5040d250cd3c1c2525ff3b03b1eb4f
Reviewed-on: https://webrtc-review.googlesource.com/55880
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22139}
2018-02-21 19:15:09 +00:00
Sebastian Jansson
8f83b42946 Moved bitrate config interface from Call class.
Moving usage of bitrate configuration related interface from Call
interface to the corresponding methods in the RtpSendTransportController
interface.
SetBitrateConfig was replaced with SetSdpBitrateParameters
SetBitrateConfigMask was replaced with SetClientBitratePreferences
OnNetworkRouteChanged was replaced with OnNetworkRouteChanged

This makes it more clear that RtpSendTransportController owns bitrate
configuration and fits a longer term ambition to reduce the scope of
the Call class.

Bug: webrtc:8415
Change-Id: I6d04eaad22a54ecd5ed60096e01689b0c67e9c65
Reviewed-on: https://webrtc-review.googlesource.com/54365
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22131}
2018-02-21 15:03:45 +00:00
Sebastian Jansson
fc8d26bd8a Reland "Moved BitrateConfig out of Call::Config."
This is a reland of 5897fe27ab.

Adding back CallConfig::kDefaultStartBitrateBps as deprecated.
Also making BitrateContraints::kDefaultStartBitrateBps private to stop
it from being used in other places.

Original change's description:
> Moved BitrateConfig out of Call::Config.
>
> This prepares for a CL extracting the bitrate configuration logic from
> the Call class.
>
> Also renaming BitrateConfig to BitrateConstraints.
>
> Bug: webrtc:8415
> Change-Id: I7e472683034c57bdc8093cdf5e78e477d1732480
> Reviewed-on: https://webrtc-review.googlesource.com/54400
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22104}

Bug: webrtc:8415
Change-Id: Iacfe2d6daedff710832ab89210c7c66d4403c93b
Reviewed-on: https://webrtc-review.googlesource.com/55980
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22123}
2018-02-21 11:38:42 +00:00
Steve Anton
6e22137f70 Enable Unified Plan tests that were blocked on the stats collector
The stats collectors now work with Unified Plan, so re-enable the
tests that were disabled.

Bug: webrtc:8764
Change-Id: I9ac97fd19d0024b3aaf26dd5ab09d3ffcb33210a
Reviewed-on: https://webrtc-review.googlesource.com/55800
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22114}
2018-02-21 01:12:36 +00:00
Qingsi Wang
72a43a1d2c Collect packet loss and RTT stats of STUN binding requests.
STUN candidates use STUN binding requests to keep NAT bindings open.
Related stats including packet loss and RTT can be now collected via the
legacy GetStats in PeerConnection.

Bug: None
Change-Id: I7b0eee1ccb07eb670a32ee303c9590047b25f31c
Reviewed-on: https://webrtc-review.googlesource.com/54100
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22113}
2018-02-21 00:49:26 +00:00
Seth Hampson
2f0d70287e Parameterize PeerConnection integration tests for Unified Plan
Bug: webrtc:8765
Change-Id: I572966c57fd8d8f9293fc05a8be579dd982102f7
Reviewed-on: https://webrtc-review.googlesource.com/52800
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22111}
2018-02-20 23:46:06 +00:00
Steve Anton
afb0bb73de Remove PeerConnection voice_channel/video_channel methods
These methods no longer work with Unified Plan and have been
replaced by iterating over RtpTransceivers to get all the
VoiceChannels and VideoChannels.

Bug: webrtc:8587
Change-Id: I66ec282ee9f7eb987c32e30957733c13c6cf45b8
Reviewed-on: https://webrtc-review.googlesource.com/55760
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22110}
2018-02-20 23:40:16 +00:00
Qingsi Wang
db53f8e604 Add configurable STUN binding request interval.
STUN candidates use STUN binding requests to keep NAT bindings open. The
interval at which the STUN keepalive pings are sent is configurable now
via RTCConfiguration.

TBR=sakal@webrtc.org

Bug: None
Change-Id: I5f99ea3fe1e9042fa2bf7dcab0aace78f57739e6
Reviewed-on: https://webrtc-review.googlesource.com/54180
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22109}
2018-02-20 23:32:46 +00:00
Lu Liu
e4bf600cad Revert "Moved BitrateConfig out of Call::Config."
This reverts commit 5897fe27ab.

Reason for revert: Breaking internal builds

Original change's description:
> Moved BitrateConfig out of Call::Config.
> 
> This prepares for a CL extracting the bitrate configuration logic from
> the Call class.
> 
> Also renaming BitrateConfig to BitrateConstraints.
> 
> Bug: webrtc:8415
> Change-Id: I7e472683034c57bdc8093cdf5e78e477d1732480
> Reviewed-on: https://webrtc-review.googlesource.com/54400
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22104}

TBR=nisse@webrtc.org,stefan@webrtc.org,srte@webrtc.org

Change-Id: I598040edba7f1ff8b39d2d9c3c3ceca5627aaa0c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/55740
Reviewed-by: Lu Liu <lliuu@webrtc.org>
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22106}
2018-02-20 19:16:38 +00:00
Sebastian Jansson
5897fe27ab Moved BitrateConfig out of Call::Config.
This prepares for a CL extracting the bitrate configuration logic from
the Call class.

Also renaming BitrateConfig to BitrateConstraints.

Bug: webrtc:8415
Change-Id: I7e472683034c57bdc8093cdf5e78e477d1732480
Reviewed-on: https://webrtc-review.googlesource.com/54400
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22104}
2018-02-20 16:40:05 +00:00
Steve Anton
80dd7b5d68 Reland "Set session error if SetLocal/RemoteDescription ever fails"
Original change's description:
> Set session error if SetLocal/RemoteDescription ever fails
> 
> This changes SetLocalDescription/SetRemoteDescription to set a
> session error which will cause any future calls to fail early if
> there is an error when applying a session description.
> 
> This is needed since until better error recovery is implemented
> failing a call to SetLocalDescription or SetRemoteDescription
> could leave the PeerConnection in an inconsistent state.
> 
> Bug: chromium:800775
> Change-Id: If06fd73d6e902af15d072dc562bbe830d3b11ad5
> Reviewed-on: https://webrtc-review.googlesource.com/54061
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22061}

Bug: chromium:800775
Change-Id: I0016108264e013452e9d34239c012baf23240e99
Reviewed-on: https://webrtc-review.googlesource.com/54720
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22067}
2018-02-17 02:08:19 +00:00
Steve Anton
8b815cddca Add OnTrack PeerConnection callback for Unified Plan
This adds a callback corresponding to the ontrack event as defined
in the WebRTC specification.

Bug: webrtc:7600
Change-Id: Ied8c55e11dcea864428fb194623c1595c21657c7
Reviewed-on: https://webrtc-review.googlesource.com/52660
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22066}
2018-02-17 01:03:59 +00:00
Steve Anton
57858b3be0 Reland "Update RTCStatsCollector to work with RtpTransceivers"
Original change's description:
> Update RTCStatsCollector to work with RtpTransceivers
> 
> Bug: webrtc:8764
> Change-Id: I8b442345869eb6d8b65fd12241ed7cb6e7d7ce3d
> Reviewed-on: https://webrtc-review.googlesource.com/49580
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22026}

Bug: webrtc:8764
Change-Id: I6a682824febf3f4f41397fc1a8dd7396c4ffa8e3
Reviewed-on: https://webrtc-review.googlesource.com/54160
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22064}
2018-02-17 00:01:39 +00:00
Steve Anton
b953245311 Revert "Set session error if SetLocal/RemoteDescription ever fails"
This reverts commit 71439a60e7.

Reason for revert: https://ci.chromium.org/buildbot/chromium.webrtc.fyi/Mac%20Tester/47796

Original change's description:
> Set session error if SetLocal/RemoteDescription ever fails
> 
> This changes SetLocalDescription/SetRemoteDescription to set a
> session error which will cause any future calls to fail early if
> there is an error when applying a session description.
> 
> This is needed since until better error recovery is implemented
> failing a call to SetLocalDescription or SetRemoteDescription
> could leave the PeerConnection in an inconsistent state.
> 
> Bug: chromium:800775
> Change-Id: If06fd73d6e902af15d072dc562bbe830d3b11ad5
> Reviewed-on: https://webrtc-review.googlesource.com/54061
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22061}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org

Change-Id: I8af271f2b6dd6a896e390a6fe736e809329b4f4a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:800775
Reviewed-on: https://webrtc-review.googlesource.com/54700
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22063}
2018-02-16 22:27:10 +00:00
Steve Anton
71439a60e7 Set session error if SetLocal/RemoteDescription ever fails
This changes SetLocalDescription/SetRemoteDescription to set a
session error which will cause any future calls to fail early if
there is an error when applying a session description.

This is needed since until better error recovery is implemented
failing a call to SetLocalDescription or SetRemoteDescription
could leave the PeerConnection in an inconsistent state.

Bug: chromium:800775
Change-Id: If06fd73d6e902af15d072dc562bbe830d3b11ad5
Reviewed-on: https://webrtc-review.googlesource.com/54061
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22061}
2018-02-16 19:39:59 +00:00
Steve Anton
c49bcd9911 Fire OnAddStream with Unified Plan
Bug: webrtc:7600
Change-Id: Ic4e5560fdeb9848c65c59e0f45ca3a2a4a22a2ad
Reviewed-on: https://webrtc-review.googlesource.com/53401
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22042}
2018-02-16 01:19:15 +00:00
Qingsi Wang
9c98f0c254 Fix a bug that holds IceConfig unchanged after changing
RTCConfiguration.

This bug holds IceConfig unchanged in PeerConnection::SetConfiguration
when the update of IceConfig is necessary, unless ice_check_min_interval
is part of the update.

TBR=deadbeef@webrtc.org

Bug: webrtc:8898
Change-Id: I87774863bfedd7c05408fb22937d7322e53417c3
Reviewed-on: https://webrtc-review.googlesource.com/54201
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#22041}
2018-02-16 00:50:36 +00:00
Guido Urdaneta
ee2388f3f0 Revert "Update RTCStatsCollector to work with RtpTransceivers"
This reverts commit 56bae8ded3.

Reason for revert: Speculative revert. This CL is suspect of making Chrome trybots fail the following test, preventing rolls:
 external/wpt/webrtc/RTCPeerConnection-track-stats.https.html

Some failed roll attempts:
https://chromium-review.googlesource.com/c/chromium/src/+/921421
https://chromium-review.googlesource.com/c/chromium/src/+/921422
https://chromium-review.googlesource.com/c/chromium/src/+/921781

Some failed bot runs:
https://ci.chromium.org/buildbot/tryserver.chromium.linux/linux_chromium_rel_ng/647669
https://ci.chromium.org/buildbot/tryserver.chromium.win/win7_chromium_rel_ng/103786


Original change's description:
> Update RTCStatsCollector to work with RtpTransceivers
> 
> Bug: webrtc:8764
> Change-Id: I8b442345869eb6d8b65fd12241ed7cb6e7d7ce3d
> Reviewed-on: https://webrtc-review.googlesource.com/49580
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22026}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,hbos@webrtc.org,pthatcher@webrtc.org

Change-Id: I21ce2109087d7b2d9470471ee9a6757f904296d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8764
Reviewed-on: https://webrtc-review.googlesource.com/54000
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22036}
2018-02-15 16:37:26 +00:00
Steve Anton
56bae8ded3 Update RTCStatsCollector to work with RtpTransceivers
Bug: webrtc:8764
Change-Id: I8b442345869eb6d8b65fd12241ed7cb6e7d7ce3d
Reviewed-on: https://webrtc-review.googlesource.com/49580
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22026}
2018-02-15 02:00:44 +00:00
Seth Hampson
ae8a90a1d4 Fixes to PeerConnection for Unified Plan sdp & transceiver logic.
This change includes updates to the sdp logic, and transceiver
dissociation and also tests these updates. The sdp validation for
unified plan is updated to consider both the stored remote and local
descriptions for an offer, because either could be the most up to date.
This is important when considering a recycled m section. This also
updates to only dissociate a transceiver when we are setting the remote
or local description from an offer. The final small update allows us to
properly create a media description for a transceiver that is not new
but is part of a recycled m section that has only been set locally for
an offer and we are re-offering.

Bug: webrtc:8765
Change-Id: Ia86e54fcd977478824cfa88ebaf992215ed68aae
Reviewed-on: https://webrtc-review.googlesource.com/52080
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22025}
2018-02-14 17:58:09 +00:00
Steve Anton
b8867115a7 Prepare StatsCollector to work with RtpTransceivers
This changes the StatsCollector to handle stats from multiple
MediaChannels of the same type (e.g., audio or video).

Bug: webrtc:8764
Change-Id: I91ba50d10cf469420189a311acdafbf6f78579b2
Reviewed-on: https://webrtc-review.googlesource.com/49560
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22009}
2018-02-14 03:42:04 +00:00
Harald Alvestrand
5dbb58602f Add UMA counters for type of SDP semantic in use.
We count a) what semantics are asked for explicitly (if any),
and b) what semantics are reflected in the successfully
processed answer, as indicated by presence of msid lines
of type Unified Plan vs Plan B.

This gives an indication of usage in sessions initiated by
the browser. It does not indicate usage in sessions where the
browser is the answerer.

Bug: chromium:811683
Change-Id: I2e28a6a83df1664e1aa1e17cd4ff2921de1fba7e
Reviewed-on: https://webrtc-review.googlesource.com/52101
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22008}
2018-02-14 00:18:20 +00:00
Jonas Olsson
45cc890560 Assorted logging pedantry
This cl fixes various minor issues found during a quick scan of the current log
usage.

Bug: webrtc:8529
Change-Id: I1e1eb02ef220177dbb327203509736ad7f70cc1c
Reviewed-on: https://webrtc-review.googlesource.com/52262
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Grunell <henrikg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21996}
2018-02-13 10:47:24 +00:00
Steve Anton
6947025e95 Move media_type to RtpTransceiverInterface
Media type is not part of the WebRTC spec for RtpTransceiver, but it is
handy and the RtpSender/RtpReceiver also have it.

Bug: webrtc:7600
Change-Id: I8350069502588bff478db4dc1318329626dcf9be
Reviewed-on: https://webrtc-review.googlesource.com/50560
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21988}
2018-02-12 19:18:44 +00:00
Steve Anton
dffead8835 Fail CreateAnswer if signaling state is not correct
This changes CreateAnswer to become compliant with the WebRTC 1.0
specification which details that createAnswer should fail if the
PeerConnection is in a state other than 'have-remote-offer' or
'have-local-pranswer'.

Bug: webrtc:8813
Change-Id: I7ca41bdebda1ea163aec8815267c1bbfd7d6d11e
Reviewed-on: https://webrtc-review.googlesource.com/47581
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21923}
2018-02-06 19:19:54 +00:00
Daniel Lazarenko
2870b0a57e Expose a link-local network interfaces enumeration option
The bug 8432 is caused by trying to connect through a
"link-local" interface (IP address 169.254.0.x/16),
which is listed among the iPhone network interfaces.
The bug is not happening if the link-local network interfaces
are skipped in the ICE candidate gethering process.

To control this behaviour an option - disable_link_local_networks -
is added inside the RTCConfiguration.
It is used to set the new BasicPortAllocatorSession flag -
PORTALLOCATOR_DISABLE_LINK_LOCAL_NETWORKS.
The port allocator flag is added if the configuration option is set.

IPIsLinkLocal IPAddress function and its friends (IPIsLoopback, IPIsPrivate)
are refactored to work on both IPv4 and IPv6.
Unit test IPIsLinkLocal.

Bonus: fix a bug in IPIsLinkLocalV6:
take into account just 10 network mask bits instead of 16.

Bug: webrtc:8432
Change-Id: Ibe8f677a36098057b7fcad5c798380727b23359b
Reviewed-on: https://webrtc-review.googlesource.com/36380
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21922}
2018-02-06 19:12:04 +00:00
Steve Anton
5dfde18c77 Change PeerConnection stats interface to be more flexible
This removes the SessionStats object and replaces it with two
methods on PeerConnection: GetTransportNamesByMid and
GetTransportStatsByNames for use by the stats collectors. These
methods are more flexible and can cover cases where there are more
than one video/audio channel.

Bug: webrtc:8764
Change-Id: Id400cc548fc43675462ff6175a7fa9c9f4fd5948
Reviewed-on: https://webrtc-review.googlesource.com/47244
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21921}
2018-02-06 19:02:44 +00:00
Qingsi Wang
93a843944a Bind the structured ICE logging with P2PTransportChannel.
This change list passes the instance of RtcEventLog from Peerconnection
down to P2PTransportChannel, and binds the structured ICE logging with
ICE layer objects. Logs of ICE connectivity checks are injected for
candidate pairs.

TBR=terelius@webrtc.org

Bug: None
Change-Id: Ia979dbbac6d31dcf0f8988da1065bdfc3e461821
Reviewed-on: https://webrtc-review.googlesource.com/34660
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21884}
2018-02-03 07:06:49 +00:00
Oleh Prypin
c22d6a8f9b Revert "Reland "Parameterize PeerConnection signaling tests for Unified Plan""
This reverts commit 7b581eb1ca.

Reason for revert: Breaks downstream projects

Original change's description:
> Reland "Parameterize PeerConnection signaling tests for Unified Plan"
> 
> Original change's description:
> > Parameterize PeerConnection signaling tests for Unified Plan
> >
> > This also changes the behavior of CreateAnswer to fail unless
> > the signaling state is kHaveRemoteOffer or kHaveLocalPranswer,
> > as per the WebRTC specification.
> >
> > Bug: webrtc:8765
> > Change-Id: I60ac67cd92b17fcbff964afc14d049481e816a28
> > Reviewed-on: https://webrtc-review.googlesource.com/41042
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Commit-Queue: Steve Anton <steveanton@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#21779}
> 
> Bug: webrtc:8813
> Change-Id: I9f608fcd0b7aca00b4c1092e271dbd9cd710c38a
> Reviewed-on: https://webrtc-review.googlesource.com/46861
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21860}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,pthatcher@webrtc.org

Change-Id: I15490e4db3290a8ab6056cf82959be7a97e6b1c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8813
Reviewed-on: https://webrtc-review.googlesource.com/47340
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21865}
2018-02-02 08:44:00 +00:00
Steve Anton
c7b964cd71 Report cipher usage to UMA for all media types on a transport
Previously, the code which reported cipher stats to UMA for all
transports would classify the media type based on the transport name,
which is brittle and misleading with BUNDLE. This corrects the code to
track all media types (audio, video, data) which use the transport and
report once for each.

Bug: None
Change-Id: I8506f64f0011788b744b8386ac58518a21914b52
Reviewed-on: https://webrtc-review.googlesource.com/47247
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21863}
2018-02-02 00:56:44 +00:00
Steve Anton
7b581eb1ca Reland "Parameterize PeerConnection signaling tests for Unified Plan"
Original change's description:
> Parameterize PeerConnection signaling tests for Unified Plan
>
> This also changes the behavior of CreateAnswer to fail unless
> the signaling state is kHaveRemoteOffer or kHaveLocalPranswer,
> as per the WebRTC specification.
>
> Bug: webrtc:8765
> Change-Id: I60ac67cd92b17fcbff964afc14d049481e816a28
> Reviewed-on: https://webrtc-review.googlesource.com/41042
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21779}

Bug: webrtc:8813
Change-Id: I9f608fcd0b7aca00b4c1092e271dbd9cd710c38a
Reviewed-on: https://webrtc-review.googlesource.com/46861
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21860}
2018-02-01 21:28:41 +00:00
Steve Anton
e831b8c94d Add MSID signaling compatibility for Unified Plan endpoints
This is intended to ensure compatibility between Plan B and
Unified Plan endpoints for the single audio - single video case.

If Unified Plan is the offerer, it will add a=msid and a=ssrc MSID
entries to its offer.
If Unified Plan is the answerer, it will use whatever MSID
signaling mechanism was used in the offer (either a=msid or
a=ssrc).

Bug: webrtc:7600
Change-Id: I6192dec19123fbb56f5d04540d2175c7fb30b9b6
Reviewed-on: https://webrtc-review.googlesource.com/44162
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21859}
2018-02-01 21:17:41 +00:00
Steve Anton
5f94aa2c01 Correct MSID behavior with Unified Plan
This changes the behavior of CreateOffer/CreateAnswer when Unified
Plan is enabled to be in line with that specified in JSEP.

In particular, MSID information is now only included if the
RtpTransceiver is not stopped and either is sending or has ever
sent.

Bug: webrtc:7600
Change-Id: I6400f0583525c7776331eeb0e1bb53973bc02dfb
Reviewed-on: https://webrtc-review.googlesource.com/46400
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21857}
2018-02-01 19:58:31 +00:00
Qingsi Wang
9a5c6f8f3f Add the network preference to RTCConfiguration.
The network preference is added to RTCConfiguration and passed to ICE.
ICE considers now the preference set by applications over network
interface types when making decisions in candidate pair switching.

Bug: webrtc:8816
Change-Id: I40d2612705b54c83dd45772ac855808e0a76b1e1
Reviewed-on: https://webrtc-review.googlesource.com/44020
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21855}
2018-02-01 19:32:21 +00:00
Zhi Huang
70b820fefe Implemented the GetRemoteAudioSSLCertificate method.
This method returns the DTLS SSL certificate chain associated with the
audio transport on the remote side. This will become populated once the
DTLS connection with the peer has been completed.

TBR=deadbeef@webrtc.org

Bug: webrtc:8800
Change-Id: Ib90ccb3463415e798c17c187c5bdbfc4da26f11f
Reviewed-on: https://webrtc-review.googlesource.com/44140
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21785}
2018-01-27 23:48:36 +00:00
Steve Anton
22da89f502 Implement legacy offer_to_receive options for Unified Plan
This implements the WebRTC specification for handling
the legacy offer options offer_to_receive_audio and
offer_to_receive_video. They are not implemented for CreateAnswer.

With Unified Plan semantics, clients should switch to the
RtpTransceiver API for ensuring the correct media sections are
offered.

Bug: webrtc:7600
Change-Id: I6ced00b86b165a352bd0ca3d64b48fadcfd12235
Reviewed-on: https://webrtc-review.googlesource.com/41341
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21784}
2018-01-27 02:20:29 +00:00
Steve Anton
74255ffb39 Add PeerConnection interop integration tests
These tests verify the behavior between Plan B and
Unified Plan PeerConnections.

Bug: webrtc:7600
Change-Id: Ic41a0e692d32cde6fe7719ada2dbffd4281c008c
Reviewed-on: https://webrtc-review.googlesource.com/43244
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21782}
2018-01-26 23:24:49 +00:00
Taylor Brandstetter
94d8ccec4c Revert "Parameterize PeerConnection signaling tests for Unified Plan"
This reverts commit 65c0a60302.

Reason for revert: Breaking downstream test which was calling CreateAnswer in stable state. Will reland after fixing test.

Original change's description:
> Parameterize PeerConnection signaling tests for Unified Plan
> 
> This also changes the behavior of CreateAnswer to fail unless
> the signaling state is kHaveRemoteOffer or kHaveLocalPranswer,
> as per the WebRTC specification.
> 
> Bug: webrtc:8765
> Change-Id: I60ac67cd92b17fcbff964afc14d049481e816a28
> Reviewed-on: https://webrtc-review.googlesource.com/41042
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21779}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,pthatcher@webrtc.org

Change-Id: I90eacadb217353a7e098826563f5aeaaced52452
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8765
Reviewed-on: https://webrtc-review.googlesource.com/44581
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21781}
2018-01-26 22:44:30 +00:00
Steve Anton
65c0a60302 Parameterize PeerConnection signaling tests for Unified Plan
This also changes the behavior of CreateAnswer to fail unless
the signaling state is kHaveRemoteOffer or kHaveLocalPranswer,
as per the WebRTC specification.

Bug: webrtc:8765
Change-Id: I60ac67cd92b17fcbff964afc14d049481e816a28
Reviewed-on: https://webrtc-review.googlesource.com/41042
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21779}
2018-01-26 21:06:52 +00:00
Steve Anton
ad7bffccd1 Parameterize PeerConnection media tests for Unified Plan
Bug: webrtc:8765
Change-Id: I9bcd053c3e5f6524576f8da9f818de82fcd1836d
Reviewed-on: https://webrtc-review.googlesource.com/41020
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21754}
2018-01-25 01:34:46 +00:00
Steve Anton
2d8609c77e Move internal PeerConnection methods to PeerConnectionInternal
PeerConnectionInternal is being introduced so that it can be mocked in
tests and so that a fake can be written for it to be used by stats
tests.

Bug: webrtc:8764
Change-Id: I375d12ce352523e8ac584402685a7870bc399fac
Reviewed-on: https://webrtc-review.googlesource.com/43202
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21747}
2018-01-24 17:24:29 +00:00
Harald Alvestrand
194939b8ca Added UMA counters for SDES vs DTLS key agreement
This is required to figure out when we can deprecate and remove
SDES.

Bug: chromium:804275
Change-Id: Ie234e6b3c8f5de8e78dda8d755d955caa61b7aa7
Reviewed-on: https://webrtc-review.googlesource.com/43340
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21746}
2018-01-24 16:09:59 +00:00
Steve Anton
dbf9d03204 Parameterize PeerConnection data channel tests for Unified Plan
Bug: webrtc:8765
Change-Id: Ifac06b2f36230adb093169af0a88dda5463a1216
Reviewed-on: https://webrtc-review.googlesource.com/40503
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21704}
2018-01-20 00:50:53 +00:00
Steve Anton
7464fca9f3 Parameterize PeerConnection BUNDLE tests for Unified Plan
Bug: webrtc:8765
Change-Id: I825a3e31af3b0fb4acf50b08b5c4f0ad6e8820e2
Reviewed-on: https://webrtc-review.googlesource.com/40500
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21701}
2018-01-19 20:32:23 +00:00
Steve Anton
d367921eb1 Configure media flow correctly with Unified Plan
This also changes RtpReceiver and RemoteAudioSource to have two-step
initialization, since in Unified Plan RtpReceivers are created much
earlier than in Plan B.

Bug: webrtc:7600
Change-Id: Ia135d25eb8bcab22969007b3a825a5a43ce62bf4
Reviewed-on: https://webrtc-review.googlesource.com/39382
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21681}
2018-01-18 19:01:38 +00:00
Steve Anton
47136ddaea Change RtpSenders to interact with the media channel directly
Similar to the change for RtpReceivers, this removes the BaseChannel
methods that would just proxy calls to the MediaChannel and instead
gives the MediaChannel directly to the RtpSenders to make the calls
directly.

Bug: webrtc:8587
Change-Id: Ibab98d75ff1641e902281ad9e31ffdad36caff35
Reviewed-on: https://webrtc-review.googlesource.com/38983
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21608}
2018-01-13 01:44:04 +00:00
Steve Anton
ef65ef1811 Fire OnAddTrack when Unified Plan is enabled
When Unified Plan semantics are set, PeerConnection will fire OnAddTrack
according to the WebRTC spec. OnRemoveTrack will never be fired and will
be deprecated in the future.

Bug: webrtc:7600
Change-Id: Idfaada65b795b5fb9fe4844cff036d52ea90da17
Reviewed-on: https://webrtc-review.googlesource.com/38122
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21564}
2018-01-11 01:43:00 +00:00
Steve Anton
02ee47c1ae Signal track ID correctly when Unified Plan semantics selected
This change corrects PeerConnection behavior under Unified
Plan semantics to:
- Set the RtpSender id to be the track ID if created with AddTrack.
- Put the RtpSender id in the SDP as part of the MSID.
- Set the RtpReceiver id to be the track part of the MSID
    when created via SetRemoteDescription.

Also, the RtpSender constructors have been simplified to defer
mutable state (in this case, setting BaseChannels) to method calls.

Bug: webrtc:8721
Change-Id: Idc80965e2df7a803b8bbeec1d96de9ad95391cce
Reviewed-on: https://webrtc-review.googlesource.com/38480
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21563}
2018-01-11 01:11:15 +00:00
Steve Anton
6077675ab3 Change RtpReceivers to interact with the media channel directly
Currently, the RtpReceivers take a BaseChannel which is (mostly)
just used for proxying calls to the MediaChannel. This change
removes the extra layer and moves the proxying logic to RtpReceiver.

Bug: webrtc:8587
Change-Id: I01b0e3d57b4629e43d9d148cc94d6dd2941d320e
Reviewed-on: https://webrtc-review.googlesource.com/38120
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21562}
2018-01-11 00:16:44 +00:00
Steve Anton
2d6c76aa39 Switch to using AddTrack with stream labels
Bug: webrtc:8587
Change-Id: I8d4a3a225e6f6a6ae59def972ecae3255c0f2bda
Reviewed-on: https://webrtc-review.googlesource.com/37547
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21509}
2018-01-06 02:01:39 +00:00
Steve Anton
43a723a71b Move AddTrack stats update to submethod
AddTrack is just a legacy wrapper for the new AddTrack method, so
calling the new AddTrack method should do everything that the old one
does.

Bug: None
Change-Id: I272a9e9584c470d54243377c1307b786f41c660d
Reviewed-on: https://webrtc-review.googlesource.com/37546
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21508}
2018-01-06 00:54:09 +00:00
Harald Alvestrand
75ceef2ab4 Pivot old stats generation to iterate senders/receivers
This is the old-style-stats equivalent of CL 34360.

Bug: webrtc:8616
Change-Id: I12573eb305a8f1ecf8134b87ab14e33eaec5ba22
Reviewed-on: https://webrtc-review.googlesource.com/37080
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21497}
2018-01-04 14:58:19 +00:00
Taylor Brandstetter
389a97c0f4 Fixing leaked reference from SCTP transport to DTLS/ICE transport.
This was causing ICE pings to continue going out on PeerConnections
that use DataChannels, even after closing the PeerConnection.

This CL adds a two-line fix, and an integration test that will catch
this and similar issues.

Bug: webrtc:7655
Change-Id: I589a2a1aaf6433c1d65be69a1267e1b52a33534b
Reviewed-on: https://webrtc-review.googlesource.com/37145
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21488}
2018-01-04 00:53:07 +00:00
Steve Anton
fa2260d08d Add support for data channels with Unified Plan
Bug: webrtc:7600
Change-Id: Idca1219fa692b24ced104aff7e89cde8a1bfe301
Reviewed-on: https://webrtc-review.googlesource.com/36240
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21478}
2018-01-02 19:46:01 +00:00
Harald Alvestrand
8906187c86 Pivot generation of stats to iterate senders/receivers
This will allow stats to be generated when AddTrack() is used.
It also exposes a ClearStatsCache() call on the PC to allow enforcement
of cache lifetime restrictions.

Bug: webrtc:8616
Change-Id: If47b967ce9e40fa768303e6f5f54fe74db2cc7a4
Reviewed-on: https://webrtc-review.googlesource.com/34360
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21468}
2018-01-02 13:36:01 +00:00
Steve Anton
dcc3c02468 Add support for JSEP offer/answer with transceivers
This change adds support to PeerConnection's CreateOffer/
CreateAnswer/SetLocalDescription/SetRemoteDescription for
Unified Plan SDP mapping to/from RtpTransceivers. This behavior
is enabled using the kUnifiedPlan SDP semantics in the
PeerConnection configuration.

Bug: webrtc:7600
Change-Id: I4b44f5d3690887d387bf9c47eac00db8ec974571
Reviewed-on: https://webrtc-review.googlesource.com/28341
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21442}
2017-12-23 01:12:45 +00:00
Steve Anton
b1c1de17d4 Use the SDP ContentInfo helpers to avoid downcasting
This changes all internal code to use the media_description() helper
for ContentInfo along with the as_audio, as_video, and as_data casting
methods introduced in a previous CL. Reduces the total number of
pointer static_casts in pc/ from 351 to 122.

Bug: webrtc:8620
Change-Id: I996f49b55f1501c758a9e5223e30539a9f8d4eac
Reviewed-on: https://webrtc-review.googlesource.com/35921
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21419}
2017-12-22 00:17:53 +00:00
Steve Anton
5adfafdbf6 Make ContentInfo/ContentDescription slightly more ergonomic
This makes the following changes:
- Replaces ContentDescription with its only subclass,
    MediaContentDescription
- Adds helpers to cast a MediaContentDescription to its
    audio, video, and data subclasses.
- Changes ContentInfo.type to a new enum, MediaProtocolType.

Bug: webrtc:8620
Change-Id: I5eb0811cb16a51b0b9d73ecc4fe8edc7037f1aed
Reviewed-on: https://webrtc-review.googlesource.com/35100
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21401}
2017-12-21 01:35:57 +00:00
Steve Anton
741164813a Remove SessionStats.proxy_to_transport
The stats collectors would only ever call this on the signaling
thread, so they might as well just ask the voice/video channel
their transport_name directly.

Bug: None
Change-Id: I8dd36210ff22d222b45b5f5e22c253f601cdc79e
Reviewed-on: https://webrtc-review.googlesource.com/34581
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21339}
2017-12-18 23:37:47 +00:00